DragBar class
#include <Jazz2/UI/Windows/Widgets.h>
Row that moves what it belongs to when dragged, such as the title of a window.
Only the parts of the row that don't take the pointer themselves start a drag, a button in the row is still clicked as usual.
Base classes
- class Stack
- Places its children in a row or a column.
Constructors, destructors, conversion operators
- DragBar(float spacing = Theme::Spacing) explicit
- Creates a new instance.
Public functions
- auto AcceptsPointer() const -> bool override
- Returns
trueif the element takes the pointer itself. - auto OnPointerDown(const PointerEvent& event) -> bool override
- Called when the pointer is pressed over the element, returns
trueto keep getting it until released. - void OnPointerMove(const PointerEvent& event) override
- Called when the pointer moves while pressed over the element.
- void OnPointerUp(const PointerEvent& event, bool inside) override
- Called when the pointer is released,
insidetells whether it's still over the element. - void Update(float timeMult) override
- Advances animations of the element and its children.
Public variables
- Function<void(Vector2f)> OnDragStart
- Called when the row is pressed, with the position of the pointer.
- Function<void(Vector2f, Vector2f)> OnDrag
- Called with how far the pointer moved since the row was pressed and where it is now, in pixels.
- Function<void(Vector2f)> OnDragEnd
- Called when the row is let go, with the position of the pointer.
- Function<void()> OnDoubleClick
- Called when the row is double clicked.
- bool ShowMoveArrows
- Whether the arrows of moving are shown by the pointer while it's over the row,
falsewhen dragging it doesn't move anything now.