wxArt2D
edsttool.h
Go to the documentation of this file.
1 /*! \file wx/editor/edsttool.h
2  \brief stack based tools controller and tools for drawing and editing.
3 
4  This is a whole set of tools and controller which work closely together,
5  such that they can function well inside one application.
6  The controller uses a stack of tools, where the first one is always active.
7 
8  \author Klaas Holwerda
9 
10  Copyright: 2001-2004 (c) Klaas Holwerda
11 
12  Licence: wxWidgets Licence
13 
14  RCS-ID: $Id: sttool.h,v 1.48 2009/10/01 19:22:35 titato Exp $
15 */
16 
17 #ifndef __A2DEDITORSTTOOL_H__
18 #define __A2DEDITORSTTOOL_H__
19 
20 #ifndef WX_PRECOMP
21 #include "wx/wx.h"
22 #endif
23 
24 #include <wx/listimpl.cpp>
25 
26 #include "wx/canvas/sttool.h"
27 
28 
29 //!Interactive Insertion of an text object with a wxURI Object.
30 /*!Either with just one click or draging a rectangle to fit the text height in.
31 
32 \remark Left Click and/or drag.
33 
34 \sa a2dStToolContr
35 
36 
37  \ingroup tools
38 */
39 class A2DCANVASDLLEXP a2dLinkTool: public a2dStDrawTool
40 {
41 public:
42 
43  //! push this tool on the tools stack
44  /*! \ingroup commandid
45  */
47 
48  a2dLinkTool( a2dStToolContr* controller );
49 
50  ~a2dLinkTool();
51 
52  bool ZoomSave() { return true;};
53 
54  //! font to use
55  void SetFont( const a2dFont& font ) { m_font = font; }
56 
57  //! return used font
58  const a2dFont& GetFont() { return m_font; }
59 
60 
61 protected:
62 
63  virtual void GenerateAnotation();
64 
65  void OnChar( wxKeyEvent& event );
66 
67  void OnMouseEvent( wxMouseEvent& event );
68 
69  a2dFont m_font;
70 
71 public:
72 
73  DECLARE_CLASS( a2dLinkTool )
74  DECLARE_EVENT_TABLE()
75 
76 };
77 
78 //!Interactive follow link.
79 /*!
80 \sa a2dStToolContr
81 
82  \ingroup tools
83 */
84 class A2DCANVASDLLEXP a2dFollowLinkDocDrawCam: public a2dStTool
85 {
86 public:
87 
88  //! push this tool on the tools stack
89  /*! \ingroup commandid
90  */
92 
94 
95  bool StartFollowHere( double x, double y );
96 
97  bool StartFollowHere( int x, int y );
98 
99  bool ZoomSave() { return true;};
100 
101 protected:
102 
103  void OnChar( wxKeyEvent& event );
104 
105  void OnMouseEvent( wxMouseEvent& event );
106 
107 public:
108  DECLARE_CLASS( a2dFollowLinkDocDrawCam )
109  DECLARE_EVENT_TABLE()
110 
111 };
112 
113 //!Master tool for objects graphics slecting and dragging
114 /*!This tool controls other tools such that simple object graphics
115 can be edited without manually changing tools.
116 
117 - Left Down + Drag + Shift Down => select objects in rectangle add to already selected
118 - Left Down + Drag + Cntrl Down => select objects in rectangle deselect already selected first
119 - Left Down + Drag => move selected objects
120 - Left Down + Drag => move object and select it
121 - Left Down + Drag + Ctrl Down + Shift Down => copy selected objects
122 - Right Down => Drag canvas view
123 - Right Down + Up => Show Popup
124 
125 ( wire mode )
126 
127 - First LeftDown click on non wire object selects it.
128 - Shift + LeftDown to select a wire.
129 - Shift + LeftDown to select more.
130 - Second click on Selected object does NOT deselect
131 - Wire is draggable in segment and vertex and vertex insert when selected.
132 - Wire starts on pin of non wire object.
133 - Wire starts on wire and pin of wire object.
134 - LeftDown + drag on wire pin, makes it draggable.
135 - Dragging starting at non hit, or wire, starts a rectangle selection.
136 - Double Click => Edit Selected of hit
137 
138 ( select mode )
139 
140 - First LeftDown click on object selects it.
141 - Shift + LeftDown to select more.
142 - Second click on Selected object does de-select
143 - wire is draggable in segment and vertex and vertex insert, without selecting needed.
144 - Wire starts on pin of non wire object.
145 - Wire starts on wire and pin object when Ctrl is down.
146 - LeftDown + drag on wire pin, makes it draggable.
147 - Dragging starting at non hit, or wire, starts a rectangle selection.
148 - Double Click => Edit Selected of hit
149 
150 \ingroup tools
151 */
153 {
154 public:
155 
156  a2dMasterTagGroups3Link ( a2dStToolContr* controller );
158 
159  wxString GetToolString() const;
160 
161  virtual void EditDlgOrHandles( a2dCanvasObject* hit, bool modifier, bool noHandleEditForWire );
162 
163 protected:
164 
165  void PushEditTool( a2dCanvasObject* hit );
166  void PushLinkTool( a2dCanvasObject* hit );
167 
168  DECLARE_CLASS( a2dMasterTagGroups3Link )
169  DECLARE_EVENT_TABLE()
170 };
171 
172 
173 #endif /* __A2DEDITORSTTOOL_H__ */
174 
175 
176 
const a2dFont & GetFont()
return used font
Definition: edsttool.h:58
The a2dStTool is used to derive tools from.
Definition: sttool.h:115
Defines a font to be set to a2dDrawer2D or stored in a2dCanvsObject etc.
Definition: stylebase.h:779
a2dCanvasObject is the base class for Canvas Objects.
Definition: canobj.h:371
static const a2dCommandId COMID_PushTool_FollowLinkDocDrawCam
push this tool on the tools stack
Definition: edsttool.h:91
static const a2dCommandId COMID_PushTool_Link
push this tool on the tools stack
Definition: edsttool.h:46
void OnMouseEvent(wxMouseEvent &event)
called on mouse events
Definition: sttool.cpp:1203
base for tools that draw and are stack based.
Definition: sttool.h:427
bool ZoomSave()
Is Zooming while the tool is busy Save.
Definition: edsttool.h:99
The a2dStToolContr is a Tool Controller specialized for working with a2dCanvasView.
Definition: sttool.h:485
bool ZoomSave()
Is Zooming while the tool is busy Save.
Definition: edsttool.h:52
Each a2dCommand is given a command id at construction.
Definition: comevt.h:99
Interactive Insertion of an text object with a wxURI Object.
Definition: edsttool.h:39
void SetFont(const a2dFont &font)
font to use
Definition: edsttool.h:55
Master tool for objects graphics slecting and dragging.
void OnChar(wxKeyEvent &event)
called on key events
Definition: sttool.cpp:1798
stack based tools controller and tools for drawing and editing.
virtual void GenerateAnotation()
to display a string along with a tool drawing.
Definition: sttool.cpp:1346
Interactive follow link.
Definition: edsttool.h:84
edsttool.h Source File -- Sun Oct 12 2014 17:04:19 -- Sun Oct 12 2014 -- 1.8.5 -- wxArt2D -- . -- Main Page Reference Documentation