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

Base class for windows (widgets with a border and a title bar) More...

#include <Window.h>

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

List of all members.

Public Member Functions

PLGUI_API Window (Widget *pParent=nullptr)
 Constructor.
virtual PLGUI_API ~Window ()
 Destructor.
PLGUI_API PLCore::uint32 GetSystemButtons () const
 Get system buttons.
PLGUI_API void SetSystemButtons (PLCore::uint32 nButtons)
 Set system buttons.
PLGUI_API bool GetShowTitleBar () const
 Check if a title bar is displayed.
PLGUI_API void SetShowTitleBar (bool bVisible)
 Set if a title bar is displayed.
PLGUI_API bool GetShowBorder () const
 Check if a border is displayed.
PLGUI_API void SetShowBorder (bool bVisible)
 Set if a border is displayed.
PLGUI_API bool GetResizable () const
 Check if the window is resizable.
PLGUI_API void SetResizable (bool bResizable)
 Set if the window is resizable.
PLGUI_API PLMath::Vector2i GetMinSize () const
 Get minimum size for resizing.
PLGUI_API void SetMinSize (const PLMath::Vector2i &vSize)
 Set minimum size for resizing.
PLGUI_API PLMath::Vector2i GetMaxSize () const
 Get maximum size for resizing.
PLGUI_API void SetMaxSize (const PLMath::Vector2i &vSize)
 Set maximum size for resizing.

Protected Member Functions

virtual PLGUI_API void OnDraw (Graphics &cGraphics) override
 Called to draw the widget.
virtual PLGUI_API void OnAdjustContent () override
 Called when the widget content has to be adjusted.
virtual PLGUI_API void OnWindowState (EWindowState nWindowState) override
 Called when the window state has changed.
virtual PLGUI_API void OnEnterFullscreen () override
 Called when fullscreen mode is activated.
virtual PLGUI_API void OnLeaveFullscreen () override
 Called when fullscreen mode is deactivated.
virtual PLGUI_API void OnActivate (bool bActivate) override
 Called when the widget has been activated or deactivated (focus has changed)
virtual PLGUI_API void OnMove (const PLMath::Vector2i &vPos) override
 Called when the widget gets moved.
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 OnMousePosUpdate (const PLMath::Vector2i &vPos) override
 Called when the mouse position inside the widget has changed.
virtual PLGUI_API void OnMouseLeave () override
 Called when the mouse has left the widget.
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.
virtual PLGUI_API void OnMouseButtonDoubleClick (PLCore::uint32 nButton, const PLMath::Vector2i &vPos) override
 Called when a mouse button is double-clicked.

Protected Attributes

PLCore::uint32 m_nSystemButtons
bool m_bShowTitleBar
bool m_bShowBorder
bool m_bResizable
PLMath::Vector2i m_vMinSize
PLMath::Vector2i m_vMaxSize
SystemButtonm_pSysButtonMinimize
SystemButtonm_pSysButtonMaximize
SystemButtonm_pSysButtonClose
PLMath::Vector2i m_vPos
PLMath::Vector2i m_vMousePos
bool m_bMouseTitle
bool m_bMouseLeft
bool m_bMouseRight
bool m_bMouseTop
bool m_bMouseBottom
bool m_bMove
bool m_bSizeXLeft
bool m_bSizeXRight
bool m_bSizeYTop
bool m_bSizeYBottom

Detailed Description

Base class for windows (widgets with a border and a title bar)


Constructor & Destructor Documentation

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

Constructor.

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

Destructor.


Member Function Documentation

PLGUI_API PLCore::uint32 PLGui::Window::GetSystemButtons ( ) const

Get system buttons.

Returns:
Flags describing the displayed system buttons
PLGUI_API void PLGui::Window::SetSystemButtons ( PLCore::uint32  nButtons)

Set system buttons.

Parameters:
[in]nButtonsFlags describing the displayed system buttons
PLGUI_API bool PLGui::Window::GetShowTitleBar ( ) const

Check if a title bar is displayed.

Returns:
'true' if title bar is visible, else 'false'
PLGUI_API void PLGui::Window::SetShowTitleBar ( bool  bVisible)

Set if a title bar is displayed.

Parameters:
[in]bVisible'true' if title bar is visible, else 'false'
PLGUI_API bool PLGui::Window::GetShowBorder ( ) const

Check if a border is displayed.

Returns:
'true' if border is visible, else 'false'
PLGUI_API void PLGui::Window::SetShowBorder ( bool  bVisible)

Set if a border is displayed.

Parameters:
[in]bVisible'true' if border is visible, else 'false'
PLGUI_API bool PLGui::Window::GetResizable ( ) const

Check if the window is resizable.

Returns:
'true' if window is resizable, else 'false'
PLGUI_API void PLGui::Window::SetResizable ( bool  bResizable)

Set if the window is resizable.

Parameters:
[in]bResizable'true' if window is resizable, else 'false'

Get minimum size for resizing.

Returns:
Size
PLGUI_API void PLGui::Window::SetMinSize ( const PLMath::Vector2i vSize)

Set minimum size for resizing.

Parameters:
[in]vSizeSize

Get maximum size for resizing.

Returns:
Size
PLGUI_API void PLGui::Window::SetMaxSize ( const PLMath::Vector2i vSize)

Set maximum size for resizing.

Parameters:
[in]vSizeSize
virtual PLGUI_API void PLGui::Window::OnDraw ( Graphics cGraphics) [override, protected, virtual]

Called to draw the widget.

Parameters:
[in]cGraphicsGraphics object used for painting

Reimplemented from PLGui::WidgetFunctions.

virtual PLGUI_API void PLGui::Window::OnAdjustContent ( ) [override, protected, virtual]

Called when the widget content has to be adjusted.

Reimplemented from PLGui::ContainerWidget.

virtual PLGUI_API void PLGui::Window::OnWindowState ( EWindowState  nWindowState) [override, protected, virtual]

Called when the window state has changed.

Parameters:
[in]nWindowStateWindow state

Reimplemented from PLGui::WidgetFunctions.

virtual PLGUI_API void PLGui::Window::OnEnterFullscreen ( ) [override, protected, virtual]

Called when fullscreen mode is activated.

Reimplemented from PLGui::WidgetFunctions.

virtual PLGUI_API void PLGui::Window::OnLeaveFullscreen ( ) [override, protected, virtual]

Called when fullscreen mode is deactivated.

Reimplemented from PLGui::WidgetFunctions.

virtual PLGUI_API void PLGui::Window::OnActivate ( bool  bActivate) [override, protected, virtual]

Called when the widget has been activated or deactivated (focus has changed)

Parameters:
[in]bActivate'true' if the widget itself or one of it's child widgets had the focus, else 'false'

Reimplemented from PLGui::WidgetFunctions.

virtual PLGUI_API void PLGui::Window::OnMove ( const PLMath::Vector2i vPos) [override, protected, virtual]

Called when the widget gets moved.

Parameters:
[in]vPosPosition

Reimplemented from PLGui::WidgetFunctions.

virtual PLGUI_API void PLGui::Window::OnMouseMove ( const PLMath::Vector2i vPos) [override, protected, 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::Window::OnMousePosUpdate ( const PLMath::Vector2i vPos) [override, protected, virtual]

Called when the mouse position inside the widget has changed.

Parameters:
[in]vPosMouse position within the widget
Remarks:
This function is called, when the mouse position inside the widget has changed without the user moving the mouse. This is the case e.g. when the widget has been moved while the mouse was inside. Usually, you should only need OnMouseMove() to react on mouse movements, but when implementing widget movement, you must also react on OnMousePosUpdate() to update the new mouse position without doing any action. This is especially important in order to let several Widget-Modifiers work together without interfering each other.

Reimplemented from PLGui::WidgetFunctions.

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

Called when the mouse has left the widget.

Reimplemented from PLGui::WidgetFunctions.

virtual PLGUI_API void PLGui::Window::OnMouseButtonDown ( PLCore::uint32  nButton,
const PLMath::Vector2i vPos 
) [override, protected, 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::Window::OnMouseButtonUp ( PLCore::uint32  nButton,
const PLMath::Vector2i vPos 
) [override, protected, 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.

virtual PLGUI_API void PLGui::Window::OnMouseButtonDoubleClick ( PLCore::uint32  nButton,
const PLMath::Vector2i vPos 
) [override, protected, virtual]

Called when a mouse button is double-clicked.

Parameters:
[in]nButtonMouse button that is double-clicked
[in]vPosMouse position within the widget

Reimplemented from PLGui::WidgetFunctions.


Member Data Documentation

PLCore::uint32 PLGui::Window::m_nSystemButtons [protected]

System buttons that are available in this window

Show title of window?

bool PLGui::Window::m_bShowBorder [protected]

Show window border?

bool PLGui::Window::m_bResizable [protected]

Is window resizable?

Minimum size for resizing

Maximum size for resizing

System button to minimize the window size

System button to maximize or restore the window size

System button to close the window

Current widget position

Reimplemented from PLGui::Widget.

Current mouse position

bool PLGui::Window::m_bMouseTitle [protected]

Is the mouse position on the title bar?

bool PLGui::Window::m_bMouseLeft [protected]

Is the mouse position on the left border?

bool PLGui::Window::m_bMouseRight [protected]

Is the mouse position on the right border?

bool PLGui::Window::m_bMouseTop [protected]

Is the mouse position on the top border?

Is the mouse position on the bottom border?

bool PLGui::Window::m_bMove [protected]

Is the window currently moved?

bool PLGui::Window::m_bSizeXLeft [protected]

Is the window currently sized (left border)?

bool PLGui::Window::m_bSizeXRight [protected]

Is the window currently sized (right border)?

bool PLGui::Window::m_bSizeYTop [protected]

Is the window currently sized (top border)?

Is the window currently sized (bottom border)?


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


PixelLight PixelLight 0.9.10-R1
Copyright (C) 2002-2011 by The PixelLight Team
Last modified Fri Dec 23 2011 15:51:19
The content of this PixelLight document is published under the
Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported