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

Modifier that snaps a widget to window borders. More...

#include <ModSnap.h>

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

List of all members.

Public Member Functions

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

Protected Member Functions

virtual void OnAttach (Widget &cWidget) override
 Called when the modifier is attached to a widget.
virtual void OnDetach (Widget &cWidget) override
 Called when the modifier is detached from a widget.
virtual void OnMove (const PLMath::Vector2i &vPos) override
 Called when the widget gets moved.
void TryUnsnap (const PLMath::Vector2i &vPos)
 Try to unsnap the widget from it's current snap-targets.
void TrySnap (const PLMath::Vector2i &vPos, Widget *pSnapWidget, bool bParent)
 Try to snap to a specific widget.

Protected Attributes

PLCore::EventHandler< const
PLMath::Vector2i & > 
EventHandlerMove
PLMath::Vector2i m_vPos
Widgetm_pSnappedLeft
Widgetm_pSnappedRight
Widgetm_pSnappedTop
Widgetm_pSnappedBottom
bool m_bPerformedSnap

Detailed Description

Modifier that snaps a widget to window borders.


Constructor & Destructor Documentation

PLGUI_API PLGui::ModSnap::ModSnap ( )

Constructor.

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

Destructor.


Member Function Documentation

virtual void PLGui::ModSnap::OnAttach ( Widget cWidget) [override, protected, virtual]

Called when the modifier is attached to a widget.

Parameters:
[in]cWidgetWidget to which the modifier is attached

Reimplemented from PLGui::Modifier.

virtual void PLGui::ModSnap::OnDetach ( Widget cWidget) [override, protected, virtual]

Called when the modifier is detached from a widget.

Parameters:
[in]cWidgetWidget from which the modifier is detached

Reimplemented from PLGui::Modifier.

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

Called when the widget gets moved.

Parameters:
[in]vPosPosition

Reimplemented from PLGui::WidgetFunctions.

void PLGui::ModSnap::TryUnsnap ( const PLMath::Vector2i vPos) [protected]

Try to unsnap the widget from it's current snap-targets.

Parameters:
[in]vPosPosition
void PLGui::ModSnap::TrySnap ( const PLMath::Vector2i vPos,
Widget pSnapWidget,
bool  bParent 
) [protected]

Try to snap to a specific widget.

Parameters:
[in]vPosPosition
[in]pSnapWidgetWidget to snap to, can be either the parent or a sibling widget
[in]bParent'true', if pWidget is the parent window of this widget, else 'false'

Member Data Documentation

Widget gets moved, new widget position as parameter

Current position

Widget to which we are currently snapped on our left side

Widget to which we are currently snapped on our right side

Widget to which we are currently snapped on our top side

Widget to which we are currently snapped on our bottom side

Widget has performed a snap in the last cycle


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