Some questions and troubles with List...
Hi! i was playing around with a list and i noted that there are some strange behaviours in some conditions.
First of all, if i create a list through a panel and add, for example, 15 items in the list and set the list allowScrolling(true), the list behaviour is correct.
but if i don't allow the scrolling of the list but change its height, comes a strange behaviour...here is the code that reproduce it.
mPanel = mSheet->createPanel();
mList = mPanel->createList();
First, scrolling the panel up i have noted that the text of the list don't clip with the up border of the panel.
Second, always scrolling the panel, you can note that seems there's also another "clipping border" that doens't belong to the panel(the parent).
I tried to change the clip mode but nothing solve the "problem"...i don't know if change the QuadContainer to the parent container can modify something...or if this is correct...
Hey Artic, I loaded up your code and see the issue also. To think I was done with clipping..
I looked into it a lot this morning, and couldn't really track down the cause. I'll have to look into it in the coming week. Any suggestions for a clipping system that works are welcome.
after this try with the list, i try to simulate the list with two panels: panel 1 that create the panel 2, and this panel 2 creates some textboxes, similar to the list widget. the result is the same behaviour of the list, but if i set the clipmode of the textboxes to CLIPMODE_PARENT_CONTAINER the textboxes don't clip with the panel2, but clips with the panel1. The text, instead, seems don't clip correctly with the top border...
here is the second branch of code:
panel1 = mSheet->createPanel("panel1");
panel2 = panel1->createPanel("panel2");
for(int i = 0; i<15; ++i)
tempTB = panel2->createTextBox(Ogre::StringConverter::toString(i));
Theoretically the clipping system should works with the actual implementation...
I'm going to think about this, I'll try to fix this as soon as I can, I was hoping to release soon. Logically it should work.
CLIPMODE_NONE - Lists when used as Menus should not be clipped at all.
CLIPMODE_OWNER - Text should be clipped to its Widget's bounds.
CLIPMODE_PARENT - Texture Quads
CLIPMODE_GRANDPARENT - Borders.
well, i have some question also with the clipping mode.
for example, i have a widget that is composed by borders, a texture and the text. Have all the components their own clip mode?
Now that I think about it, I should remove Widget::set/getClipMode, because ClipMode is not at the Widget level, but at the Quad level. Think of ClipMode in terms of the Quad. The "Owner" is the Widget which created the Quad. "Parent" refers to the ParentWidget of the Owner.
For Borders, they are component widgets. Using a Window with Borders as an example, the Borders lie outside Window Dimensions and should not be clipped by the Window (Parent) dimensions. Instead, the Borders should be clipped by the Window's parent, which is why I needed to create the CLIPMODE_GRANDPARENT type.
The types I listed are not accurate with the current implementation, right now I have CLIPMODE_CONTAINER. I don't think I need to clip to containers, parent and grandparent should be more accurate.
ok, now i've understood. i think too that the parent-grandparent clipping system is both more accurate, intuitive and maybe take trace in some ways of relationship between widgets.
Ok, I think I have made some good progress on Clipping. At least, your simple example works correctly, and everything looks ok.
ok! good job kungfoomasta!!!!
you are the best!