PixelLightAPI  .
Public Member Functions | Protected Member Functions
PLGui::WidgetFunctions Class Reference

Widget functions base class. More...

#include <WidgetFunctions.h>

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

List of all members.

Public Member Functions

PLGUI_API WidgetFunctions ()
 Constructor.
virtual PLGUI_API ~WidgetFunctions ()
 Destructor.

Protected Member Functions

virtual PLGUI_API void OnMessage (const GuiMessage &cMessage)
 Process GUI message.
virtual PLGUI_API void OnThemeChanged ()
 Called when the theme has been changed.
virtual PLGUI_API void OnUpdateContent ()
 Called when the widget has been changed.
virtual PLGUI_API void OnUpdateChildWidget (Widget *pWidget)
 Called when a child widget has been changed.
virtual PLGUI_API void OnAddChildWidget (Widget *pWidget)
 Called when a child window has been added.
virtual PLGUI_API void OnRemoveChildWidget (Widget *pWidget)
 Called when a child window has been removed.
virtual PLGUI_API void OnClose ()
 Called when the widget shall be closed.
virtual PLGUI_API void OnCreate ()
 Called after the widget has been created.
virtual PLGUI_API void OnDestroy ()
 Called before the widget is destroyed.
virtual PLGUI_API void OnShow ()
 Called when the widget is shown.
virtual PLGUI_API void OnHide ()
 Called when the widget gets hidden.
virtual PLGUI_API void OnEnable ()
 Called when the widget is enabled.
virtual PLGUI_API void OnDisable ()
 Called when the widget gets disabled.
virtual PLGUI_API void OnGetFocus ()
 Called when the widget gets the keyboard focus.
virtual PLGUI_API void OnLooseFocus ()
 Called when the widget looses the keyboard focus.
virtual PLGUI_API void OnActivate (bool bActivate)
 Called when the widget has been activated or deactivated (focus has changed)
virtual PLGUI_API void OnDrawBackground (Graphics &cGraphics)
 Called to draw the widget background.
virtual PLGUI_API void OnDraw (Graphics &cGraphics)
 Called to draw the widget.
virtual PLGUI_API void OnMove (const PLMath::Vector2i &vPos)
 Called when the widget gets moved.
virtual PLGUI_API void OnSize (const PLMath::Vector2i &vSize)
 Called when the widget gets resized.
virtual PLGUI_API void OnWindowState (EWindowState nWindowState)
 Called when the window state has changed.
virtual PLGUI_API void OnEnterFullscreen ()
 Called when fullscreen mode is activated.
virtual PLGUI_API void OnLeaveFullscreen ()
 Called when fullscreen mode is deactivated.
virtual PLGUI_API PLMath::Vector2i OnPreferredSize (const PLMath::Vector2i &vRefSize) const
 Called when the widget is to calculate it's preferred size.
virtual PLGUI_API void OnAdjustContent ()
 Called when the widget content has to be adjusted.
virtual PLGUI_API void OnMouseEnter ()
 Called when the mouse has entered the widget.
virtual PLGUI_API void OnMouseLeave ()
 Called when the mouse has left the widget.
virtual PLGUI_API void OnMouseOver (bool bMouseOver)
 Called when the mouse-over state of the widget has changed.
virtual PLGUI_API void OnMouseMove (const PLMath::Vector2i &vPos)
 Called when the mouse is moved within the widget or captured by it.
virtual PLGUI_API void OnMouseHover ()
 Called when the mouse hovers over the widget.
virtual PLGUI_API void OnMousePosUpdate (const PLMath::Vector2i &vPos)
 Called when the mouse position inside the widget has changed.
virtual PLGUI_API void OnMouseButtonDown (PLCore::uint32 nButton, const PLMath::Vector2i &vPos)
 Called when a mouse button is pressed.
virtual PLGUI_API void OnMouseButtonUp (PLCore::uint32 nButton, const PLMath::Vector2i &vPos)
 Called when a mouse button is released.
virtual PLGUI_API void OnMouseButtonClick (PLCore::uint32 nButton, const PLMath::Vector2i &vPos)
 Called when a mouse button is clicked.
virtual PLGUI_API void OnMouseButtonDoubleClick (PLCore::uint32 nButton, const PLMath::Vector2i &vPos)
 Called when a mouse button is double-clicked.
virtual PLGUI_API void OnMouseWheel (int nDelta)
 Called when the mouse wheel is used.
virtual PLGUI_API void OnKeyDown (PLCore::uint32 nKey, PLCore::uint32 nModifiers)
 Called when a key was pressed.
virtual PLGUI_API void OnKeyUp (PLCore::uint32 nKey, PLCore::uint32 nModifiers)
 Called when a key was released.
virtual PLGUI_API void OnHotkey (PLCore::uint32 nHotkey)
 Called when a hotkey was pressed.
virtual PLGUI_API void OnDrop (const DataObject &cData)
 Called when data has been dropped onto the widget.
virtual PLGUI_API void OnUserMessage (PLCore::uint32 nData, void *pDataPtr)
 Called when a user defined message has been sent.

Detailed Description

Widget functions base class.

Remarks:
This base class is used for classes, that respond to widget events, such as Widget itself and Modifier

Constructor & Destructor Documentation

Constructor.

virtual PLGUI_API PLGui::WidgetFunctions::~WidgetFunctions ( ) [virtual]

Destructor.


Member Function Documentation

virtual PLGUI_API void PLGui::WidgetFunctions::OnMessage ( const GuiMessage cMessage) [protected, virtual]

Process GUI message.

Parameters:
[in]cMessageGUI message
Remarks:
Usually, you should not override this method, but rather use the virtual functions that are called after a specific message arrived (e.g. OnShow(), OnClose() etc.). If you decide to override this method, make sure to call the base implementation first, otherwise the messages will not be processed and no virtual functions or events will be called anymore.

Reimplemented in PLGui::Widget, and PLGui::Modifier.

virtual PLGUI_API void PLGui::WidgetFunctions::OnThemeChanged ( ) [protected, virtual]

Called when the theme has been changed.

Remarks:
This event is caused, when the widget gets a new theme. Use this to perform all tasks necessary to adjust to the new theme, e.g. resizing certain child widgets or redrawing the widget.

Reimplemented in PLGui::Widget, and PLGui::ContainerWidget.

virtual PLGUI_API void PLGui::WidgetFunctions::OnUpdateContent ( ) [protected, virtual]

Called when the widget has been changed.

Remarks:
This event is caused, when the widget calls UpdateContent() to indicate that the widget has been changed in a way that could affect it's size or appearance. This is used to perform an AdjustContent() on the parent widget, whenever the size of a child widget could have been altered.

Reimplemented in PLGui::Widget.

virtual PLGUI_API void PLGui::WidgetFunctions::OnUpdateChildWidget ( Widget pWidget) [protected, virtual]

Called when a child widget has been changed.

Remarks:
After an UpdateContent()-event has been called on a widget, it will cause an UpdateChildWidget()-event on it's parent widget. See OnUpdateContent() for further detail on UpdateContent()-events.
virtual PLGUI_API void PLGui::WidgetFunctions::OnAddChildWidget ( Widget pWidget) [protected, virtual]

Called when a child window has been added.

Parameters:
[in]pWidgetWidget
virtual PLGUI_API void PLGui::WidgetFunctions::OnRemoveChildWidget ( Widget pWidget) [protected, virtual]

Called when a child window has been removed.

Parameters:
[in]pWidgetWidget
virtual PLGUI_API void PLGui::WidgetFunctions::OnClose ( ) [protected, virtual]

Called when the widget shall be closed.

Reimplemented in PLGui::Dialog, and PLGui::ModClose.

virtual PLGUI_API void PLGui::WidgetFunctions::OnCreate ( ) [protected, virtual]

Called after the widget has been created.

virtual PLGUI_API void PLGui::WidgetFunctions::OnDestroy ( ) [protected, virtual]

Called before the widget is destroyed.

virtual PLGUI_API void PLGui::WidgetFunctions::OnShow ( ) [protected, virtual]

Called when the widget is shown.

Reimplemented in PLGui::ModTimeout.

virtual PLGUI_API void PLGui::WidgetFunctions::OnHide ( ) [protected, virtual]

Called when the widget gets hidden.

virtual PLGUI_API void PLGui::WidgetFunctions::OnEnable ( ) [protected, virtual]

Called when the widget is enabled.

virtual PLGUI_API void PLGui::WidgetFunctions::OnDisable ( ) [protected, virtual]

Called when the widget gets disabled.

Reimplemented in PLGui::AbstractButton, PLGui::ScrollBar, and PLGui::Slider.

virtual PLGUI_API void PLGui::WidgetFunctions::OnGetFocus ( ) [protected, virtual]

Called when the widget gets the keyboard focus.

Reimplemented in PLGui::AbstractButton, and PLGui::AbstractMenu.

virtual PLGUI_API void PLGui::WidgetFunctions::OnLooseFocus ( ) [protected, virtual]

Called when the widget looses the keyboard focus.

Reimplemented in PLGui::AbstractButton, and PLGui::AbstractMenu.

virtual PLGUI_API void PLGui::WidgetFunctions::OnActivate ( bool  bActivate) [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 in PLGui::Window.

virtual PLGUI_API void PLGui::WidgetFunctions::OnDrawBackground ( Graphics cGraphics) [protected, virtual]

Called to draw the widget background.

Parameters:
[in]cGraphicsGraphics object used for painting
virtual PLGUI_API void PLGui::WidgetFunctions::OnDraw ( Graphics cGraphics) [protected, virtual]
virtual PLGUI_API void PLGui::WidgetFunctions::OnMove ( const PLMath::Vector2i vPos) [protected, virtual]

Called when the widget gets moved.

Parameters:
[in]vPosPosition

Reimplemented in PLGui::Window, and PLGui::ModSnap.

virtual PLGUI_API void PLGui::WidgetFunctions::OnSize ( const PLMath::Vector2i vSize) [protected, virtual]

Called when the widget gets resized.

Parameters:
[in]vSizeSize

Reimplemented in PLGui::ScrollWidget.

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

Called when the window state has changed.

Parameters:
[in]nWindowStateWindow state

Reimplemented in PLGui::Window.

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

Called when fullscreen mode is activated.

Reimplemented in PLGui::Window.

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

Called when fullscreen mode is deactivated.

Reimplemented in PLGui::Window.

virtual PLGUI_API PLMath::Vector2i PLGui::WidgetFunctions::OnPreferredSize ( const PLMath::Vector2i vRefSize) const [protected, 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 in PLGui::Widget, PLGui::TabBar, PLGui::TabBarEntry, PLGui::AbstractMenu, PLGui::Splitter, PLGui::Border, PLGui::ScrollBar, PLGui::Slider, PLGui::Panel, PLGui::Button, PLGui::CheckBox, PLGui::MenuBar, PLGui::RadioButton, and PLGui::SlimEntry.

virtual PLGUI_API void PLGui::WidgetFunctions::OnAdjustContent ( ) [protected, virtual]
virtual PLGUI_API void PLGui::WidgetFunctions::OnMouseEnter ( ) [protected, virtual]

Called when the mouse has entered the widget.

Reimplemented in PLGui::AbstractButton, PLGui::TabBarEntry, PLGui::TabBarButton, and PLGui::Button.

virtual PLGUI_API void PLGui::WidgetFunctions::OnMouseLeave ( ) [protected, virtual]
virtual PLGUI_API void PLGui::WidgetFunctions::OnMouseOver ( bool  bMouseOver) [protected, virtual]

Called when the mouse-over state of the widget has changed.

Parameters:
[in]bMouseOver'true' if the mouse is over the widget or a child widget, else 'false'

Reimplemented in PLGui::ModBlend.

virtual PLGUI_API void PLGui::WidgetFunctions::OnMouseMove ( const PLMath::Vector2i vPos) [protected, virtual]

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

Parameters:
[in]vPosMouse position within the widget

Reimplemented in PLGui::AbstractButton, PLGui::Window, PLGui::AbstractMenu, PLGui::Splitter, PLGui::ScrollBar, and PLGui::Slider.

virtual PLGUI_API void PLGui::WidgetFunctions::OnMouseHover ( ) [protected, virtual]

Called when the mouse hovers over the widget.

Reimplemented in PLGui::ModTooltip.

virtual PLGUI_API void PLGui::WidgetFunctions::OnMousePosUpdate ( const PLMath::Vector2i vPos) [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 in PLGui::Window.

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

Called when a mouse button is pressed.

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

Reimplemented in PLGui::AbstractButton, PLGui::Window, PLGui::AbstractMenu, PLGui::Splitter, PLGui::ScrollBar, and PLGui::Slider.

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

Called when a mouse button is released.

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

Reimplemented in PLGui::AbstractButton, PLGui::Window, PLGui::AbstractMenu, PLGui::Splitter, PLGui::ScrollBar, and PLGui::Slider.

virtual PLGUI_API void PLGui::WidgetFunctions::OnMouseButtonClick ( PLCore::uint32  nButton,
const PLMath::Vector2i vPos 
) [protected, virtual]

Called when a mouse button is clicked.

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

Reimplemented in PLGui::TabBarEntry.

virtual PLGUI_API void PLGui::WidgetFunctions::OnMouseButtonDoubleClick ( PLCore::uint32  nButton,
const PLMath::Vector2i vPos 
) [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 in PLGui::Window.

virtual PLGUI_API void PLGui::WidgetFunctions::OnMouseWheel ( int  nDelta) [protected, virtual]

Called when the mouse wheel is used.

Parameters:
[in]nDeltaMouse wheel movement
virtual PLGUI_API void PLGui::WidgetFunctions::OnKeyDown ( PLCore::uint32  nKey,
PLCore::uint32  nModifiers 
) [protected, virtual]

Called when a key was pressed.

Parameters:
[in]nKeyPressed key
[in]nModifiersModifier keys pressed
Note:
  • Because of a possible autorepeat the key may be 'pressed' multiple times before the 'OnKeyUp'-function is called

Reimplemented in PLGui::AbstractButton, PLGui::AbstractMenu, and PLGui::ModFullscreen.

virtual PLGUI_API void PLGui::WidgetFunctions::OnKeyUp ( PLCore::uint32  nKey,
PLCore::uint32  nModifiers 
) [protected, virtual]

Called when a key was released.

Parameters:
[in]nKeyReleased key
[in]nModifiersModifier keys pressed

Reimplemented in PLGui::AbstractButton.

virtual PLGUI_API void PLGui::WidgetFunctions::OnHotkey ( PLCore::uint32  nHotkey) [protected, virtual]

Called when a hotkey was pressed.

Parameters:
[in]nHotkeyHotkey ID
virtual PLGUI_API void PLGui::WidgetFunctions::OnDrop ( const DataObject cData) [protected, virtual]

Called when data has been dropped onto the widget.

Parameters:
[in]cDataData
virtual PLGUI_API void PLGui::WidgetFunctions::OnUserMessage ( PLCore::uint32  nData,
void *  pDataPtr 
) [protected, virtual]

Called when a user defined message has been sent.

Parameters:
[in]nDataMessage data
[in]pDataPtrData pointer

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:32
The content of this PixelLight document is published under the
Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported