Interactor

A canvas graphic might return Nil with its CreateInteractor function if it does not support graphic-specific interaction. This interactor defines graphic-specific interaction for the canvas graphic that created the interactor.

The interactor created by this function is not generic. Therefore, do not create an interactor with this function when the interaction behavior is general to all canvas graphics such as rotating, scaling, or translating the selected canvas graphics. However, you would create an interactor this way if each canvas graphic defines its own way of interacting such as how it is drawn. For example, selecting multiple points for a polyline as opposed to dragging out a rectangle or ellipse.

As shown in the following function declaration, CreateInteractor takes a selection, a tool handler, and a point as parameters.

      virtual TCanvasInteractor* 
      CreateInteractor(   MCanvasSelection* adoptSelection, MToolHandler* toolHandler, 
                          const TGPoint& hitLocation ) const;
The end user clicks the mouse on a canvas graphic. The location of that click is the TGPoint instance passed to this function. The MCanvasSelection instance is the selection on which the interactor works. The MToolHandler is for the command action.


[Contents] [Previous] [Next]
Click the icon to mail questions or corrections about this material to Taligent personnel.
Copyright©1995 Taligent,Inc. All rights reserved.

Generated with WebMaker