mgui/toolcanv.h

Go to the documentation of this file.
00001 /**
00002  * \file mgui/toolcanv.h
00003  * \brief MGUI::TOOL_CANVAS definitions.
00004  *
00005  * \if NODOC
00006  * $Id: toolcanv.h_v 1.4 2003/10/03 19:58:19 linux32build!build Exp $
00007  *
00008  * $Log: toolcanv.h_v $
00009  * Revision 1.4  2003/10/03 19:58:19  linux32build!build
00010  * Doxygen
00011  *
00012  * Revision 1.3  2003/09/15 13:49:32  fileserver!dwilliss
00013  * Doxygen
00014  *
00015  * Revision 1.2  2003/01/10 23:07:57  mju
00016  * Add GetCanvasExtents.
00017  *
00018  * Revision 1.1  2003/01/08 22:56:58  mju
00019  * Initial revision
00020  * \endif
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 //!   TOOLCANVAS - Container canvas for graphic tools
00042 
00043 class TOOLCANVAS : public CANVAS {
00044 
00045    public:
00046 
00047       //! Default constructor.
00048       TOOLCANVAS ();
00049       
00050       //! Destructor.               
00051       virtual ~TOOLCANVAS ();
00052 
00053       //! Get pointer to currently active graphic tool.
00054       TOOL_BASE *GetActiveTool (
00055          ) const { return (m_ActiveTool); }
00056 
00057       //! Resume active graphic tool.
00058       void GraphicToolResume (
00059          ) const;
00060 
00061       //! Suspend active graphic tool.
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       //! MGUI::CANVAS overrides.
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 }  // End namspace MGUI
00093 
00094 #endif   // INC_MGUI_TOOLCANV_H

Generated on Thu Aug 12 06:18:29 2004 for TNTsdk by doxygen 1.3.4-20031026