00001
00034 #ifndef INC_GRE_UIVIEWTOOLSIMPLE_H
00035 #define INC_GRE_UIVIEWTOOLSIMPLE_H
00036
00037 #ifndef INC_GRE_UIVIEWTOOL_H
00038 #include <gre/uiviewtool.h>
00039 #endif
00040
00041 #ifndef INC_MGUI_TOOLBASE_H
00042 #include <mgui/toolbase.h>
00043 #endif
00044
00045 namespace GRE {
00046 namespace UI {
00047
00048
00049
00051 class VIEWTOOL_SIMPLE : public GRE::UI::VIEWTOOL {
00052 public:
00053
00055 VIEWTOOL_SIMPLE (
00056 GRE::UI::VIEW_CANVAS& view,
00057 MGUI::TOOL_BASE& guitool,
00058 const MISTRING& name,
00059 ICONID iconid,
00060 bool AutoTrans = true,
00061 VIEWTOOLID toolid = VIEWTOOLID_Unspecified,
00062 char HotKey = 0
00063 );
00064
00066 VIEWTOOL_SIMPLE (
00067 GRE::UI::VIEW_CANVAS& view,
00068 MGUI::TOOL_BASE& guitool,
00069 const MISTRING& name,
00070 ICONID iconid,
00071 ICID icidmenu,
00072 ICID icidbutton,
00073 bool AutoTrans = true,
00074 VIEWTOOLID toolid = VIEWTOOLID_Unspecified,
00075 char HotKey = 0
00076 );
00077
00078 virtual ~VIEWTOOL_SIMPLE ();
00079
00082 void EnableAutoTrans (
00083 bool enable
00084 ) { m_AutoTrans = enable; }
00085
00088 void SetDelegateOnActivate (
00089 DELEGATE_VOID_NOPARMS delegate
00090 ) { m_DelegateOnActivate = delegate; }
00091
00094 void SetDelegateOnDeactivate (
00095 DELEGATE_VOID_NOPARMS delegate
00096 ) { m_DelegateOnDeactivate = delegate; }
00097
00100 void SetDelegateOnResume (
00101 DELEGATE_VOID_NOPARMS delegate
00102 ) { m_DelegateOnResume = delegate; }
00103
00104 private:
00105 #ifndef GENERATING_DOXYGEN_OUTPUT
00106
00107 typedef VIEWTOOL_SIMPLE THISCLASS;
00108
00109 MGUI::TOOL_BASE& m_guitool;
00110 DELEGATE_VOID_NOPARMS m_DelegateOnActivate;
00111 DELEGATE_VOID_NOPARMS m_DelegateOnDeactivate;
00112 DELEGATE_VOID_NOPARMS m_DelegateOnResume;
00113 bool m_AutoTrans;
00114
00115 void SetupTrans ();
00116
00117 virtual bool v_Activate ();
00118 virtual void v_Deactivate ();
00119 virtual void v_Suspend ();
00120 virtual void v_Resume ();
00121
00122 #endif
00123 };
00124
00125
00126
00128 template <typename _TOOLTYPE> class VIEWTOOL_SIMPLE_T : public VIEWTOOL_SIMPLE {
00129 public:
00130
00132 VIEWTOOL_SIMPLE_T (
00133 GRE::UI::VIEW_CANVAS& view,
00134 const MISTRING& name,
00135 ICONID iconid,
00136 bool AutoTrans = true,
00137 VIEWTOOLID toolid = VIEWTOOLID_Unspecified,
00138 char HotKey = 0
00139 ) : VIEWTOOL_SIMPLE(view,m_guitool,name,iconid,AutoTrans,toolid,HotKey), m_guitool(&view.GetCanvas()) { }
00140
00142 VIEWTOOL_SIMPLE_T (
00143 GRE::UI::VIEW_CANVAS& view,
00144 const MISTRING& name,
00145 ICONID iconid,
00146 ICID icidmenu,
00147 ICID icidbutton,
00148 bool AutoTrans = true,
00149 VIEWTOOLID toolid = VIEWTOOLID_Unspecified,
00150 char HotKey = 0
00151 ) : VIEWTOOL_SIMPLE(view,m_guitool,name,iconid,icidmenu,icidbutton,AutoTrans,toolid,HotKey), m_guitool(&view.GetCanvas()) { }
00152
00154 const _TOOLTYPE& GetGuiTool () const
00155 { return (m_guitool); }
00156
00158 _TOOLTYPE& GetGuiTool ()
00159 { return (m_guitool); }
00160
00161 private:
00162 #ifndef GENERATING_DOXYGEN_OUTPUT
00163 _TOOLTYPE m_guitool;
00164 #endif
00165 };
00166
00167
00168
00169 }
00170 }
00171
00172
00173 #endif INC_GRE_UIVIEWTOOLSIMPLE_H