Hi again, here a new problem with child widgets.
I add a RadioButton (and some other widgets) on a ItemEntry, and i want the RadionButton be in the same "Selected" state with it's parent - the ItemEntry, in a ItemListbox. It seems not automatically. And I have to write codes to trace the last selected RadionButton and de-select it. Any better solution?
[solved]Howto inform child widgets about the Selected state?
Moderators: CEGUI MVP, CEGUI Team
[solved]Howto inform child widgets about the Selected state?
Last edited by lcy03406 on Wed Jul 01, 2009 09:32, edited 1 time in total.
- CrazyEddie
- CEGUI Project Lead
- Posts: 6760
- Joined: Wed Jan 12, 2005 12:06
- Location: England
- Contact:
Re: [help]How to inform child widgets about the Selected state?
The deselection algorithm only works on the immediate parent, which obviously is not helpful when your widgets are children of ItemEntry windows so they can be added to the ItemListbox. From this, you should gather that currently, to manually go through and deselect the other radio buttons in the group is the only solution
CE
CE
Useful Links: Forum Guidelines | Documentation | Tutorials | HOWTO | Videos | Donate to CEGUI | CEGUI Twitter
Re: [help]How to inform child widgets about the Selected state?
By 'trace' I am assuming you mean 'iterate'; instead of iterating over all the radiobuttons looking for the selected one, whenever one is selected store a pointer to it as a member of your class; then when a radiobutton or listitem is selected, you already know which one (if any) to deselect.
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!
Re: [help]How to inform child widgets about the Selected state?
Finally i decide to register an event handler for ItemEntry::EventSelectionChanged on EVERY item of the list.
Who is online
Users browsing this forum: No registered users and 29 guests