PixelLightAPI
.
|
Scroll bar widget. More...
#include <ScrollBar.h>
Classes | |
struct | SScrollBarButton |
Scroll bar button. More... | |
struct | SScrollBarSlider |
Scroll bar slider. More... | |
Public Member Functions | |
PLGUI_API | ScrollBar (Widget *pParent=nullptr) |
Constructor. | |
virtual PLGUI_API | ~ScrollBar () |
Destructor. | |
PLGUI_API EOrientation | GetOrientation () const |
Get orientation. | |
PLGUI_API void | SetOrientation (EOrientation nOrientation) |
Set orientation. | |
virtual PLGUI_API void | OnDraw (Graphics &cGraphics) override |
Called to draw the widget. | |
virtual PLGUI_API PLMath::Vector2i | OnPreferredSize (const PLMath::Vector2i &vRefSize) const override |
Called when the widget is to calculate it's preferred size. | |
virtual PLGUI_API void | OnDisable () override |
Called when the widget gets disabled. | |
virtual PLGUI_API void | OnMouseLeave () override |
Called when the mouse has left the widget. | |
virtual PLGUI_API void | OnMouseMove (const PLMath::Vector2i &vPos) override |
Called when the mouse is moved within the widget or captured by it. | |
virtual PLGUI_API void | OnMouseButtonDown (PLCore::uint32 nButton, const PLMath::Vector2i &vPos) override |
Called when a mouse button is pressed. | |
virtual PLGUI_API void | OnMouseButtonUp (PLCore::uint32 nButton, const PLMath::Vector2i &vPos) override |
Called when a mouse button is released. | |
Protected Member Functions | |
virtual PLGUI_API void | OnChangeValue (int nValue) override |
Called when a new value has been set. | |
void | CalculateMinusButtonPos () |
Calculate position of minus button. | |
void | CalculatePlusButtonPos () |
Calculate position of plus button. | |
void | CalculateHandlePos () |
Calculate position of scrollbar handle. | |
PLCore::uint32 | GetMinusButtonState () |
Get widget state for the minus button. | |
PLCore::uint32 | GetPlusButtonState () |
Get widget state for the plus button. | |
PLCore::uint32 | GetHandleState () |
Get widget state for the handle. | |
void | CheckButtons (const PLMath::Vector2i &vPos, bool bSlider) |
Check if a button has been pressed. | |
void | OnTimer () |
Called when the timer has fired. | |
Protected Attributes | |
EOrientation | m_nOrientation |
PLCore::uint64 | m_nRepeatInterval |
SScrollBarButton | m_sButtonMinus |
SScrollBarButton | m_sButtonPlus |
SScrollBarSlider | m_sHandle |
PLMath::Vector2i | m_vMousePos |
Timer | m_cTimer |
Scroll bar widget.
PLGUI_API PLGui::ScrollBar::ScrollBar | ( | Widget * | pParent = nullptr | ) |
Constructor.
[in] | pParent | Pointer to the parent widget |
virtual PLGUI_API PLGui::ScrollBar::~ScrollBar | ( | ) | [virtual] |
Destructor.
PLGUI_API EOrientation PLGui::ScrollBar::GetOrientation | ( | ) | const |
Get orientation.
PLGUI_API void PLGui::ScrollBar::SetOrientation | ( | EOrientation | nOrientation | ) |
Set orientation.
[in] | nOrientation | Orientation |
virtual PLGUI_API void PLGui::ScrollBar::OnChangeValue | ( | int | nValue | ) | [override, protected, virtual] |
Called when a new value has been set.
[in] | nValue | Value |
Reimplemented from PLGui::AbstractSlider.
virtual PLGUI_API void PLGui::ScrollBar::OnDraw | ( | Graphics & | cGraphics | ) | [override, virtual] |
Called to draw the widget.
[in] | cGraphics | Graphics object used for painting |
Reimplemented from PLGui::WidgetFunctions.
virtual PLGUI_API PLMath::Vector2i PLGui::ScrollBar::OnPreferredSize | ( | const PLMath::Vector2i & | vRefSize | ) | const [override, virtual] |
Called when the widget is to calculate it's preferred size.
[in] | vRefSize | Precalculated reference size, can be (-1, -1) if no reference size is available |
Reimplemented from PLGui::Widget.
virtual PLGUI_API void PLGui::ScrollBar::OnDisable | ( | ) | [override, virtual] |
Called when the widget gets disabled.
Reimplemented from PLGui::WidgetFunctions.
virtual PLGUI_API void PLGui::ScrollBar::OnMouseLeave | ( | ) | [override, virtual] |
Called when the mouse has left the widget.
Reimplemented from PLGui::WidgetFunctions.
virtual PLGUI_API void PLGui::ScrollBar::OnMouseMove | ( | const PLMath::Vector2i & | vPos | ) | [override, virtual] |
Called when the mouse is moved within the widget or captured by it.
[in] | vPos | Mouse position within the widget |
Reimplemented from PLGui::WidgetFunctions.
virtual PLGUI_API void PLGui::ScrollBar::OnMouseButtonDown | ( | PLCore::uint32 | nButton, |
const PLMath::Vector2i & | vPos | ||
) | [override, virtual] |
Called when a mouse button is pressed.
[in] | nButton | Mouse button that is pressed |
[in] | vPos | Mouse position within the widget |
Reimplemented from PLGui::WidgetFunctions.
virtual PLGUI_API void PLGui::ScrollBar::OnMouseButtonUp | ( | PLCore::uint32 | nButton, |
const PLMath::Vector2i & | vPos | ||
) | [override, virtual] |
Called when a mouse button is released.
[in] | nButton | Mouse button that is released |
[in] | vPos | Mouse position within the widget |
Reimplemented from PLGui::WidgetFunctions.
void PLGui::ScrollBar::CalculateMinusButtonPos | ( | ) | [protected] |
Calculate position of minus button.
void PLGui::ScrollBar::CalculatePlusButtonPos | ( | ) | [protected] |
Calculate position of plus button.
void PLGui::ScrollBar::CalculateHandlePos | ( | ) | [protected] |
Calculate position of scrollbar handle.
PLCore::uint32 PLGui::ScrollBar::GetMinusButtonState | ( | ) | [protected] |
Get widget state for the minus button.
PLCore::uint32 PLGui::ScrollBar::GetPlusButtonState | ( | ) | [protected] |
Get widget state for the plus button.
PLCore::uint32 PLGui::ScrollBar::GetHandleState | ( | ) | [protected] |
Get widget state for the handle.
void PLGui::ScrollBar::CheckButtons | ( | const PLMath::Vector2i & | vPos, |
bool | bSlider | ||
) | [protected] |
Check if a button has been pressed.
[in] | vPos | Mouse position |
[in] | bSlider | Allow selection of slider? |
void PLGui::ScrollBar::OnTimer | ( | ) | [protected] |
Called when the timer has fired.
EOrientation PLGui::ScrollBar::m_nOrientation [protected] |
Scrollbar orientation
PLCore::uint64 PLGui::ScrollBar::m_nRepeatInterval [protected] |
Interval (in ms) between repeated clicks
SScrollBarButton PLGui::ScrollBar::m_sButtonMinus [protected] |
Button 'minus'
SScrollBarButton PLGui::ScrollBar::m_sButtonPlus [protected] |
Button 'plus'
SScrollBarSlider PLGui::ScrollBar::m_sHandle [protected] |
Handle
PLMath::Vector2i PLGui::ScrollBar::m_vMousePos [protected] |
Last mouse position
Timer PLGui::ScrollBar::m_cTimer [protected] |
Timer for repeated clicks
|