00001
00080 #ifndef INC_GRE_UIVIEWCANVAS_H
00081 #define INC_GRE_UIVIEWCANVAS_H
00082
00083 #ifndef INC_GRE_VIEW_H
00084 #include <gre/view.h>
00085 #endif
00086
00087 #ifndef INC_GRE_UIVIEWTOOLID_H
00088 #include <gre/uiviewtoolid.h>
00089 #endif
00090
00091 #ifndef INC_MGUI_TOOLCANVAS_H
00092 #include <mgui/toolcanvas.h>
00093 #endif
00094
00095
00096 #ifndef GENERATING_DOXYGEN_OUTPUT
00097
00098 namespace GRE {
00099 class TOOLSCRIPT;
00100 namespace UI {
00101 class VIEWTOOL;
00102 class VIEWTOOLMGR;
00103 }
00104 }
00105 namespace MGD {
00106 class DEVICE_MEM32RGB;
00107 }
00108 #endif
00109
00110
00111 namespace GRE {
00112 namespace UI {
00113
00114
00115
00116 class VIEW_CANVAS : public GRE::VIEW {
00117 public:
00118
00120 VIEW_CANVAS ();
00121
00123 virtual ~VIEW_CANVAS ();
00124
00126 ERRVALUE CreateCanvas (
00127 MGUI::LAYOUT_PANE& ParentPane,
00128 VIEWABLE *viewable,
00129 int iwidth,
00130 int iheight,
00131 const char *sizefield = 0,
00132 CREATEFLAGS createflags = CREATEFLAG_None,
00133 MGUI::LAYOUT_SIZEALIGN sizealign = MGUI::LAYOUT_SIZEALIGN_Expand
00134 );
00135
00137 MGUI::TOOLCANVAS& GetCanvas (
00138 ) { return (*m_pCanvas); }
00139
00141 MGD::DEVICE_MEM32RGB* GetDrawingDeviceViewInView (
00142 ) const { return (m_pDeviceViewInView); }
00143
00146 MGUI::LAYOUT_PANE* GetToolBarPane (
00147 ) { return (v_GetToolBarPane()); }
00148
00151 VIEWTOOLMGR* GetToolMgr (
00152 ) const { return (m_pViewToolMgr); }
00153
00156 ERRVALUE Pan (
00157 INT16 dx,
00158 INT16 dy
00159 );
00160
00162 VIEWTOOL* ToolFind (
00163 VIEWTOOLID ViewToolID
00164 ) const;
00165
00168 VIEWTOOL* ToolGetActive (
00169 ) const;
00170
00173 VIEWTOOLID ToolGetActiveID (
00174 ) const;
00175
00177 void ToolSet (
00178 VIEWTOOL* tool
00179 );
00180
00182 void ToolSet (
00183 VIEWTOOLID ViewToolID
00184 );
00185
00187 void ToolSetDefault (
00188 );
00189
00192 ERRVALUE Zoom (
00193 double dz,
00194 INT16 cx,
00195 INT16 cy
00196 );
00197
00198 #ifndef GENERATING_DOXYGEN_OUTPUT
00199
00200 static void SML_ClassInstall (
00201 SML::CONTEXT *context
00202 );
00203 #endif
00204
00205 protected:
00206
00209
00212 virtual bool v_OnKey (
00213 MGUI::POINT point,
00214 MGUI::KEYCODE keycode,
00215 MGUI::KEYSTATE keystate
00216 );
00217
00220 virtual void v_OnPointerButtonDown (MGUI::POINT point, MGUI::POINTERBUTTON button, MGUI::KEYSTATE keystate);
00221
00224 virtual void v_OnPointerButtonUp (MGUI::POINT point, MGUI::POINTERBUTTON button, MGUI::KEYSTATE keystate);
00225
00228 virtual void v_OnPointerEnter ();
00229
00232 virtual void v_OnPointerLeave ();
00233
00236 virtual void v_OnPointerMove (
00237 MGUI::POINT point,
00238 MGUI::KEYSTATE keystate
00239 );
00240
00242
00243 private:
00244 #ifndef GENERATING_DOXYGEN_OUTPUT
00245 typedef VIEW_CANVAS THISCLASS;
00246 friend class GRE::UI::VIEWTOOLMGR;
00247 class PRIVCANVAS;
00248 friend class GRE::UI::VIEW_CANVAS::PRIVCANVAS;
00249
00250 MGUI::TOOLCANVAS *m_pCanvas;
00251 VIEWTOOLMGR *m_pViewToolMgr;
00252 MGD::DEVICE_MEM32RGB *m_pDeviceViewInView;
00253 MGUI::CTRL_TOOLTIP *m_pDataTip;
00254
00255 bool NotifyCanvasKey (MGUI::POINT point, MGUI::KEYCODE keycode, MGUI::KEYSTATE keystate);
00256 void NotifyCanvasPaint (MGD::CONTEXT *gc);
00257 void NotifyCanvasPointerButtonDown (MGUI::POINT point, MGUI::POINTERBUTTON button, MGUI::KEYSTATE keystate);
00258 void NotifyCanvasPointerButtonUp (MGUI::POINT point, MGUI::POINTERBUTTON button, MGUI::KEYSTATE keystate);
00259 void NotifyCanvasPointerEnter ();
00260 void NotifyCanvasPointerLeave ();
00261 void NotifyCanvasPointerMove (MGUI::POINT point, MGUI::POINTERBUTTON button, MGUI::KEYSTATE keystate);
00262 void NotifyCanvasSize (int width, int height);
00263
00264
00265 virtual void v_DataTipSetDelay (INT32 delay);
00266 virtual void v_DataTipSetPixelDelta (int PixelDelta);
00267 virtual ERRVALUE v_Draw ();
00268 virtual ERRVALUE v_DrawThisOnly (GRE::DRAWFLAGS drawflags);
00269 virtual MDLGPARENT v_GetDlgParent () const;
00270 virtual MGD::DEVICE* v_GetDrawingDeviceMemory (bool UseStereo) const;
00271 virtual MGD::DEVICE* v_GetDrawingDeviceScreen () const;
00272 virtual int v_GetViewNum () const;
00273 virtual void v_OnLayerRendered (GRE::LAYER *layer);
00274 virtual void v_RestoreFromMemory (const LRECT2D *rect, bool UseScreenBuffer);
00275 virtual ERRVALUE v_TestCancel ();
00276 virtual void v_UpdateMessage (const MISTRING& string);
00277 virtual void v_UpdateUI ();
00278
00279
00280 VIEW_CANVAS (const VIEW_CANVAS&);
00281 VIEW_CANVAS& operator= (const VIEW_CANVAS&);
00282 #endif
00283
00284
00285
00288 virtual MGUI::LAYOUT_PANE* v_GetToolBarPane ();
00289 };
00290
00291
00292
00293 VIEWTOOL* ToolAddDragZoom (VIEW_CANVAS *view);
00294 VIEWTOOL* ToolAddExamineRaster (VIEW_CANVAS *view);
00295 VIEWTOOL* ToolAddGeoToolbox (VIEW_CANVAS *view);
00296 VIEWTOOL* ToolAddHyperEdit (VIEW_CANVAS *view);
00297 VIEWTOOL* ToolAddHyperNavigate (VIEW_CANVAS *view);
00298 VIEWTOOL* ToolAddPlacement (VIEW_CANVAS *view);
00299 VIEWTOOL* ToolAddPointProfile (VIEW_CANVAS *view);
00300 VIEWTOOL* ToolAddRecenter (VIEW_CANVAS *view);
00301 VIEWTOOL* ToolAddScript (VIEW_CANVAS *view, const TOOLSCRIPT& script);
00302 VIEWTOOL* ToolAddSelectPoint (VIEW_CANVAS *view);
00303 VIEWTOOL* ToolAddSketch (VIEW_CANVAS *view);
00304 VIEWTOOL* ToolAddViewInView (VIEW_CANVAS *view);
00305 VIEWTOOL* ToolAddViewPos3D (VIEW_CANVAS *view);
00306 VIEWTOOL* ToolAddZoom (VIEW_CANVAS *view);
00307
00308
00309 }
00310 }
00311
00312 #endif // INC_GRE_UIVIEWCANVAS_H