55 GUIElementController::initialize();
59 GUIElementController::dispose();
67 GUIElementController::handleMouseEvent(
node, event);
69 if (
node == this->node &&
70 event->
getType() == GUIMouseEvent::MOUSEEVENT_RELEASED ==
true) {
72 event->setProcessed(
true);
76 event->
getType() == GUIMouseEvent::MOUSEEVENT_DRAGGED ==
true)) {
77 event->setProcessed(
true);
79 auto sliderPosition = Math::clamp(
91 GUIElementController::handleKeyboardEvent(event);
93 case GUIKeyboardEvent::KEYCODE_LEFT: {
94 event->setProcessed(
true);
95 if (event->
getType() == GUIKeyboardEvent::KEYBOARDEVENT_KEY_PRESSED) {
102 case GUIKeyboardEvent::KEYCODE_RIGHT: {
103 event->setProcessed(
true);
104 if (event->
getType() == GUIKeyboardEvent::KEYBOARDEVENT_KEY_PRESSED) {
115 GUIElementController::tick();
void setFoccussedNode(GUIElementNode *newFoccussedNode)
Set focussed node.
GUI horizontal slider 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.
GUIParentNode * sliderParentNode
void handleKeyboardEvent(GUIKeyboardEvent *event) override
Handle keyboard event.
void onFocusLost() override
On focus lost.
void setValue(const MutableString &value) override
Set value.
void handleMouseEvent(GUINode *node, GUIMouseEvent *event) override
Handle mouse event.
void tick() override
Tick method will be executed once per frame.
void updateSlider()
Update slider.
void setDisabled(bool disabled) override
Set disabled.
const MutableString & getValue() override
bool isDisabled() override
GUIKeyboardEventType getType()
GUIMouseEventType getType()
virtual int getContentHeight()=0
GUINode_Padding & getPadding()
virtual int getContentWidth()=0
bool isEventBelongingToNode(GUIMouseEvent *event, Vector2 &position)
Is event belonging to node.
GUINode_ComputedConstraints & getComputedConstraints()
GUIScreenNode * getScreenNode()
void getEventNodePosition(GUIMouseEvent *event, Vector2 &position)
Get event position clamped to node constraints TODO: use Vector2 instead of array<float,...
GUIParentNode * getParentNode()
GUI screen node that represents a screen that can be rendered via GUI system.
GUINode * getNodeById(const string &nodeId)
Get GUI node by id.
void delegateValueChanged(GUIElementNode *node)
Delegate value changed.
MutableString & set(char c)
Set character.
const string & getString() const
int additionalAlignmentLeft
int additionalAlignmentTop