00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #ifndef INC_MGUI_TOOLCANV_H
00024 #define INC_MGUI_TOOLCANV_H
00025
00026 #ifndef INC_MGUI_CANVAS_H
00027 #include <mgui/canvas.h>
00028 #endif
00029
00030 #ifndef INC_MI32_MILIST_H
00031 #include <mi32/milist.h>
00032 #endif
00033
00034 namespace MGUI {
00035
00036 #ifndef GENERATING_DOXYGEN_OUTPUT
00037 class TOOL_BASE;
00038 #endif // GENERATING_DOXYGEN_OUTPUT
00039
00040
00041
00042
00043 class TOOLCANVAS : public CANVAS {
00044
00045 public:
00046
00047
00048 TOOLCANVAS ();
00049
00050
00051 virtual ~TOOLCANVAS ();
00052
00053
00054 TOOL_BASE *GetActiveTool (
00055 ) const { return (m_ActiveTool); }
00056
00057
00058 void GraphicToolResume (
00059 ) const;
00060
00061
00062 void GraphicToolSuspend (
00063 ) const;
00064
00065 private:
00066 #ifndef GENERATING_DOXYGEN_OUTPUT
00067
00068 TOOL_BASE *m_ActiveTool;
00069 MILIST<TOOL_BASE*> m_ToolList;
00070
00071 void AddTool (TOOL_BASE *const tool);
00072 void RemoveTool (TOOL_BASE *const tool);
00073 void SetActiveTool (TOOL_BASE* tool) { m_ActiveTool = tool; }
00074
00075
00076 virtual void v_OnCaptureChanged ();
00077 virtual bool v_OnKey (MGUI::POINT point, MGUI::KEYCODE keycode, MGUI::KEYSTATE keystate);
00078 virtual void v_OnLeftDown (MGUI::POINT point, KEYSTATE keystate);
00079 virtual void v_OnLeftUp (MGUI::POINT point, KEYSTATE keystate);
00080 virtual void v_OnMouseMove (MGUI::POINT point, KEYSTATE keystate);
00081 virtual void v_OnPaint (MGD::CONTEXT *gc);
00082 virtual void v_OnRightDown (MGUI::POINT point, KEYSTATE keystate);
00083 virtual void v_OnRightUp (MGUI::POINT point, KEYSTATE keystate);
00084 virtual void v_OnSize (int width, int height);
00085 #endif // GENERATING_DOXYGEN_OUTPUT
00086
00087 friend class TOOL_BASE;
00088 };
00089
00090
00091
00092 }
00093
00094 #endif // INC_MGUI_TOOLCANV_H