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

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

asjt3
Just popping in
Just popping in
Posts: 10
Joined: Fri Jun 12, 2009 13:54

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

Postby asjt3 » Wed Oct 27, 2010 18:44

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

Jamarr
CEGUI MVP
CEGUI MVP
Posts: 812
Joined: Tue Jun 03, 2008 23:59
Location: USA

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

Postby Jamarr » Wed Oct 27, 2010 19:43

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.
If somebody helps you by replying to your thread, upvote him/her as a thanks! Make sure to include your CEGUI.log and everything you tried when posting! And remember that we are not magicians!

asjt3
Just popping in
Just popping in
Posts: 10
Joined: Fri Jun 12, 2009 13:54

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

Postby asjt3 » Fri Oct 29, 2010 16:42

Ah I see. So is there any workaround to not specifying the items via code?

Thanks for the reply,

alex

Jamarr
CEGUI MVP
CEGUI MVP
Posts: 812
Joined: Tue Jun 03, 2008 23:59
Location: USA

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

Postby Jamarr » Fri Oct 29, 2010 17:16

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.
If somebody helps you by replying to your thread, upvote him/her as a thanks! Make sure to include your CEGUI.log and everything you tried when posting! And remember that we are not magicians!


Return to “Help”

Who is online

Users browsing this forum: No registered users and 21 guests