25string GUIRadioButtonController::CONDITION_SELECTED =
"selected";
26string GUIRadioButtonController::CONDITION_UNSELECTED =
"unselected";
27string GUIRadioButtonController::CONDITION_DISABLED =
"disabled";
28string GUIRadioButtonController::CONDITION_ENABLED =
"enabled";
30map<string, vector<GUIElementNode*>>* GUIRadioButtonController::radioButtonGroupNodesByName =
new map<string, vector<GUIElementNode*>>();
32GUIRadioButtonController::GUIRadioButtonController(
GUINode* node)
35 this->
selected = required_dynamic_cast<GUIElementNode*>(
node)->isSelected();
36 this->
disabled = required_dynamic_cast<GUIElementNode*>(
node)->isDisabled();
37 (*radioButtonGroupNodesByName)[
39 "_radiobuttongroup_" +
40 required_dynamic_cast<GUIElementNode*>(
node)->getName()
41 ].push_back(required_dynamic_cast<GUIElementNode*>(
node));
53 "_radiobuttongroup_" +
54 required_dynamic_cast<GUIElementNode*>(this->node)->getName()
57 for (
auto i = 0; i < radioButtonGroupNodesIt->second.size(); i++) {
58 auto radioButtonNode = required_dynamic_cast<GUIElementNode*>(radioButtonGroupNodesIt->second[i]);
59 auto& nodeConditions = radioButtonNode->getActiveConditions();
60 auto nodeController = required_dynamic_cast<GUIRadioButtonController*>(radioButtonNode->getController());
62 nodeController->selected =
false;
66 auto& nodeConditions = required_dynamic_cast<GUIElementNode*>(
node)->getActiveConditions();
79 auto& nodeConditions = required_dynamic_cast<GUIElementNode*>(
node)->getActiveConditions();
87 auto& nodeConditions = required_dynamic_cast<GUIElementNode*>(
node)->getActiveConditions();
91 GUIElementController::initialize();
96 GUIElementController::dispose();
99 "_radiobuttongroup_" +
100 required_dynamic_cast<GUIElementNode*>(this->node)->getName()
110 GUIElementController::handleMouseEvent(
node, event);
112 event->setProcessed(
true);
113 if (event->
getType() == GUIMouseEvent::MOUSEEVENT_RELEASED) {
123 GUIElementController::handleKeyboardEvent(event);
126 case GUIKeyboardEvent::KEYCODE_SPACE: {
127 event->setProcessed(
true);
128 if (event->
getType() == GUIKeyboardEvent::KEYBOARDEVENT_KEY_PRESSED) {
144 GUIElementController::tick();
171 if (
value.
equals(required_dynamic_cast<GUIElementNode*>(
node)->getValue()) ==
true) {
void setFoccussedNode(GUIElementNode *newFoccussedNode)
Set focussed node.
GUIKeyboardEventType getType()
GUIMouseEventType getType()
GUI element node conditions.
bool isEventBelongingToNode(GUIMouseEvent *event, Vector2 &position)
Is event belonging to node.
GUIScreenNode * getScreenNode()
GUI screen node that represents a screen that can be rendered via GUI system.
void delegateValueChanged(GUIElementNode *node)
Delegate value changed.
MutableString & append(char c)
Append character.
MutableString & reset()
Reset.
bool equals(const string &s2) const
Equals.