Page 1 of 1

ComboBox resizing issue

Posted: Mon Feb 02, 2015 17:38
by Boost113
Hi,

I'm trying to create a ComboBox which should display all items when the drop down list is open. Though, it seems to only resize to fit a single element:
Image
Even worse with the same .layout a ComboBox in a slightly different place doesn't resize at all:
Image

This is the layout:

Code: Select all

    <Window name="PlayerTNumber0TypeSelect" type="TaharezLook/Combobox">
       
        <Property name="Area" value="{{0.17, 0}, {0.34, 0}, {0.5, 0}, {0.5, 0}}"/>
        <Property name="Disabled" value="True"/> <!-- The window gets enabled after adding the elements, could that be the issue? -->
       
        <Property name="Font" value="Simonetta-Black"/>
        <Property name="Text" value="Choose controls/AI"/>
       
    </Window>


I add the strings to the combobox like in the samples:

Code: Select all

    CEGUI::Combobox* convbox = dynamic_cast<CEGUI::Combobox*>(obj);

    if(!convbox)
        return false;
   
    // Imagine a loop here...
    convbox->addItem(new CEGUI::StandardItem(CEGUI::String(text)));

    convbox->setAutoSizeListHeightToContent(true);
    // These don't seem to do what they are supposed to do
    convbox->handleUpdatedListItemData();
    convbox->updateAutoSizedDropList();
    // Loop ends here


Which should resize the drop down list to match the contents, right?

Version is my fork of default which should be up to date. Log doesn't have any errors related to this issue.

Any help on this would be much appreciated.

EDIT: As it turns out the size of the Combobox constrains the size of the drop down list (http://cegui.org.uk/forum/viewtopic.php?f=10&t=6140).
So the fix to this issue is increasing the size of the combobox, but that doesn't do what I want. I want to have the list overlap widgets under it. Is there some widget/way to do that, then?

Re: ComboBox resizing issue

Posted: Tue Feb 17, 2015 22:43
by Ident
Yea a combobox will only expand as much as it allows in the widget's defined height. So you need to make it large.

What do you mean by "I want the widget to overlap widgets under it". This should be the case. Try the property AlwaysOnTop = True (i think thats how it is called, correct me if i m wrong). Does that make a difference?

Else explain the problem in more detail