00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015 #ifndef __A2DMEASURE_H__
00016 #define __A2DMEASURE_H__
00017
00018 #ifndef WX_PRECOMP
00019 #include "wx/wx.h"
00020 #endif
00021
00022 #include "wx/editor/sttool.h"
00023
00024
00025
00026 #define SYMBOL_A2DMEASUREDLG_STYLE wxCAPTION|wxRESIZE_BORDER|wxSYSTEM_MENU|wxCLOSE_BOX
00027 #define SYMBOL_A2DMEASUREDLG_TITLE _("Measure")
00028 #define SYMBOL_A2DMEASUREDLG_SIZE wxSize(400, 300)
00029 #define SYMBOL_A2DMEASUREDLG_POSITION wxDefaultPosition
00030
00031
00032
00033
00034
00035
00036 #ifndef wxCLOSE_BOX
00037 #define wxCLOSE_BOX 0x1000
00038 #endif
00039 #ifndef wxFIXED_MINSIZE
00040 #define wxFIXED_MINSIZE 0
00041 #endif
00042
00043
00044
00045
00046
00047 class a2dMeasureDlg: public wxDialog
00048 {
00049 DECLARE_DYNAMIC_CLASS( a2dMeasureDlg )
00050 DECLARE_EVENT_TABLE()
00051
00052 public:
00053
00054 a2dMeasureDlg( );
00055 ~a2dMeasureDlg( );
00056 a2dMeasureDlg( wxWindow* parent, wxWindowID id = -1, const wxString& caption = SYMBOL_A2DMEASUREDLG_TITLE, const wxPoint& pos = SYMBOL_A2DMEASUREDLG_POSITION, const wxSize& size = SYMBOL_A2DMEASUREDLG_SIZE, long style = SYMBOL_A2DMEASUREDLG_STYLE );
00057
00058
00059 bool Create( wxWindow* parent, wxWindowID id = -1, const wxString& caption = SYMBOL_A2DMEASUREDLG_TITLE, const wxPoint& pos = SYMBOL_A2DMEASUREDLG_POSITION, const wxSize& size = SYMBOL_A2DMEASUREDLG_SIZE, long style = SYMBOL_A2DMEASUREDLG_STYLE );
00060
00061
00062 void CreateControls();
00063
00064
00065
00066
00067 void OnCloseWindow( wxCloseEvent& event );
00068
00069
00070 void OnIdle( wxIdleEvent& event );
00071
00072
00073 void OnXEnter( wxCommandEvent& event );
00074
00075
00076 void OnXUpdate( wxUpdateUIEvent& event );
00077
00078
00079 void OnYEnter( wxCommandEvent& event );
00080
00081
00082 void OnYUpdate( wxUpdateUIEvent& event );
00083
00084
00085 void OnListboxSelected( wxCommandEvent& event );
00086
00087
00088 void OnListboxUpdate( wxUpdateUIEvent& event );
00089
00090
00091 void OnHideClick( wxCommandEvent& event );
00092
00093
00094 void OnClearClick( wxCommandEvent& event );
00095
00096
00097 void OnSumUpdate( wxUpdateUIEvent& event );
00098
00099
00100
00101
00102
00103
00104 wxBitmap GetBitmapResource( const wxString& name );
00105
00106
00107 wxIcon GetIconResource( const wxString& name );
00108
00109
00110
00111 static bool ShowToolTips();
00112
00113 void AppendMeasure( double x, double y );
00114
00115 void OnComEvent( a2dComEvent& event );
00116 void OnDoEvent( a2dCommandProcessorEvent& event );
00117
00118
00119 wxTextCtrl* m_x;
00120 wxTextCtrl* m_y;
00121 wxListBox* m_lb;
00122 wxButton* m_hide;
00123 wxButton* m_clear;
00124 wxTextCtrl* m_sum;
00125
00126 a2dVertexList m_vertexes;
00127
00128 };
00129
00130
00131
00132
00133
00134
00135
00136
00137
00138
00139
00140 class A2DEDITORDLLEXP a2dMeasureTool: public a2dDrawPolylineLTool
00141 {
00142 public:
00143
00144
00145
00146
00147 static const a2dCommandId COMID_PushTool_Measure;
00148
00149 a2dMeasureTool(a2dStToolContr* controller);
00150 ~a2dMeasureTool();
00151
00152 bool ZoomSave(){return true;};
00153
00154 protected:
00155
00156 virtual void GenerateAnotation();
00157
00158
00159 void OnChar(wxKeyEvent& event);
00160
00161 void OnMouseEvent(wxMouseEvent& event);
00162
00163 virtual wxString GetCommandGroupName() { return _("Measure Tool"); }
00164
00165 public:
00166
00167 DECLARE_CLASS(a2dMeasureTool)
00168 A2D_DECLARE_EVENT_TABLE()
00169 };
00170
00171 #endif
00172
00173
00174