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

Container widget that splits an area into two sides. More...

#include <Splitter.h>

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

List of all members.

Public Member Functions

PLGUI_API Splitter (Widget *pParent=nullptr)
 Constructor.
virtual PLGUI_API ~Splitter ()
 Destructor.
PLGUI_API EOrientation GetOrientation () const
 Get orientation.
PLGUI_API void SetOrientation (EOrientation nOrientation)
 Set orientation.
PLGUI_API bool GetSizable () const
 Check if size can be altered by the user.
PLGUI_API void SetSizable (bool bSizable)
 Set if size can be altered by the user.
PLGUI_API const SizeHintGetSizeLeft () const
 Get size of left (or top) side.
PLGUI_API void SetSizeLeft (const SizeHint &cSize)
 Set size of left (or top) side.
PLGUI_API const SizeHintGetSizeRight () const
 Get size of right (or bottom) side.
PLGUI_API void SetSizeRight (const SizeHint &cSize)
 Set size of right (or bottom) side.
PLGUI_API WidgetGetSide (ESide nSide) const
 Get content widget of a given side.
virtual PLGUI_API WidgetGetContentWidget () const
 Get content widget.
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 OnAdjustContent () override
 Called when the widget content has to be adjusted.
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

PLGUI_API void ChangeSize (int nDelta)
 Change size of content widgets.

Protected Attributes

EOrientation m_nOrientation
bool m_bSizable
SizeHint m_cSizeLeft
SizeHint m_cSizeRight
Widgetm_pContentLeft
Widgetm_pContentRight
PLMath::Vector2i m_vMousePos
bool m_bSizing

Detailed Description

Container widget that splits an area into two sides.


Constructor & Destructor Documentation

PLGUI_API PLGui::Splitter::Splitter ( Widget pParent = nullptr)

Constructor.

Parameters:
[in]pParentPointer to parent widget
virtual PLGUI_API PLGui::Splitter::~Splitter ( ) [virtual]

Destructor.


Member Function Documentation

Get orientation.

Returns:
Orientation
PLGUI_API void PLGui::Splitter::SetOrientation ( EOrientation  nOrientation)

Set orientation.

Parameters:
[in]nOrientationOrientation
PLGUI_API bool PLGui::Splitter::GetSizable ( ) const

Check if size can be altered by the user.

Returns:
'true' if sizable, else 'false'
PLGUI_API void PLGui::Splitter::SetSizable ( bool  bSizable)

Set if size can be altered by the user.

Parameters:
[in]bSizable'true' if sizable, else 'false'
PLGUI_API const SizeHint& PLGui::Splitter::GetSizeLeft ( ) const

Get size of left (or top) side.

Returns:
Size hint
PLGUI_API void PLGui::Splitter::SetSizeLeft ( const SizeHint cSize)

Set size of left (or top) side.

Parameters:
[in]cSizeSize hint
PLGUI_API const SizeHint& PLGui::Splitter::GetSizeRight ( ) const

Get size of right (or bottom) side.

Returns:
Size hint
PLGUI_API void PLGui::Splitter::SetSizeRight ( const SizeHint cSize)

Set size of right (or bottom) side.

Parameters:
[in]cSizeSize hint
PLGUI_API Widget* PLGui::Splitter::GetSide ( ESide  nSide) const

Get content widget of a given side.

Parameters:
[in]nSideSide
Returns:
Content widget
Remarks:
A splitter has exactly two content widgets. The first is retrieved with SideLeft or SideTop, the second with SideRight or SideBottom.
virtual PLGUI_API Widget* PLGui::Splitter::GetContentWidget ( ) const [virtual]

Get content widget.

Returns:
Content widget
Remarks:
A splitter has actually two content widgets, this function returns the first one. See GetSide() for retrieving both content widgets.

Reimplemented from PLGui::Widget.

virtual PLGUI_API void PLGui::Splitter::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::Splitter::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::Splitter::OnAdjustContent ( ) [override, virtual]

Called when the widget content has to be adjusted.

Reimplemented from PLGui::Widget.

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

Called when the mouse has left the widget.

Reimplemented from PLGui::WidgetFunctions.

virtual PLGUI_API void PLGui::Splitter::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::Splitter::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::Splitter::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.

PLGUI_API void PLGui::Splitter::ChangeSize ( int  nDelta) [protected]

Change size of content widgets.

Parameters:
[in]nDeltaMovement delta (in pixels)

Member Data Documentation

Orientation

bool PLGui::Splitter::m_bSizable [protected]

Is the widget sizable?

Size of left (or top) container

Size of right (or bottom) container

Inner widget for the left/top side

Inner widget for the right/bottom side

Current mouse position

bool PLGui::Splitter::m_bSizing [protected]

Are we currently changing the size?


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