TGUI  0.8.9
Signal.hpp
1 //
3 // TGUI - Texus' Graphical User Interface
4 // Copyright (C) 2012-2020 Bruno Van de Velde (vdv_b@tgui.eu)
5 //
6 // This software is provided 'as-is', without any express or implied warranty.
7 // In no event will the authors be held liable for any damages arising from the use of this software.
8 //
9 // Permission is granted to anyone to use this software for any purpose,
10 // including commercial applications, and to alter it and redistribute it freely,
11 // subject to the following restrictions:
12 //
13 // 1. The origin of this software must not be misrepresented;
14 // you must not claim that you wrote the original software.
15 // If you use this software in a product, an acknowledgment
16 // in the product documentation would be appreciated but is not required.
17 //
18 // 2. Altered source versions must be plainly marked as such,
19 // and must not be misrepresented as being the original software.
20 //
21 // 3. This notice may not be removed or altered from any source distribution.
22 //
24 
25 
26 #ifndef TGUI_SIGNAL_HPP
27 #define TGUI_SIGNAL_HPP
28 
30 
31 #include <TGUI/Global.hpp>
32 #include <TGUI/Vector2f.hpp>
33 #include <TGUI/Animation.hpp>
34 #include <TGUI/Color.hpp>
35 #include <SFML/System/String.hpp>
36 #include <type_traits>
37 #include <functional>
38 #include <typeindex>
39 #include <memory>
40 #include <vector>
41 #include <deque>
42 #include <map>
43 
44 #undef MessageBox // windows.h defines MessageBox when NOMB isn't defined before including windows.h
45 
47 
48 namespace tgui
49 {
50  class Widget;
51  class ChildWindow;
52  class SignalWidgetBase;
53 
54  namespace internal_signal
55  {
56  extern TGUI_API std::deque<const void*> parameters;
57  }
58 
60  namespace Signals
61  {
62  struct Widget
63  {
64  static constexpr const char* const PositionChanged = "PositionChanged";
65  static constexpr const char* const SizeChanged = "SizeChanged";
66  static constexpr const char* const Focused = "Focused";
67  static constexpr const char* const Unfocused = "Unfocused";
68  static constexpr const char* const MouseEntered = "MouseEntered";
69  static constexpr const char* const MouseLeft = "MouseLeft";
70  static constexpr const char* const AnimationFinished = "AnimationFinished";
71  };
72 
73  struct ClickableWidget : public Widget
74  {
75  static constexpr const char* const MousePressed = "MousePressed";
76  static constexpr const char* const MouseReleased = "MouseReleased";
77  static constexpr const char* const Clicked = "Clicked";
78  static constexpr const char* const RightMousePressed = "RightMousePressed";
79  static constexpr const char* const RightMouseReleased = "RightMouseReleased";
80  static constexpr const char* const RightClicked = "RightClicked";
81  };
82 
83  struct Button : public ClickableWidget
84  {
85  static constexpr const char* const Pressed = "Pressed";
86  };
87 
88  struct ChildWindow : public Widget
89  {
90  static constexpr const char* const MousePressed = "MousePressed";
91  static constexpr const char* const Closed = "Closed";
92  static constexpr const char* const Minimized = "Minimized";
93  static constexpr const char* const Maximized = "Maximized";
94  static constexpr const char* const EscapeKeyPressed = "EscapeKeyPressed";
95  };
96 
97  struct ColorPicker : public ChildWindow
98  {
99  static constexpr const char* const ColorChange = "ColorChanged";
100  static constexpr const char* const OkPressed = "OkPressed";
101  };
102 
103  struct ComboBox : public Widget
104  {
105  static constexpr const char* const ItemSelected = "ItemSelected";
106  };
107 
108  struct EditBox : public ClickableWidget
109  {
110  static constexpr const char* const TextChanged = "TextChanged";
111  static constexpr const char* const ReturnKeyPressed = "ReturnKeyPressed";
112  };
113 
114  struct Knob : public Widget
115  {
116  static constexpr const char* const ValueChanged = "ValueChanged";
117  };
118 
119  struct Label : public ClickableWidget
120  {
121  static constexpr const char* const DoubleClicked = "DoubleClicked";
122  };
123 
124  struct ListBox : public Widget
125  {
126  static constexpr const char* const ItemSelected = "ItemSelected";
127  static constexpr const char* const MousePressed = "MousePressed";
128  static constexpr const char* const MouseReleased = "MouseReleased";
129  static constexpr const char* const DoubleClicked = "DoubleClicked";
130  };
131 
132  struct ListView : public Widget
133  {
134  static constexpr const char* const ItemSelected = "ItemSelected";
135  static constexpr const char* const DoubleClicked = "DoubleClicked";
136  static constexpr const char* const RightClicked = "RightClicked";
137  static constexpr const char* const HeaderClicked = "HeaderClicked";
138  };
139 
140  struct MenuBar : public Widget
141  {
146  static constexpr const char* const MenuItemClicked = "MenuItemClicked";
147  };
148 
149  struct MessageBox : public ChildWindow
150  {
151  static constexpr const char* const ButtonPressed = "ButtonPressed";
152  };
153 
154  struct Panel : public Widget
155  {
156  static constexpr const char* const MousePressed = "MousePressed";
157  static constexpr const char* const MouseReleased = "MouseReleased";
158  static constexpr const char* const Clicked = "Clicked";
159  static constexpr const char* const RightMousePressed = "RightMousePressed";
160  static constexpr const char* const RightMouseReleased = "RightMouseReleased";
161  static constexpr const char* const RightClicked = "RightClicked";
162  };
163 
164  struct Picture : public ClickableWidget
165  {
166  static constexpr const char* const DoubleClicked = "DoubleClicked";
167  };
168 
169  struct ProgressBar : public ClickableWidget
170  {
171  static constexpr const char* const ValueChanged = "ValueChanged";
172  static constexpr const char* const Full = "Full";
173  };
174 
175  struct RadioButton : public ClickableWidget
176  {
177  static constexpr const char* const Checked = "Checked";
178  static constexpr const char* const Unchecked = "Unchecked";
179  static constexpr const char* const Changed = "Changed";
180  };
181 
182  struct RangeSlider : public Widget
183  {
184  static constexpr const char* const RangeChanged = "RangeChanged";
185  };
186 
187  struct Scrollbar : public Widget
188  {
189  static constexpr const char* const ValueChanged = "ValueChanged";
190  };
191 
192  struct Slider : public Widget
193  {
194  static constexpr const char* const ValueChanged = "ValueChanged";
195  };
196 
197  struct SpinButton : public ClickableWidget
198  {
199  static constexpr const char* const ValueChanged = "ValueChanged";
200  };
201 
202  struct Tabs : public Widget
203  {
204  static constexpr const char* const TabSelected = "TabSelected";
205  };
206 
207  struct TextBox : public Widget
208  {
209  static constexpr const char* const TextChanged = "TextChanged";
210  static constexpr const char* const SelectionChanged = "SelectionChanged";
211  };
212 
213  struct TreeView : public Widget
214  {
215  static constexpr const char* const ItemSelected = "ItemSelected";
216  static constexpr const char* const DoubleClicked = "DoubleClicked";
217  static constexpr const char* const Expanded = "Expanded";
218  static constexpr const char* const Collapsed = "Collapsed";
219  static constexpr const char* const RightClicked = "RightClicked";
220  };
221 
222  using BitmapButton = Button;
223  using CheckBox = RadioButton;
224  using ScrollablePanel = Panel;
225  }
226 
230  class TGUI_API Signal
231  {
232  public:
233 
234  using Delegate = std::function<void()>;
235  using DelegateEx = std::function<void(std::shared_ptr<Widget>, const std::string&)>;
236 
237 
238  virtual ~Signal() = default;
239 
240 
247  Signal(std::string&& name, std::size_t extraParameters = 0) :
248  m_name{std::move(name)}
249  {
250  if (1 + extraParameters > internal_signal::parameters.size())
251  internal_signal::parameters.resize(1 + extraParameters);
252  }
253 
254 
258  Signal(const Signal& other);
259 
260 
264  Signal(Signal&& other) noexcept = default;
265 
266 
270  Signal& operator=(const Signal& other);
271 
272 
276  Signal& operator=(Signal&& other) noexcept = default;
277 
278 
286  unsigned int connect(const Delegate& handler);
287 
288 
296  unsigned int connect(const DelegateEx& handler);
297 
298 
306  bool disconnect(unsigned int id);
307 
308 
313 
314 
322  bool emit(const Widget* widget)
323  {
324  if (m_handlers.empty() || !m_enabled)
325  return false;
326 
327  internal_signal::parameters[0] = static_cast<const void*>(&widget);
328 
329  // Copy the handlers before calling them in case the widget (and this signal) gets destroyed during the handler
330  auto handlers = m_handlers;
331  for (auto& handler : handlers)
332  handler.second();
333 
334  return true;
335  }
336 
337 
343  std::string getName() const
344  {
345  return m_name;
346  }
347 
348 
357  void setEnabled(bool enabled)
358  {
359  m_enabled = enabled;
360  }
361 
362 
371  bool isEnabled() const
372  {
373  return m_enabled;
374  }
375 
376 
382  virtual unsigned int validateTypes(std::initializer_list<std::type_index> unboundParameters) const;
383 
384 
386  protected:
387 
392  static std::shared_ptr<Widget> getWidget();
393 
394 
396  protected:
397 
398  bool m_enabled = true;
399  std::string m_name;
400  std::map<unsigned int, std::function<void()>> m_handlers;
401  };
402 
403  #define TGUI_SIGNAL_VALUE_DECLARATION(TypeName, Type) \
404  /**************************************************************************************************************************** \
405  * @brief Signal to which the user can subscribe to get callbacks from
406  ****************************************************************************************************************************/ \
407  class TGUI_API Signal##TypeName : public Signal \
408  { \
409  public: \
410  using Delegate##TypeName = std::function<void(Type)>; \
411  using Delegate##TypeName##Ex = std::function<void(std::shared_ptr<Widget>, const std::string&, Type)>; \
412  using Signal::connect; \
413  \
414  /************************************************************************************************************************ \
415  * @brief Constructor
416  ************************************************************************************************************************/ \
417  Signal##TypeName(std::string&& name) : \
418  Signal{std::move(name), 1} \
419  { \
420  } \
421  \
422  /************************************************************************************************************************ \
423  * @brief Connects a signal handler that will be called when this signal is emitted
424  *
425  * @param handler Callback function that is given a Vector2f as argument
426  *
427  * @return Unique id of the connection
428  ************************************************************************************************************************/ \
429  unsigned int connect(const Delegate##TypeName& handler); \
430  \
431  /************************************************************************************************************************ \
432  * @brief Connects a signal handler that will be called when this signal is emitted
433  *
434  * @param handler Callback function that is given a pointer to the widget, the name of the signal and a Vector2f as arguments
435  *
436  * @return Unique id of the connection
437  ************************************************************************************************************************/ \
438  unsigned int connect(const Delegate##TypeName##Ex& handler); \
439  \
440  /************************************************************************************************************************ \
441  * @internal
442  * @brief Call all connected signal handlers
443  ************************************************************************************************************************/ \
444  bool emit(const Widget* widget, Type param) \
445  { \
446  if (m_handlers.empty()) \
447  return false; \
448  \
449  internal_signal::parameters[1] = static_cast<const void*>(&param); \
450  return Signal::emit(widget); \
451  } \
452  \
453  private: \
454  /************************************************************************************************************************ \
455  * @internal
456  * @brief Checks whether the unbound parameters match with this signal
457  * @return The index in the parameters list where the parameters will be stored
458  ************************************************************************************************************************/ \
459  unsigned int validateTypes(std::initializer_list<std::type_index> unboundParameters) const override; \
460  };
461 
462  TGUI_SIGNAL_VALUE_DECLARATION(Int, int)
463  TGUI_SIGNAL_VALUE_DECLARATION(UInt, unsigned int)
464  TGUI_SIGNAL_VALUE_DECLARATION(Bool, bool)
465  TGUI_SIGNAL_VALUE_DECLARATION(Float, float)
466  TGUI_SIGNAL_VALUE_DECLARATION(String, const sf::String&)
467  TGUI_SIGNAL_VALUE_DECLARATION(Vector2f, Vector2f)
468  TGUI_SIGNAL_VALUE_DECLARATION(Color, Color)
469 
470 
471 
474  class TGUI_API SignalRange : public Signal
475  {
476  public:
477 
478  using DelegateRange = std::function<void(float, float)>;
479  using DelegateRangeEx = std::function<void(std::shared_ptr<Widget>, const std::string&, float, float)>;
480  using Signal::connect;
481 
485  SignalRange(std::string&& name) :
486  Signal{std::move(name), 2}
487  {
488  }
489 
490 
498  unsigned int connect(const DelegateRange& handler);
499 
500 
508  unsigned int connect(const DelegateRangeEx& handler);
509 
510 
515  bool emit(const Widget* widget, float value1, float value2);
516 
517 
518  private:
519 
525  unsigned int validateTypes(std::initializer_list<std::type_index> unboundParameters) const override;
526 
527 
529  };
530 
531 
535  class TGUI_API SignalChildWindow : public Signal
536  {
537  public:
538 
539  using DelegateChildWindow = std::function<void(std::shared_ptr<ChildWindow>)>;
540  using DelegateChildWindowEx = std::function<void(std::shared_ptr<Widget>, const std::string&, std::shared_ptr<ChildWindow>)>;
541  using Signal::connect;
542 
543 
547  SignalChildWindow(std::string&& name) :
548  Signal{std::move(name), 1}
549  {
550  }
551 
552 
560  unsigned int connect(const DelegateChildWindow& handler);
561 
562 
570  unsigned int connect(const DelegateChildWindowEx& handler);
571 
572 
577  bool emit(ChildWindow* param);
578 
579 
580  private:
581 
587  unsigned int validateTypes(std::initializer_list<std::type_index> unboundParameters) const override;
588 
589 
591  };
592 
593 
597  class TGUI_API SignalItem : public Signal
598  {
599  public:
600 
601  using DelegateItem = std::function<void(const sf::String&)>;
602  using DelegateItemAndId = std::function<void(const sf::String&, const sf::String&)>;
603  using DelegateItemIndex = std::function<void(int)>;
604  using DelegateItemEx = std::function<void(std::shared_ptr<Widget>, const std::string&, const sf::String&)>;
605  using DelegateItemAndIdEx = std::function<void(std::shared_ptr<Widget>, const std::string&, const sf::String&, const sf::String&)>;
606  using DelegateItemIndexEx = std::function<void(std::shared_ptr<Widget>, const std::string&, int)>;
607  using Signal::connect;
608 
609 
613  SignalItem(std::string&& name) :
614  Signal{std::move(name), 3}
615  {
616  }
617 
618 
626  unsigned int connect(const DelegateItem& handler);
627 
628 
636  unsigned int connect(const DelegateItemEx& handler);
637 
638 
646  unsigned int connect(const DelegateItemAndId& handler);
647 
648 
656  unsigned int connect(const DelegateItemAndIdEx& handler);
657 
658 
666  unsigned int connect(const DelegateItemIndex& handler);
667 
668 
676  unsigned int connect(const DelegateItemIndexEx& handler);
677 
678 
683  bool emit(const Widget* widget, const sf::String& item, const sf::String& id, int index)
684  {
685  if (m_handlers.empty())
686  return false;
687 
688  internal_signal::parameters[1] = static_cast<const void*>(&item);
689  internal_signal::parameters[2] = static_cast<const void*>(&id);
690  internal_signal::parameters[3] = static_cast<const void*>(&index);
691  return Signal::emit(widget);
692  }
693 
694 
695  private:
696 
702  unsigned int validateTypes(std::initializer_list<std::type_index> unboundParameters) const override;
703 
704 
706  };
707 
708 
717  class TGUI_API SignalAnimation : public Signal
718  {
719  public:
720 
724  SignalAnimation(std::string&& name) :
725  Signal{std::move(name), 2}
726  {
727  }
728 
733  bool emit(const Widget* widget, ShowAnimationType type, bool visible)
734  {
735  if (m_handlers.empty())
736  return false;
737 
738  internal_signal::parameters[1] = static_cast<const void*>(&type);
739  internal_signal::parameters[2] = static_cast<const void*>(&visible);
740  return Signal::emit(widget);
741  }
742 
743 
744  private:
745 
751  unsigned int validateTypes(std::initializer_list<std::type_index> unboundParameters) const override;
752 
753 
755  };
756 
757 
761  class TGUI_API SignalItemHierarchy : public Signal
762  {
763  public:
764 
765  using DelegateMenuItem = std::function<void(const sf::String&)>;
766  using DelegateMenuItemFull = std::function<void(const std::vector<sf::String>&)>;
767  using DelegateMenuItemEx = std::function<void(std::shared_ptr<Widget>, const std::string&, const sf::String&)>;
768  using DelegateMenuItemFullEx = std::function<void(std::shared_ptr<Widget>, const std::string&, const std::vector<sf::String>&)>;
769  using Signal::connect;
770 
771 
775  SignalItemHierarchy(std::string&& name) :
776  Signal{std::move(name), 2}
777  {
778  }
779 
780 
788  unsigned int connect(const DelegateMenuItem& handler);
789 
790 
798  unsigned int connect(const DelegateMenuItemEx& handler);
799 
800 
808  unsigned int connect(const DelegateMenuItemFull& handler);
809 
810 
818  unsigned int connect(const DelegateMenuItemFullEx& handler);
819 
820 
825  bool emit(const Widget* widget, const sf::String& item, const std::vector<sf::String>& fullItem)
826  {
827  if (m_handlers.empty())
828  return false;
829 
830  internal_signal::parameters[1] = static_cast<const void*>(&item);
831  internal_signal::parameters[2] = static_cast<const void*>(&fullItem);
832  return Signal::emit(widget);
833  }
834 
835 
836  private:
837 
843  unsigned int validateTypes(std::initializer_list<std::type_index> unboundParameters) const override;
844 
845 
847  };
848 
849 #ifndef TGUI_REMOVE_DEPRECATED_CODE
851 #endif
852 
853 
857  class TGUI_API SignalWidgetBase
858  {
859  public:
860 
861  virtual ~SignalWidgetBase() = default;
862 
863 #if defined(__cpp_if_constexpr) && (__cpp_if_constexpr >= 201606L)
873  template <typename Func, typename... BoundArgs>
874  unsigned int connect(std::string signalName, Func&& handler, const BoundArgs&... args);
875 
876 #else
886  template <typename Func, typename... Args, typename std::enable_if<std::is_convertible<Func, std::function<void(const Args&...)>>::value>::type* = nullptr>
887  unsigned int connect(std::string signalName, Func&& handler, const Args&... args);
888 
889 
900  template <typename Func, typename... BoundArgs, typename std::enable_if<!std::is_convertible<Func, std::function<void(const BoundArgs&...)>>::value // Ambigious otherwise when passing bind expression
901  && std::is_convertible<Func, std::function<void(const BoundArgs&..., std::shared_ptr<Widget>, const std::string&)>>::value>::type* = nullptr>
902  unsigned int connect(std::string signalName, Func&& handler, BoundArgs&&... args);
903 
904 
914  template <typename Func, typename... BoundArgs, typename std::enable_if<!std::is_convertible<Func, std::function<void(const BoundArgs&...)>>::value
915  && !std::is_convertible<Func, std::function<void(const BoundArgs&..., std::shared_ptr<Widget>, const std::string&)>>::value>::type* = nullptr>
916  unsigned int connect(std::string signalName, Func&& handler, BoundArgs&&... args);
917 #endif
918 
928  template <typename Func, typename... BoundArgs>
929  unsigned int connect(std::initializer_list<std::string> signalNames, Func&& handler, BoundArgs&&... args);
930 
931 
939  bool disconnect(unsigned int id);
940 
941 
947  void disconnectAll(std::string signalName);
948 
949 
953  void disconnectAll();
954 
955 
959  virtual Signal& getSignal(std::string signalName) = 0;
960 
961 
963  private:
964 
965  std::map<unsigned int, std::string> m_connectedSignals;
966 
967 
969  };
970 
972 }
973 
975 
976 #endif // TGUI_SIGNAL_HPP
Child window widget.
Definition: ChildWindow.hpp:44
Wrapper for colors.
Definition: Color.hpp:49
Signal to which the user can subscribe to get callbacks from.
Definition: Signal.hpp:695
Signal to which the user can subscribe to get callbacks from.
Definition: Signal.hpp:513
Signal to which the user can subscribe to get callbacks from.
Definition: Signal.hpp:739
Signal to which the user can subscribe to get callbacks from.
Definition: Signal.hpp:575
Signal to which the user can subscribe to get callbacks from.
Definition: Signal.hpp:452
Base class for Widget which provides functionality to connect signals based on their name.
Definition: Signal.hpp:835
Signal to which the user can subscribe to get callbacks from.
Definition: Signal.hpp:231
bool emit(const Widget *widget)
Call all connected signal handlers.
Definition: Signal.hpp:322
Signal & operator=(const Signal &other)
Copy assignment operator which will not copy the signal handlers.
Signal & operator=(Signal &&other) noexcept=default
Default move assignment operator.
std::string getName() const
Returns the name given to the signal.
Definition: Signal.hpp:343
Signal(const Signal &other)
Copy constructor which will not copy the signal handlers.
bool isEnabled() const
Returns whether this signal calls the connected functions when triggered.
Definition: Signal.hpp:371
void disconnectAll()
Disconnect all signal handler from this signal.
void setEnabled(bool enabled)
Changes whether this signal calls the connected functions when triggered.
Definition: Signal.hpp:357
bool disconnect(unsigned int id)
Disconnect a signal handler from this signal.
unsigned int connect(const Delegate &handler)
Connects a signal handler that will be called when this signal is emitted.
Signal(std::string &&name, std::size_t extraParameters=0)
Constructor.
Definition: Signal.hpp:247
unsigned int connect(const DelegateEx &handler)
Connects a signal handler that will be called when this signal is emitted.
Signal(Signal &&other) noexcept=default
Default move constructor.
Wrapper class to store strings.
Definition: String.hpp:119
Definition: Vector2f.hpp:39
The parent class for every widget.
Definition: Widget.hpp:74
Namespace that contains all TGUI functions and classes.
Definition: AbsoluteOrRelativeValue.hpp:37
ShowAnimationType
Type of animation to show/hide widget.
Definition: Animation.hpp:44
Definition: Signal.hpp:84
static constexpr const char *const Pressed
The button was pressed. Optional parameter: text of the button.
Definition: Signal.hpp:85
Definition: Signal.hpp:89
static constexpr const char *const EscapeKeyPressed
The escape key was pressed while the child window was focused. Optional parameter: pointer to the win...
Definition: Signal.hpp:94
static constexpr const char *const Maximized
The window was maximized. Optional parameter: pointer to the window.
Definition: Signal.hpp:93
static constexpr const char *const Minimized
The window was minimized. Optional parameter: pointer to the window.
Definition: Signal.hpp:92
static constexpr const char *const MousePressed
The mouse went down on the widget.
Definition: Signal.hpp:90
static constexpr const char *const Closed
The window was closed. Optional parameter: pointer to the window.
Definition: Signal.hpp:91
Definition: Signal.hpp:74
static constexpr const char *const RightClicked
The widget was right clicked. Optional parameter: mouse position relative to widget.
Definition: Signal.hpp:80
static constexpr const char *const RightMousePressed
The right mouse button went down on the widget. Optional parameter: mouse position relative to widget...
Definition: Signal.hpp:78
static constexpr const char *const RightMouseReleased
The right mouse button was released on top of the widget. Optional parameter: mouse position relative...
Definition: Signal.hpp:79
static constexpr const char *const MousePressed
The mouse went down on the widget. Optional parameter: mouse position relative to widget.
Definition: Signal.hpp:75
static constexpr const char *const MouseReleased
The mouse was released on top of the widget. Optional parameter: mouse position relative to widget.
Definition: Signal.hpp:76
static constexpr const char *const Clicked
The widget was clicked. Optional parameter: mouse position relative to widget.
Definition: Signal.hpp:77
Definition: Signal.hpp:98
static constexpr const char *const OkPressed
The ok key was pressed. Optional parameter: color chosen.
Definition: Signal.hpp:100
static constexpr const char *const ColorChange
The color was changed. Optional parameter: color chosen.
Definition: Signal.hpp:99
Definition: Signal.hpp:104
static constexpr const char *const ItemSelected
An item was selected in the combo box. Optional parameter: selected item or its index.
Definition: Signal.hpp:105
Definition: Signal.hpp:109
static constexpr const char *const ReturnKeyPressed
The return key was pressed. Optional parameter: text in the edit box.
Definition: Signal.hpp:111
static constexpr const char *const TextChanged
The text was changed. Optional parameter: new text.
Definition: Signal.hpp:110
Definition: Signal.hpp:115
static constexpr const char *const ValueChanged
The value of the know changed. Optional parameter: new value.
Definition: Signal.hpp:116
Definition: Signal.hpp:120
static constexpr const char *const DoubleClicked
The label was double clicked. Optional parameter: text of the label.
Definition: Signal.hpp:121
Definition: Signal.hpp:125
static constexpr const char *const ItemSelected
An item was selected in the list box. Optional parameter: selected item or its index.
Definition: Signal.hpp:126
static constexpr const char *const MousePressed
The mouse went down on an item. Optional parameter: selected item or its index.
Definition: Signal.hpp:127
static constexpr const char *const MouseReleased
The mouse was released on one of the items. Optional parameter: selected item or its index.
Definition: Signal.hpp:128
static constexpr const char *const DoubleClicked
An item was double clicked. Optional parameter: selected item or its index.
Definition: Signal.hpp:129
Definition: Signal.hpp:133
static constexpr const char *const RightClicked
Right mouse clicked. Optional parameter: index of item below mouse (-1 when not on top of item)
Definition: Signal.hpp:136
static constexpr const char *const DoubleClicked
An item was double clicked. Optional parameter: selected item index.
Definition: Signal.hpp:135
static constexpr const char *const HeaderClicked
The header was clicked. Optional parameter: column index.
Definition: Signal.hpp:137
static constexpr const char *const ItemSelected
An item was selected in the list view. Optional parameter: selected item index (-1 when deselecting)
Definition: Signal.hpp:134
Definition: Signal.hpp:141
static constexpr const char *const MenuItemClicked
Definition: Signal.hpp:146
Definition: Signal.hpp:150
static constexpr const char *const ButtonPressed
One of the buttons was pressed. Optional parameter: text of the pressed button.
Definition: Signal.hpp:151
Definition: Signal.hpp:155
static constexpr const char *const MouseReleased
The mouse was released on top of the panel. Optional parameter: mouse position relative to panel.
Definition: Signal.hpp:157
static constexpr const char *const MousePressed
The mouse went down on the panel. Optional parameter: mouse position relative to panel.
Definition: Signal.hpp:156
static constexpr const char *const RightMousePressed
The right mouse button went down on the panel. Optional parameter: mouse position relative to panel.
Definition: Signal.hpp:159
static constexpr const char *const RightMouseReleased
The right mouse button was released on top of the panel. Optional parameter: mouse position relative ...
Definition: Signal.hpp:160
static constexpr const char *const Clicked
The panel was clicked. Optional parameter: mouse position relative to panel.
Definition: Signal.hpp:158
static constexpr const char *const RightClicked
The panel was right clicked. Optional parameter: mouse position relative to panel.
Definition: Signal.hpp:161
Definition: Signal.hpp:165
static constexpr const char *const DoubleClicked
The picture was double clicked. Optional parameter: mouse position relative to picture.
Definition: Signal.hpp:166
Definition: Signal.hpp:170
static constexpr const char *const Full
Value of the progress bar changed and he progress bar became full.
Definition: Signal.hpp:172
static constexpr const char *const ValueChanged
Value of the progress bar changed. Optional parameter: new value.
Definition: Signal.hpp:171
Definition: Signal.hpp:176
static constexpr const char *const Unchecked
Radio button was unchecked. Optional parameter: bool which is always false.
Definition: Signal.hpp:178
static constexpr const char *const Checked
Radio button was checked. Optional parameter: bool which is always true.
Definition: Signal.hpp:177
static constexpr const char *const Changed
Radio button was checked or unchecked. Optional parameter: bool indicating whether it is checked.
Definition: Signal.hpp:179
Definition: Signal.hpp:183
static constexpr const char *const RangeChanged
Value of the slider changed. Optional parameter: new value.
Definition: Signal.hpp:184
Definition: Signal.hpp:188
static constexpr const char *const ValueChanged
Value of the scrollbar changed. Optional parameter: new value.
Definition: Signal.hpp:189
Definition: Signal.hpp:193
static constexpr const char *const ValueChanged
Value of the slider changed. Optional parameter: new value.
Definition: Signal.hpp:194
Definition: Signal.hpp:198
static constexpr const char *const ValueChanged
Value of the spin button changed. Optional parameter: new value.
Definition: Signal.hpp:199
Definition: Signal.hpp:203
static constexpr const char *const TabSelected
A tab that was selected. Optional parameter: selected item.
Definition: Signal.hpp:204
Definition: Signal.hpp:208
static constexpr const char *const SelectionChanged
Selected text changed.
Definition: Signal.hpp:210
static constexpr const char *const TextChanged
The text was changed. Optional parameter: new text.
Definition: Signal.hpp:209
Definition: Signal.hpp:214
static constexpr const char *const RightClicked
A node was right clicked. Optional parameter: node below mouse.
Definition: Signal.hpp:219
static constexpr const char *const ItemSelected
An node was selected in the tree view. Optional parameter: selected node.
Definition: Signal.hpp:215
static constexpr const char *const DoubleClicked
A leaf node was double clicked. Optional parameter: selected node.
Definition: Signal.hpp:216
static constexpr const char *const Expanded
A branch node was expanded in the tree view. Optional parameter: expanded node.
Definition: Signal.hpp:217
static constexpr const char *const Collapsed
A branch node was collapsed in the tree view. Optional parameter: collapsed node.
Definition: Signal.hpp:218
Definition: Signal.hpp:63
static constexpr const char *const MouseLeft
The mouse left the widget.
Definition: Signal.hpp:69
static constexpr const char *const Unfocused
The widget was unfocused.
Definition: Signal.hpp:67
static constexpr const char *const Focused
The widget was focused.
Definition: Signal.hpp:66
static constexpr const char *const AnimationFinished
A show or hide animation finished. Optional parameters: animation type, new widget visibility or both...
Definition: Signal.hpp:70
static constexpr const char *const MouseEntered
The mouse entered the widget.
Definition: Signal.hpp:68
static constexpr const char *const SizeChanged
The size of the widget changed. Optional parameter: new size.
Definition: Signal.hpp:65
static constexpr const char *const PositionChanged
The position of the widget changed. Optional parameter: new position.
Definition: Signal.hpp:64