ComboBox drop down text options not visible

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

tpynegar
Just popping in
Just popping in
Posts: 6
Joined: Thu Jan 22, 2009 10:46

ComboBox drop down text options not visible

Postby tpynegar » Wed Feb 04, 2009 21:52

Hey,

I've got some combo box's in a Frame and i'm using the Windows looknfeel. I've tried to populate these combox box's and the text in the drop downs is not visible. When i select one of these options which obviously i can't see it is selected and it's correct entry is put into the main text area of the combox box. I haven't built from source and that's going to be the next move but thought i'd ask here and see if anyone has had anything similar happen. I've got other combo box's working on other pages. I seem to get a lot of these messages in the CEGUI.log, about been added to dead pool, i've done some googling but nothing came up.

Thanks,
Tim.

04/02/2009 21:46:34 (InfL2) Window 'Editor/frmPlayer/cbEthnicOrigin__auto_editbox__' has been added to dead pool.
04/02/2009 21:46:34 (InfL2) Window 'Editor/frmPlayer/cbEthnicOrigin__auto_droplist____auto_hscrollbar____auto_incbtn__' has been added to dead pool.
04/02/2009 21:46:34 (InfL2) Window 'Editor/frmPlayer/cbEthnicOrigin__auto_droplist____auto_hscrollbar____auto_decbtn__' has been added to dead pool.
04/02/2009 21:46:34 (InfL2) Window 'Editor/frmPlayer/cbEthnicOrigin__auto_droplist____auto_hscrollbar____auto_thumb__' has been added to dead pool.
04/02/2009 21:46:34 (InfL2) Window 'Editor/frmPlayer/cbEthnicOrigin__auto_droplist____auto_hscrollbar__' has been added to dead pool.
04/02/2009 21:46:34 (InfL2) Window 'Editor/frmPlayer/cbEthnicOrigin__auto_droplist____auto_vscrollbar____auto_incbtn__' has been added to dead pool.
04/02/2009 21:46:34 (InfL2) Window 'Editor/frmPlayer/cbEthnicOrigin__auto_droplist____auto_vscrollbar____auto_decbtn__' has been added to dead pool.
04/02/2009 21:46:34 (InfL2) Window 'Editor/frmPlayer/cbEthnicOrigin__auto_droplist____auto_vscrollbar____auto_thumb__' has been added to dead pool.
04/02/2009 21:46:34 (InfL2) Window 'Editor/frmPlayer/cbEthnicOrigin__auto_droplist____auto_vscrollbar__' has been added to dead pool.
04/02/2009 21:46:34 (InfL2) Window 'Editor/frmPlayer/cbEthnicOrigin__auto_droplist__' has been added to dead pool.
04/02/2009 21:46:34 (InfL2) Window 'Editor/frmPlayer/cbEthnicOrigin__auto_button__' has been added to dead pool.
04/02/2009 21:46:34 (InfL2) Window 'Editor/frmPlayer/cbEthnicOrigin' has been added to dead pool.

User avatar
CrazyEddie
CEGUI Project Lead
Posts: 6760
Joined: Wed Jan 12, 2005 12:06
Location: England
Contact:

Postby CrazyEddie » Thu Feb 05, 2009 09:39

Hi,

I think the combobox list is getting clipped to the edge of the containing window. You might set the combo box (or even just the list) so that it's not clipped by parent. This is done via the Window::setClippedByParent function or via the "ClippedByParent" property.

Those log messages are normal, and indicate the window objects are listed for destruction (as happens when you close the app, for example).

HTH

CE.

Pompei2
Home away from home
Home away from home
Posts: 489
Joined: Tue May 23, 2006 16:31

Postby Pompei2 » Thu Feb 05, 2009 12:06

If I understand you correctly, I had this problem long time ago and it was just that the font color was exactly the same as the list's background, maybe it's that for you too?

tpynegar
Just popping in
Just popping in
Posts: 6
Joined: Thu Jan 22, 2009 10:46

Postby tpynegar » Thu Feb 05, 2009 23:01

Thanks for your replys, in the tool i've changed the "Clipped by parent" to false and with the font it's on "Bold" but so is everything else on the form so i'm not sure why it is.

I've posted the .layout file for this form and also the code i use to populate the combobox. If you've got a moment to take a look at it i'd really appricate it.

CEGUI::Combobox * lpEthnicOriginComboBox = getComboboxPnt( "Editor/frmPlayer/cbEthnicOrigin" );

CEGUI::ListboxTextItem* item;
item = new CEGUI::ListboxTextItem((CEGUI::utf8*)"Entry1", 1);
item->setText( "Entry1" );
lpEthnicOriginComboBox->addItem(item);

item = new CEGUI::ListboxTextItem((CEGUI::utf8*)"Entry2", 2);
item->setText( "Entry2" );
lpEthnicOriginComboBox->addItem(item);


<Window Type="WindowsLook/FrameWindow" Name="Editor/frmPlayer" >
<Property Name="Text" Value="Player" />
<Property Name="TitlebarFont" Value="Bold" />
<Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
<Property Name="TitlebarEnabled" Value="True" />
<Property Name="UnifiedAreaRect" Value="{{0,0},{0,50},{0,300},{0,591}}" />
<Window Type="WindowsLook/StaticText" Name="Editor/frmPlayer/lbName" >
<Property Name="Text" Value="Name" />
<Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
<Property Name="UnifiedAreaRect" Value="{{0,15},{0,50},{0,115},{0,80}}" />
</Window>
<Window Type="WindowsLook/Editbox" Name="Editor/frmPlayer/txtName" >
<Property Name="MaxTextLength" Value="1073741823" />
<Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
<Property Name="UnifiedAreaRect" Value="{{0,130},{0,50},{0,280},{0,80}}" />
</Window>
<Window Type="WindowsLook/StaticText" Name="Editor/frmPlayer/lbGroup" >
<Property Name="Text" Value="Group" />
<Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
<Property Name="UnifiedAreaRect" Value="{{0,15},{0,90},{0,115},{0,120}}" />
</Window>
<Window Type="WindowsLook/Editbox" Name="Editor/frmPlayer/txtGroup" >
<Property Name="MaxTextLength" Value="1073741823" />
<Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
<Property Name="UnifiedAreaRect" Value="{{0,130},{0,90},{0,280},{0,120}}" />
</Window>
<Window Type="WindowsLook/StaticText" Name="Editor/frmPlayer/lbRole" >
<Property Name="Text" Value="Role" />
<Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
<Property Name="UnifiedAreaRect" Value="{{0,15},{0,200},{0,110},{0,230}}" />
</Window>
<Window Type="WindowsLook/Combobox" Name="Editor/frmPlayer/cbRole" >
<Property Name="Font" Value="Regular" />
<Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
<Property Name="ClippedByParent" Value="False" />
<Property Name="UnifiedAreaRect" Value="{{0,15},{0,240},{0,285},{0,377}}" />
<Property Name="MaxEditTextLength" Value="1073741823" />
</Window>
<Window Type="WindowsLook/StaticText" Name="Editor/frmPlayer/lbAnimState1" >
<Property Name="Text" Value="Anim 1" />
<Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
<Property Name="UnifiedAreaRect" Value="{{0,15},{0,280},{0,120},{0,310}}" />
</Window>
<Window Type="WindowsLook/Combobox" Name="Editor/frmPlayer/cbAnim1" >
<Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
<Property Name="ClippedByParent" Value="False" />
<Property Name="UnifiedAreaRect" Value="{{0,15},{0,320},{0,285},{0,449}}" />
<Property Name="MaxEditTextLength" Value="1073741823" />
</Window>
<Window Type="WindowsLook/Editbox" Name="Editor/frmPlayer/txtTime" >
<Property Name="MaxTextLength" Value="1073741823" />
<Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
<Property Name="UnifiedAreaRect" Value="{{0,210},{0,440},{0,260},{0,470}}" />
</Window>
<Window Type="WindowsLook/StaticText" Name="Editor/frmPlayer/lbEthnicity" >
<Property Name="Font" Value="Bold" />
<Property Name="Text" Value="Ethnicity" />
<Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
<Property Name="UnifiedAreaRect" Value="{{0,15},{0,130},{0,150},{0,160}}" />
</Window>
<Window Type="WindowsLook/StaticText" Name="Editor/frmPlayer/lbAnimState2" >
<Property Name="Font" Value="Bold" />
<Property Name="Text" Value="Anim 2" />
<Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
<Property Name="UnifiedAreaRect" Value="{{0,15},{0,360},{0,120},{0,390}}" />
</Window>
<Window Type="WindowsLook/Combobox" Name="Editor/frmPlayer/cbAnim2" >
<Property Name="Font" Value="Bold" />
<Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
<Property Name="ClippedByParent" Value="False" />
<Property Name="UnifiedAreaRect" Value="{{0,15},{0,400},{0,285},{0,520}}" />
<Property Name="MaxEditTextLength" Value="1073741823" />
</Window>
<Window Type="WindowsLook/StaticText" Name="Editor/frmPlayer/lbBlendPeriod" >
<Property Name="Text" Value="Blend Period" />
<Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
<Property Name="UnifiedAreaRect" Value="{{0,15},{0,440},{0,200},{0,470}}" />
</Window>
<Window Type="WindowsLook/Checkbox" Name="Editor/frmPlayer/ckbSkeleton" >
<Property Name="Text" Value="Skeleton" />
<Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
<Property Name="UnifiedAreaRect" Value="{{0,15},{0,480},{0,160},{0,510}}" />
</Window>
<Window Type="WindowsLook/Combobox" Name="Editor/frmPlayer/cbEthnicOrigin" >
<Property Name="Font" Value="Commonwealth-10" />
<Property Name="ReadOnly" Value="True" />
<Property Name="AlwaysOnTop" Value="True" />
<Property Name="InheritsAlpha" Value="False" />
<Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
<Property Name="ClippedByParent" Value="False" />
<Property Name="UnifiedAreaRect" Value="{{0,13},{0,159},{0,283},{0,417}}" />
<Property Name="MaxEditTextLength" Value="1073741823" />
</Window>
</Window>

gamecat
Just popping in
Just popping in
Posts: 20
Joined: Mon Jan 12, 2009 06:40
Location: SF Bay Area

Postby gamecat » Fri Feb 06, 2009 06:35

I'm having the exact same problem, which is what prompted me to upgrade from CEGUI 6.0 to 6.2 (see the 'Building CEGUI 6.2 for MinGw' thread for the gory details). That didn't fix it however.

My next step was going to be to get a Debug build going so that I could step through it. I'll be inerested in seeing how you fix your problem. I'll post if I figure out anything on my own.

gamecat

gamecat
Just popping in
Just popping in
Posts: 20
Joined: Mon Jan 12, 2009 06:40
Location: SF Bay Area

Postby gamecat » Fri Feb 06, 2009 06:37

BTW, do you happen to be using Ogre3d + Code::Blocks?

User avatar
CrazyEddie
CEGUI Project Lead
Posts: 6760
Joined: Wed Jan 12, 2005 12:06
Location: England
Contact:

Postby CrazyEddie » Fri Feb 06, 2009 09:38

Hi,

I did not test the layout, but looking at the code posted above, Pompei2 was indeed correct when he mentioned the text colour. The CEGUI::ListboxTextItem defaults to white, when rendered on a white background as in the WindowsLook list widgets, obviously you don't see anything :)

You should set the text colours to something more appropriate:

Code: Select all

item->setTextColours( 0xFF000000 );


You probably also want to set an image to be used as the highlight 'brush' also,

Code: Select all

item->setSelectionBrushImage( "WindowsLook", "Background" );


HTH

CE.

gamecat
Just popping in
Just popping in
Posts: 20
Joined: Mon Jan 12, 2009 06:40
Location: SF Bay Area

Postby gamecat » Sat Feb 07, 2009 02:48

setTextColours fixed it for me. :-/

Does this mean that the default text color is white? Not quite what I was expecting. Funny thing is, the text that I apply directly to the window via setText shows up as black, but I have to set the color on the ListBoxTextItems in order for them to show.

Anyway, thanks!

User avatar
CrazyEddie
CEGUI Project Lead
Posts: 6760
Joined: Wed Jan 12, 2005 12:06
Location: England
Contact:

Postby CrazyEddie » Sat Feb 07, 2009 09:25

Yeah, the default colour is white.

The thing about having the black default for other parts in WindowsLook is because other parts are Window and looknfeel skin based, so we can modify the defaults, whereas the ListboxTextItem is more of a lightweight content class that has no skinning, as such the defaults are hard-coded.

One recommendation I usually make is to subclass ListboxTextItem in order to provide suitable defaults for the text colour and selection brush (as we do in demo 7)

CE.

gamecat
Just popping in
Just popping in
Posts: 20
Joined: Mon Jan 12, 2009 06:40
Location: SF Bay Area

Postby gamecat » Sun Feb 08, 2009 00:26

I did end up wrapping ListTextBoxItem, but may I also suggest changing

const colour ListboxTextItem::DefaultTextColour = 0xFFFFFFFF;

to

const colour ListboxTextItem::DefaultTextColour = 0xFF000000;

?

User avatar
CrazyEddie
CEGUI Project Lead
Posts: 6760
Joined: Wed Jan 12, 2005 12:06
Location: England
Contact:

Postby CrazyEddie » Sun Feb 08, 2009 08:45

I could do that, but then anyone using a skin that uses dark backgrounds (such as TaharezLook) would then have the same issue, but in reverse ;) Overall the "best" solution has been to leave things as they are (although this solution is not ideal).

Pompei2
Home away from home
Home away from home
Posts: 489
Joined: Tue May 23, 2006 16:31

Postby Pompei2 » Mon Feb 09, 2009 10:44

You could also have the default ListboxTextItem query the looknfeel's background color, calculate its "darkness" and automagically switch from white to black :)

tpynegar
Just popping in
Just popping in
Posts: 6
Joined: Thu Jan 22, 2009 10:46

Postby tpynegar » Mon Feb 09, 2009 14:30

Thanks that fine now.

gamecat
Just popping in
Just popping in
Posts: 20
Joined: Mon Jan 12, 2009 06:40
Location: SF Bay Area

Postby gamecat » Tue Feb 10, 2009 08:26

I guess that I just assumed that white backgrounds were more prevalent than black backgrounds. Well, my problem's fixed. The next poor bloke can figure it out by reading the forums. ;-)

User avatar
CrazyEddie
CEGUI Project Lead
Posts: 6760
Joined: Wed Jan 12, 2005 12:06
Location: England
Contact:

Postby CrazyEddie » Tue Feb 10, 2009 09:40

Pompei2 wrote:You could also have the default ListboxTextItem query the looknfeel's background color, calculate its "darkness" and automagically switch from white to black :)

This is a possibility, thanks for the idea. I'll look into it in more detail once that "other job" I'm working on is done ;)

CE.


Return to “Help”

Who is online

Users browsing this forum: No registered users and 28 guests