[solved] Preventing cegui control state change
Posted: Mon Jun 02, 2008 15:57
Hello people.
Is there a way to prevent a cegui control to change it's state in event handler.
Let me clarify a bit:
I have a checkbox for example, and I want to prevent the user from checking/unchecking it if a certain condition is fulfilled (whatever, some variable is > 10), and I check for that condition in the handler for EventCheckStateChanged for example.
I tried returning false (thought that might do the trick), and the checkbox was still changed. (const EventArgs &) e and it's e.handled is read-only.
Can I do something in that (or any other) event handler that will prevent the checkbox from changing it's state on mouse click, other than disabling the control?
Thx
Is there a way to prevent a cegui control to change it's state in event handler.
Let me clarify a bit:
I have a checkbox for example, and I want to prevent the user from checking/unchecking it if a certain condition is fulfilled (whatever, some variable is > 10), and I check for that condition in the handler for EventCheckStateChanged for example.
I tried returning false (thought that might do the trick), and the checkbox was still changed. (const EventArgs &) e and it's e.handled is read-only.
Can I do something in that (or any other) event handler that will prevent the checkbox from changing it's state on mouse click, other than disabling the control?
Thx