Page 1 of 1

Elems created out of viewport then slided, are not clickable

Posted: Wed Mar 28, 2012 16:14
by matt
Hello!

I've implemented a little slider, that contains:
- A Window "A"
- A Stencil Window "B" into "A"
- An Ribbon (HorizontalLayoutContainer) "C" into "B"
- A Bunch of Button into this HorizontalLayoutContainer

Only the first buttons of the Ribbon are visible because those out of the stencil "B" are cut by it.

I make the Ribbon "C" slide into the Stencil Window "B".
The thing is that my buttons into the Ribbon are reacting to mouse only for those that primary where in the zone of the Window "A" (which is the main parent), before the slide to start.

Indeed, it seems that all that as been created and clipped outside of my main application window, and then slide into it, is not clickable.

When I slide enough the HorizontalLayoutContainer I can't click anymore one them.

I've tried

Code: Select all

      this->notifyClippingChanged();

But without success

Is it a bug? Or do I need a special call to make the buttons to refresh their Click Area after each move of my ribbon?

Thanx in advance for the help

Re: Elems created out of viewport then slided, are not click

Posted: Thu Mar 29, 2012 09:07
by matt
Going on investigating on my problem, I tried another configuration in order to restrict my problem into a 'small area'

I create a simple StaticImage , let's say "A", with a very big width: 4000px.
With a button in my scene, I slide this StaticImage (=container) to the left or right.

I parent this StaticImage into a 300*300 Window;

Two very strange things:
  • Sliding the StaticImage, I notice that this StaticImage width is not 4000px as defined in its properties, but only the width of the parent box (300px)
  • If I give a start offset (for example 200px) to this StaticImage, and then slide it to the left, I notice that its width is although exactly the width of my parent box (300px)

  • Testing an even simpler case, it seems that Window's can't be bigger than the Screen:

    Code: Select all

       
          WindowManager& wmgr = WindowManager::getSingleton();
          Window* base = static_cast<Window*>(wmgr.createWindow( "DefaultWindow"));
          CEGUI::System::getSingleton().setGUISheet( base );

          Window* image = static_cast<Window*>(wmgr.createWindow( "HaevaLookSpecialWidgets/StaticClicheImage"));
          image->setProperty("Image", "set:HaevaLookSpecialWidgets   image:SelectorHover");
          image->setSize( UVector2(cegui_absdim(3000), cegui_absdim(50)) );   //Problem is here: The Image will fit exactly the width of the screen, even if it set to 3000px
          base ->addChildWindow( image );



Re: Elems created out of viewport then slided, are not click

Posted: Fri Mar 30, 2012 08:22
by Kulik
This does sound like a bug in CEGUI, you shouldn't have to do anything to make this work, CEGUI should take care of it.

I will do some testing later and hopefully fix this.

http://cegui.org.uk/mantis/view.php?id=764

Re: Elems created out of viewport then slided, are not click

Posted: Mon Apr 02, 2012 08:32
by matt
Thanx Kulik for your answer

Do you think there is a workaround that I could use? Something like an "update click area" method.
I tried various things like "invalidate()", or "setUpdateMode(WUM_ALWAYS)", but it has no effects...

Re: Elems created out of viewport then slided, are not click

Posted: Fri Jun 22, 2012 17:32
by CrazyEddie
Hi,

We discussed this a little today, since I have no idea how best to try and reproduce this. Anyway, we think you might be running up against a common gotcha (it's certainly 'got' us a few times - with many hours wasted). With regards to the comment that things "can't be bigger than the screen", this is a side-effect of the default maximum size - which is, yes, you guessed it, the same size as the screen. So, try setting the max size of your affected windows to be something big, and hopefully it should resolve the issue.

Please let us know, so we can close the associated ticket :)

HTH

CE.

PS. If this does not work, can you provide code for a simple test case that reproduces the issue. Thanks.