JugiMap Framework
jmGuiCommon.h
1 #ifndef JUGIMAP_GUI_COMMON_H
2 #define JUGIMAP_GUI_COMMON_H
3 
4 #include "jmGlobal.h"
5 #include "jmInput.h"
6 #include "jmCommonFunctions.h"
7 
8 
9 namespace jugimap {
10 
11 
12 class Sprite;
13 class Map;
14 
15 class GuiWidget;
16 
17 
18 
21 
22 
23 
26 {
27 
28  virtual ~GuiWidgetCallback(){}
29 
30 
34  virtual void OnPressed(GuiWidget*){}
35 
36 
40  virtual void OnCursorOver(GuiWidget*){}
41 
42 
46  virtual void OnCursorDown(GuiWidget*){}
47 
48 
52  virtual void OnValueChanged(GuiWidget*){}
53 
54 
59 
60 };
61 
62 
63 
65 class GuiWidget
66 {
67 
68 public:
69 
70  GuiWidget(){}
71  virtual ~GuiWidget();
72  GuiWidget(const GuiWidget &src) = delete;
73  GuiWidget(const GuiWidget &&src) = delete;
74  GuiWidget& operator=(const GuiWidget &src) = delete;
75  GuiWidget& operator=(const GuiWidget &&src) = delete;
76 
77 
78  //-----------------------------------------------------------------
79 
83  bool IsCursorDown(){ return cursorDown; }
84 
85 
89  bool IsCursorOver(){ return cursorOver; }
90 
91 
95  bool IsPressed(){ return pressed; }
96 
97 
101  bool IsValueChanged(){ return valueChanged; }
102 
103 
107  virtual void SetDisabled(bool _disabled);
108 
109 
113  bool IsDisabled(){ return disabled; }
114 
115 
120  virtual void SetVisible(bool _visible);
121 
122 
126  bool IsVisible(){ return visible; }
127 
128 
132  void SetName(const std::string &_name){ name = _name;}
133 
134 
138  std::string GetName(){ return name; }
139 
140 
144  void SetTag(int _tag){ tag = _tag;}
145 
146 
150  int GetTag(){ return tag; }
151 
152 
154  GuiWidgetKind GetKind(){ return kind; }
155 
156 
158  std::string GetDesignKind(){ return designKind; }
159 
160 
165  void AssignCustomObject(CustomObject* _customObject);
166 
167 
171  CustomObject* GetCustomObject(){ return obj; }
172 
173 
178  void AssignCallback(GuiWidgetCallback *_callback);
179 
180 
184  GuiWidgetCallback * GetCallback(){ return callbackObj; }
185 
186 
187  virtual void _SetHighlighted(bool _highlighted);
188 
189 
190 
191  // QUERY INTERACTED WIDGET
192  //-----------------------------------------------------------------
193 
194 
198  static GuiWidget* GetInteracted(){ return interactedWidget; }
199 
200 
204  static GuiWidget* GetInteracted(const std::string &_name){ return (interactedWidget && interactedWidget->GetName()==_name)? interactedWidget : nullptr;}
205 
206 
210  static GuiWidget* GetInteracted(int _tag){ return (interactedWidget && interactedWidget->GetTag()==_tag)? interactedWidget : nullptr;}
211 
212 
216  static GuiWidget* GetInteracted(CustomObject* _customObject){ return (interactedWidget && interactedWidget->GetCustomObject()==_customObject)? interactedWidget : nullptr;}
217 
218 
219  //-----------------------------------------------------------------
220 
221 
225  static GuiWidget* GetInteracted_Pressed(){ return (interactedWidget && interactedWidget->IsPressed())? interactedWidget : nullptr; }
226 
227 
231  static GuiWidget* GetInteracted_Pressed(const std::string &_name){ return (interactedWidget && interactedWidget->IsPressed() && interactedWidget->GetName()==_name)? interactedWidget : nullptr; }
232 
233 
237  static GuiWidget* GetInteracted_Pressed(int _tag){ return (interactedWidget && interactedWidget->IsPressed() && interactedWidget->GetTag()==_tag)? interactedWidget : nullptr; }
238 
239 
243  static GuiWidget* GetInteracted_Pressed(CustomObject* _customObject){ return (interactedWidget && interactedWidget->IsPressed() && interactedWidget->GetCustomObject()==_customObject)? interactedWidget : nullptr; }
244 
245 
246  //-----------------------------------------------------------------
247 
248 
252  static GuiWidget* GetInteracted_ValueChanged(){ return (interactedWidget && interactedWidget->IsValueChanged())? interactedWidget : nullptr; }
253 
254 
258  static GuiWidget* GetInteracted_ValueChanged(const std::string &_name){ return (interactedWidget && interactedWidget->IsValueChanged() && interactedWidget->GetName()==_name)? interactedWidget : nullptr; }
259 
260 
264  static GuiWidget* GetInteracted_ValueChanged(int _tag){ return (interactedWidget && interactedWidget->IsValueChanged() && interactedWidget->GetTag()==_tag)? interactedWidget : nullptr; }
265 
266 
270  static GuiWidget* GetInteracted_ValueChanged(CustomObject* _customObject){ return (interactedWidget && interactedWidget->IsValueChanged() && interactedWidget->GetCustomObject()==_customObject)? interactedWidget : nullptr; }
271 
272 
273  //-----------------------------------------------------------------
274 
275 
279  static GuiWidget* GetInteracted_CursorOver(){ return (interactedWidget && interactedWidget->IsCursorOver())? interactedWidget : nullptr; }
280 
281 
285  static GuiWidget* GetInteracted_CursorOver(const std::string &_name){ return (interactedWidget && interactedWidget->IsCursorOver() && interactedWidget->GetName()==_name)? interactedWidget : nullptr; }
286 
287 
291  static GuiWidget* GetInteracted_CursorOver(int _tag){ return (interactedWidget && interactedWidget->IsCursorOver() && interactedWidget->GetTag()==_tag)? interactedWidget : nullptr; }
292 
293 
297  static GuiWidget* GetInteracted_CursorOver(CustomObject* _customObject){ return (interactedWidget && interactedWidget->IsCursorOver() && interactedWidget->GetCustomObject()==_customObject)? interactedWidget : nullptr; }
298 
299 
300  //-----------------------------------------------------------------
301 
302 
306  static GuiWidget* GetInteracted_cursorDown(){ return (interactedWidget && interactedWidget->IsCursorDown())? interactedWidget : nullptr; }
307 
308 
312  static GuiWidget* GetInteracted_CursorDown(const std::string &_name){ return (interactedWidget && interactedWidget->IsCursorDown() && interactedWidget->GetName()==_name)? interactedWidget : nullptr; }
313 
314 
318  static GuiWidget* GetInteracted_CursorDown(int _tag){ return (interactedWidget && interactedWidget->IsCursorDown() && interactedWidget->GetTag()==_tag)? interactedWidget : nullptr; }
319 
320 
324  static GuiWidget* GetInteracted_CursorDown(CustomObject* _customObject){ return (interactedWidget && interactedWidget->IsCursorDown() && interactedWidget->GetCustomObject()==_customObject)? interactedWidget : nullptr; }
325 
326 
327 
328  //-----------------------------------------------------------------
329 
330  virtual void Update() = 0;
331  virtual void SetToInitialState(){}
332 
333  static void _SetInteractedWidget(GuiWidget *_widget);
334  static void ResetInteractedPerUpdate(){ interactedWidget = nullptr; }
335 
336 
337 protected:
338 
339  GuiWidgetKind kind = GuiWidgetKind::NOT_DEFINED;
340  std::string name;
341  int tag = 0;
342  std::string designKind;
343  CustomObject* obj = nullptr; // owned
344  GuiWidgetCallback *callbackObj = nullptr; // owned
345 
346  // state flags
347  bool disabled = false;
348  bool visible = true;
349 
350  // interaction flags
351  bool pressed = false;
352  bool cursorOver = false;
353  bool cursorDown = false;
354  bool valueChanged = false;
355 
356  Sprite *highlightMarkerSprite = nullptr; // LINK
357 
358 
359 private:
360  static GuiWidget *interactedWidget; // LINK
361 
362 };
363 
364 
365 //================================================================================================
366 
367 
372 {
373 
374 public:
375 
376  Vec2f GetCursorScreenPosition(){ return cursorScreenPosition; }
377  Vec2f GetCursorInMapPosition(){ return cursorPosition; }
378  bool IsPressed(){ return cursorPressed; }
379  bool IsCursorDown(){ return cursorDown; }
380 
381 
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; }
386 
387 
388 private:
389  Vec2f cursorScreenPosition;
390  Vec2f cursorPosition;
391  bool cursorPressed = false;
392  bool cursorDown = false;
393 
394 };
395 
396 
399 
400 
401 
406 {
407 
408 public:
409 
410 
411  void Update();
412 
413  GuiWidget* GetHighlightedWidget(){ return highlightedWidget; }
414  bool GetHighlighedPressed(){ return highlightedPressed; }
415  bool GetHighlighedDown(){ return highlightedDown; }
416  int GetHighlightedChangeValue(){ return highlightedChangeValue; }
417 
418 
422  void SetDisabled(bool _disabled){ disabled = _disabled; }
423 
424 
428  bool IsDisabled(){ return disabled; }
429 
430 
434  void SetWidgets(std::vector<GuiWidget*>_widgets, GuiWidget* _highlightedWidget=nullptr);
435 
436 
438  std::vector<GuiWidget*>& GetWidgets(){ return widgets; }
439 
440 
442  void SetNavigateForwardKeys(const std::vector<KeyCode> &_keys){ navigateForwardKeys = _keys; }
443 
444 
446  void SetNavigateBackwardKeys(const std::vector<KeyCode> &_keys){ navigateBackwardKeys = _keys; }
447 
448 
450  void SetPressKeys(const std::vector<KeyCode> &_keys){ pressKeys = _keys; }
451 
452 
456  void SetIncrementValueKeys(const std::vector<KeyCode> &_keys){ incrementValueKeys = _keys; }
457 
458 
462  void SetDecrementValueKeys(const std::vector<KeyCode> &_keys){ decrementValueKeys = _keys; }
463 
464 
466  void SetNavigateForwardJoystickPOV_X(Joystick::POV_X _pov){ joyNavigateForwardPOV_X = _pov; }
467 
468 
470  void SetNavigateForwardJoystickPOV_Y(Joystick::POV_Y _pov){ joyNavigateForwardPOV_Y = _pov; }
471 
472 
474  void SetNavigateBackwardJoystickPOV_X(Joystick::POV_X _pov){ joyNavigateBackwardPOV_X = _pov; }
475 
476 
478  void SetNavigateBackwardJoystickPOV_Y(Joystick::POV_Y _pov){ joyNavigateBackwardPOV_Y = _pov; }
479 
480 
482  void SetJoystickPressButtons(const std::vector<int> &_joyPressButtons){ joyPressButtons = _joyPressButtons; }
483 
484 
488  void SetIncrementValueJoystickPOV_X(Joystick::POV_X _pov){ joyIncrementValue_POV_X = _pov; }
489 
490 
494  void SetIncrementValueJoystickPOV_Y(Joystick::POV_Y _pov){ joyIncrementValue_POV_Y = _pov; }
495 
496 
500  void SetDecrementValueJoystickPOV_X(Joystick::POV_X _pov){ joyDecrementValue_POV_X = _pov; }
501 
502 
506  void SetDecrementValueJoystickPOV_Y(Joystick::POV_Y _pov){ joyDecrementValue_POV_Y = _pov; }
507 
508 
509 
510  void _ClearHighlightedWidget();
511  void _ProposeWidgetIndex(GuiWidget * _widget);
512 
513 
514 private:
515  bool disabled = false;
516  GuiWidget *highlightedWidget = nullptr; // LINK
517  bool highlightedPressed = false;
518  bool highlightedDown = false;
519  int highlightedChangeValue = 0;
520 
521  std::vector<GuiWidget*>widgets; // LINKs
522  int indexHighlighted = -1;
523 
524  // keyboard navigation keys
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;
530 
531  // joystick navigation keys
532  Joystick::POV_X joyNavigateForwardPOV_X = Joystick::POV_X::NONE;
533  Joystick::POV_X joyNavigateBackwardPOV_X = Joystick::POV_X::NONE;
534  Joystick::POV_Y joyNavigateForwardPOV_Y = Joystick::POV_Y::NONE;
535  Joystick::POV_Y joyNavigateBackwardPOV_Y = Joystick::POV_Y::NONE;
536  Joystick::POV_X joyIncrementValue_POV_X = Joystick::POV_X::NONE;
537  Joystick::POV_X joyDecrementValue_POV_X = Joystick::POV_X::NONE;
538  Joystick::POV_Y joyIncrementValue_POV_Y = Joystick::POV_Y::NONE;
539  Joystick::POV_Y joyDecrementValue_POV_Y = Joystick::POV_Y::NONE;
540 
541  std::vector<int>joyPressButtons;
542 
543 
544 
545  void _SetHighlightedPressed(bool _pressed);
546  void _SetHighlightedDown(bool _down);
547  void _SetHighlightedNavigate(int _highlightedNavigate);
548  void _SetHighlightedChangeValue(int _highlightedChangeValue);
549 
550 };
551 
552 
554 extern GuiKeyboardAndJoystickInput guiKeyboardAndJoystickInput;
555 
556 
558 
559 }
560 
561 
562 
563 #endif
jugimap::GuiWidget::GetKind
GuiWidgetKind GetKind()
Returns the kind of this widget.
Definition: jmGuiCommon.h:154
jugimap::GuiKeyboardAndJoystickInput::SetNavigateForwardKeys
void SetNavigateForwardKeys(const std::vector< KeyCode > &_keys)
Set the keyborad keys used for forward navigation between widgets.
Definition: jmGuiCommon.h:442
jugimap::GuiWidget::SetName
void SetName(const std::string &_name)
Set the name of this widget.
Definition: jmGuiCommon.h:132
jugimap::GuiWidget::IsPressed
bool IsPressed()
Returns true if the cursor is pressed while over this widget; otherwise returns false.
Definition: jmGuiCommon.h:95
jugimap::GuiWidget::SetVisible
virtual void SetVisible(bool _visible)
Set the visibility of this widget.
Definition: jmGuiCommon.cpp:47
jugimap::CustomObject
The CustomObject class is the base class for custom objects.
Definition: jmCommon.h:555
jugimap::GuiWidgetCallback::OnPressed
virtual void OnPressed(GuiWidget *)
A function call when the cursor is pressed. /// This callback is available for GuiButton.
Definition: jmGuiCommon.h:34
jugimap::GuiWidget::GetCustomObject
CustomObject * GetCustomObject()
Returns the custom object of this widget or nullptr if none.
Definition: jmGuiCommon.h:171
jugimap::GuiWidget
The GuiWidget class is the base widget class.
Definition: jmGuiCommon.h:65
jugimap::GuiWidget::GetName
std::string GetName()
Returns the name of this widget.
Definition: jmGuiCommon.h:138
jugimap::Joystick::POV_X
POV_X
POV X values.
Definition: jmInput.h:370
jugimap::GuiWidget::IsCursorDown
bool IsCursorDown()
Returns true if the cursor is hold down over this widget; otherwise returns false.
Definition: jmGuiCommon.h:83
jugimap::GuiKeyboardAndJoystickInput::SetIncrementValueJoystickPOV_X
void SetIncrementValueJoystickPOV_X(Joystick::POV_X _pov)
Set the joystick POV X button for incrementing the value of the highlighted widget.
Definition: jmGuiCommon.h:488
jugimap::Joystick::POV_Y
POV_Y
POV Y values.
Definition: jmInput.h:378
jugimap::GuiKeyboardAndJoystickInput::SetIncrementValueJoystickPOV_Y
void SetIncrementValueJoystickPOV_Y(Joystick::POV_Y _pov)
Set the joystick POV Y button for incrementing the value of the highlighted widget.
Definition: jmGuiCommon.h:494
jugimap::GuiWidget::GetInteracted_Pressed
static GuiWidget * GetInteracted_Pressed(const std::string &_name)
Returns the interacted widget with the given *_name* which is pressed.
Definition: jmGuiCommon.h:231
jugimap::GuiWidget::GetInteracted_CursorDown
static GuiWidget * GetInteracted_CursorDown(CustomObject *_customObject)
Returns the interacted widget with assigned *_customObject* which has the cursor hold down.
Definition: jmGuiCommon.h:324
jugimap::GuiWidget::GetTag
int GetTag()
Returns the tag of this widget.
Definition: jmGuiCommon.h:150
jugimap::GuiWidget::AssignCustomObject
void AssignCustomObject(CustomObject *_customObject)
Assign the given *_customObject* to this widget.
Definition: jmGuiCommon.cpp:60
jugimap::GuiWidget::GetInteracted_Pressed
static GuiWidget * GetInteracted_Pressed(CustomObject *_customObject)
Returns the interacted widget with assigned *_customObject* which is pressed.
Definition: jmGuiCommon.h:243
jugimap::GuiWidget::AssignCallback
void AssignCallback(GuiWidgetCallback *_callback)
Assign the given *_callback* to this widget.
Definition: jmGuiCommon.cpp:70
jugimap::GuiKeyboardAndJoystickInput::SetWidgets
void SetWidgets(std::vector< GuiWidget * >_widgets, GuiWidget *_highlightedWidget=nullptr)
Set widgets which can be interacted with keyboard or joystick.
Definition: jmGuiCommon.cpp:207
jugimap::GuiWidget::IsDisabled
bool IsDisabled()
Returns true if this widget is disabled; otherwise returns false.
Definition: jmGuiCommon.h:113
jugimap::GuiWidget::GetInteracted_CursorOver
static GuiWidget * GetInteracted_CursorOver(int _tag)
Returns the interacted widget with the given *_tag* which has the cursor over.
Definition: jmGuiCommon.h:291
jugimap::GuiKeyboardAndJoystickInput::SetPressKeys
void SetPressKeys(const std::vector< KeyCode > &_keys)
Set the keyborad keys used for pressing the highlighted widget.
Definition: jmGuiCommon.h:450
jugimap::GuiKeyboardAndJoystickInput::GetWidgets
std::vector< GuiWidget * > & GetWidgets()
Returns a reference to the vector of widgets.
Definition: jmGuiCommon.h:438
jugimap::GuiKeyboardAndJoystickInput::IsDisabled
bool IsDisabled()
Returns true if keyboard and joystick input is disabled; otherwise return false.
Definition: jmGuiCommon.h:428
jugimap::GuiKeyboardAndJoystickInput::SetNavigateForwardJoystickPOV_Y
void SetNavigateForwardJoystickPOV_Y(Joystick::POV_Y _pov)
Set the joystick POV Y button used for forward navigation between widgets.
Definition: jmGuiCommon.h:470
jugimap::GuiWidget::GetInteracted
static GuiWidget * GetInteracted(int _tag)
Returns the interacted widget with the given *_tag*.
Definition: jmGuiCommon.h:210
jugimap::GuiWidget::GetCallback
GuiWidgetCallback * GetCallback()
Returns the callback of this widget or nullptr if none.
Definition: jmGuiCommon.h:184
jugimap::GuiWidget::GetInteracted_CursorOver
static GuiWidget * GetInteracted_CursorOver(CustomObject *_customObject)
Returns the interacted widget with assigned *_customObject* which has the cursor over.
Definition: jmGuiCommon.h:297
jugimap::GuiWidget::GetInteracted
static GuiWidget * GetInteracted(CustomObject *_customObject)
Returns the interacted widget which has assigned the given *_customObject*.
Definition: jmGuiCommon.h:216
jugimap::GuiWidget::GetInteracted_ValueChanged
static GuiWidget * GetInteracted_ValueChanged(CustomObject *_customObject)
Returns the interacted widget with assigned *_customObject* which has changed value.
Definition: jmGuiCommon.h:270
jugimap::GuiKeyboardAndJoystickInput::SetDecrementValueKeys
void SetDecrementValueKeys(const std::vector< KeyCode > &_keys)
Set the keyborad keys used for incrementing the value of the highlighted widget.
Definition: jmGuiCommon.h:462
jugimap::GuiWidget::GetInteracted
static GuiWidget * GetInteracted()
Returns the interacted widget.
Definition: jmGuiCommon.h:198
jugimap::GuiWidget::GetInteracted_CursorOver
static GuiWidget * GetInteracted_CursorOver(const std::string &_name)
Returns the interacted widget with the given *_name* which has the cursor over.
Definition: jmGuiCommon.h:285
jugimap::GuiKeyboardAndJoystickInput::SetNavigateBackwardJoystickPOV_Y
void SetNavigateBackwardJoystickPOV_Y(Joystick::POV_Y _pov)
Set the joystick POV Y button used for backward navigation between widgets.
Definition: jmGuiCommon.h:478
jugimap::GuiWidget::GetInteracted_Pressed
static GuiWidget * GetInteracted_Pressed(int _tag)
Returns the interacted widget with the given *_tag* which is pressed.
Definition: jmGuiCommon.h:237
jugimap::GuiWidgetCallback::OnValueChanged
virtual void OnValueChanged(GuiWidget *)
A function call when the value of a widget is changed.
Definition: jmGuiCommon.h:52
jugimap::GuiKeyboardAndJoystickInput::SetDisabled
void SetDisabled(bool _disabled)
Set the disabled state.
Definition: jmGuiCommon.h:422
jugimap::GuiWidgetCallback
The GuiWidgetCallback class is the base callback class for widgets.
Definition: jmGuiCommon.h:25
jugimap::GuiWidgetCallback::OnCursorDown
virtual void OnCursorDown(GuiWidget *)
A function call when the cursor is hold down.
Definition: jmGuiCommon.h:46
jugimap::GuiWidget::SetDisabled
virtual void SetDisabled(bool _disabled)
Set the disabled state of this widget.
Definition: jmGuiCommon.cpp:34
jugimap::guiKeyboardAndJoystickInput
GuiKeyboardAndJoystickInput guiKeyboardAndJoystickInput
Global GuiKeyboardAndJoystickInput object used by widgets.
Definition: jmGuiCommon.cpp:20
jugimap::guiCursorDeviceInput
GuiCursorDeviceInput guiCursorDeviceInput
Global GuiCursorDeviceInput object used by widgets.
Definition: jmGuiCommon.cpp:15
jugimap::GuiWidget::IsValueChanged
bool IsValueChanged()
Returns true if this widget's value is changed; otherwise returns false.
Definition: jmGuiCommon.h:101
jugimap::GuiKeyboardAndJoystickInput::SetJoystickPressButtons
void SetJoystickPressButtons(const std::vector< int > &_joyPressButtons)
Set the joystick buttons used for pressing the highlighted widget.
Definition: jmGuiCommon.h:482
jugimap::GuiKeyboardAndJoystickInput::SetDecrementValueJoystickPOV_X
void SetDecrementValueJoystickPOV_X(Joystick::POV_X _pov)
Set the joystick POV X button for decrementing the value of the highlighted widget.
Definition: jmGuiCommon.h:500
jugimap::GuiWidget::GetDesignKind
std::string GetDesignKind()
Returns the design kind of this widget.
Definition: jmGuiCommon.h:158
jugimap::GuiWidgetCallback::OnCursorOver
virtual void OnCursorOver(GuiWidget *)
A function call when the cursor is over the widget. /// This callback is available for GuiButton.
Definition: jmGuiCommon.h:40
jugimap::GuiWidget::IsCursorOver
bool IsCursorOver()
Returns true if the cursor is over this widget; otherwise returns false.
Definition: jmGuiCommon.h:89
jugimap::GuiCursorDeviceInput
The GuiCursorDeviceInput class provides the mouse and touch input information for widget interactions...
Definition: jmGuiCommon.h:371
jugimap::GuiWidget::GetInteracted
static GuiWidget * GetInteracted(const std::string &_name)
Returns the interacted widget with the given *_name*.
Definition: jmGuiCommon.h:204
jugimap::GuiWidget::GetInteracted_CursorOver
static GuiWidget * GetInteracted_CursorOver()
Returns the interacted widget which has the cursor over.
Definition: jmGuiCommon.h:279
jugimap::GuiKeyboardAndJoystickInput::SetNavigateBackwardKeys
void SetNavigateBackwardKeys(const std::vector< KeyCode > &_keys)
Set the keyborad keys used for backward navigation between widgets.
Definition: jmGuiCommon.h:446
jugimap::GuiWidget::GetInteracted_ValueChanged
static GuiWidget * GetInteracted_ValueChanged(const std::string &_name)
Returns the interacted widget with the given *_name* which has changed value.
Definition: jmGuiCommon.h:258
jugimap::GuiKeyboardAndJoystickInput::SetIncrementValueKeys
void SetIncrementValueKeys(const std::vector< KeyCode > &_keys)
Set the keyborad keys used for incrementing the value of the highlighted widget.
Definition: jmGuiCommon.h:456
jugimap::GuiKeyboardAndJoystickInput::SetNavigateBackwardJoystickPOV_X
void SetNavigateBackwardJoystickPOV_X(Joystick::POV_X _pov)
Set the joystick POV X button used for backward navigation between widgets.
Definition: jmGuiCommon.h:474
jugimap::Vec2< float >
jugimap::GuiWidgetCallback::OnValueChangedViaButton
virtual void OnValueChangedViaButton(GuiWidget *)
A function call when a slider's value is changed via increment or decrement button.
Definition: jmGuiCommon.h:58
jugimap::GuiWidgetKind
GuiWidgetKind
The kinds of widget. Used as identifier for GuiWidget objects.
Definition: jmGlobal.h:216
jugimap::GuiWidget::GetInteracted_ValueChanged
static GuiWidget * GetInteracted_ValueChanged(int _tag)
Returns the interacted widget with the given *_tag* which has changed value.
Definition: jmGuiCommon.h:264
jugimap::GuiWidget::IsVisible
bool IsVisible()
Returns true if this widget is visible; otherwise returns false.
Definition: jmGuiCommon.h:126
jugimap::GuiWidget::SetTag
void SetTag(int _tag)
Set the tag of this widget.
Definition: jmGuiCommon.h:144
jugimap::GuiWidget::GetInteracted_CursorDown
static GuiWidget * GetInteracted_CursorDown(int _tag)
Returns the interacted widget with the given *_tag* which has the cursor hold down.
Definition: jmGuiCommon.h:318
jugimap::GuiKeyboardAndJoystickInput
The GuiKeyboardAndJoystickInput class provides the keyboard and joystick input information for widget...
Definition: jmGuiCommon.h:405
jugimap::GuiWidget::GetInteracted_Pressed
static GuiWidget * GetInteracted_Pressed()
Returns the interacted widget which is pressed.
Definition: jmGuiCommon.h:225
jugimap::GuiKeyboardAndJoystickInput::SetDecrementValueJoystickPOV_Y
void SetDecrementValueJoystickPOV_Y(Joystick::POV_Y _pov)
Set the joystick POV Y button for decrementing the value of the highlighted widget.
Definition: jmGuiCommon.h:506
jugimap::GuiWidget::GetInteracted_ValueChanged
static GuiWidget * GetInteracted_ValueChanged()
Returns the interacted widget which has changed value.
Definition: jmGuiCommon.h:252
jugimap::GuiKeyboardAndJoystickInput::SetNavigateForwardJoystickPOV_X
void SetNavigateForwardJoystickPOV_X(Joystick::POV_X _pov)
Set the joystick POV X button used for forward navigation between widgets.
Definition: jmGuiCommon.h:466
jugimap::GuiWidget::GetInteracted_CursorDown
static GuiWidget * GetInteracted_CursorDown(const std::string &_name)
Returns the interacted widget with the given *_name* which has the cursor hold down.
Definition: jmGuiCommon.h:312
jugimap::GuiWidget::GetInteracted_cursorDown
static GuiWidget * GetInteracted_cursorDown()
Returns the interacted widget which has the cursor hold down.
Definition: jmGuiCommon.h:306