17 #ifndef __A2DCANVASSTTOOL_H__
18 #define __A2DCANVASSTTOOL_H__
24 #include <wx/listimpl.cpp>
32 WX_DECLARE_LIST_WITH_DECL(
a2dBoundingBox, wxZoomList,
class A2DCANVASDLLEXP );
40 A2DCANVASDLLEXP_DATA(
extern const long )
TC_UNDO;
41 A2DCANVASDLLEXP_DATA( extern const
long ) TC_REDO;
42 A2DCANVASDLLEXP_DATA( extern const
long ) TC_ENDTOOL;
43 A2DCANVASDLLEXP_DATA( extern const
long ) TC_ZOOMIN;
44 A2DCANVASDLLEXP_DATA( extern const
long ) TC_ZOOMOUT;
45 A2DCANVASDLLEXP_DATA( extern const
long ) TC_ZOOMBACK;
46 A2DCANVASDLLEXP_DATA( extern const
long ) TC_ZOOMOUT2;
47 A2DCANVASDLLEXP_DATA( extern const
long ) TC_ZOOMIN2;
48 A2DCANVASDLLEXP_DATA( extern const
long ) TC_ZOOMPANXY;
49 A2DCANVASDLLEXP_DATA( extern const
long ) TC_PROPERTY_XY;
101 #if defined(WXART2D_USINGDLL)
136 virtual bool OnPushNewTool(
a2dBaseTool* newtool );
138 virtual void SetActive(
bool active =
true );
147 virtual bool EnterBusyMode();
149 virtual void FinishBusyMode(
bool closeCommandGroup =
true );
150 virtual void AbortBusyMode();
162 virtual void Render();
168 void RenderAnotation();
193 a2dOpaqueMode_Off = 0x00000000,
194 a2dOpaqueMode_Tool = 0x00000001,
195 a2dOpaqueMode_Tool_FixedStyle = 0x00000002,
196 a2dOpaqueMode_Controller = 0x00000004,
229 void SetStateString(
const wxString& message = wxEmptyString,
size_t field = 0 );
238 m_snapSourceFeatures = value ? m_snapSourceFeatures | snapSourceFeature :
239 m_snapSourceFeatures & ( a2dRestrictionEngine::snapToAll ^ snapSourceFeature );
253 m_snapTargetFeatures = value ? m_snapTargetFeatures | snapTargetFeature :
254 m_snapTargetFeatures & ( a2dRestrictionEngine::snapToAll ^ snapTargetFeature );
260 return ( m_snapTargetFeatures & snapTargetFeature ) > 0;
273 void PrepareForRewire(
a2dCanvasObjectList& dragList,
bool walkWires =
true,
bool selected =
false,
bool stopAtSelectedWire =
false,
bool CreateExtraWires =
true,
a2dRefMap* = NULL );
278 void MouseToToolWorld(
int x,
int y,
double& xWorldLocal,
double& yWorldLocal );
284 void GetTextExtent(
const wxString&
string, wxCoord* w, wxCoord* h, wxCoord* descent = NULL, wxCoord* externalLeading = NULL );
287 void OnPaint( wxPaintEvent& event );
290 void OnIdle( wxIdleEvent& event );
302 virtual void GenerateAnotation();
305 void AddAnotationToPendingUpdateArea();
308 void GetKeyIncrement(
double* xIncr,
double* yIncr );
311 void OnKeyDown( wxKeyEvent& event );
313 void OnKeyUp( wxKeyEvent& event );
316 void OnChar( wxKeyEvent& event );
319 void OnMouseEvent( wxMouseEvent& event );
322 virtual void AdjustRenderOptions();
326 virtual bool CreateToolObjects();
329 virtual void CleanupToolObjects();
348 int m_prevxanotation;
349 int m_prevyanotation;
423 DECLARE_EVENT_TABLE()
444 bool EnterBusyMode();
445 virtual void FinishBusyMode(
bool closeCommandGroup =
true );
446 void AbortBusyMode();
449 void OnKeyDown( wxKeyEvent& event );
451 void OnKeyUp( wxKeyEvent& event );
454 void OnChar( wxKeyEvent& event );
458 virtual bool CreateToolObjects();
460 void AdjustRenderOptions();
462 bool m_AllowModifyTemplate;
467 DECLARE_EVENT_TABLE()
503 virtual void ReStart();
515 void SetMousePopupMenu( wxMenu* mousemenu );
540 void SetZoomFirst(
bool zoomfirst );
569 void SetDrawMode(
a2dDrawStyle drawstyle ) { m_drawmode = drawstyle; }
577 unsigned int GetDefaultBehavior() {
return m_defaultBehavior; }
580 void Undo( wxCommandEvent& );
583 void Redo( wxCommandEvent& );
586 void EndTool( wxCommandEvent& );
607 void Zoom(
double x,
double y,
double uppx,
double uppy );
610 void ZoomOut2AtMouse();
613 void ZoomIn2AtMouse();
619 void SetFormat(
const wxString& format ) { m_format = format; }
621 wxString GetFormat() {
return m_format; }
624 void ClearStateStrings();
628 virtual void SetStateString(
const wxString& message = wxEmptyString,
size_t field = 3 );
646 bool TriggerReStartEdit( wxUint16 editmode );
649 bool RotateObject90LeftRight(
bool Right );
671 void SetDraggingCanvasOption(
bool draggingCanvasOption ) { m_draggingCanvasOption = draggingCanvasOption; }
673 bool GetDraggingCanvasOption() {
return m_draggingCanvasOption; }
684 void SetSelectionStateUndo(
bool selectionStateUndo ) { m_selectionStateUndo = selectionStateUndo; }
689 void SetSelectAtEnd(
bool selectedAtEnd ) { m_selectedAtEnd = selectedAtEnd; }
694 void ZoomWindowMenu( wxCommandEvent& );
696 void ZoomPanMenu( wxCommandEvent& );
698 void ZoomUndoMenu( wxCommandEvent& );
700 void ZoomoutMenu( wxCommandEvent& );
702 void Zoomout2Menu( wxCommandEvent& );
704 void Zoomin2Menu( wxCommandEvent& );
710 void OnMouseEvent( wxMouseEvent& event );
712 void OnChar( wxKeyEvent& event );
714 void OnKeyDown( wxKeyEvent& event );
716 void OnKeyUp( wxKeyEvent& event );
724 std::vector<wxString> m_statusStrings;
783 bool m_selectionStateUndo;
785 bool m_selectedAtEnd;
794 DECLARE_EVENT_TABLE()
820 void SetRadius(
double radius ) { m_radius = radius; }
824 virtual void GenerateAnotation();
826 void OnMouseEvent( wxMouseEvent& event );
834 DECLARE_EVENT_TABLE()
873 virtual void GenerateAnotation();
876 void OnChar( wxKeyEvent& event );
878 void OnMouseEvent( wxMouseEvent& event );
885 DECLARE_EVENT_TABLE()
910 void SetShiftIsAdd(
bool shift_is_add =
true ) { m_shift_is_add = shift_is_add; }
915 virtual void GenerateAnotation();
917 void OnChar( wxKeyEvent& event );
919 void OnMouseEvent( wxMouseEvent& event );
921 virtual bool EnterBusyMode();
923 virtual bool CreateToolObjects();
930 DECLARE_EVENT_TABLE()
987 virtual void GenerateAnotation();
989 void OnChar( wxKeyEvent& event );
991 void OnMouseEvent( wxMouseEvent& event );
993 bool m_drawPatternOnTop;
998 DECLARE_EVENT_TABLE()
1033 void SetDropAndDrop(
bool val ) { m_dropAndDrop = val; }
1039 void CaptureMouse();
1041 void ReleaseMouse();
1046 virtual void AdjustShift(
double* x,
double* y );
1050 void OnChar( wxKeyEvent& event );
1052 void OnMouseEvent( wxMouseEvent& event );
1054 virtual bool EnterBusyMode();
1055 virtual void FinishBusyMode(
bool closeCommandGroup =
true );
1056 virtual void AbortBusyMode();
1059 virtual void DragAbsolute(
double x,
double y );
1062 virtual bool CreateToolObjects();
1063 virtual void CleanupToolObjects();
1094 DECLARE_EVENT_TABLE()
1120 void CaptureMouse();
1122 void ReleaseMouse();
1127 virtual void AdjustShift(
double* x,
double* y );
1131 void OnChar( wxKeyEvent& event );
1133 void OnMouseEvent( wxMouseEvent& event );
1135 virtual bool EnterBusyMode();
1136 virtual void FinishBusyMode(
bool closeCommandGroup =
true );
1137 virtual void AbortBusyMode();
1140 virtual void DragAbsolute(
double x,
double y );
1143 virtual bool CreateToolObjects();
1144 virtual void CleanupToolObjects();
1172 DECLARE_EVENT_TABLE()
1176 DECLARE_MENU_ITEMID( CmdMenu_NoDragMenu )
1205 void SetBoxCenterDrag(
bool boxCenterDrag ) { m_boxCenterDrag = boxCenterDrag; }
1206 bool GetBoxCenterDrag() {
return m_boxCenterDrag; }
1212 bool RotateObject90LeftRight(
bool right );
1214 void OnMouseEvent( wxMouseEvent& event );
1216 virtual void AdjustRenderOptions();
1223 void OnEnter( wxMouseEvent& WXUNUSED( event ) );
1225 void OnChar( wxKeyEvent& event );
1228 virtual void DoStopTool(
bool abort );
1229 virtual bool EnterBusyMode();
1230 virtual void FinishBusyMode(
bool closeCommandGroup =
true );
1242 DECLARE_EVENT_TABLE()
1265 void SetDeepCopy(
bool deepCopy ) { m_deepCopy = deepCopy ; }
1267 bool GetDeepCopy() {
return m_deepCopy; }
1270 void OnMouseEvent( wxMouseEvent& event );
1272 virtual bool CreateToolObjects();
1273 bool EnterBusyMode();
1274 void FinishBusyMode(
bool closeCommandGroup =
true );
1276 virtual void AdjustShift(
double* x,
double* y );
1286 DECLARE_EVENT_TABLE()
1310 void CaptureMouse();
1312 void ReleaseMouse();
1316 bool EnterBusyMode();
1317 virtual void FinishBusyMode(
bool closeCommandGroup =
true );
1318 void AbortBusyMode();
1320 void OnChar( wxKeyEvent& event );
1322 void OnIdle( wxIdleEvent& event );
1324 void OnMouseEvent( wxMouseEvent& event );
1340 DECLARE_EVENT_TABLE()
1368 void OnChar( wxKeyEvent& event );
1370 void OnMouseEvent( wxMouseEvent& event );
1376 DECLARE_EVENT_TABLE()
1404 void SetMode(
int mode );
1408 void OnIdle( wxIdleEvent& event );
1410 void OnChar( wxKeyEvent& event );
1412 void OnMouseEvent( wxMouseEvent& event );
1414 virtual void GenerateAnotation();
1422 DECLARE_EVENT_TABLE()
1444 static const a2dCommandId COMID_PushTool_DrawLineScaledArrow;
1467 void SetEndScaleX(
double xs );
1469 void SetEndScaleY(
double ys );
1491 void OnChar( wxKeyEvent& event );
1493 void OnMouseEvent( wxMouseEvent& event );
1497 virtual void GenerateAnotation();
1509 DECLARE_EVENT_TABLE()
1535 void SetMode(
int mode );
1539 void OnIdle( wxIdleEvent& event );
1541 void OnMouseEvent( wxMouseEvent& event );
1543 void OnChar( wxKeyEvent& event );
1545 virtual void GenerateAnotation();
1553 DECLARE_EVENT_TABLE()
1585 void SetMode(
int mode );
1588 void SetMode2(
int mode );
1590 void SetChord(
bool chord ) { m_chord = chord; };
1592 bool GetChord()
const {
return m_chord; }
1596 void OnIdle( wxIdleEvent& event );
1598 void OnChar( wxKeyEvent& event );
1600 void OnMouseEvent( wxMouseEvent& event );
1602 virtual void GenerateAnotation();
1625 DECLARE_EVENT_TABLE()
1657 void SetMode(
int mode );
1660 void SetMode2(
int mode );
1665 bool GetChord()
const {
return m_chord; }
1669 void OnIdle( wxIdleEvent& event );
1671 void OnChar( wxKeyEvent& event );
1673 void OnMouseEvent( wxMouseEvent& event );
1675 virtual void GenerateAnotation();
1698 DECLARE_EVENT_TABLE()
1741 void SetMode(
int mode );
1747 void SetSpline(
bool spline );
1754 void OnIdle( wxIdleEvent& event );
1756 void OnChar( wxKeyEvent& event );
1758 void OnMouseEvent( wxMouseEvent& event );
1765 void BeginPolygon(
double x,
double y );
1766 void AddPoint(
double x,
double y );
1790 DECLARE_EVENT_TABLE()
1849 void SetEndScaleX(
double xs );
1851 void SetEndScaleY(
double ys );
1867 void OnMouseEvent( wxMouseEvent& event );
1877 DECLARE_EVENT_TABLE()
1891 a2d_BasedOnObjectClassRequired,
1896 a2d_StartGenerateSearchFinish
1943 void SetWiringMode(
a2dWiringMode wiringMode ) { m_wiringMode = wiringMode; }
1946 void SetEndMode(
bool splitAtEnd ) { m_splitAtEnd = splitAtEnd; }
1948 bool GetEndMode() {
return m_splitAtEnd; }
1952 void SetEndSegmentMode( a2dNextSeg mode );
1954 a2dNextSeg GetEndSegmentMode() {
return m_endSegmentMode; }
1969 void OnChar( wxKeyEvent& event );
1974 void OnIdle( wxIdleEvent& event );
1992 void OnMouseEvent( wxMouseEvent& event );
1999 int m_startWireXdev;
2000 int m_startWireYdev;
2001 bool m_hadDoubleClick;
2006 a2dNextSeg m_endSegmentMode;
2010 double m_manx, m_many;
2014 DECLARE_EVENT_TABLE()
2039 void SetOnlyKeys(
bool onlyKeys ) { m_onlyKeys = onlyKeys; }
2044 void OnKeyUp( wxKeyEvent& event );
2045 void OnChar( wxKeyEvent& event );
2047 void OnMouseEvent( wxMouseEvent& event );
2054 void CaptureMouse();
2056 void ReleaseMouse();
2058 void DragAbsolute(
double x,
double y );
2063 virtual void AdjustShift(
double* x,
double* y );
2091 DECLARE_EVENT_TABLE()
2113 void OnMouseEvent( wxMouseEvent& event );
2117 bool StartDragging(
int x,
int y );
2124 void OnEnter( wxMouseEvent& WXUNUSED( event ) );
2140 DECLARE_EVENT_TABLE()
2163 void OnChar( wxKeyEvent& event );
2165 void OnMouseEvent( wxMouseEvent& event );
2167 void AdjustShift(
double* x,
double* y );
2175 DECLARE_EVENT_TABLE()
2220 void OnMouseEvent( wxMouseEvent& event );
2227 DECLARE_EVENT_TABLE()
2251 bool StartEditing(
double x,
double y );
2253 bool StartEditing(
int x,
int y );
2259 void OnChar( wxKeyEvent& event );
2261 void OnMouseEvent( wxMouseEvent& event );
2271 DECLARE_EVENT_TABLE()
2289 DECLARE_EVENT_TABLE()
2296 a2dTakeToolstyleNon = 0x0000,
2303 a2dTakeToolstyleToCmdhOnPush = 0x0001,
2310 a2dTakeToolstyleFromCmdhOnPop = 0x0002,
2317 a2dTakeToolstyleFromCmdhOnPush = 0x0004,
2320 a2dTakeToolstyleToNewObject = 0x0008,
2323 a2dTakeToolstyleToCentral = 0x0010,
2334 void SetTakeToolstyleToCmdhOptions( wxUint32 set ) { m_options = set; }
2335 wxUint32 GetTakeToolstyleToCmdhOptions() {
return m_options; }
2342 void OnKeyUp( wxKeyEvent& event );
2347 void OnIdle( wxIdleEvent& event );
2371 DECLARE_EVENT_TABLE()
2391 void OnKeyDown( wxKeyEvent& event );
2392 void OnKeyUp( wxKeyEvent& event );
2448 void SetMode(
int mode );
2452 void OnIdle( wxIdleEvent& event );
2454 void OnChar( wxKeyEvent& event );
2456 void OnMouseEvent( wxMouseEvent& event );
2495 DECLARE_EVENT_TABLE()
2516 bool StartEditing(
double x,
double y );
2518 bool StartEditing(
int x,
int y );
2524 void OnChar( wxKeyEvent& event );
2526 void OnMouseEvent( wxMouseEvent& event );
2533 DECLARE_EVENT_TABLE()
2563 void OnMouseEvent( wxMouseEvent& event );
2565 virtual void AdjustRenderOptions();
2572 void OnEnter( wxMouseEvent& WXUNUSED( event ) );
2575 virtual void DoStopTool(
bool abort );
2576 virtual bool EnterBusyMode();
2577 virtual void FinishBusyMode(
bool closeCommandGroup =
true );
2578 virtual void AbortBusyMode();
2592 DECLARE_EVENT_TABLE()
Display Part of a a2dDrawing, in which a2dCanvasObjects are shown.
static const a2dCommandId COMID_PushTool_Rotate
push this tool on the tools stack
a2dPATH_END_TYPE
defines the way a polyline with a contour width is ended.
static const a2dSignal sig_toolComEventAddObject
static const a2dCommandId COMID_PushTool_DrawEllipse
push this tool on the tools stack
class to map references to objects stored in XML, in order to make the connection later on...
static const a2dCommandId COMID_PushTool_DrawPolygonL
push this tool on the tools stack
a2dDocumentRenderStyle operator|(a2dDocumentRenderStyle a, a2dDocumentRenderStyle b)
OR-ing a2dDocumentRenderStyle is allowed.
a2dPin is used in a2dCanvasObject to add pins to it.
This is a class/type description for a2dPin's.
polygon defined with list of points.
bool ZoomSave()
Is Zooming while the tool is busy Save.
static const a2dCommandId COMID_PushTool_MovePin
push this tool on the tools stack
The base class for all drawable objects in a a2dCanvasDocument.
snapping engine, for snapping while editing a drawing
static const a2dCommandId COMID_PushTool_DrawPolylineL
push this tool on the tools stack
#define DECLARE_PROPERTIES()
check if class has the given id as a valid id for this object
a2dCanvasObject is the base class for Canvas Objects.
static const a2dCommandId COMID_PushTool_DrawArc
push this tool on the tools stack
static const a2dCommandId COMID_PushTool_DragNew
push this tool on the tools stack
vertex list of line and arc segments.
static const a2dSignal sig_toolComEventSetEditObject
static const a2dCommandId COMID_PushTool_CopyMulti
push this tool on the tools stack
a2dDrawStyle
Define the manner in which a2dCanvasView draws to the device.
static const a2dCommandId COMID_PushTool_Property
push this tool on the tools stack
wxUint64 a2dCanvasObjectFlagsMask
mask flags for a2dCanvasObject
a2dText is an abstract base class.
virtual bool EditProperties(const a2dPropertyId *id, bool withUndo=true)
edit properties of the object
static const a2dCommandId COMID_PushTool_Delete
push this tool on the tools stack
void SetTemplateObject(a2dText *templateobject)
get template for line object
polyline defined with list of points.
static const a2dCommandId COMID_PushTool_DrawPolylineL_Splined
push this tool on the tools stack
static const a2dCommandId COMID_PushTool_Copy
push this tool on the tools stack
Normal straight line segment in a2dVpath.
static const a2dCommandId COMID_PushTool_DragNew
push this tool on the tools stack
static const a2dCommandId COMID_PushTool_DrawRectangle
push this tool on the tools stack
Normal straight line segment in a2dVertexList and a2dVertexArray.
static const a2dCommandId COMID_PushTool_DrawWirePolylineL
push this tool on the tools stack
static const a2dCommandId COMID_PushTool_DrawPolygonL_Splined
push this tool on the tools stack
static const a2dCommandId COMID_PushTool_Zoom
push this tool on the tools stack
bool m_withUndo
undoable or not
static const a2dCommandId COMID_PushTool_DragMulti
push this tool on the tools stack
static const a2dCommandId COMID_PushTool_DrawLine
push this tool on the tools stack
bool ZoomSave()
Is Zooming while the tool is busy Save.
wxUint32 a2dSnapToWhatMask
mask for a2dSnapToWhat flags
Each a2dCommand is given a command id at construction.
static const a2dCommandId COMID_PushTool_Image
push this tool on the tools stack
A 2x3 affine matrix class for 2D transformations.
static const a2dCommandId COMID_PushTool_Drag
push this tool on the tools stack
while iterating a a2dCanvasDocument, this holds the context.
static const a2dCommandId COMID_PushTool_DrawEllipticArc_Chord
push this tool on the tools stack
static const a2dCommandId COMID_PushTool_DrawEllipticArc
push this tool on the tools stack
Interactive drawing a text object.
static const a2dCommandId COMID_PushTool_FollowLink
push this tool on the tools stack
static const a2dCommandId COMID_PushTool_DrawText
push this tool on the tools stack
This is the base class for all kinds of property id's for a2dObject.
static const a2dCommandId COMID_PushTool_DrawVPath
push this tool on the tools stack
Event sent to a2dCommandProcessor.
static const a2dCommandId COMID_PushTool_DrawArc_Chord
push this tool on the tools stack
static const wxEventType sm_showCursor
The a2dBoundingBox class stores one a2dBoundingBox of a a2dCanvasObject.
static const a2dCommandId COMID_PushTool_DragOrg
push this tool on the tools stack
static const a2dCommandId COMID_PushTool_DrawCircle
push this tool on the tools stack
a2dCanvasObject for a Vector Path
This template class is for property ids with a known data type.
static const a2dCanvasObjectFlagsMask ALL
static const a2dCommandId COMID_PushTool_Select
push this tool on the tools stack
CloneOptions
options for cloning
when a new wire or other connection object needs to be created,
a2dText * GetTemplateObject() const
set template for line object
a2dEllipticArc centered at x,y