rwlogo

Rogue Wave Views
Gantt Package API Reference Guide

Product Documentation:

Rogue Wave Views
Documentation Home

 All Classes Files Functions Variables Typedefs Enumerations Enumerator
List of all members | Public Member Functions
IlvGanttDragDropInteractor Class Reference

Interactor to drag and drop nodes and subnode. More...

#include <ilviews/gantt/ganttint.h>

Inheritance diagram for IlvGanttDragDropInteractor:
IlvDragDropInteractor IlvInteractor

Public Member Functions

 IlvGanttDragDropInteractor (IlvView *target=0, IlvGraphic *ghost=0)
 Constructor. More...
 
virtual void doIt (IlvView *target, IlvGraphic *ghost, const IlvPoint &p)
 Performs the drop action. More...
 
virtual void dropNode (const IlvGanttNode *source, IlInt *startMinArray, IlInt *startMaxArray, IlInt *endMinArray, IlInt *endMaxArray, IlvGanttLine **lines, IlUShort *capacities)
 Action method called when the user drops the dragged object. More...
 
virtual void dropSubNode (IlvGanttNode *dst, IlUShort idx, IlInt startMin, IlInt startMax, IlInt endMin, IlInt endMax, IlvGanttLine *line, IlUShort capacity)
 Action method called when the user drops the dragged object. More...
 
IlvGanttChartgetGanttChart (const IlvGraphic *obj) const
 Returns the Gantt chart managing a given object. More...
 
IlvGanttChartgetTargetGanttChart (const IlvView *targetView) const
 Returns the Gantt chart associated to a target view. More...
 
virtual IlvGanttNodemakeNode (const IlvGanttNode *source, IlInt *startMinArray, IlInt *startMaxArray, IlInt *endMinArray, IlInt *endMaxArray, IlvGanttLine **lines, IlUShort *capacities)
 Factory method to create Gantt nodes. More...
 
virtual IlvGanttSubNodemakeSubNode (IlvGanttNode *dst, IlInt startMin, IlInt startMax, IlInt endMin, IlInt endMax, IlvGanttLine *line, IlUShort capacity)
 Factory method to create Gantt subnodes. More...
 

Detailed Description

Interactor to drag and drop nodes and subnode.

Library: ilvgantt

Use the IlvGanttDragDropInteractor class to give a Gantt subnode or node the possibility of being dragged to another view, then dropped and duplicated. This interactor is attached by default to all subnodes stored in the Gantt grapher. The drag is performed on the graphic representation the Gantt subnode. You can specify that the whole node must be duplicated by keeping the CTRL key pressed when clicking on the subnode.

The registered name of this interactor is "GanttDragDrop".

See Also
IlvGanttChart, IlvGanttSubNode, IlvGanttNode.

Constructor & Destructor Documentation

IlvGanttDragDropInteractor::IlvGanttDragDropInteractor ( IlvView target = 0,
IlvGraphic ghost = 0 
)

Constructor.

The constructor specifies the target view where the object can be dropped. If a graphic object is specified for the ghost parameter, this object is used by the interactor as a ghost image during the interaction. Otherwise, the object to be drawn is the one being dragged.

Parameters
targetThe target view.
ghostThe graphic object used as ghost image.

Member Function Documentation

virtual void IlvGanttDragDropInteractor::doIt ( IlvView target,
IlvGraphic ghost,
const IlvPoint p 
)
virtual

Performs the drop action.

If the Ctrl key is pressed, the IlvGanttDragDropInteractor::dropNode is called, otherwise the IlvGanttDragDropInteractor::dropSubNode is called.

Parameters
targetThe target view where the mouse button is released.
ghostThe graphic object being dropped.
pThe coordinates of drop location in screen coordinates.

Reimplemented from IlvDragDropInteractor.

virtual void IlvGanttDragDropInteractor::dropNode ( const IlvGanttNode source,
IlInt startMinArray,
IlInt startMaxArray,
IlInt endMinArray,
IlInt endMaxArray,
IlvGanttLine **  lines,
IlUShort capacities 
)
virtual

Action method called when the user drops the dragged object.

Makes a copy of the source Gantt node using the IlvGanttDragDropInteractor::makeNode method. The IlvGanttDragDropInteractor::makeSubNode method is also used to add a copy of each subnode of source into the new Gantt node. This new node is then added to the Gantt chart.

Parameters
sourceThe Gantt node associated with the dragged object.
startMinArrayThe new earliest start times for the subnodes copy of source.
startMaxArrayThe new latest start times for the subnodes copy of source.
endMinArrayThe new earliest end times for the subnodes copy of source.
endMaxArrayThe new latest end times for the subnodes copy of source.
linesThe new Gantt lines for the subnodes copy of source.
capacitiesThe capacities of the subnodes of source.
virtual void IlvGanttDragDropInteractor::dropSubNode ( IlvGanttNode dst,
IlUShort  idx,
IlInt  startMin,
IlInt  startMax,
IlInt  endMin,
IlInt  endMax,
IlvGanttLine line,
IlUShort  capacity 
)
virtual

Action method called when the user drops the dragged object.

Makes a copy of the subnode of index idx in the node dst using the IlvGanttDragDropInteractor::makeSubNode method. The subnode copy is then stored in the dst node.

Parameters
dstThe Gantt node associated with the dragged object.
idxThe index of the considered subnode in node.
startMinThe earliest start time of the subnode copy.
startMaxThe latest start time of the subnode copy.
endMinThe earliest end time of the subnode copy.
endMaxThe latest end time of the subnode copy.
lineThe Gantt line with which the subnode copy must be associated.
capacityThe capacity of the subnode copy.
IlvGanttChart* IlvGanttDragDropInteractor::getGanttChart ( const IlvGraphic obj) const

Returns the Gantt chart managing a given object.

Parameters
objThe considered graphic object.
Returns
The Gantt chart managing the object obj.
IlvGanttChart* IlvGanttDragDropInteractor::getTargetGanttChart ( const IlvView targetView) const

Returns the Gantt chart associated to a target view.

Parameters
targetViewThe target view.
Returns
The Gantt chart to which targetView is attached.
virtual IlvGanttNode* IlvGanttDragDropInteractor::makeNode ( const IlvGanttNode source,
IlInt startMinArray,
IlInt startMaxArray,
IlInt endMinArray,
IlInt endMaxArray,
IlvGanttLine **  lines,
IlUShort capacities 
)
virtual

Factory method to create Gantt nodes.

Is designed to be overloaded when linking the Gantt with a scheduling program. The default implementation returns an empty Gantt node.

Parameters
sourceThe Gantt node associated with the dragged object.
startMinArrayThe new earliest start times for the subnodes copy of source.
startMaxArrayThe new latest start times for the subnodes copy of source.
endMinArrayThe new earliest end times for the subnodes copy of source.
endMaxArrayThe new latest end times for the subnodes copy of source.
linesThe new Gantt lines for the subnodes copy of source.
capacitiesThe capacities of the subnodes of source.
virtual IlvGanttSubNode* IlvGanttDragDropInteractor::makeSubNode ( IlvGanttNode dst,
IlInt  startMin,
IlInt  startMax,
IlInt  endMin,
IlInt  endMax,
IlvGanttLine line,
IlUShort  capacity 
)
virtual

Factory method to create Gantt subnodes.

Is designed to be overloaded when linking the Gantt with a scheduling program. The default implementation returns a Gantt subnode initialized with the given parameters.

Parameters
dstThe Gantt node to which the created subnode will be added.
startMinThe earliest start time for the created subnode.
startMaxThe latest start time for the created subnode.
endMinThe earliest end time for the created subnode.
endMaxThe latest end time for the created subnode.
lineThe Gantt line for the created subnode..
capacityThe capacity for the created subnode.

© Copyright 2015, Rogue Wave Software, Inc. All Rights Reserved.
Rogue Wave is a registered trademark of Rogue Wave Software, Inc. in the United States and other countries. All other trademarks are the property of their respective owners.