PixelLightAPI  .
Classes | Public Member Functions | Protected Member Functions | Protected Attributes
PLGui::Slider Class Reference

Slider widget. More...

#include <Slider.h>

Inheritance diagram for PLGui::Slider:
Inheritance graph
[legend]

List of all members.

Classes

struct  SSliderHandle
 Slider handle. More...

Public Member Functions

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 CalculateHandlePos ()
 Calculate position of slider handle.
PLCore::uint32 GetHandleState ()
 Get widget state for the handle.
void CheckButtons (const PLMath::Vector2i &vPos)
 Check if a button has been pressed.

Protected Attributes

EOrientation m_nOrientation
SSliderHandle m_sHandle
PLMath::Vector2i m_vMousePos

Detailed Description

Slider widget.


Member Function Documentation

virtual PLGUI_API void PLGui::Slider::OnChangeValue ( int  nValue) [override, protected, virtual]

Called when a new value has been set.

Parameters:
[in]nValueValue

Reimplemented from PLGui::AbstractSlider.

virtual PLGUI_API void PLGui::Slider::OnDraw ( Graphics cGraphics) [override, virtual]

Called to draw the widget.

Parameters:
[in]cGraphicsGraphics object used for painting

Reimplemented from PLGui::WidgetFunctions.

virtual PLGUI_API PLMath::Vector2i PLGui::Slider::OnPreferredSize ( const PLMath::Vector2i vRefSize) const [override, virtual]

Called when the widget is to calculate it's preferred size.

Parameters:
[in]vRefSizePrecalculated reference size, can be (-1, -1) if no reference size is available
Returns:
Preferred size
Remarks:
If the widget returns -1 in a component (X/Y), it means that there is no preferred size in that direction. A layout will in that case use 'as much space as possible', while the FitSize() functions will use the current size.

Reimplemented from PLGui::Widget.

virtual PLGUI_API void PLGui::Slider::OnDisable ( ) [override, virtual]

Called when the widget gets disabled.

Reimplemented from PLGui::WidgetFunctions.

virtual PLGUI_API void PLGui::Slider::OnMouseLeave ( ) [override, virtual]

Called when the mouse has left the widget.

Reimplemented from PLGui::WidgetFunctions.

virtual PLGUI_API void PLGui::Slider::OnMouseMove ( const PLMath::Vector2i vPos) [override, virtual]

Called when the mouse is moved within the widget or captured by it.

Parameters:
[in]vPosMouse position within the widget

Reimplemented from PLGui::WidgetFunctions.

virtual PLGUI_API void PLGui::Slider::OnMouseButtonDown ( PLCore::uint32  nButton,
const PLMath::Vector2i vPos 
) [override, virtual]

Called when a mouse button is pressed.

Parameters:
[in]nButtonMouse button that is pressed
[in]vPosMouse position within the widget

Reimplemented from PLGui::WidgetFunctions.

virtual PLGUI_API void PLGui::Slider::OnMouseButtonUp ( PLCore::uint32  nButton,
const PLMath::Vector2i vPos 
) [override, virtual]

Called when a mouse button is released.

Parameters:
[in]nButtonMouse button that is released
[in]vPosMouse position within the widget

Reimplemented from PLGui::WidgetFunctions.

void PLGui::Slider::CalculateHandlePos ( ) [protected]

Calculate position of slider handle.

PLCore::uint32 PLGui::Slider::GetHandleState ( ) [protected]

Get widget state for the handle.

Returns:
Widget state of handle (combination of EWidgetState values)
void PLGui::Slider::CheckButtons ( const PLMath::Vector2i vPos) [protected]

Check if a button has been pressed.

Parameters:
[in]vPosMouse position

Member Data Documentation

Scrollbar orientation

Handle

Last mouse position


The documentation for this class was generated from the following file:


PixelLight PixelLight 0.9.11-R1
Copyright (C) 2002-2012 by The PixelLight Team
Last modified Thu Feb 23 2012 14:09:33
The content of this PixelLight document is published under the
Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported