Gorgon Game Engine
WidgetContainer.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include <stdexcept>
4 
5 #include "Widget.h"
6 #include "../Layer.h"
7 #include "../Input/Keyboard.h"
8 #include "Organizers/Base.h"
9 
10 namespace Gorgon { namespace UI {
11 
12  class WidgetContainer;
13 
18  bool Transformed = false;
19 
22 
25 
28  };
29 
38  friend class Widget;
39  public:
45 
49 
55 
60 
63  Deny
64  };
65 
66  WidgetContainer() = default;
67 
69 
71  virtual ~WidgetContainer();
72 
74 
79  bool Add(Widget &widget);
80 
86  bool Insert(Widget &widget, int index);
87 
92  bool Remove(Widget &widget);
93 
95  void ForceRemove(Widget &widget);
96 
100  void ChangeFocusOrder(Widget &widget, int order);
101 
102  int GetFocusOrder(const Widget &widget) const;
103 
107  void ChangeZorder(Widget &widget, int order);
108 
112  bool FocusFirst();
113 
119  bool FocusNext();
120 
126  bool FocusNext(int after);
127 
133  bool FocusNext(const Widget &widget) { return FocusNext(GetFocusOrder(widget)); }
134 
138  bool FocusLast() { return FocusPrevious(widgets.GetSize()); }
139 
145  bool FocusPrevious() { return FocusPrevious(focusindex); }
146 
152  bool FocusPrevious(const Widget& widget) { return FocusNext(GetFocusOrder(widget)); }
153 
159  bool FocusPrevious(int before);
160 
162  bool SetFocusTo(Widget &widget);
163 
165  bool RemoveFocus();
166 
168  void ForceRemoveFocus();
169 
171  bool HasFocusedWidget() const { return focusindex != -1; }
172 
175  Widget &GetFocus() const;
176 
182  virtual bool EnsureVisible(const Widget &widget) = 0;
183 
187  virtual bool IsVisible() const = 0;
188 
190  virtual bool IsEnabled() const { return isenabled; }
191 
194  void Enable() {
195  SetEnabled(true);
196  }
197 
200  void Disable() {
201  SetEnabled(false);
202  }
203 
206  void ToggleEnabled() {
207  SetEnabled(!IsEnabled());
208  }
209 
212  virtual void SetEnabled(bool value) {
213  if(value != isenabled) {
214  isenabled = value;
216  }
217  }
218 
220  virtual Geometry::Size GetInteriorSize() const = 0;
221 
225  virtual bool ResizeInterior(Geometry::Size size) = 0;
226 
229  virtual bool IsTabSwitchEnabled() const { return tabswitch; }
230 
234 
238 
241  void ToggleTabSwitchEnabledState() { tabswitch=!tabswitch; }
242 
245  virtual void SetTabSwitchEnabledState(bool state) { tabswitch = state; }
246 
248  auto begin() {
249  return widgets.begin();
250  }
251 
253  auto begin() const {
254  return widgets.begin();
255  }
256 
258  auto end() {
259  return widgets.end();
260  }
261 
263  auto end() const {
264  return widgets.end();
265  }
266 
268  int GetCount() const {
269  return (int)widgets.GetCount();
270  }
271 
273  const Widget &operator [](int ind) const {
274  return widgets[ind];
275  }
276 
278  Widget &operator [](int ind) {
279  return widgets[ind];
280  }
281 
289  virtual Widget &GetDefault() const {
290  if(!def)
291  throw std::runtime_error("Container does not have a default");
292 
293  return *def;
294  }
295 
297  virtual bool HasDefault() const { return def!=nullptr; }
298 
301  virtual void SetDefault(Widget &widget) { def=&widget; }
302 
304  virtual void RemoveDefault() { def=nullptr; }
305 
311  virtual Widget &GetCancel() const {
312  if(!def)
313  throw std::runtime_error("Container does not have a default");
314 
315  return *cancel;
316  }
317 
319  virtual bool HasCancel() const { return cancel!=nullptr; }
320 
323  virtual void SetCancel(Widget &widget) { cancel=&widget; }
324 
326  virtual void RemoveCancel() { cancel=nullptr; }
327 
330  focusmode = value;
331  }
332 
336  return focusmode;
337  }
338 
341  if(focusmode == Inherit)
342  return getparentfocusstrategy();
343  else
344  return focusmode;
345  }
346 
348  template <class O_, class ...Args_>
349  O_ &CreateOrganizer(Args_ &&... args) {
350  auto &org = *new O_(std::forward<Args_>(args)...);
351  AttachOrganizer(org);
352 
353  ownorganizer = true;
354 
355  return org;
356  }
357 
360  void AttachOrganizer(Organizers::Base &organizer);
361 
363  void RemoveOrganizer();
364 
366  bool HasOrganizer() const {
367  return organizer != nullptr;
368  }
369 
373  if(organizer == nullptr) {
374  throw std::runtime_error("The container does not have an organizer");
375  }
376 
377  return *organizer;
378  }
379 
381  void Displaced();
382 
384  virtual bool KeyEvent(Input::Key key, float state) { return distributekeyevent(key, state, true); }
385 
388  virtual bool CharacterEvent(Char c) { return distributecharevent(c); }
389 
392 
393  protected:
396 
399  virtual bool addingwidget(Widget &) { return true; }
400 
402  virtual void widgetadded(Widget &) { }
403 
407  virtual bool removingwidget(Widget &) { return true; }
408 
410  virtual void widgetremoved(Widget &) { }
411 
415  return AllowAll;
416  }
417 
419  virtual Layer &getlayer() = 0;
420 
422  virtual void focuschanged() { }
423 
425  bool handlestandardkey(Input::Key key);
426 
429  bool distributekeyevent(Input::Key key, float state, bool handlestandard);
430 
432  bool distributecharevent(Char c);
433 
435  void distributeparentenabled(bool state);
436 
438  virtual void childboundschanged(Widget *source);
439 
440  private:
441  bool isenabled = true;
442  bool tabswitch = true;
443  Widget *def = nullptr;
444  Widget *cancel = nullptr;
445  Widget *focused = nullptr;
446  int focusindex = -1;
447  Organizers::Base *organizer = nullptr;
448  bool ownorganizer = false;
449 
450  FocusStrategy focusmode = Inherit;
451  };
452 
453 } }
Gorgon::UI::Widget::HasParent
bool HasParent() const
Returns if this widget has a parent.
Definition: Widget.h:140
Gorgon::Input::Keyboard::Keycodes::Numpad_Enter
constexpr Key Numpad_Enter
Definition: Keyboard.h:131
Gorgon::UI::WidgetContainer::getparentfocusstrategy
virtual FocusStrategy getparentfocusstrategy() const
If this widget is not top level, return the current strategy used by the parent.
Definition: WidgetContainer.h:414
Gorgon::Input::Keyboard::Modifier::None
@ None
No modifier is pressed.
Definition: Keyboard.h:172
Gorgon::Input::Keyboard::Keycodes::Enter
constexpr Key Enter
Definition: Keyboard.h:56
Gorgon::UI::WidgetContainer::Add
bool Add(Widget &widget)
Adds the given widget to this container.
Definition: WidgetContainer.cpp:5
Widget.h
Gorgon::UI::Widget::focused
virtual void focused()
This is called after the focus is transferred to this widget.
Definition: Widget.cpp:102
Gorgon::UI::WidgetContainer::HasDefault
virtual bool HasDefault() const
Returns if this container has a default object.
Definition: WidgetContainer.h:297
Gorgon::UI::WidgetContainer::widgetremoved
virtual void widgetremoved(Widget &)
This function is called after a widget is removed.
Definition: WidgetContainer.h:410
Gorgon::UI::WidgetContainer::~WidgetContainer
virtual ~WidgetContainer()
Virtual destructor.
Definition: WidgetContainer.cpp:466
Gorgon::UI::WidgetContainer::removingwidget
virtual bool removingwidget(Widget &)
This function is called before removing a widget.
Definition: WidgetContainer.h:407
Gorgon::UI::WidgetContainer::Inherit
@ Inherit
Inherit from the parent.
Definition: WidgetContainer.h:44
Gorgon::UI::WidgetContainer::distributekeyevent
bool distributekeyevent(Input::Key key, float state, bool handlestandard)
Distributes the pressed key to the focused widget.
Definition: WidgetContainer.cpp:400
Gorgon::UI::WidgetContainer::Enable
void Enable()
Enables the container, allowing interaction with the widgets in it.
Definition: WidgetContainer.h:194
Gorgon::UI::Widget::allowfocus
virtual bool allowfocus() const
Should return true if the widget can be focused.
Definition: Widget.h:222
Gorgon::UI::WidgetContainer::RemoveDefault
virtual void RemoveDefault()
Removes the default widget of this container.
Definition: WidgetContainer.h:304
Gorgon::UI::WidgetContainer::DisableTabSwitch
void DisableTabSwitch()
Disable tab switching.
Definition: WidgetContainer.h:237
Gorgon::UI::WidgetContainer::CharacterEvent
virtual bool CharacterEvent(Char c)
This function should be called whenever a character is received from operating system.
Definition: WidgetContainer.h:388
Gorgon::UI::WidgetContainer::ToggleTabSwitchEnabledState
void ToggleTabSwitchEnabledState()
Toggles the state of tab switching.
Definition: WidgetContainer.h:241
Gorgon::Input::Keyboard::CurrentModifier
Modifier CurrentModifier
Current keyboard modifier, this is a global value.
Definition: Input.cpp:7
Base.h
Gorgon::UI::WidgetContainer::CurrentFocusStrategy
FocusStrategy CurrentFocusStrategy() const
Returns the active focus strategy. This function will not return Inherit.
Definition: WidgetContainer.h:340
Gorgon::UI::WidgetContainer::GetFocusOrder
int GetFocusOrder(const Widget &widget) const
Definition: WidgetContainer.cpp:118
Gorgon::UI::Widget::addedto
virtual void addedto(WidgetContainer &container)
Called when this widget added to the given container.
Definition: Widget.cpp:71
Gorgon::Input::Keyboard::Modifier::Shift
@ Shift
Only shift modifier is pressed.
Definition: Keyboard.h:174
Gorgon::UI::WidgetContainer::GetDefault
virtual Widget & GetDefault() const
Returns the default element of the container.
Definition: WidgetContainer.h:289
Gorgon::UI::Widget::Activate
virtual bool Activate()=0
Activates the widget.
Gorgon::UI::WidgetContainer::SetEnabled
virtual void SetEnabled(bool value)
Sets the enabled state of this container.
Definition: WidgetContainer.h:212
Gorgon::UI::Widget::removed
virtual void removed()
Called after this widget is removed from its parent.
Definition: Widget.cpp:83
Gorgon::UI::WidgetContainer::FocusPrevious
bool FocusPrevious()
Focuses the previous widget that accepts focus.
Definition: WidgetContainer.h:145
Gorgon::UI::WidgetContainer::GetFocus
Widget & GetFocus() const
Returns the focused widget.
Definition: WidgetContainer.cpp:362
Gorgon::UI::WidgetContainer::getlayer
virtual Layer & getlayer()=0
Returns the layer that will be used to place the contained widgets.
Gorgon::UI::WidgetContainer::childboundschanged
virtual void childboundschanged(Widget *source)
The boundary of any of the children is changed. Source could be nullptr.
Definition: WidgetContainer.cpp:431
Gorgon::UI::WidgetContainer::FocusFirst
bool FocusFirst()
Focuses the first widget that accepts focus.
Definition: WidgetContainer.cpp:137
Gorgon::UI::WidgetContainer::KeyEvent
virtual bool KeyEvent(Input::Key key, float state)
This function should be called whenever a key is pressed or released.
Definition: WidgetContainer.h:384
Gorgon::UI::WidgetContainer::Displaced
void Displaced()
Call this function if the container or widgets in it is moved without move function is called.
Definition: WidgetContainer.cpp:471
Gorgon::UI::WidgetContainer::SetFocusStrategy
void SetFocusStrategy(FocusStrategy value)
Sets the focus strategy, see FocusStrategy.
Definition: WidgetContainer.h:329
Gorgon::Input::Keyboard::Keycodes::Escape
constexpr Key Escape
Definition: Keyboard.h:60
Gorgon::UI::Organizers::Base
Provides the basis for the automatic UI organizers.
Definition: Base.h:18
Gorgon::UI::WidgetContainer::Strict
@ Strict
Only the widget that will not work without input will receive focus.
Definition: WidgetContainer.h:59
Gorgon::Input::Keyboard::Keycodes::Tab
constexpr Key Tab
Definition: Keyboard.h:57
Gorgon::UI::WidgetContainer::HasOrganizer
bool HasOrganizer() const
Returns if this container has an organizer.
Definition: WidgetContainer.h:366
Gorgon::UI::WidgetContainer::IsEnabled
virtual bool IsEnabled() const
Returns whether container is enabled.
Definition: WidgetContainer.h:190
Gorgon::UI::WidgetContainer::Selective
@ Selective
Widgets that require input to work or benefit from input greatly are allowed to receive focus.
Definition: WidgetContainer.h:54
Gorgon::UI::WidgetContainer::SetTabSwitchEnabledState
virtual void SetTabSwitchEnabledState(bool state)
Sets the state of tab switching.
Definition: WidgetContainer.h:245
Gorgon::Input::Key
int Key
A type to represent an input key.
Definition: Input.h:14
Gorgon::UI::WidgetContainer::GetInteriorSize
virtual Geometry::Size GetInteriorSize() const =0
Should return the interior (usable) size of the container.
Gorgon::UI::WidgetContainer::widgetadded
virtual void widgetadded(Widget &)
This function is called after a widget is added.
Definition: WidgetContainer.h:402
Gorgon::UI::Widget::GetParent
WidgetContainer & GetParent() const
Returns the parent of this widget, throws if it does not have a parent.
Definition: Widget.cpp:30
Gorgon
Root namespace for Gorgon Game Engine.
Definition: Any.h:19
Gorgon::Geometry::basic_Size
This class represents a 2D geometric size.
Definition: Size.h:23
Gorgon::Char
uint32_t Char
Definition: Types.h:46
Gorgon::UI::WidgetContainer::GetFocusStrategy
FocusStrategy GetFocusStrategy() const
Returns the focus strategy set to this container.
Definition: WidgetContainer.h:335
Gorgon::UI::WidgetContainer::end
auto end() const
Returns the end iterator for the contained widgets.
Definition: WidgetContainer.h:263
Gorgon::Input::Keyboard::Modifier::Ctrl
@ Ctrl
Only control modifier is pressed.
Definition: Keyboard.h:176
Gorgon::UI::ExtenderRequestResponse::Extender
WidgetContainer * Extender
If the extender is provided by the request.
Definition: WidgetContainer.h:21
Gorgon::UI::Widget::addto
virtual void addto(Layer &layer)=0
When called, widget should locate itself on to this layer.
Gorgon::UI::WidgetContainer::Disable
void Disable()
Disables the container, disallowing interactions of all widgets in it.
Definition: WidgetContainer.h:200
Gorgon::Containers::Collection
Collection is a container for reference typed objects.
Definition: Collection.h:21
Gorgon::UI::WidgetContainer::EnableTabSwitch
void EnableTabSwitch()
Enable tab switching.
Definition: WidgetContainer.h:233
Gorgon::UI::WidgetContainer::IsVisible
virtual bool IsVisible() const =0
Should return whether the container is visible.
Gorgon::UI::WidgetContainer::end
auto end()
Returns the end iterator for the contained widgets.
Definition: WidgetContainer.h:258
Gorgon::UI::WidgetContainer::focuschanged
virtual void focuschanged()
This function is called when the focus is changed.
Definition: WidgetContainer.h:422
Gorgon::UI::WidgetContainer::RemoveCancel
virtual void RemoveCancel()
Removes the cancel widget of this container.
Definition: WidgetContainer.h:326
Gorgon::UI::WidgetContainer::SetDefault
virtual void SetDefault(Widget &widget)
Sets the default object of the container.
Definition: WidgetContainer.h:301
Gorgon::UI::WidgetContainer::ForceRemoveFocus
void ForceRemoveFocus()
Forcefully removes the focus from the focused widget.
Definition: WidgetContainer.cpp:347
Gorgon::UI::Widget::canloosefocus
virtual bool canloosefocus() const
Should return true if the widget can loose the focus right now.
Definition: Widget.h:230
Gorgon::UI::WidgetContainer::RemoveFocus
bool RemoveFocus()
Removes the focus from the focused widget.
Definition: WidgetContainer.cpp:335
Gorgon::UI::Organizers::Base::RemoveFrom
void RemoveFrom()
Removes the organizer from the container.
Definition: Base.cpp:17
Gorgon::UI::ExtenderRequestResponse
This structure is used to transfer extender request response.
Definition: WidgetContainer.h:15
Gorgon::UI::Widget::removefrom
virtual void removefrom(Layer &layer)=0
When called, widget should remove itself from the given layer.
Gorgon::UI::WidgetContainer::widgets
Containers::Collection< Widget > widgets
This container is sorted by the focus order.
Definition: WidgetContainer.h:395
Gorgon::UI::WidgetContainer::ToggleEnabled
void ToggleEnabled()
Toggles the enabled state of this container.
Definition: WidgetContainer.h:206
Gorgon::Layer
This class is the base class for all layer types.
Definition: Layer.h:79
Gorgon::UI::ExtenderRequestResponse::CoordinatesInExtender
Geometry::Point CoordinatesInExtender
Coordinates of the given point in the extender container.
Definition: WidgetContainer.h:24
Gorgon::Geometry::basic_Point
This class represents a 2D point.
Definition: Point.h:32
Gorgon::UI::WidgetContainer::IsTabSwitchEnabled
virtual bool IsTabSwitchEnabled() const
Check if tab switch is enabled.
Definition: WidgetContainer.h:229
Gorgon::UI::ExtenderRequestResponse::TotalSize
Geometry::Size TotalSize
Total size of the container. -1 means infinite.
Definition: WidgetContainer.h:27
Gorgon::UI::WidgetContainer::HasFocusedWidget
bool HasFocusedWidget() const
Returns if this container has a focused widget.
Definition: WidgetContainer.h:171
Gorgon::UI::WidgetContainer::ResizeInterior
virtual bool ResizeInterior(Geometry::Size size)=0
Should resize the interior (usable) size of the container.
Gorgon::UI::Organizers::Base::AttachTo
void AttachTo(WidgetContainer &container)
Attaches this organizer to a container.
Definition: Base.cpp:6
Gorgon::UI::ExtenderRequestResponse::Transformed
bool Transformed
If the coordinates are properly translated.
Definition: WidgetContainer.h:18
Gorgon::UI::WidgetContainer::WidgetContainer
WidgetContainer()=default
Gorgon::UI::Widget::IsEnabled
virtual bool IsEnabled() const =0
Returns whether the widget is enabled.
Gorgon::UI::WidgetContainer::handlestandardkey
bool handlestandardkey(Input::Key key)
Performs the standard operations (tab/enter/escape)
Definition: WidgetContainer.cpp:369
Gorgon::UI::WidgetContainer::begin
auto begin() const
Returns the begin iterator for the contained widgets.
Definition: WidgetContainer.h:253
Gorgon::UI::Organizers::Base::Reorganize
void Reorganize()
Reorganizes the widgets that are organized by this organizer.
Definition: Base.cpp:31
Gorgon::UI::WidgetContainer::ChangeZorder
void ChangeZorder(Widget &widget, int order)
Changes the z-order of the widget.
Definition: WidgetContainer.cpp:127
Gorgon::UI::WidgetContainer::FocusLast
bool FocusLast()
Focuses the last widget in the container.
Definition: WidgetContainer.h:138
Gorgon::UI::WidgetContainer::AttachOrganizer
void AttachOrganizer(Organizers::Base &organizer)
Attaches an organizer to this container.
Definition: WidgetContainer.cpp:452
Gorgon::UI::WidgetContainer::Remove
bool Remove(Widget &widget)
Removes the given widget from this container.
Definition: WidgetContainer.cpp:57
Gorgon::UI::WidgetContainer::RequestExtender
virtual ExtenderRequestResponse RequestExtender(const Gorgon::Layer &self)=0
This function will return a container that will act as an extender.
Gorgon::UI::WidgetContainer::ForceRemove
void ForceRemove(Widget &widget)
Forcefully removes the given widget from this container.
Definition: WidgetContainer.cpp:75
Gorgon::UI::Widget::CharacterEvent
virtual bool CharacterEvent(Char)
This function should be called whenever a character is received from operating system.
Definition: Widget.h:166
Gorgon::UI::Widget::focuslost
virtual void focuslost()
This is called after the focus is lost.
Definition: Widget.cpp:96
Gorgon::UI::WidgetContainer::GetCancel
virtual Widget & GetCancel() const
Returns the cancel element of the container which is called when the use presses escape key.
Definition: WidgetContainer.h:311
Gorgon::UI::WidgetContainer::FocusStrategy
FocusStrategy
Defines focus strategy for the container. Default is Inherit.
Definition: WidgetContainer.h:41
Gorgon::UI::WidgetContainer::begin
auto begin()
Returns the begin iterator for the contained widgets.
Definition: WidgetContainer.h:248
Gorgon::UI::WidgetContainer::WidgetContainer
WidgetContainer(WidgetContainer &&)=default
Gorgon::UI::Widget::setlayerorder
virtual void setlayerorder(Layer &layer, int order)=0
When called, widget should reorder itself in layer hierarchy.
Gorgon::UI::WidgetContainer::AllowAll
@ AllowAll
All widgets that can be focused are allowed to receive focus, including buttons but not labels.
Definition: WidgetContainer.h:48
Gorgon::UI::WidgetContainer::Deny
@ Deny
No widget is allowed focus and this container will not handle any keys.
Definition: WidgetContainer.h:63
Gorgon::UI::WidgetContainer::EnsureVisible
virtual bool EnsureVisible(const Widget &widget)=0
Ensures the widget is visible.
Gorgon::UI::WidgetContainer
This class is the base class for all widget containers.
Definition: WidgetContainer.h:37
WidgetContainer.h
Gorgon::UI::Widget::addingto
virtual bool addingto(WidgetContainer &)
Called when it is about to be added to the given container.
Definition: Widget.h:201
Gorgon::UI::WidgetContainer::FocusNext
bool FocusNext(const Widget &widget)
Focuses the next widget that accepts focus starting from the given focus index.
Definition: WidgetContainer.h:133
Gorgon::UI::WidgetContainer::addingwidget
virtual bool addingwidget(Widget &)
This function can return false to prevent the given widget from getting added to the container.
Definition: WidgetContainer.h:399
Gorgon::UI::WidgetContainer::RemoveOrganizer
void RemoveOrganizer()
Removes the organizer from this container.
Definition: WidgetContainer.cpp:436
Gorgon::UI::WidgetContainer::HasCancel
virtual bool HasCancel() const
Returns if this container has a cancel widget.
Definition: WidgetContainer.h:319
Gorgon::UI::WidgetContainer::GetOrganizer
Organizers::Base & GetOrganizer() const
Returns the organizer controlling this container.
Definition: WidgetContainer.h:372
Gorgon::UI::WidgetContainer::FocusNext
bool FocusNext()
Focuses the next widget that accepts focus.
Definition: WidgetContainer.cpp:141
Gorgon::UI::WidgetContainer::distributecharevent
bool distributecharevent(Char c)
Distributes a pressed character to the focused widget.
Definition: WidgetContainer.cpp:416
Gorgon::UI::WidgetContainer::ChangeFocusOrder
void ChangeFocusOrder(Widget &widget, int order)
Changes the focus order of the given widget.
Definition: WidgetContainer.cpp:95
Gorgon::UI::WidgetContainer::GetCount
int GetCount() const
Returns the number of widgets in this container.
Definition: WidgetContainer.h:268
Gorgon::UI::WidgetContainer::FocusPrevious
bool FocusPrevious(const Widget &widget)
Focuses the previous widget that accepts focus.
Definition: WidgetContainer.h:152
Gorgon::UI::Widget::IsVisible
bool IsVisible() const
Returns if the widget is visible.
Definition: Widget.h:113
Gorgon::UI::Widget::KeyEvent
virtual bool KeyEvent(Input::Key, float)
This function should be called whenever a key is pressed or released.
Definition: Widget.h:162
Gorgon::UI::WidgetContainer::SetCancel
virtual void SetCancel(Widget &widget)
Sets the cancel widget of the container.
Definition: WidgetContainer.h:323
Gorgon::UI::WidgetContainer::CreateOrganizer
O_ & CreateOrganizer(Args_ &&... args)
Creates a new organizer that lives with this container.
Definition: WidgetContainer.h:349
Gorgon::UI::WidgetContainer::distributeparentenabled
void distributeparentenabled(bool state)
Distributes a enabled state to children.
Definition: WidgetContainer.cpp:426
Gorgon::UI::WidgetContainer::operator=
WidgetContainer & operator=(WidgetContainer &&)=default
Gorgon::UI::WidgetContainer::SetFocusTo
bool SetFocusTo(Widget &widget)
Sets the focus to the given widget.
Definition: WidgetContainer.cpp:297
Gorgon::UI::WidgetContainer::operator[]
const Widget & operator[](int ind) const
Returns the widget at the given index.
Definition: WidgetContainer.h:273
Gorgon::UI::Widget::removingfrom
virtual bool removingfrom()
Called before this widget is removed from its parent.
Definition: Widget.h:213
Gorgon::UI::WidgetContainer::Insert
bool Insert(Widget &widget, int index)
Add the given widget to this container.
Definition: WidgetContainer.cpp:28
Gorgon::UI::Widget
This class is the base for all widgets.
Definition: Widget.h:16