I'm making a list of items using ItemListbox (the box) and ItemEntry (the items), but for some reason the items are overflow to outside the boundary of the box.
For example, if the box can fit 3 items and I added 5, then there will be 2 items showing up beneath the listbox. This is not just a graphical glitch either, as the box doesn't scroll, I can highlight the last 2 items outside the box. It's as if the box thinks it can fit all 5 items.
I tried to use sizeToContent() and the box will resize to fit all 5 items but that's not what I want. I need it to fit 3 items and scroll.
I use addItem and also addChildWindow to add the items to the listbox. Is there some function I'm forgeting? I'm using 0.7.0.
ListboxItem outside the box
Moderators: CEGUI MVP, CEGUI Team
-
- Just popping in
- Posts: 13
- Joined: Wed Oct 21, 2009 20:21
- CrazyEddie
- CEGUI Project Lead
- Posts: 6760
- Joined: Wed Jan 12, 2005 12:06
- Location: England
- Contact:
Re: ListboxItem outside the box
Hi,
I wonder, are you using one of the pre-defined skins that come with CEGUI or some other skin? Perhaps the named area in the skin, that ItemListbox uses for rendering into and clipping the items, is not defined or is defined incorrectly?
CE.
I wonder, are you using one of the pre-defined skins that come with CEGUI or some other skin? Perhaps the named area in the skin, that ItemListbox uses for rendering into and clipping the items, is not defined or is defined incorrectly?
CE.
Useful Links: Forum Guidelines | Documentation | Tutorials | HOWTO | Videos | Donate to CEGUI | CEGUI Twitter
-
- Just popping in
- Posts: 13
- Joined: Wed Oct 21, 2009 20:21
Re: ListboxItem outside the box
I'm using Taharez as the skin and FairChar as the pixmap font.
I think they are the same as they were in the package, except that FairChar was downloaded from the CEGUI website as it's not part of the library (there are no pixmap font in the library).
I think they are the same as they were in the package, except that FairChar was downloaded from the CEGUI website as it's not part of the library (there are no pixmap font in the library).
- CrazyEddie
- CEGUI Project Lead
- Posts: 6760
- Joined: Wed Jan 12, 2005 12:06
- Location: England
- Contact:
Re: ListboxItem outside the box
Hmmm. FairChar should be included with the library packages - which package are you using that does not contain this font?
I will retest this with the FairChar font...
CE.
I will retest this with the FairChar font...
CE.
Useful Links: Forum Guidelines | Documentation | Tutorials | HOWTO | Videos | Donate to CEGUI | CEGUI Twitter
-
- Just popping in
- Posts: 13
- Joined: Wed Oct 21, 2009 20:21
Re: ListboxItem outside the box
You're right, FairChar is part of the 0.7.0 lib that I use. I tested it on the sample project and it actually work. This means the original lib actually works fine. So the problem is only happening on my phyre ported version of the lib.
My question is then, where is the code that determines which item gets rendered, and if the list should scroll down. Because the problem I'm having is that not only the whole list is showing, it also doesn't scroll and you can highlight items outside the box.
For reference, the phyre engine port of the library is mostly identical to the original. The renderer module is the part that's new and I also comment out dynamic module and implement my own timer. But I don't think these changes should effect the listbox.
My question is then, where is the code that determines which item gets rendered, and if the list should scroll down. Because the problem I'm having is that not only the whole list is showing, it also doesn't scroll and you can highlight items outside the box.
For reference, the phyre engine port of the library is mostly identical to the original. The renderer module is the part that's new and I also comment out dynamic module and implement my own timer. But I don't think these changes should effect the listbox.
- CrazyEddie
- CEGUI Project Lead
- Posts: 6760
- Joined: Wed Jan 12, 2005 12:06
- Location: England
- Contact:
Re: ListboxItem outside the box
Ok.
The code that decides the area available to render into is line 57 of cegui/src/WindowRendererSets/Falagard/FalItemListbox.cpp. If this returns something really, badly wrong, then you might see the issue you're getting - this could happen, for example, if the renderer / render target are returning bad info as regards to the size of the display / target.
The code that decides about clipping, hit-testing of items and such is the regular code used for the rest of the system; for a scrolled list, such as ItemListbox, the content is added to a content pane window that is positioned appropriately so that the correct content is visible in the area determined above - there is no special case code used for this.
HTH
CE.
The code that decides the area available to render into is line 57 of cegui/src/WindowRendererSets/Falagard/FalItemListbox.cpp. If this returns something really, badly wrong, then you might see the issue you're getting - this could happen, for example, if the renderer / render target are returning bad info as regards to the size of the display / target.
The code that decides about clipping, hit-testing of items and such is the regular code used for the rest of the system; for a scrolled list, such as ItemListbox, the content is added to a content pane window that is positioned appropriately so that the correct content is visible in the area determined above - there is no special case code used for this.
HTH
CE.
Useful Links: Forum Guidelines | Documentation | Tutorials | HOWTO | Videos | Donate to CEGUI | CEGUI Twitter
-
- Just popping in
- Posts: 13
- Joined: Wed Oct 21, 2009 20:21
Re: ListboxItem outside the box
The area return, basically the d_innerUnclippedRect of the listbox is way too high. I tried to make the box smaller in the editor and the area in code will be smaller but only by a very small margin.
Before, top is 499 and bot is 969. After making the box 1/3 of it's original height, the top remains at 499 and bot becomes 643, which is only a small change.
I've check that ViewportTarget's area and Renderer's d_displaySize are both the screen size. I test with other values and it doesn't effect the items outside the box at all.
How is the dimension calculated? I got very confused falagard xml handler...
Before, top is 499 and bot is 969. After making the box 1/3 of it's original height, the top remains at 499 and bot becomes 643, which is only a small change.
I've check that ViewportTarget's area and Renderer's d_displaySize are both the screen size. I test with other values and it doesn't effect the items outside the box at all.
How is the dimension calculated? I got very confused falagard xml handler...
- CrazyEddie
- CEGUI Project Lead
- Posts: 6760
- Joined: Wed Jan 12, 2005 12:06
- Location: England
- Contact:
Re: ListboxItem outside the box
The position and size of this area comes from a set of named areas defined in the looknfeel. Taking the basic, no scrollbars, one as an example, we have:
This is describing the area as being the size of the containing window minus the size of the images used for the frame. Here it seems the BottomEdge (and RightEdge?) part(s) is (are) incorrect. All these are saying is a scale value of '1' - which basically says take the height (or width) of the containing element (in this case the ItemListbox window). Then we just subtract the height (or width) of the image used for those edges of the frame.
CE.
Code: Select all
<NamedArea name="ItemRenderArea">
<Area>
<Dim type="LeftEdge" ><ImageDim imageset="TaharezLook" image="ListboxLeft" dimension="Width" /></Dim>
<Dim type="TopEdge" ><ImageDim imageset="TaharezLook" image="ListboxTop" dimension="Height" /></Dim>
<Dim type="RightEdge" >
<UnifiedDim scale="1" type="RightEdge">
<DimOperator op="Subtract">
<ImageDim imageset="TaharezLook" image="ListboxRight" dimension="Width" />
</DimOperator>
</UnifiedDim>
</Dim>
<Dim type="BottomEdge" >
<UnifiedDim scale="1" type="BottomEdge">
<DimOperator op="Subtract">
<ImageDim imageset="TaharezLook" image="ListboxBottom" dimension="Height" />
</DimOperator>
</UnifiedDim>
</Dim>
</Area>
</NamedArea>
This is describing the area as being the size of the containing window minus the size of the images used for the frame. Here it seems the BottomEdge (and RightEdge?) part(s) is (are) incorrect. All these are saying is a scale value of '1' - which basically says take the height (or width) of the containing element (in this case the ItemListbox window). Then we just subtract the height (or width) of the image used for those edges of the frame.
CE.
Useful Links: Forum Guidelines | Documentation | Tutorials | HOWTO | Videos | Donate to CEGUI | CEGUI Twitter
Return to “Modifications / Integrations / Customisations”
Who is online
Users browsing this forum: No registered users and 2 guests