ifm::DefaultDockManager Class Reference

Inheritance diagram for ifm::DefaultDockManager:

ifm::DockManager

List of all members.


Detailed Description

Implements the default docking behavior.

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 Componentget_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 DockTargetget_docktarget (int id) const
virtual DockTargetget_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< Componentm_component
 The component being dragged.
DockTargets m_docktargets
Componentm_hovered
 Identifies which component the mouse is hovering over during a drag operation.
InterfaceManagerm_manager
Point m_starting_point
 The point where the drag was initiated.
enum ifm::DefaultDockManager::STATE m_state

Member Typedef Documentation

typedef std::vector<DockTarget*> ifm::DefaultDockManager::DockTargets [protected]


Member Enumeration Documentation

Identifiers for DockTargets

Enumerator:
WIDGET_LEFT  Left of the managed widget.
WIDGET_TOP  Top of the managed widget.
WIDGET_RIGHT  Right of the managed widget.
WIDGET_BOTTOM  Bottom of the managed widget.
COMPONENT_LEFT  Left of the focused component.
COMPONENT_RIGHT  Right of the focused component.
COMPONENT_TOP  Above the focused component.
COMPONENT_BOTTOM  Below the focused component.
COMPONENT_TAB  As a tab with the focused compnent as a sibling.

Enumerator:
NONE 
INIT  Left button clicked, tracking motion before initiating drag.
DRAG  Drag in progress.


Constructor & Destructor Documentation

ifm::DefaultDockManager::DefaultDockManager ( InterfaceManager manager  ) 

ifm::DefaultDockManager::~DefaultDockManager (  ) 


Member Function Documentation

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.

Parameters:
canceled Whether the drag sequence is ending because the user canceled it.

DockTarget * ifm::DefaultDockManager::get_docktarget ( int  id  )  const [protected, virtual]

Returns:
The DockTarget with the given ID or 0 if no such DockTarget exists.

Component * ifm::DefaultDockManager::get_dragged_component (  )  const [virtual]

Returns:
The Component currently being dragged, or 0 if no component is being dragged.

Implements ifm::DockManager.

DockTarget * ifm::DefaultDockManager::get_hovered_docktarget (  )  const [protected, virtual]

Returns:
The hovered DockTarget, or 0 if none are hovered.

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.

Returns:
Whether the drag sequence was begun.

bool ifm::DefaultDockManager::on_left_down ( const MouseEventData data  )  [virtual]

Processes a left mouse button down event.

Parameters:
data The data for this event
Returns:
Whether or not the event was processed.

Implements ifm::DockManager.

bool ifm::DefaultDockManager::on_left_up ( const MouseEventData data  )  [virtual]

Processes a left mouse button up event.

Parameters:
data The data for this event
Returns:
Whether or not the event was processed.

Implements ifm::DockManager.

bool ifm::DefaultDockManager::on_mouse_move ( const MouseEventData data  )  [virtual]

Processes a mouse move event.

Parameters:
data The data for this event
Returns:
Whether or not the event was processed.

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.

Parameters:
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.

Returns:
Whether special case docking was performed.

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.

Parameters:
pos The mouse position in screen coordinates


Member Data Documentation

The component being dragged.

Identifies which component the mouse is hovering over during a drag operation.

The point where the drag was initiated.


doxygen Get IFM - Interface Management System at SourceForge.net. Fast, secure and Free Open Source software downloads