When the data/state of a widget is changed while disabled, why do events fire off when the widget is (re)enabled?
For example:
We have validation events subscribed to checkboxes (and other widgets too) that are tied to the CEGUI::Checkbox::EventCheckStateChanged event. When we are changing the checkbox, we DISABLE it because we don't want the event to fire. However, after we change the checkbox state and then ENABLE the checkbox the event fires PRIOR to the user changing the state of teh checkbox. It seems that the checkbox is instantly reacting to the state change while it was disabled. Is this behavior correct?
Implemenation:
This doesn't make since to us. We display data "as it is now" and then permit the user to change it. When a "change" occurs to the data we enable the "CANCEL and COMMIT" buttons. If the user hit's CANCEL, we disable all the widgets, reset the data back to "as it is now" and then re-enable the widgets. However, the "CHANGE" events are still being fired when the widget it is re-enabled. It makes more since that envents only fire when the widget is enabled. If the state changes while disabled, then don't fire the event.
Event Behavior: Enabled vs Disabled
Moderators: CEGUI MVP, CEGUI Team
- CrazyEddie
- CEGUI Project Lead
- Posts: 6760
- Joined: Wed Jan 12, 2005 12:06
- Location: England
- Contact:
To gaurantee that no events get fired, you should be using the method EventSet::setMutedState.
HTH
CE.
HTH
CE.
- CrazyEddie
- CEGUI Project Lead
- Posts: 6760
- Joined: Wed Jan 12, 2005 12:06
- Location: England
- Contact:
Return to “Modifications / Integrations / Customisations”
Who is online
Users browsing this forum: No registered users and 6 guests