|
FifeGUI 0.2.0
A C++ GUI library designed for games.
|
#include <dragdrop.hpp>
Public Member Functions | |
| bool | beginDrag (Widget *source, std::unique_ptr< DragPayload > payload, int mouseX, int mouseY) |
| bool | beginDragFromWidget (Widget *source, int mouseX, int mouseY) |
| void | cancel () |
| DragHandler (Gui *gui) | |
| DropResult | drop (int mouseX, int mouseY) |
| Widget * | getActiveDropTarget () const |
| Widget * | getHoveredWidget () const |
| Widget * | getModalWidget () const |
| DragPayload const * | getPayload () const |
| DragRenderConfig const & | getRenderConfig () const |
| DragState | getState () const |
| void | render (Graphics &graphics) |
| void | setModalWidget (Widget *modal) |
| void | setRenderConfig (DragRenderConfig config) |
| void | update (int mouseX, int mouseY) |
Static Public Member Functions | |
| static Widget * | findWidgetAt (Widget *root, int x, int y, bool mustBeVisible=true, bool mustBeEnabled=true) |
Manages drag and drop operations for a Gui instance.
Tracks drag state, active payload, hovered widget and provides rendering hooks for ghost and highlight visuals.
Definition at line 216 of file dragdrop.hpp.
|
explicit |
Create a drag handler for a GUI.
Definition at line 28 of file dragdrop.cpp.
| bool fcn::DragHandler::beginDrag | ( | Widget * | source, |
| std::unique_ptr< DragPayload > | payload, | ||
| int | mouseX, | ||
| int | mouseY ) |
Start a drag with the given payload.
Definition at line 52 of file dragdrop.cpp.
References fcn::Dragging.
| bool fcn::DragHandler::beginDragFromWidget | ( | Widget * | source, |
| int | mouseX, | ||
| int | mouseY ) |
Start a drag from a widget without explicit payload.
Definition at line 64 of file dragdrop.cpp.
| void fcn::DragHandler::cancel | ( | ) |
Cancel the current drag.
Definition at line 128 of file dragdrop.cpp.
References fcn::Dragging, and fcn::Idle.
| DropResult fcn::DragHandler::drop | ( | int | mouseX, |
| int | mouseY ) |
Drop at the given position.
Definition at line 102 of file dragdrop.cpp.
References fcn::Accepted, fcn::Cancelled, fcn::Dragging, and fcn::Idle.
|
static |
Find a widget at the given coordinates.
Definition at line 166 of file dragdrop.cpp.
References fcn::Widget::getWidgetAt().
| Widget * fcn::DragHandler::getActiveDropTarget | ( | ) | const |
Get the active drop target widget.
Definition at line 42 of file dragdrop.cpp.
| Widget * fcn::DragHandler::getHoveredWidget | ( | ) | const |
Get the widget currently hovered by the drag.
Definition at line 37 of file dragdrop.cpp.
| Widget * fcn::DragHandler::getModalWidget | ( | ) | const |
Get the modal widget if any.
Definition at line 161 of file dragdrop.cpp.
| DragPayload const * fcn::DragHandler::getPayload | ( | ) | const |
Get the active payload.
Definition at line 47 of file dragdrop.cpp.
References fcn::DragPayload::get().
| DragRenderConfig const & fcn::DragHandler::getRenderConfig | ( | ) | const |
Get the current render config.
Definition at line 152 of file dragdrop.cpp.
| DragState fcn::DragHandler::getState | ( | ) | const |
Get the current drag state.
Definition at line 32 of file dragdrop.cpp.
| void fcn::DragHandler::render | ( | Graphics & | graphics | ) |
Render drag related visuals.
Definition at line 142 of file dragdrop.cpp.
| void fcn::DragHandler::setModalWidget | ( | Widget * | modal | ) |
Set a modal widget to ignore hits.
Definition at line 157 of file dragdrop.cpp.
| void fcn::DragHandler::setRenderConfig | ( | DragRenderConfig | config | ) |
Set how drag visuals are rendered.
Definition at line 147 of file dragdrop.cpp.
| void fcn::DragHandler::update | ( | int | mouseX, |
| int | mouseY ) |
Update drag position.
Definition at line 70 of file dragdrop.cpp.
References fcn::Dragging, and fcn::Widget::getWidgetAt().