Does "setText" keep Combobox items ordered?

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

Dirso
Not too shy to talk
Not too shy to talk
Posts: 25
Joined: Sun Dec 31, 2006 15:49

Does "setText" keep Combobox items ordered?

Postby Dirso » Sun Dec 16, 2007 12:15

Hi,

If I store a pointer for each CEGUI::ListboxTextItem that I add to my combobox and if I have to change their text - for translation purposes for example, will it stay sorted? I'm asking because it's not sorted with me. :(

Thanks,
Dirso.

User avatar
scriptkid
Home away from home
Home away from home
Posts: 1178
Joined: Wed Jan 12, 2005 12:06
Location: The Hague, The Netherlands
Contact:

Postby scriptkid » Sun Dec 16, 2007 18:06

Hi,

Combox has a method 'handleUpdatedListItemData()', which -i think- should do what you want. Because its documentation reads: "Causes the list box to update it's internal state after changes have been made to one or more attached ListboxItem objects.".

HTH.
Check out my released snake game using Cegui!

Dirso
Not too shy to talk
Not too shy to talk
Posts: 25
Joined: Sun Dec 31, 2006 15:49

Postby Dirso » Mon Dec 17, 2007 01:35

Still not working :(
To make it sorted (when I start) I'm using this:

Code: Select all

static_cast<CEGUI::Combobox*>(getWindow(ID))->setSortingEnabled(true);

Am I right?

Thanks,
Dirso

User avatar
scriptkid
Home away from home
Home away from home
Posts: 1178
Joined: Wed Jan 12, 2005 12:06
Location: The Hague, The Netherlands
Contact:

Postby scriptkid » Mon Dec 17, 2007 13:41

Hi,

yeah that looks okay. I checked the code, and (re)sorting is not a part of the update method i mentioned. I've added this to Mantis. A workaround would be to cause a resort manually by saying:

Code: Select all

static_cast<CEGUI::Combobox*>(getWindow(ID))->setSortingEnabled(false);
static_cast<CEGUI::Combobox*>(getWindow(ID))->setSortingEnabled(true);


but i noticed that the (re)sort will sort from high to low, which is not correct i think. If you use SVN, the fix has already been made (so you can use the workaround).

Otherwise you have to wait for an update, and re-add the items yourself.

Sorry ;)
Check out my released snake game using Cegui!

Dirso
Not too shy to talk
Not too shy to talk
Posts: 25
Joined: Sun Dec 31, 2006 15:49

Postby Dirso » Sat Dec 29, 2007 14:02

scriptkid wrote:Hi,

yeah that looks okay. I checked the code, and (re)sorting is not a part of the update method i mentioned. I've added this to Mantis. A workaround would be to cause a resort manually by saying:

Code: Select all

static_cast<CEGUI::Combobox*>(getWindow(ID))->setSortingEnabled(false);
static_cast<CEGUI::Combobox*>(getWindow(ID))->setSortingEnabled(true);


but i noticed that the (re)sort will sort from high to low, which is not correct i think. If you use SVN, the fix has already been made (so you can use the workaround).

Otherwise you have to wait for an update, and re-add the items yourself.

Sorry ;)

Since I use OgreSDK, the better choice would be wait for the next release, right?

Thanks again,
Dirso

User avatar
scriptkid
Home away from home
Home away from home
Posts: 1178
Joined: Wed Jan 12, 2005 12:06
Location: The Hague, The Netherlands
Contact:

Postby scriptkid » Sat Dec 29, 2007 16:33

Yes, i would recommend that. Note that we are currently in the process of creating new releases.
Check out my released snake game using Cegui!

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

Postby CrazyEddie » Mon Feb 11, 2008 12:58

This is now fixed in svn trunk rev. 1540.

CE


Return to “Help”

Who is online

Users browsing this forum: Bing [Bot] and 6 guests