00001 00002 00003 #ifndef _TOOLCONTR 00004 #define _TOOLCONTR 00005 00006 #ifdef __GNUG__ 00007 #pragma interface 00008 #endif 00009 00010 #include "misc.h" 00011 #include "tool.h" 00012 #include "windrv.h" 00013 #include "wxwin.h" 00014 00016 00029 class ToolControl :public wxEvtHandler 00030 { 00031 public: 00032 //constructor 00033 ToolControl(); 00034 //destructor 00035 ~ToolControl(); 00036 00038 void OnMouseEvent(wxMouseEvent& event); 00040 void OnChar(wxKeyEvent& event); 00042 void OnKeyDown(wxKeyEvent& event); 00044 void OnKeyUp(wxKeyEvent& event); 00045 00047 ToolSet GetActiveType(); 00049 BaseTool* GetActiveTool(); 00050 00052 bool PopTool(); 00054 bool PushTool(); 00059 bool StartTool(ToolSet a_tool,bool onlyonce); 00060 00062 bool EndTool(bool now=false); 00063 00065 bool StopTool(); 00067 bool StopTool(bool settoolinfo); 00069 void CalculateCurrent(); 00071 int NumberOfTools(); 00073 bool Undo(); 00074 //draw contents of tools on the stack 00075 bool Draw(); 00077 bool Begin(); 00079 bool End(); 00080 00081 protected: 00083 bool _toolactive; 00085 DL_List<void*>* _tool_stack; 00087 BaseTool* _tool; 00089 long _currentX; 00091 long _currentY; 00093 double _realcurrentX; 00095 double _realcurrentY; 00096 00097 public: 00098 DECLARE_EVENT_TABLE() 00099 00100 }; 00101 00102 #endif 00103 00104