Main Page   Namespace List   Class Hierarchy   Compound List   File List   Compound Members   File Members  

MoveTool Class Reference

A Tool subclass that allows the user to move objects. More...

Inheritance diagram for MoveTool:

Tool Object List of all members.

Public Methods

 MoveTool ()
void start ()
 called when the tool is selected in the tool window

int mouseClick (const Position &pos)
 When the mouse is clicked on the canvas, it iterates over each selected object by using Drawing's Selection class and iteration functions.

void stop ()
 called when another tool is selected


Static Public Attributes

MoveTool::Factory factory

Detailed Description

A Tool subclass that allows the user to move objects.


Constructor & Destructor Documentation

MoveTool::MoveTool   [inline]
 

00008 : Tool("move-button.bmp") {}


Member Function Documentation

int MoveTool::mouseClick const Position &    pos [inline, virtual]
 

When the mouse is clicked on the canvas, it iterates over each selected object by using Drawing's Selection class and iteration functions.

It then uses the move method on each object to move it to the clicked point.

Implements Tool.

00017                                       {
00018     Drawing::Selection begin = drawing->begin_selection(),
00019       end = drawing->end_selection();
00020     for (Drawing::Selection i = begin; i != end; ++i) {
00021       (*i)->move(pos);
00022     }
00023     return begin != end;
00024   }

void MoveTool::start   [inline, virtual]
 

called when the tool is selected in the tool window

Implements Tool.

00010 {}

void MoveTool::stop   [inline, virtual]
 

called when another tool is selected

Implements Tool.

00026 {}


Member Data Documentation

MoveTool::Factory MoveTool::factory [static]
 


The documentation for this class was generated from the following file:
Generated on Fri Nov 8 10:52:30 2002 for Draw by doxygen1.2.17