ScrollablePane HorizontalScrollbar

For help with general CEGUI usage:
- Questions about the usage of CEGUI and its features, if not explained in the documentation.
- Problems with the CMAKE configuration or problems occuring during the build process/compilation.
- Errors or unexpected behaviour.

Moderators: CEGUI MVP, CEGUI Team

r0br0y
Not too shy to talk
Not too shy to talk
Posts: 26
Joined: Thu Apr 08, 2010 09:36

ScrollablePane HorizontalScrollbar

Postby r0br0y » Tue Aug 31, 2010 16:09

Hi,

I've an annoying problem with a scrollablepane - as soon as the content gets too high and the vertical scrollbar apprears it's also neccessary to scroll horizontally. It seems that the pane-contents are not resized because of the smaller inner-pane-width (that is reduced by the verticalscrollbar-width). The pane-contents are a verticallayoutcontainer that owns some windows with width = UDim(1,0) ... I've already tried to call layout() in the layoutcontainer after its childs are added but no success.

Thanks for any advice
rob

User avatar
Kulik
CEGUI Team
Posts: 1382
Joined: Mon Jul 26, 2010 18:47
Location: Czech Republic
Contact:

Re: ScrollablePane HorizontalScrollbar

Postby Kulik » Tue Aug 31, 2010 17:19

I've ran into something different before and it's likely a bug in scrollable pane but it wasn't discovered yet. Scrollable pane sometimes decides to go haywire and (at least for me) doesn't allow scrolling all the way to the end.
When scrollbars appear though, content inside is resized for me automatically. I remember I used to click on the scrollbar to make it resize but it resizes OK since I migrated to pixel size instead of mixed size.

Are you running svn branch or the official 0.7.2 release?

r0br0y
Not too shy to talk
Not too shy to talk
Posts: 26
Joined: Thu Apr 08, 2010 09:36

Re: ScrollablePane HorizontalScrollbar

Postby r0br0y » Wed Sep 01, 2010 10:15

I'm working with the 0-7 branch...

hmm I did some more testing/debugging and there's sth messy with the size- and layout-updates.
I think the steps of my use-case are:

--- manual ---
1. Empty scrollpane, contentpane-width = 100;
2. scrollpane->add(layoutcontainer)
3. layoutcontainer->add(some windows)
--- cegui-system ---
4. layoutcontainer->layout() in there absWidth is set to 100 because the scrollpane doesn't know that it needs to scroll yet - no scrollbars are shown that reduce layoutcontainer->getChildWindowContentArea()
5. scrollpane recognizes that contentpane is too big -> scrolling is enabled, contentpane stays at 100 because layoutcontainer-width is set to 100
--- manual ---
6. If I call layoutcontainer->layout() again (manually) the width reduces correctly, the scrollpane hides the horz-scollbar but still uses the HVScrollArea... :roll:

(I think the second layout succeeds somehow because the reduced contentarea of the scrollpane is routed to the layoutcontainer-children?!)
Additionally I noticed that my window-structure needs to render at least once to have size-updates...

Any ideas how to fix this w/o doing manual update-calls?

thanks
rob
Last edited by r0br0y on Wed Sep 01, 2010 10:36, edited 1 time in total.

User avatar
Kulik
CEGUI Team
Posts: 1382
Joined: Mon Jul 26, 2010 18:47
Location: Czech Republic
Contact:

Re: ScrollablePane HorizontalScrollbar

Postby Kulik » Wed Sep 01, 2010 10:35

I don't think absWidth is related, it's only used to compare mixed sizes... Unfortunately in my case this works ok :-( I will try some more to reproduce it.

r0br0y
Not too shy to talk
Not too shy to talk
Posts: 26
Joined: Thu Apr 08, 2010 09:36

Re: ScrollablePane HorizontalScrollbar

Postby r0br0y » Wed Sep 01, 2010 12:17

Kulik wrote:I don't think absWidth is related, it's only used to compare mixed sizes... Unfortunately in my case this works ok :-( I will try some more to reproduce it.

hmm you're aright, but in my case I'm using the verticallayoutcontainer and in its layout()-method the childWidth.asAbsolute(absWidth) evaluates to absWidth because child has a relative width of 1...


I think a possible fix would be a call to LayoutContainer::layout() in ScrollablePane::configureScrollbars(void) somewhere near to the performChildWindowLayout()-call... well but it's more a guess ...

thanks again for having one more look...




EDIT
Just one more note:
On another usecase I had a problem with a bottom aligned layoutcontainer that owns a single scrollablepane. Without a manual call to layout() after the windows are setup there is a one-frame-flickering/misplacement-at-top concerning the bottom-alignment... I'm wondering when layout() gets called by the system? before/on/after rendering?

r0br0y
Not too shy to talk
Not too shy to talk
Posts: 26
Joined: Thu Apr 08, 2010 09:36

Re: ScrollablePane HorizontalScrollbar

Postby r0br0y » Thu Sep 02, 2010 12:43

After some more debugging and :x and :cry: and :twisted: I managed to work around my problem of mixing layoutcontainers and scrollablepanes:
layout() has to be called for all layoutcontainers from bottom(nested/childs/leafs) to top (parents) of my window-structure so that child-sizes are valid for the next layout().
If the size of a scrollablepane needs to be adjusted it has to be set before or inbetween the layout()-calls (according to position in window-strucutre).

Any ideas how to improve this?

If you try to reproduce this try to create such a window-structure before the first rendering as it seems to result in a different behaviour if created later...

thanks
rob

User avatar
Kulik
CEGUI Team
Posts: 1382
Joined: Mon Jul 26, 2010 18:47
Location: Czech Republic
Contact:

Re: ScrollablePane HorizontalScrollbar

Postby Kulik » Thu Sep 02, 2010 14:15

there is a patch http://www.cegui.org.uk/phpBB2/viewtopic.php?f=5&t=5030&start=45#p24271 that might make this work flawlessly, I haven't tried though. Please try it and report back. It will probably go into CEGUI svn over the weekend.

EDIT: You have to inject time pulses with this patch, otherwise layouting will never happen!

r0br0y
Not too shy to talk
Not too shy to talk
Posts: 26
Joined: Thu Apr 08, 2010 09:36

Re: ScrollablePane HorizontalScrollbar

Postby r0br0y » Thu Sep 02, 2010 15:14

EDIT:
Works like a charme! Thanks!


Return to “Help”

Who is online

Users browsing this forum: No registered users and 18 guests