![]() |
Gorgon Game Engine
|
This widget is a scrollbar. More...
Public Member Functions | |
Scrollbar (const Scrollbar &)=delete | |
Scrollbar (const UI::Template &temp, T_ cur, T_ max) | |
Scrollbar (const UI::Template &temp, T_ cur=T_{}) | |
Scrollbar (T_ cur, T_ max, Registry::TemplateType type=defaultregistry) | |
Scrollbar (T_ cur=T_{}, Registry::TemplateType type=defaultregistry) | |
void | DisableSmoothChange () |
Disables smooth change. More... | |
T_ | GetLargeChange () const |
Returns the amount of change on a large change action. More... | |
T_ | GetMaximum () const |
Returns the current maximum value. More... | |
T_ | GetRange () const |
Returns the range the container can display. More... | |
T_ | GetSmallChange () const |
Returns the amount of change on a small change action. More... | |
T_ | GetSmoothChangeSpeed () const |
Returns the smooth change speed. More... | |
float | GetSmoothChangeSpeedRatio () const |
Returns the smooth change in ratio to the maximum. More... | |
T_ | GetValue () const |
Gets the current value of the slider. More... | |
bool | IsSmoothChangeEnabled () const |
Returns if the smooth change is enabled. More... | |
void | SetLargeChange (const T_ &value) |
Sets the amount of change on a large change action. More... | |
void | SetMaximum (const T_ &value) |
Sets the maximum value that this slider reaches up to. More... | |
void | SetRange (const T_ &value) |
Sets the range the container can display. More... | |
void | SetSmallChange (const T_ &value) |
Sets the amount of change on a small change action. More... | |
void | SetSmoothChangeSpeed (T_ value) |
Adjusts the smooth change speed. More... | |
void | SetSmoothChangeSpeedRatio (float value) |
Adjusts the smooth change speed. More... | |
void | SetValue (const T_ &value, bool instant=false) |
Sets the current value of the slider. More... | |
![]() | |
SliderBase (const SliderBase &)=delete | |
SliderBase (const UI::Template &temp, T_ cur, T_ max) | |
SliderBase (const UI::Template &temp, T_ cur=T_{}) | |
SliderBase (T_ cur, T_ max, Registry::TemplateType type=Registry::Progress_Regular) | |
SliderBase (T_ cur=T_{}, Registry::TemplateType type=Registry::Progress_Regular) | |
![]() | |
ComponentStackWidget (ComponentStackWidget &&)=default | |
ComponentStackWidget (const Template &temp, std::map< ComponentTemplate::Tag, std::function< Widget *(const Template &)>> generators={}) | |
virtual | ~ComponentStackWidget () |
virtual Geometry::Point | GetLocation () const override |
Returns the location of the widget. More... | |
virtual Geometry::Size | GetSize () const override |
Returns the size of the widget. More... | |
virtual bool | IsEnabled () const override |
Returns whether the widget is enabled. More... | |
virtual void | Move (const Geometry::Point &location) override |
Moves this widget to the given position. More... | |
virtual void | Move (const Geometry::Point &location)=0 |
Moves this widget to the given position. More... | |
void | Move (int x, int y) |
Moves this widget to the given position. More... | |
virtual void | Resize (const Geometry::Size &size) override |
Changes the size of the widget. More... | |
virtual void | Resize (const Geometry::Size &size)=0 |
Changes the size of the widget. More... | |
virtual void | Resize (int w, int h) |
Changes the size of the widget. More... | |
virtual void | SetEnabled (bool value) override |
Sets the enabled state of the widget. More... | |
![]() | |
Widget () | |
Widget (Widget &&)=default | |
virtual | ~Widget () |
bool | AllowFocus () const |
If this widget can be focused currently. More... | |
virtual bool | CharacterEvent (Char) |
This function should be called whenever a character is received from operating system. More... | |
bool | Defocus () |
Removes the focus from this widget if this widget is focused. More... | |
void | Disable () |
Disables the widget so that the user cannot interact with it. More... | |
virtual bool | Done () |
For widgets that supports it, this will trigger finalization the user interaction. More... | |
void | Enable () |
Enables the widget so that the user can interact with it. More... | |
bool | EnsureVisible () const |
Ensures this widget is visible in its container by scrolling it into view. More... | |
bool | Focus () |
Transfers the focus to this widget. More... | |
Geometry::Bounds | GetBounds () const |
Returns the bounds of the widget. More... | |
int | GetHeight () const |
Returns the height of the widget. More... | |
WidgetContainer & | GetParent () const |
Returns the parent of this widget, throws if it does not have a parent. More... | |
int | GetWidth () const |
Returns the width of the widget. More... | |
bool | HasParent () const |
Returns if this widget has a parent. More... | |
void | Hide () |
Hides this widget, when hidden, widgets cannot gain focus. More... | |
bool | IsFloating () const |
Returns floating status of this widget. More... | |
bool | IsFocused () const |
Returns if this widget is focused. More... | |
bool | IsVisible () const |
Returns if the widget is visible. More... | |
virtual bool | KeyEvent (Input::Key, float) |
This function should be called whenever a key is pressed or released. More... | |
void | Move (int x, int y) |
Moves this widget to the given position. More... | |
bool | Remove () |
Removes the widget from its parent. More... | |
virtual void | Resize (int w, int h) |
Changes the size of the widget. More... | |
void | SetHeight (int height) |
Sets the height of the widget. More... | |
virtual void | SetIsFloating (bool value) |
Sets floating status of this widget. More... | |
void | setname (std::string value) |
This is a debug feature. More... | |
void | SetVisible (bool value) |
Changes the visibility of the widget. More... | |
void | SetWidth (int width) |
Sets the width of the widget. More... | |
void | Show () |
Shows this widget, widgets are visible by default. More... | |
void | ToggleEnabled () |
Toggles enabled state of the widget. More... | |
void | ToggleVisible () |
Toggles the visibility state of the widget. More... | |
![]() | |
NumericProperty (NumericProperty &&)=default | |
NumericProperty (UI::internal::prophelper< SliderBase< T_, DIV_, VAL_, Gorgon::NumericProperty, interactive, valuemapping >, T_ > &Object) | |
NumericProperty (UI::internal::prophelper< SliderBase< T_, DIV_, VAL_, Gorgon::NumericProperty, interactive, valuemapping >, T_ > *Object) | |
T_ | operator* (const T_ &v) const |
T_ | operator*= (const O_ &v) |
T_ | operator+ (const T_ &v) const |
T_ | operator++ () |
T_ | operator++ (int) |
T_ | operator+= (const T_ &v) |
T_ | operator- (const T_ &v) const |
T_ | operator-- () |
T_ | operator-- (int) |
T_ | operator-= (const T_ &v) |
T_ | operator/ (const T_ &v) const |
T_ | operator/= (const O_ &v) |
bool | operator< (const T_ &v) const |
bool | operator<= (const T_ &v) const |
NumericProperty & | operator= (const NumericProperty &other) |
NumericProperty & | operator= (const Property< AC_, O_, G_, S_ > &prop) |
NumericProperty & | operator= (const T_ &value) |
NumericProperty & | operator= (NumericProperty &&)=default |
bool | operator> (const T_ &v) const |
bool | operator>= (const T_ &v) const |
![]() | |
Property (const Property &)=delete | |
Property (Property &&)=default | |
Property (UI::internal::prophelper< SliderBase< T_, DIV_, VAL_, Gorgon::NumericProperty, interactive, valuemapping >, T_ > &Object) | |
Property (UI::internal::prophelper< SliderBase< T_, DIV_, VAL_, Gorgon::NumericProperty, interactive, valuemapping >, T_ > *Object) | |
T_ | Get () const |
operator const T_ () const | |
operator T_ () | |
bool | operator!= (const T_ &v) const |
T_ | operator* () const |
Property & | operator= (const O_ &value) |
Property & | operator= (const Property &)=delete |
Property & | operator= (const Property< AC_, T_, G_, S_ > &prop) |
Property & | operator= (const T_ &value) |
Property & | operator= (Property &&)=default |
bool | operator== (const T_ &v) const |
void | Set (const T_ &value) |
Public Attributes | |
NumericProperty< SliderBase, T_, &SliderBase::GetLargeChange, &SliderBase::SetLargeChange > | LargeChange |
Controls the amount of change on a large change action. More... | |
NumericProperty< SliderBase, T_, &SliderBase::GetMaximum, &SliderBase::SetMaximum > | Maximum |
This property controls the maximum value that the slider can have. More... | |
NumericProperty< SliderBase, T_, &SliderBase::GetRange, &SliderBase::SetRange > | Range |
This is used to show how much more the scroller can be scrolled. More... | |
NumericProperty< SliderBase, T_, &SliderBase::GetSmallChange, &SliderBase::SetSmallChange > | SmallChange |
Controls the amount of change on a small change action. More... | |
Event< Scrollbar, T_ > | ValueChanged |
This event is fired when the scroll is changed. More... | |
![]() | |
Event< Widget > | BoundsChangedEvent |
This event will be fired when the area that the widget occupies on its container is changed. More... | |
std::string | dbgname |
Event< Widget > | FocusEvent |
This event will be fired when the widget receives or looses focus. More... | |
Geometry::PointProperty< Widget, &Widget::getlocation, &Widget::move > | Location |
Geometry::SizeProperty< Widget, &Widget::getsize, &Widget::resize > | Size |
Protected Member Functions | |
virtual bool | allowfocus () const override |
Should return true if the widget can be focused. More... | |
virtual void | valuechanged (T_ value) override |
![]() | |
virtual bool | Activate () override |
Activates the widget. More... | |
std::enable_if< vm==internal::SliderValueMapping::ValueAndRange, T_ >::type | actualmax () |
std::enable_if< vm !=internal::SliderValueMapping::ValueAndRange, T_ >::type | actualmax () |
virtual bool | allowfocus () const override |
Should return true if the widget can be focused. More... | |
void | DisableSmoothChange () |
Disables smooth change. More... | |
T_ | get () const |
Returns the value in the box. More... | |
T_ | GetLargeChange () const |
Returns the amount of change on a large change action. More... | |
T_ | GetMaximum () const |
Returns the current maximum value. More... | |
T_ | GetMinimum () const |
Returns the current minimum value. More... | |
T_ | GetRange () const |
Returns the range the container can display. More... | |
T_ | GetSmallChange () const |
Returns the amount of change on a small change action. More... | |
T_ | GetSmoothChangeSpeed () const |
Returns the smooth change speed. More... | |
float | GetSmoothChangeSpeedRatio () const |
Returns the smooth change in ratio to the maximum. More... | |
T_ | GetValue () const |
Gets the current value of the slider. More... | |
bool | IsSmoothChangeEnabled () const |
Returns if the smooth change is enabled. More... | |
operator T_ () const | |
Returns the current value of the slider. More... | |
SliderBase & | operator= (T_ value) |
Sets the current value of the slider. More... | |
virtual void | refreshvalue (bool instant=false) |
void | set (const T_ &val) |
Changes the value in the box. More... | |
void | SetLargeChange (const T_ &value) |
Sets the amount of change on a large change action. More... | |
void | SetLimits (T_ min, T_ max, bool exchange=true) |
Sets minimum and maximum limits. More... | |
void | SetMaximum (const T_ &value) |
Sets the maximum value that this slider reaches up to. More... | |
void | SetMinimum (const T_ &value) |
Sets the minimum value that this slider reaches up to. More... | |
void | SetRange (const T_ &value) |
Sets the range the container can display. More... | |
void | SetSmallChange (const T_ &value) |
Sets the amount of change on a small change action. More... | |
void | SetSmoothChangeSpeed (T_ value) |
Adjusts the smooth change speed. More... | |
void | SetSmoothChangeSpeedRatio (float value) |
Adjusts the smooth change speed. More... | |
bool | setval (T_ val, bool instant=false) |
void | SetValue (const T_ &value, bool instant=false) |
Sets the current value of the slider. More... | |
![]() | |
virtual void | addto (Layer &layer) override |
When called, widget should locate itself on to this layer. More... | |
virtual void | focused () override |
This is called after the focus is transferred to this widget. More... | |
virtual void | focuslost () override |
This is called after the focus is lost. More... | |
virtual void | parentenabledchanged (bool state) override |
This function is called when the parent's enabled state changes. More... | |
virtual void | removed () override |
Called after this widget is removed from its parent. More... | |
virtual void | removefrom (Layer &layer) override |
When called, widget should remove itself from the given layer. More... | |
virtual void | setlayerorder (Layer &, int order) override |
When called, widget should reorder itself in layer hierarchy. More... | |
![]() | |
virtual void | addedto (WidgetContainer &container) |
Called when this widget added to the given container. More... | |
virtual bool | addingto (WidgetContainer &) |
Called when it is about to be added to the given container. More... | |
virtual void | boundschanged () |
Call this function when the widget bounds is changed. More... | |
virtual bool | canloosefocus () const |
Should return true if the widget can loose the focus right now. More... | |
virtual void | displaced () |
Call this function when the widget container causes it to be displaced. More... | |
virtual bool | removingfrom () |
Called before this widget is removed from its parent. More... | |
This widget is a scrollbar.
It is basically a slider without ticks and potentially has buttons to adjust value. This widget has no ability to provide scroll capability to another widget automatically. Therefore, it has no additional capability on top of slider.
Scrollbar orientation is controlled by its template. You may use HScrollbar and VScrollbar to denote the orientation. Additionally, these variants have their type fixed to int.
|
explicit |
|
explicit |
|
explicit |
Scrollbar | ( | const UI::Template & | temp, |
T_ | cur, | ||
T_ | max | ||
) |
References Template::GetSpacing().
|
overrideprotectedvirtual |
Should return true if the widget can be focused.
Reimplemented from Widget.
void DisableSmoothChange |
Disables smooth change.
T_ GetLargeChange |
Returns the amount of change on a large change action.
This action could be click of arrow buttons, keyboard keys or mouse scroll.
T_ GetMaximum |
Returns the current maximum value.
T_ GetRange |
Returns the range the container can display.
This is used to show how much more the scroller can be scrolled.
T_ GetSmallChange |
Returns the amount of change on a small change action.
This action could be click of bar or keyboard keys (page up/down)
T_ GetSmoothChangeSpeed |
Returns the smooth change speed.
If smooth change is disabled, this value will be 0.
float GetSmoothChangeSpeedRatio |
Returns the smooth change in ratio to the maximum.
1 means full progress will be done in 1 second.
T_ GetValue |
Gets the current value of the slider.
bool IsSmoothChangeEnabled |
Returns if the smooth change is enabled.
void SetLargeChange |
Sets the amount of change on a large change action.
This action could be click of bar or keyboard keys (page up/down).
void SetMaximum |
Sets the maximum value that this slider reaches up to.
If equal to minimum, progress will display 0.
void SetRange |
Sets the range the container can display.
This is used to show how much more the scroller can be scrolled.
void SetSmallChange |
Sets the amount of change on a small change action.
This action could be click of arrow buttons, keyboard keys or mouse scroll.
void SetSmoothChangeSpeed |
Adjusts the smooth change speed.
Given value is in values per second, default value is max and will be sync to the maximum value.
void SetSmoothChangeSpeedRatio |
Adjusts the smooth change speed.
Given value is in values per second, default value is 1 and will be sync to the maximum value.
void SetValue |
Sets the current value of the slider.
If instant is set to true, the value will be set instantly without any animations.
|
overrideprotectedvirtual |
NumericProperty<SliderBase, T_, &SliderBase::GetLargeChange, &SliderBase::SetLargeChange> LargeChange |
Controls the amount of change on a large change action.
This action could be click of bar or keyboard keys (page up/down).
NumericProperty<SliderBase, T_, &SliderBase::GetMaximum, &SliderBase::SetMaximum> Maximum |
This property controls the maximum value that the slider can have.
This is used to show how much more the scroller can be scrolled.
NumericProperty<SliderBase, T_, &SliderBase::GetSmallChange, &SliderBase::SetSmallChange> SmallChange |
Controls the amount of change on a small change action.
This action could be click of arrow buttons, keyboard keys or mouse scroll.