Page 1 of 1

CEGUI0.6: Can't get combox items to appear

Posted: Wed Oct 27, 2010 18:44
by asjt3
Hey guys,

I'm using the following code in an xml layout file to try and populate a droplist. I can't seem to get the items to appear in the list, as of now it is blank.

Before when I was creating the GUI at runtime, I just used Combobox along with ListBoxTextItem and it worked.

As you can see, for the first listbox item I tried setting different property values to make it visible, but to no avail. any ideas?


Code: Select all

<Window Type='TaharezLook/Static' Name='Cam Panel'>
      <Property Name='UnifiedAreaRect' Value='{{0.000000,0.000000},{0.0,0.000000},{1.0,0.000000},{0.3,0.000000}}'/>
      <Property Name='FrameEnabled' Value='false'/>

      <Window Type='TaharezLook/Combobox' Name='CamList'>
        <Property Name='ReadOnly' Value='true'/>
        <Property Name='FrameEnabled' Value='false'/>
        <Property Name='UnifiedAreaRect' Value='{{0.000000,0.000000},{0.0,0.000000},{1.0,0.000000},{1.0,0.000000}}'/>

        <Window Type ='TaharezLook/ComboDropList' Name='DropList'>
          <Property Name='Visible' Value='true'/>
         
          <Window Type ='TaharezLook/ListboxItem' Name='Port'>
            <Property Name='Text' Value='PORT'/>
            <Property Name='Visible' Value='true'/>
            <Property Name='TextColour' Value='FFFFFF'/>
            <Property Name='AlwaysOnTop' Value='true'/>
          </Window>
         
          <Window Type ='TaharezLook/ListboxItem' Name='Starboard'>
            <Property Name='Text' Value='STBD'/>
          </Window>
     </Window>
  </Window>
  </Window>


Thanks,

alex

Re: CEGUI0.6: Can't get combox items to appear

Posted: Wed Oct 27, 2010 19:43
by Jamarr
The combobox does not use CEGUI::ItemEntry (CEGUI::Window) based items and therefor cannot accept items via xml. The combobox requires ListboxItem based items which can only be specified via code.

Re: CEGUI0.6: Can't get combox items to appear

Posted: Fri Oct 29, 2010 16:42
by asjt3
Ah I see. So is there any workaround to not specifying the items via code?

Thanks for the reply,

alex

Re: CEGUI0.6: Can't get combox items to appear

Posted: Fri Oct 29, 2010 17:16
by Jamarr
You would need to rewrite the container class. Since the Combobox, ComboDropList, Listbox, and MultiColumnList all require the use of the ListboxItem, which is not Window based, none of them can have items specified in the layout xml. On a similar note, the Tree control relies on TreeItem, which is also not Window based. The only way to correct this is to re-write each container to use ItemEntry (Window) based items. As far as I know, this is on CE's TODO list - but is not high priority.

You may be able to mimic a combox using a Menu/Popup control. I have not used these myself, but afaik they use MenuItem which is ItemEntry-based.