Gorgon Game Engine
Panel.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include "../UI/ComponentStackWidget.h"
4 #include "../UI/WidgetContainer.h"
5 #include "../Property.h"
6 #include "../Input/KeyRepeater.h"
7 #include "Registry.h"
8 #include "Scrollbar.h"
9 
10 namespace Gorgon { namespace Widgets {
11 
13  public:
14 
15  Panel(const Panel &) = delete;
16 
17  explicit Panel(const UI::Template &temp);
18 
20 
21  using Widget::Resize;
22 
23  using Widget::Remove;
24 
26 
27  virtual void Resize(const Geometry::Size &size) override;
28 
29  using Widget::Move;
30 
31  virtual void Move(const Geometry::Point &location) override;
32 
33 
34  virtual bool Activate() override;
35 
36 
37  virtual bool KeyEvent(Input::Key, float) override;
38 
39 
40  virtual bool CharacterEvent(Char) override;
41 
42 
43  virtual bool IsVisible() const override;
44 
45 
46  virtual Geometry::Size GetInteriorSize() const override;
47 
48 
49  virtual bool ResizeInterior(Geometry::Size size) override;
50 
57  void EnableScroll(bool vertical, bool horizontal);
58 
60  bool IsVerticalScrollEnabled() const {
61  return vscroll;
62  }
63 
66  return hscroll;
67  }
68 
69 
73  void ScrollTo(Geometry::Point location, bool clip = false) {
74  ScrollTo(location.X, location.Y, clip);
75  }
76 
80  void ScrollTo(int x, int y, bool clip = true);
81 
84  void ScrollTo(int y, bool clip = true) {
85  ScrollTo(ScrollOffset().X, y, clip);
86  }
87 
89  void ScrollBy(int y, bool clip = true) {
90  ScrollTo(ScrollOffset().X, ScrollOffset().Y + y, clip);
91  }
92 
94  void ScrollBy(int x, int y, bool clip = true) {
95  ScrollTo(ScrollOffset().X + x, ScrollOffset().Y + y, clip);
96  }
97 
100 
103 
107  void SetOverscroll(int value);
108 
111  int GetOverscroll() const {
112  return overscroll;
113  }
114 
117  void SetScrollDistance(int vert) {
118  scrolldist.Y = vert;
119  }
120 
123  void SetScrollDistance(int hor, int vert) {
124  SetScrollDistance({hor, vert});
125  }
126 
130  scrolldist = dist;
131  }
132 
135  return scrolldist;
136  }
137 
141  }
142 
145  void SetSmoothScrollSpeed(int value);
146 
149  int GetSmoothScrollSpeed() const {
150  return scrollspeed;
151  }
152 
154  bool IsSmoothScrollEnabled() const {
155  return scrollspeed != 0;
156  }
157 
158  using Widget::EnsureVisible;
159 
160  bool EnsureVisible(const UI::Widget &widget) override;
161 
162  using Widget::Enable;
163  using Widget::Disable;
164  using Widget::ToggleEnabled;
165 
166  virtual void SetEnabled(bool value) override {
167  if(value != IsEnabled()) {
168  ComponentStackWidget::SetEnabled(value);
170  }
171  }
172 
173  virtual bool IsEnabled() const override {
174  return ComponentStackWidget::IsEnabled();
175  }
176 
177  virtual UI::ExtenderRequestResponse RequestExtender(const Gorgon::Layer &self) override;
178 
179  protected:
180  virtual bool allowfocus() const override;
181 
182  virtual void focused() override;
183 
184  virtual void focuslost() override;
185 
186  virtual Layer &getlayer() override;
187 
188  void focuschanged() override;
189 
190  virtual void childboundschanged(Widget *source) override;
191 
192  void updatecontent();
193 
194  void updatescroll();
195 
196  void updatebars();
197 
198  bool updaterequired = false;
199 
200  void scrolltox(int x) {
201  ScrollTo(x, ScrollOffset().Y);
202  }
203 
204  void scrolltoy(int y) {
205  ScrollTo(y);
206  }
207 
209 
211  if(HasParent())
212  return GetParent().CurrentFocusStrategy();
213  else
214  return AllowAll;
215  }
216 
217  virtual void parentenabledchanged(bool state) override {
218  ComponentStackWidget::parentenabledchanged(state);
219 
220  if(!state && IsEnabled())
222  else if(state && IsEnabled())
224  }
225 
226  virtual UI::Widget *createvscroll(const UI::Template &temp);
227 
228  virtual UI::Widget *createhscroll(const UI::Template &temp);
229 
230  int overscroll = 0;
231  bool scrollclipped = true;
234  int scrollspeed = 500;
236  bool isscrolling = false;
237  float scrollleftover = 0;
238  bool vscroll = true, hscroll = false;
239  };
240 
241 } }
242 
Gorgon::UI::Widget::HasParent
bool HasParent() const
Returns if this widget has a parent.
Definition: Widget.h:140
Gorgon::Widgets::Panel::Panel
Panel(const Panel &)=delete
Gorgon::Widgets::Panel::isscrolling
bool isscrolling
Definition: Panel.h:236
Gorgon::Geometry::basic_Bounds
This class represents boundaries of 2D objects.
Definition: Bounds.h:27
Gorgon::UI::ComponentStackWidget::stack
ComponentStack & stack
Definition: ComponentStackWidget.h:76
Gorgon::Widgets::Panel::scrolldist
Geometry::Point scrolldist
Definition: Panel.h:232
Gorgon::Containers::Remove
void Remove(const I_ &first, const I_ &end)
This function works with collection iterators.
Definition: Iterator.h:386
Gorgon::Widgets::Panel::ScrollOffset
Geometry::Point ScrollOffset() const
Returns the current scroll offset.
Definition: Panel.cpp:315
Gorgon::Widgets::Panel::updatescroll
void updatescroll()
Definition: Panel.cpp:243
Gorgon::Widgets::Panel::focuslost
virtual void focuslost() override
This is called after the focus is lost.
Definition: Panel.cpp:188
Gorgon::UI::ComponentTemplate::ContentsTag
@ ContentsTag
Definition: Template.h:872
Gorgon::UI::Widget::Focus
bool Focus()
Transfers the focus to this widget.
Definition: Widget.cpp:13
Gorgon::Widgets::Panel::SetEnabled
virtual void SetEnabled(bool value) override
Sets the enabled state of the widget.
Definition: Panel.h:166
Gorgon::Input::Mouse::Scroll_Hor
@ Scroll_Hor
Definition: Mouse.h:25
Gorgon::Widgets::Panel::CharacterEvent
virtual bool CharacterEvent(Char) override
This function should be called whenever a character is received from operating system.
Definition: Panel.cpp:124
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::ComponentStackWidget::GetSize
virtual Geometry::Size GetSize() const override
Returns the size of the widget.
Definition: ComponentStackWidget.h:46
Gorgon::Widgets::Panel
Definition: Panel.h:12
Gorgon::Input::Keyboard::CurrentModifier
Modifier CurrentModifier
Current keyboard modifier, this is a global value.
Definition: Input.cpp:7
Gorgon::UI::Template
This class stores visual information about a widget template.
Definition: Template.h:392
Gorgon::Widgets::Panel::scrolloffset
Geometry::Point scrolloffset
Definition: Panel.h:233
Gorgon::UI::WidgetContainer::CurrentFocusStrategy
FocusStrategy CurrentFocusStrategy() const
Returns the active focus strategy. This function will not return Inherit.
Definition: WidgetContainer.h:340
Gorgon::UI::ComponentStack::GetLayerOf
Layer & GetLayerOf(int ind)
Returns the layer of the given component index.
Definition: ComponentStack.cpp:1356
Gorgon::Widgets::Panel::ScrollBy
void ScrollBy(int x, int y, bool clip=true)
Scrolls the contents an additional amount.
Definition: Panel.h:94
Gorgon::Widgets::Scrollbar
This widget is a scrollbar.
Definition: Scrollbar.h:25
Gorgon::UI::ComponentStack::SetValueTransitionSpeed
void SetValueTransitionSpeed(std::array< float, 4 > val)
Changes the value transition speed.
Definition: ComponentStack.h:130
Gorgon::Geometry::basic_Point::X
T_ X
X coordinate.
Definition: Point.h:368
Gorgon::Widgets::Panel::ScrollBy
void ScrollBy(int y, bool clip=true)
Scrolls the contents an additional amount.
Definition: Panel.h:89
Gorgon::Widgets::Panel::vscroll
bool vscroll
Definition: Panel.h:238
Gorgon::Widgets::Panel::IsVerticalScrollEnabled
bool IsVerticalScrollEnabled() const
Whether vertical scrolling is enabled.
Definition: Panel.h:60
Gorgon::Geometry::basic_Size::Height
T_ Height
Height of this size object.
Definition: Size.h:261
Gorgon::Input::Keyboard::Modifier::Shift
@ Shift
Only shift modifier is pressed.
Definition: Keyboard.h:174
Gorgon::Widgets::Panel::SetScrollDistance
void SetScrollDistance(int vert)
Sets the horizontal scroll distance per click in pixels.
Definition: Panel.h:117
Gorgon::Widgets::Panel::SetSmoothScrollSpeed
void SetSmoothScrollSpeed(int value)
Adjusts the smooth scrolling speed of the panel.
Definition: Panel.cpp:389
Gorgon::Widgets::Panel::SetOverscroll
void SetOverscroll(int value)
Sets the amount of extra scrolling distance after the bottom-most widget is completely visible in pix...
Definition: Panel.cpp:361
Gorgon::Widgets::Panel::scrollspeed
int scrollspeed
Definition: Panel.h:234
Gorgon::Widgets::Panel::focused
virtual void focused() override
This is called after the focus is transferred to this widget.
Definition: Panel.cpp:182
Gorgon::Widgets::Panel::ResizeInterior
virtual bool ResizeInterior(Geometry::Size size) override
Should resize the interior (usable) size of the container.
Definition: Panel.cpp:142
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::HScroll
@ HScroll
There is space horizontally to be scrolled.
Definition: Template.h:248
Gorgon::Input::Mouse::Move
@ Move
Definition: Mouse.h:17
Gorgon::Widgets::VScrollbar
Scrollbar< int, FloatDivider< int >, FloatToValue< int >, Gorgon::NumericProperty, Registry::Scrollbar_Vertical > VScrollbar
Definition: Scrollbar.h:94
Gorgon::Widgets::Panel::IsEnabled
virtual bool IsEnabled() const override
Returns whether the widget is enabled.
Definition: Panel.h:173
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::ComponentStack::TagBounds
Geometry::Bounds TagBounds(ComponentTemplate::Tag tag)
Returns the boundaries of the component marked with the given tag.
Definition: ComponentStack.cpp:1297
Gorgon::Layer::IsVisible
virtual bool IsVisible() const
Returns whether this layer is effectively visible.
Definition: Layer.h:459
Gorgon::Widgets::Panel::hscroll
bool hscroll
Definition: Panel.h:238
Gorgon::Time::DeltaTime
unsigned long DeltaTime()
Returns the time passed since the last frame.
Definition: Time.h:258
Gorgon::Widgets::Panel::GetScrollDistance
Geometry::Point GetScrollDistance() const
Returns the scroll distance per click.
Definition: Panel.h:134
Gorgon::Utils::ASSERT_FALSE
void ASSERT_FALSE(const std::string &message, int skip=1, int depth=4)
Definition: Assert.h:192
Gorgon::UI::ComponentStackWidget::Move
void Move(int x, int y)
Moves this widget to the given position.
Definition: Widget.h:45
Gorgon::Input::Keyboard::Keycodes::X
constexpr Key X
Definition: Keyboard.h:103
Gorgon::Widgets::Panel::childboundschanged
virtual void childboundschanged(Widget *source) override
Definition: Panel.cpp:319
Gorgon::UI::WidgetContainer::HasOrganizer
bool HasOrganizer() const
Returns if this container has an organizer.
Definition: WidgetContainer.h:366
Gorgon::Widgets::HScrollbar
Scrollbar< int, FloatDivider< int >, FloatToValue< int >, Gorgon::NumericProperty, Registry::Scrollbar_Horizontal > HScrollbar
Definition: Scrollbar.h:93
Gorgon::UI::ComponentTemplate::HScrollTag
@ HScrollTag
Definition: Template.h:856
Gorgon::Widgets::Registry::TemplateType
TemplateType
This enum lists all possible template types.
Definition: Registry.h:18
Gorgon::Widgets::Panel::RequestExtender
virtual UI::ExtenderRequestResponse RequestExtender(const Gorgon::Layer &self) override
This function will return a container that will act as an extender.
Definition: Panel.cpp:499
Gorgon::Geometry::basic_Bounds::Left
T_ Left
Left-most boundary.
Definition: Bounds.h:399
Gorgon::Input::Keyboard::Keycodes::PageUp
constexpr Key PageUp
Definition: Keyboard.h:44
Gorgon::Input::Key
int Key
A type to represent an input key.
Definition: Input.h:14
Gorgon::Widgets::Panel::DisableSmoothScroll
void DisableSmoothScroll()
Disables smooth scrolling of the panel.
Definition: Panel.h:139
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
Panel.h
Gorgon::UI::ComponentStack::SetFrameEvent
void SetFrameEvent(std::function< void()> handler)
Sets a function to be called before update check.
Definition: ComponentStack.h:413
Gorgon::Input::Mouse::Scroll_Vert
@ Scroll_Vert
Definition: Mouse.h:24
Gorgon::Widgets::Panel::IsHorizontalScrollEnabled
bool IsHorizontalScrollEnabled() const
Whether horizontal scrolling is enabled.
Definition: Panel.h:65
Gorgon::Widgets::Panel::MaxScrollOffset
Geometry::Point MaxScrollOffset() const
Returns the current maximum scroll offset.
Definition: Panel.cpp:368
Gorgon::UI::WidgetContainer::Widget
friend class Widget
Definition: WidgetContainer.h:38
Gorgon::Input::Keyboard::Keycodes::Up
constexpr Key Up
Definition: Keyboard.h:63
Gorgon::UI::ComponentTemplate::ViewPortTag
@ ViewPortTag
Definition: Template.h:873
Gorgon::UI::ComponentTemplate::VScrollTag
@ VScrollTag
Definition: Template.h:857
Gorgon::UI::VScroll
@ VScroll
There is space vertically to be scrolled.
Definition: Template.h:251
Gorgon::UI::ComponentStack::SetValue
void SetValue(float first)
Sets the value for this stack.
Definition: ComponentStack.h:93
Gorgon::Widgets::Panel::ScrollTo
void ScrollTo(int y, bool clip=true)
Scrolls the contents of the panel so that the given location will be at the top.
Definition: Panel.h:84
Gorgon::Widgets::Panel::IsVisible
virtual bool IsVisible() const override
Should return whether the container is visible.
Definition: Panel.cpp:128
Gorgon::Widgets::Registry::Panel_Regular
@ Panel_Regular
Definition: Registry.h:32
Gorgon::Widgets::Panel::repeater
Input::KeyRepeater repeater
Definition: Panel.h:208
Gorgon::Widgets::Panel::KeyEvent
virtual bool KeyEvent(Input::Key, float) override
This function should be called whenever a key is pressed or released.
Definition: Panel.cpp:95
Gorgon::UI::ComponentStack::GetValue
std::array< float, 4 > GetValue() const
Returns the value of the stack.
Definition: ComponentStack.h:123
Gorgon::Widgets::Panel::scrolltoy
void scrolltoy(int y)
Definition: Panel.h:204
Gorgon::UI::ComponentStack::IndexOfTag
int IndexOfTag(ComponentTemplate::Tag tag)
Returns the index of the component with the specified tag.
Definition: ComponentStack.cpp:1437
Gorgon::UI::ComponentStackWidget::Resize
virtual void Resize(int w, int h)
Changes the size of the widget.
Definition: Widget.h:54
Gorgon::Widgets::Panel::Activate
virtual bool Activate() override
Activates the widget.
Definition: Panel.cpp:86
Gorgon::UI::WidgetContainer::RemoveFocus
bool RemoveFocus()
Removes the focus from the focused widget.
Definition: WidgetContainer.cpp:335
Gorgon::UI::ExtenderRequestResponse
This structure is used to transfer extender request response.
Definition: WidgetContainer.h:15
Gorgon::Widgets::Panel::focuschanged
void focuschanged() override
This function is called when the focus is changed.
Definition: Panel.cpp:197
Gorgon::Widgets::Panel::updatecontent
void updatecontent()
Definition: Panel.cpp:333
Gorgon::UI::WidgetContainer::widgets
Containers::Collection< Widget > widgets
This container is sorted by the focus order.
Definition: WidgetContainer.h:395
Gorgon::UI::Widget::EnsureVisible
bool EnsureVisible() const
Ensures this widget is visible in its container by scrolling it into view.
Definition: Widget.cpp:55
Gorgon::UI::ComponentStack::RemoveFrameEvent
void RemoveFrameEvent()
Removes the function that will be called before update check.
Definition: ComponentStack.h:433
Gorgon::Layer
This class is the base class for all layer types.
Definition: Layer.h:79
Gorgon::Geometry::basic_Point
This class represents a 2D point.
Definition: Point.h:32
Gorgon::Widgets::Panel::scrollclipped
bool scrollclipped
Definition: Panel.h:231
Gorgon::UI::WidgetContainer::HasFocusedWidget
bool HasFocusedWidget() const
Returns if this container has a focused widget.
Definition: WidgetContainer.h:171
Gorgon::Clamp
T_ Clamp(T_ v, T_ min, T_ max)
Performs clamping on the given value and returns the result.
Definition: Types.h:99
Gorgon::Widgets::Panel::scrolltox
void scrolltox(int x)
Definition: Panel.h:200
Registry.h
Gorgon::Widgets::Panel::overscroll
int overscroll
Definition: Panel.h:230
Gorgon::Input::Mouse::EventType
EventType
The type of a mouse event.
Definition: Mouse.h:14
Gorgon::Widgets::Panel::createvscroll
virtual UI::Widget * createvscroll(const UI::Template &temp)
Definition: Panel.cpp:476
Gorgon::Widgets::Panel::getlayer
virtual Layer & getlayer() override
Returns the layer that will be used to place the contained widgets.
Definition: Panel.cpp:193
Gorgon::UI::ComponentStack::GetWidget
Widget * GetWidget(ComponentTemplate::Tag tag)
Returns the widget associated with the tag.
Definition: ComponentStack.cpp:3610
Gorgon::UI::Active
@ Active
This is for widgets that can be activated, like a count down timer.
Definition: Template.h:245
Gorgon::UI::Organizers::Base::Reorganize
void Reorganize()
Reorganizes the widgets that are organized by this organizer.
Definition: Base.cpp:31
Gorgon::Widgets::Panel::scrollleftover
float scrollleftover
Definition: Panel.h:237
Gorgon::Widgets::Panel::GetSmoothScrollSpeed
int GetSmoothScrollSpeed() const
Returns the smooth scrolling speed of the panel.
Definition: Panel.h:149
Gorgon::Widgets::Panel::updaterequired
bool updaterequired
Definition: Panel.h:198
Gorgon::Widgets::Scrollbar::SetSmoothChangeSpeed
void SetSmoothChangeSpeed(T_ value)
Adjusts the smooth change speed.
Definition: Slider.h:272
Gorgon::Geometry::basic_Bounds::Right
T_ Right
Right-most boundary.
Definition: Bounds.h:405
Gorgon::Widgets::Panel::createhscroll
virtual UI::Widget * createhscroll(const UI::Template &temp)
Definition: Panel.cpp:487
Gorgon::Widgets::Panel::EnableScroll
void EnableScroll(bool vertical, bool horizontal)
Controls whether scrolling will be enabled vertically or horizontally.
Definition: Panel.cpp:452
Gorgon::Widgets::Panel::ScrollTo
void ScrollTo(Geometry::Point location, bool clip=false)
Scrolls the contents of the panel so that the given location will be at the top left.
Definition: Panel.h:73
Gorgon::Geometry::basic_Bounds::Bottom
T_ Bottom
Bottom-most boundary.
Definition: Bounds.h:408
Gorgon::UI::HVScroll
@ HVScroll
There is space both horizontally and vertically to be scrolled.
Definition: Template.h:254
Gorgon::Widgets::Scrollbar::Maximum
NumericProperty< SliderBase, T_, &SliderBase::GetMaximum, &SliderBase::SetMaximum > Maximum
This property controls the maximum value that the slider can have.
Definition: Slider.h:313
Gorgon::UI::Widget::IsFocused
bool IsFocused() const
Returns if this widget is focused.
Definition: Widget.h:98
Gorgon::Widgets::Panel::Panel
Panel(Registry::TemplateType type=Registry::Panel_Regular)
Definition: Panel.h:19
Gorgon::Geometry::basic_Point::Y
T_ Y
Y coordinate.
Definition: Point.h:371
Gorgon::Geometry::basic_Bounds::TopLeft
basic_Point< T_ > TopLeft() const
Returns top left corner.
Definition: Bounds.h:105
Gorgon::Input::KeyRepeater
This class simplifies the use of repeated keystrokes when a key is pressed.
Definition: KeyRepeater.h:54
Gorgon::Geometry::basic_Size::Width
T_ Width
Width of this size object.
Definition: Size.h:258
Gorgon::UI::WidgetContainer::FocusStrategy
FocusStrategy
Defines focus strategy for the container. Default is Inherit.
Definition: WidgetContainer.h:41
Gorgon::Geometry::basic_Bounds::GetSize
basic_Size< T_ > GetSize() const
Returns the size of the bounds object.
Definition: Bounds.h:141
Gorgon::Widgets::Panel::GetInteriorSize
virtual Geometry::Size GetInteriorSize() const override
Should return the interior (usable) size of the container.
Definition: Panel.cpp:132
Gorgon::Widgets::Panel::SetScrollDistance
void SetScrollDistance(int hor, int vert)
Sets the scroll distance per click in pixels.
Definition: Panel.h:123
Gorgon::Input::KeyRepeater::KeyEvent
bool KeyEvent(Key &key, float amount)
This function is used to handle key events.
Definition: KeyRepeater.cpp:104
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
This class is the base class for all widget containers.
Definition: WidgetContainer.h:37
Gorgon::Widgets::Panel::updatebars
void updatebars()
Definition: Panel.cpp:295
Gorgon::Widgets::Panel::GetOverscroll
int GetOverscroll() const
Returns the amount of extra scrolling distance after the bottom-most widget is completely visible in ...
Definition: Panel.h:111
Gorgon::UI::WidgetContainer::GetOrganizer
Organizers::Base & GetOrganizer() const
Returns the organizer controlling this container.
Definition: WidgetContainer.h:372
Gorgon::GL::Resize
void Resize(const Geometry::Size &size)
Resizes the active context.
Definition: OpenGL.cpp:273
Gorgon::UI::ComponentStack::SetTagLocation
void SetTagLocation(ComponentTemplate::Tag tag, Geometry::Point location)
Set a fixed location for a tagged component.
Definition: ComponentStack.h:362
Gorgon::Input::Keyboard::Keycodes::PageDown
constexpr Key PageDown
Definition: Keyboard.h:45
Gorgon::UI::ComponentStackWidget
This class acts as a widget base that uses component stack to handle rendering, resizing and other op...
Definition: ComponentStackWidget.h:14
Gorgon::UI::Widget::IsVisible
bool IsVisible() const
Returns if the widget is visible.
Definition: Widget.h:113
Scrollbar.h
Gorgon::UI::ComponentStack::SetTagSize
void SetTagSize(ComponentTemplate::Tag tag, Geometry::Size size)
Set a fixed size for a tagged component.
Definition: ComponentStack.h:382
Gorgon::Widgets::Panel::allowfocus
virtual bool allowfocus() const override
Should return true if the widget can be focused.
Definition: Panel.cpp:170
Gorgon::UI::WidgetContainer::distributeparentenabled
void distributeparentenabled(bool state)
Distributes a enabled state to children.
Definition: WidgetContainer.cpp:426
Gorgon::UI::ComponentTemplate::Tag
Tag
Tags mark a component to be modified in a way meaningful to specific widgets.
Definition: Template.h:850
Gorgon::Input::Keyboard::Keycodes::Y
constexpr Key Y
Definition: Keyboard.h:104
Gorgon::Widgets::Panel::IsSmoothScrollEnabled
bool IsSmoothScrollEnabled() const
Returns if the smooth scroll is enabled.
Definition: Panel.h:154
Gorgon::Widgets::Registry
This class stores templates for elements.
Definition: Registry.h:12
Gorgon::Widgets::Panel::target
Geometry::Point target
Definition: Panel.h:235
Gorgon::Widgets::Panel::getparentfocusstrategy
FocusStrategy getparentfocusstrategy() const override
If this widget is not top level, return the current strategy used by the parent.
Definition: Panel.h:210
Gorgon::Geometry::basic_Bounds::Top
T_ Top
Top-most boundary.
Definition: Bounds.h:402
Gorgon::Layer::GetSize
Geometry::Size GetSize() const
Returns the size of the layer.
Definition: Layer.h:362
Gorgon::UI::Widget
This class is the base for all widgets.
Definition: Widget.h:16
Gorgon::Widgets::Panel::SetScrollDistance
void SetScrollDistance(Geometry::Point dist)
Sets the scroll distance per click in pixels.
Definition: Panel.h:129
Gorgon::UI::Widget::GetBounds
Geometry::Bounds GetBounds() const
Returns the bounds of the widget.
Definition: Widget.h:63
Gorgon::Input::Keyboard::Keycodes::Down
constexpr Key Down
Definition: Keyboard.h:65
Gorgon::Widgets::Panel::parentenabledchanged
virtual void parentenabledchanged(bool state) override
This function is called when the parent's enabled state changes.
Definition: Panel.h:217