[Solved]So the method clone won't copy comboBox's dropList?

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

Neo
Just popping in
Just popping in
Posts: 13
Joined: Sat Mar 30, 2013 16:49

[Solved]So the method clone won't copy comboBox's dropList?

Postby Neo » Thu Apr 25, 2013 02:58

Hi, i'm using CEGUI with irrlicht for my game.
However, I found that 'clone' method seems won't copy comboBox's drop list...
In my game, there are several comboBox with same content for each user to select their charecter type.
So I first made a comboBobox as a prototype with all the type names that allow users to select in its droplist, then duplicate it every time when program need to add a new comboBox(use combox.clone()).
But finally I found that the new comobox had nothing in the drop list, though the original prototype comcoBox had several items in the drop list that was prevously loaded.

So the 'Clone' method won't copy comboBox's items?
plz help me.
Thx
Last edited by Neo on Mon Apr 29, 2013 04:46, edited 1 time in total.

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

Re: So the method "clone" won't copy comboBox's dropList?

Postby CrazyEddie » Fri Apr 26, 2013 10:39

We discussed this briefly. The situation is a little complex. Ideally, we would like the items to be cloned also, and in that respect the fact they are not would be considered a bug. However, cloning the items raises issues of ownership regarding the created items (because the items are not Windows and are not otherwise managed by the system). For this reason, no immediate change is planned.

Hope this helps explain the situation a little.

CE.

Neo
Just popping in
Just popping in
Posts: 13
Joined: Sat Mar 30, 2013 16:49

Re: So the method "clone" won't copy comboBox's dropList?

Postby Neo » Fri Apr 26, 2013 15:56

I see. Thx :D
Now I load the items manualy, seems a little bit time-consuming, especially with multiple comboboxes.
Is their any other way to set the drop list directly in the comboBox? I'd like to get the dropList from one
box, and pass the pointer to another. Let them share same Items.

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

Re: So the method "clone" won't copy comboBox's dropList?

Postby CrazyEddie » Fri Apr 26, 2013 16:33

Unfortunately I don't think there is currently an easy solution for this; I think that creating the items for each Combobox is currently the only way to do it as things stand. You might consider a custom drop-list replacement class, though right now I don't have time to look or think if that's even a feasible approach (because most of the functionality comes from the Listbox base class, which therefore complicates things further).

While it does not help you now, a more model-view like approach for certain widgets has previously been discussed, which means eventually that will likely happen and thus one could share a single set of model data (combobox items) across multiple views (Combobox instances). Of course I can not give any ETA on when that might happen, but it is something we're aware of and have a mind to look at.

CE.

Neo
Just popping in
Just popping in
Posts: 13
Joined: Sat Mar 30, 2013 16:49

Re: So the method "clone" won't copy comboBox's dropList?

Postby Neo » Sat Apr 27, 2013 03:17

Okey, thx for help.
According to the situation right now, for loading effeciency, maybe I should make an object pool, to avoid initiate and destroy same comboBox
frequently. Add and remove a child window is much faster than create a new comboBox and insert a bunch of item in it, right?


Return to “Help”

Who is online

Users browsing this forum: No registered users and 28 guests