Page 1 of 1
[Solved] Help with ScrollablePanes
Posted: Tue Apr 08, 2008 16:16
by zarroba
I'm having some trouble with scrollable panes. I create a scrollable pane, add items to it until the scrollbars show up but the scrolling doesn't seems to be working fine. When I scroll the mouse wheel with the mouse on top of the ScrollThumb, Buttons or childs added to the ScrollablePane the scrollable pane area is scrolled. If I scroll with the mouse on top of the background it doesn't scroll.
Any idea of what is happening?
Thanks,
José Tavares
Posted: Tue Apr 08, 2008 18:52
by CrazyEddie
Hi,
Not certain at the moment - it should work as you wish it to.
Does the ScrollablePaneDemo sample application perform for you as you would expect (it does here in a quick test).
Can you post the widget creation code or XML?
CE.
Posted: Wed Apr 09, 2008 08:45
by zarroba
The strange thing is that the sample works fine. I'm using CEGUI in a dynamic environment where overlays are added and removed during the program. but the code I use to create an overlay is the following:
Code: Select all
component = mWindowManager->createWindow(type,id);
rootComponent->addChildWindow(component);
this->setOverlayPosition(idRepresentation,posX,posY); //function to set the position
this->setOverlaySize(idRepresentation,sizeX,sizeY); //function to set the size
component->setDestroyedByParent(true);
component->setInheritsAlpha (true);
component->setText(title);
component->show();
this->setFont2Default(fontID); //function to set the font
I create a StaticImage with a ScrollablePane inside and inside the ScrollablePane I add a variable number of Editbox.
I use the same code, but with different variables, to create the scrollable pane and the editboxs inside. The editboxs are well added, the scrollbars appear when an editbox is added in a position bigger than the size, but the scroll listener doesn't work in the background of the scrollable pane.
Oh, I'm using CEGUI 0.5 but I've checked the files and the code and looknfeel seems to be the same.
Thanks,
José Tavares
Posted: Wed Apr 09, 2008 11:17
by zarroba
Hi, I've been checking several widgets and some work and some doesn't. So, if I add Editbox, Checkbox, RadioButton, Button, Window the scroll of the scrollable pane (the parent). If I add StaticImage, Multiline, StaticText, Listbox the scroll won't work. In both cases the background of the ScrollablePane never works. Can this problem come from the LooknFeel?
José Tavares
Posted: Wed Apr 09, 2008 14:26
by zarroba
Update on my latest try. I'm thinking it's something about the version of CEGUI. The sample I've tried was with CEGUI 0.6 and I'm using version 0.5 on my project, and I'm not considering updating it. In the onMouseWheel method of MultiLineEditbox I've commented the "e.handled = true;" line at the end of the method. I've checked and this line is there in both versions. The fact is that after the change the scroll worked. Is there anything different in the way the listeners are handled in both versions?
Update: I've tried to comment the same line on the other classes that have the onMouseWheel method and it didin't work. Basically I'm still with the same problem.
José Tavares
P.S. Sorry for using this as a blog but it's being really helpful and I still may get some help
Posted: Wed Apr 09, 2008 16:23
by zarroba
Problem solved. The problem was not in CEGUI (of course! how could I think such thing). Sorry guys.. I'm using CEGUI with OGRE and OIS and the problem was in the connection between OGRE and OIS.
Sorry once again guys.
José Tavares
Posted: Thu Apr 10, 2008 08:40
by CrazyEddie
Hi,
Glad you fixed it. I was going to suggest it might be related to having content that has scrollbars - stealing the input that should go to the pane, but obviously not!
Feel free to use a forum thread in a blog-like manner. Not only did you find it useful, but it's also useful for others.
CE.