PixelLightAPI
.
|
Modifier that snaps a widget to window borders. More...
#include <ModSnap.h>
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 |
Widget * | m_pSnappedLeft |
Widget * | m_pSnappedRight |
Widget * | m_pSnappedTop |
Widget * | m_pSnappedBottom |
bool | m_bPerformedSnap |
Modifier that snaps a widget to window borders.
PLGUI_API PLGui::ModSnap::ModSnap | ( | ) |
Constructor.
virtual PLGUI_API PLGui::ModSnap::~ModSnap | ( | ) | [virtual] |
Destructor.
virtual void PLGui::ModSnap::OnAttach | ( | Widget & | cWidget | ) | [override, protected, virtual] |
Called when the modifier is attached to a widget.
[in] | cWidget | Widget 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.
[in] | cWidget | Widget 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.
[in] | vPos | Position |
Reimplemented from PLGui::WidgetFunctions.
void PLGui::ModSnap::TryUnsnap | ( | const PLMath::Vector2i & | vPos | ) | [protected] |
Try to unsnap the widget from it's current snap-targets.
[in] | vPos | Position |
void PLGui::ModSnap::TrySnap | ( | const PLMath::Vector2i & | vPos, |
Widget * | pSnapWidget, | ||
bool | bParent | ||
) | [protected] |
Try to snap to a specific widget.
[in] | vPos | Position |
[in] | pSnapWidget | Widget 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' |
PLCore::EventHandler<const PLMath::Vector2i&> PLGui::ModSnap::EventHandlerMove [protected] |
Widget gets moved, new widget position as parameter
PLMath::Vector2i PLGui::ModSnap::m_vPos [protected] |
Current position
Widget* PLGui::ModSnap::m_pSnappedLeft [protected] |
Widget to which we are currently snapped on our left side
Widget* PLGui::ModSnap::m_pSnappedRight [protected] |
Widget to which we are currently snapped on our right side
Widget* PLGui::ModSnap::m_pSnappedTop [protected] |
Widget to which we are currently snapped on our top side
Widget* PLGui::ModSnap::m_pSnappedBottom [protected] |
Widget to which we are currently snapped on our bottom side
bool PLGui::ModSnap::m_bPerformedSnap [protected] |
Widget has performed a snap in the last cycle
|