29 string GUISelectBoxOptionController::CONDITION_SELECTED =
"selected";
30 string GUISelectBoxOptionController::CONDITION_UNSELECTED =
"unselected";
31 string GUISelectBoxOptionController::CONDITION_FOCUSSED =
"focussed";
32 string GUISelectBoxOptionController::CONDITION_UNFOCUSSED =
"unfocussed";
33 string GUISelectBoxOptionController::CONDITION_DISABLED =
"disabled";
34 string GUISelectBoxOptionController::CONDITION_ENABLED =
"enabled";
35 string GUISelectBoxOptionController::CONDITION_CHILD =
"child";
37 GUISelectBoxOptionController::GUISelectBoxOptionController(
GUINode* node)
41 this->
selected = required_dynamic_cast<GUIElementNode*>(
node)->isSelected();
48 GUIElementController::setDisabled(
disabled);
53 auto& nodeConditions = required_dynamic_cast<GUIElementNode*>(
node)->getActiveConditions();
65 auto& nodeConditions = required_dynamic_cast<GUIElementNode*>(
node)->getActiveConditions();
86 auto& nodeConditions = required_dynamic_cast<GUIElementNode*>(
node)->getActiveConditions();
94 auto& nodeConditions = required_dynamic_cast<GUIElementNode*>(
node)->getActiveConditions();
103 while (_parentElementNode !=
nullptr) {
105 if (selectBoxParentOptionController !=
nullptr) {
106 if (selectBoxParentOptionController->isExpanded() ==
false)
return false;
122 while (_parentElementNode !=
nullptr) {
124 if (selectBoxParentOptionController !=
nullptr) {
125 if (selectBoxParentOptionController->isExpanded() ==
false) selectBoxParentOptionController->
toggleExpandState();
140 while (
true ==
true) {
156 while (_parentElementNode !=
nullptr) {
175 GUIElementController::initialize();
180 GUIElementController::dispose();
195 GUIElementController::handleMouseEvent(
node, event);
197 auto multipleSelection = required_dynamic_cast<GUISelectBoxController*>(
selectBoxNode->
getController())->isMultipleSelection();
199 event->setProcessed(
true);
200 if (event->
getType() == GUIMouseEvent::MOUSEEVENT_PRESSED) {
202 auto optionElementNode = required_dynamic_cast<GUIElementNode*>(
node);
203 selectBoxController->unfocus();
204 if (multipleSelection ==
true && selectBoxController->isKeyControlDown() ==
true) {
205 selectBoxController->toggle(optionElementNode);
206 selectBoxController->focus(optionElementNode);
208 selectBoxController->unselect();
209 selectBoxController->select(optionElementNode);
210 selectBoxController->focus(optionElementNode);
225 GUIElementController::handleKeyboardEvent(event);
void setFoccussedNode(GUIElementNode *newFoccussedNode)
Set focussed node.
GUI select box controller.
GUI select box option controller.
void onFocusGained() override
On focus gained.
void dispose() override
Dispose controller.
void postLayout() override
Post layout event.
void initialize() override
Initialize controller after element has been created.
void handleKeyboardEvent(GUIKeyboardEvent *event) override
Handle keyboard event.
GUIParentNode * selectBoxNode
void onFocusLost() override
On focus lost.
void setValue(const MutableString &value) override
Set value.
void handleMouseEvent(GUINode *node, GUIMouseEvent *event) override
Handle mouse event.
static STATIC_DLL_IMPEXT string CONDITION_DISABLED
static STATIC_DLL_IMPEXT string CONDITION_ENABLED
static STATIC_DLL_IMPEXT string CONDITION_UNSELECTED
void setDisabled(bool disabled) override
Set disabled.
const MutableString & getValue() override
static STATIC_DLL_IMPEXT string CONDITION_CHILD
static STATIC_DLL_IMPEXT string CONDITION_FOCUSSED
void toggle()
Toggle selection.
void expandHierarchy()
Expand hierarchy.
bool isHierarchyExpanded()
static STATIC_DLL_IMPEXT string CONDITION_SELECTED
static STATIC_DLL_IMPEXT string CONDITION_UNFOCUSSED
GUI select box parent option controller.
void toggleExpandState()
Toggle expand state.
GUIMouseEventType getType() const
const string & getParentElementNodeId()
GUINodeConditions & getActiveConditions()
GUI element node conditions.
bool add(const string &condition)
Add a condition.
GUI node controller base class.
void scrollToNodeY(GUIParentNode *toNode=nullptr)
Scroll to node Y.
void scrollToNodeX(GUIParentNode *toNode=nullptr)
Scroll to node X.
bool isEventBelongingToNode(GUIMouseEvent *event, Vector2 &nodeCoordinate)
Is event belonging to node.
GUINodeController * getController()
GUIParentNode * getParentControllerNode()
GUIScreenNode * getScreenNode()
GUI parent node base class thats supporting child nodes.
GUI screen node that represents a screen that can be rendered via GUI system.
void forwardChange(GUIElementNode *node)
Forward change event.
void forwardContextMenuRequest(GUIElementNode *node, int mouseX, int mouseY)
Forward context menu request event.
GUINode * getNodeById(const string &nodeId)
Get GUI node by id.
Mutable utf8 aware string class.