Public Types | |
enum | DOCK_TARGETS { WIDGET_LEFT, WIDGET_TOP, WIDGET_RIGHT, WIDGET_BOTTOM, COMPONENT_LEFT, COMPONENT_RIGHT, COMPONENT_TOP, COMPONENT_BOTTOM, COMPONENT_TAB } |
Public Member Functions | |
virtual void | cancel_drag () |
DefaultDockManager (InterfaceManager &manager) | |
virtual Component * | get_dragged_component () const |
virtual bool | on_left_down (const MouseEventData &data) |
virtual bool | on_left_up (const MouseEventData &data) |
virtual bool | on_mouse_move (const MouseEventData &data) |
~DefaultDockManager () | |
Protected Types | |
typedef std::vector< DockTarget * > | DockTargets |
enum | STATE { NONE, INIT, DRAG } |
Protected Member Functions | |
virtual void | create_docktargets () |
Creates the DockTargets. | |
virtual void | destroy_docktargets () |
Destroyes the DockTargets. | |
virtual void | end_drag (bool canceled) |
virtual DockTarget * | get_docktarget (int id) const |
virtual DockTarget * | get_hovered_docktarget () const |
virtual bool | init_drag (const MouseEventData &data) |
Initializes the drag sequence. | |
virtual void | reset_state () |
virtual void | show_component_docktargets (bool value, Component *component) |
virtual void | show_managed_widget_docktargets (bool value) |
virtual bool | special_toplevel_docking (Component *dragged, Container *relative, ALIGNMENT where) |
virtual void | start_drag (Component *component) |
virtual void | track_drag_motion (const MouseEventData &data) |
virtual void | track_init_motion (const MouseEventData &data) |
virtual void | update_docktargets (const Point &pos) |
Protected Attributes | |
Pointer< Component > | m_component |
The component being dragged. | |
DockTargets | m_docktargets |
Component * | m_hovered |
Identifies which component the mouse is hovering over during a drag operation. | |
InterfaceManager & | m_manager |
Point | m_starting_point |
The point where the drag was initiated. | |
enum ifm::DefaultDockManager::STATE | m_state |
typedef std::vector<DockTarget*> ifm::DefaultDockManager::DockTargets [protected] |
Identifiers for DockTargets
enum ifm::DefaultDockManager::STATE [protected] |
ifm::DefaultDockManager::DefaultDockManager | ( | InterfaceManager & | manager | ) |
ifm::DefaultDockManager::~DefaultDockManager | ( | ) |
void ifm::DefaultDockManager::cancel_drag | ( | ) | [virtual] |
Cancels the current drag operation.
Implements ifm::DockManager.
void ifm::DefaultDockManager::create_docktargets | ( | ) | [protected, virtual] |
Creates the DockTargets.
void ifm::DefaultDockManager::destroy_docktargets | ( | ) | [protected, virtual] |
Destroyes the DockTargets.
void ifm::DefaultDockManager::end_drag | ( | bool | canceled | ) | [protected, virtual] |
Called to end the drag sequence.
canceled | Whether the drag sequence is ending because the user canceled it. |
DockTarget * ifm::DefaultDockManager::get_docktarget | ( | int | id | ) | const [protected, virtual] |
Component * ifm::DefaultDockManager::get_dragged_component | ( | ) | const [virtual] |
Implements ifm::DockManager.
DockTarget * ifm::DefaultDockManager::get_hovered_docktarget | ( | ) | const [protected, virtual] |
bool ifm::DefaultDockManager::init_drag | ( | const MouseEventData & | data | ) | [protected, virtual] |
Initializes the drag sequence.
First, it must be determined whether the drag sequence should be initialized. This is done by calling Component::drag_drop_sensitive on the position of the mouse event. If this position is sensntive to drag drop operations, the drag sequence will begin.
The drag sequence begins by capturing the mouse input. This is the INIT phase of the drag sequence. During the INIT phase, mouse motion is tracked. If the mouse moves a certain threshhold distance from the position where the drag sequence was initialized, the main DRAG phase will begin.
bool ifm::DefaultDockManager::on_left_down | ( | const MouseEventData & | data | ) | [virtual] |
Processes a left mouse button down event.
data | The data for this event |
Implements ifm::DockManager.
bool ifm::DefaultDockManager::on_left_up | ( | const MouseEventData & | data | ) | [virtual] |
Processes a left mouse button up event.
data | The data for this event |
Implements ifm::DockManager.
bool ifm::DefaultDockManager::on_mouse_move | ( | const MouseEventData & | data | ) | [virtual] |
Processes a mouse move event.
data | The data for this event |
Implements ifm::DockManager.
void ifm::DefaultDockManager::reset_state | ( | ) | [protected, virtual] |
Resets internal data members.
void ifm::DefaultDockManager::show_component_docktargets | ( | bool | value, | |
Component * | component | |||
) | [protected, virtual] |
Shows or hides the DockTargets that appear in a cross shape within the Component the user is hovering the mouse inside of.
component | The component to show the DockTargets for. If 0, they will be shown for the Content Widget. |
void ifm::DefaultDockManager::show_managed_widget_docktargets | ( | bool | value | ) | [protected, virtual] |
Shows or hides the DockTargets that appear on the edges of the managed widget.
bool ifm::DefaultDockManager::special_toplevel_docking | ( | Component * | dragged, | |
Container * | relative, | |||
ALIGNMENT | where | |||
) | [protected, virtual] |
Determines if special case docking relative to a top level container should be performed. If it is determined special case docking should be performed, this function will carry out the special case docking operations.
void ifm::DefaultDockManager::start_drag | ( | Component * | component | ) | [protected, virtual] |
Called by track_init_motion to initiate the actual drag sequence.
void ifm::DefaultDockManager::track_drag_motion | ( | const MouseEventData & | data | ) | [protected, virtual] |
Tracks mouse motion during dragging.
void ifm::DefaultDockManager::track_init_motion | ( | const MouseEventData & | data | ) | [protected, virtual] |
Tracks mouse motion immediately after the user has left clicked in a component and before a drag begins. When the mouse has moved far enough away from the origin of the click, dragging will begin.
void ifm::DefaultDockManager::update_docktargets | ( | const Point & | pos | ) | [protected, virtual] |
Called during mouse movement events during a drag. Updates the hovered state of all DockTargets.
pos | The mouse position in screen coordinates |
Pointer<Component> ifm::DefaultDockManager::m_component [protected] |
The component being dragged.
DockTargets ifm::DefaultDockManager::m_docktargets [protected] |
Component* ifm::DefaultDockManager::m_hovered [protected] |
Identifies which component the mouse is hovering over during a drag operation.
InterfaceManager& ifm::DefaultDockManager::m_manager [protected] |
Point ifm::DefaultDockManager::m_starting_point [protected] |
The point where the drag was initiated.
enum ifm::DefaultDockManager::STATE ifm::DefaultDockManager::m_state [protected] |