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

ToFrontTool Class Reference

A Tool subclass that allows the user to send selected objects to the front of the drawing. More...

Inheritance diagram for ToFrontTool:

Tool Object List of all members.

Public Methods

 ToFrontTool ()
void start ()
 When the tool is selected, it moves all objects to the front by using Drawing's Selection class and the provided iteration functions, and calling the to_front method on each object.

int mouseClick (const Position &pos)
 When the mouse is clicked on the canvas, the canvas is asked to find the object that was clicked, and to_front is called on that object.

void stop ()
 called when another tool is selected


Static Public Attributes

ToFrontTool::Factory factory

Detailed Description

A Tool subclass that allows the user to send selected objects to the front of the drawing.


Constructor & Destructor Documentation

ToFrontTool::ToFrontTool   [inline]
 

00009 : Tool("to-front-button.bmp") {}


Member Function Documentation

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

When the mouse is clicked on the canvas, the canvas is asked to find the object that was clicked, and to_front is called on that object.

Implements Tool.

00027                                       {
00028     if (DrawElement* e = drawing->get_contents()->find_hit(pos)) {
00029       drawing->get_contents()->to_front(e);
00030       return 1;
00031     }
00032     return 0;    
00033   }

void ToFrontTool::start   [inline, virtual]
 

When the tool is selected, it moves all objects to the front by using Drawing's Selection class and the provided iteration functions, and calling the to_front method on each object.

Implements Tool.

00015                {
00016     Drawing::Selection begin = drawing->begin_selection(),
00017       end = drawing->end_selection();
00018     for (Drawing::Selection i = begin; i != end; ++i) {
00019       drawing->get_contents()->to_front(*i);
00020     }
00021   }

void ToFrontTool::stop   [inline, virtual]
 

called when another tool is selected

Implements Tool.

00035 {}


Member Data Documentation

ToFrontTool::Factory ToFrontTool::factory [static]
 


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