1 #ifndef JUGIMAP_GUI_COMMON_H
2 #define JUGIMAP_GUI_COMMON_H
6 #include "jmCommonFunctions.h"
132 void SetName(
const std::string &_name){ name = _name;}
187 virtual void _SetHighlighted(
bool _highlighted);
330 virtual void Update() = 0;
331 virtual void SetToInitialState(){}
333 static void _SetInteractedWidget(GuiWidget *_widget);
334 static void ResetInteractedPerUpdate(){ interactedWidget =
nullptr; }
342 std::string designKind;
343 CustomObject* obj =
nullptr;
344 GuiWidgetCallback *callbackObj =
nullptr;
347 bool disabled =
false;
351 bool pressed =
false;
352 bool cursorOver =
false;
353 bool cursorDown =
false;
354 bool valueChanged =
false;
356 Sprite *highlightMarkerSprite =
nullptr;
360 static GuiWidget *interactedWidget;
376 Vec2f GetCursorScreenPosition(){
return cursorScreenPosition; }
377 Vec2f GetCursorInMapPosition(){
return cursorPosition; }
378 bool IsPressed(){
return cursorPressed; }
379 bool IsCursorDown(){
return cursorDown; }
382 void _SetCursorScreenPosition(
Vec2f _pos){ cursorScreenPosition = _pos; }
383 void _SetCursorInMapPosition(
Vec2f _pos){ cursorPosition = _pos; }
384 void _SetCursorPressed(
bool _pressed){ cursorPressed = _pressed; }
385 void _SetCursorDown(
bool _down){ cursorDown = _down; }
389 Vec2f cursorScreenPosition;
390 Vec2f cursorPosition;
391 bool cursorPressed =
false;
392 bool cursorDown =
false;
413 GuiWidget* GetHighlightedWidget(){
return highlightedWidget; }
414 bool GetHighlighedPressed(){
return highlightedPressed; }
415 bool GetHighlighedDown(){
return highlightedDown; }
416 int GetHighlightedChangeValue(){
return highlightedChangeValue; }
450 void SetPressKeys(
const std::vector<KeyCode> &_keys){ pressKeys = _keys; }
510 void _ClearHighlightedWidget();
511 void _ProposeWidgetIndex(
GuiWidget * _widget);
515 bool disabled =
false;
517 bool highlightedPressed =
false;
518 bool highlightedDown =
false;
519 int highlightedChangeValue = 0;
521 std::vector<GuiWidget*>widgets;
522 int indexHighlighted = -1;
525 std::vector<KeyCode>navigateForwardKeys;
526 std::vector<KeyCode>navigateBackwardKeys;
527 std::vector<KeyCode>incrementValueKeys;
528 std::vector<KeyCode>decrementValueKeys;
529 std::vector<KeyCode>pressKeys;
541 std::vector<int>joyPressButtons;
545 void _SetHighlightedPressed(
bool _pressed);
546 void _SetHighlightedDown(
bool _down);
547 void _SetHighlightedNavigate(
int _highlightedNavigate);
548 void _SetHighlightedChangeValue(
int _highlightedChangeValue);
The CustomObject class is the base class for custom objects.
Definition: jmCommon.h:555
POV_X
POV X values.
Definition: jmInput.h:370
POV_Y
POV Y values.
Definition: jmInput.h:378
GuiKeyboardAndJoystickInput guiKeyboardAndJoystickInput
Global GuiKeyboardAndJoystickInput object used by widgets.
Definition: jmGuiCommon.cpp:20
GuiCursorDeviceInput guiCursorDeviceInput
Global GuiCursorDeviceInput object used by widgets.
Definition: jmGuiCommon.cpp:15
GuiWidgetKind
The kinds of widget. Used as identifier for GuiWidget objects.
Definition: jmGlobal.h:216