mgui/toolbase.h

Go to the documentation of this file.
00001 /**
00002  * \file mgui/toolbase.h
00003  * \brief MGUI::TOOL_BASE class definitions.
00004  *
00005  * \if NODOC
00006  * $Id: toolbase.h_v 1.6 2003/12/16 15:49:31 mju Exp $
00007  *
00008  * $Log: toolbase.h_v $
00009  * Revision 1.6  2003/12/16 15:49:31  mju
00010  * Use dlgshell.
00011  *
00012  * Revision 1.5  2003/10/01 22:32:36  dwilliss
00013  * doxygen
00014  *
00015  * Revision 1.4  2003/09/15 13:49:32  fileserver!dwilliss
00016  * Doxygen
00017  *
00018  * Revision 1.3  2003/01/10 23:07:47  mju
00019  * Initial tool set now donw.
00020  *
00021  * Revision 1.2  2003/01/09 21:05:34  mju
00022  * Revised design.
00023  *
00024  * Revision 1.1  2003/01/08 22:50:23  mju
00025  * Initial revision
00026  * \endif
00027 **/
00028 
00029 #ifndef  INC_MGUI_TOOLBASE_H
00030 #define  INC_MGUI_TOOLBASE_H
00031 
00032 #ifndef  INC_MGUI_CTRL_H
00033    #include <mgui/ctrl.h>
00034 #endif
00035 
00036 #ifndef  INC_MGUI_TOOLCANV_H
00037    #include <mgui/toolcanv.h>
00038 #endif
00039 
00040 #ifndef  INC_MGUI_DLGSHELL_H
00041    #include <mgui/dlgshell.h>
00042 #endif
00043 
00044 #ifndef  INC_MI32_TRANS2DC_H
00045    #include <mi32/trans2dc.h>
00046 #endif
00047 
00048 #ifndef GENERATING_DOXYGEN_OUTPUT
00049 class REGION2D;
00050 namespace MGD {
00051    class CONTEXT;
00052    }
00053 #endif // GENERATING_DOXYGEN_OUTPUT
00054 
00055 namespace MGUI {
00056 
00057 //=====================================================================================================================
00058 //!   Base class for graphic tools.
00059 //! Derived tool clients should only override the v_OnNotifyChange virtual method to receive tool change notifications.
00060 //! Tool implementations should NOT override the v_OnNotifyChange virtual methods (but may define new v_OnNotify...
00061 //! methods) as this avoids the need for derived tool client classes to call base methods.
00062 class TOOL_BASE {
00063    public:
00064 
00065       //! Adjustment flags for Move() and Resize() methods.
00066       enum ADJUSTFLAGS {
00067          ADJUST_Default =        0x00,       //!< Values are relative tool coordinates
00068          ADJUST_Absolute =       0x01,       //!< Adjustment values are absolute
00069          ADJUST_ScreenCoords =   0x02,       //!< Adjustment values are in screen pixels
00070          ADJUST_Notify =         0x80        //!< Send notification message
00071          };
00072 
00073       //! Options for standard and manual control forms.
00074       enum CTRLOPT {
00075          CTRLOPT_Default =       0x00,
00076          CTRLOPT_Manual =        0x01,    //!< Include "manual" controls if available
00077          CTRLOPT_GPS =           0x02,    //!< Include "gps" controls if supported
00078          CTRLOPT_SnapGrid =      0x04,    //!< Include "snap to grid" toggle if supported
00079          CTRLOPT_NoManualProj =  0x08     //!< Don't allow manual projection / distance controls
00080          };
00081 
00082       //! sequence
00083       enum CHANGESEQ {
00084          CHANGESEQ_None =     0,
00085          CHANGESEQ_Begin =    1,
00086          CHANGESEQ_Continue = 2,
00087          CHANGESEQ_End =      3,
00088          CHANGESEQ_Cancel =   4
00089          };
00090 
00091       enum CHANGETYPE {
00092          CHANGETYPE_None =    0,
00093          CHANGETYPE_Shift =   1,
00094          CHANGETYPE_Resize =  2,
00095          CHANGETYPE_Rotate =  3,
00096          CHANGETYPE_Shear =   4,
00097          CHANGETYPE_Edit =    5,
00098          CHANGETYPE_Create =  6,
00099          CHANGETYPE_Clear =   7
00100          };
00101 
00102       //! Marker types, not all types are supported by all tools.
00103       enum MARKER {
00104          MARKER_X =           0,    //!< Diagonal cross
00105          MARKER_Plus =        1,    //!< Orthogonal cross
00106          MARKER_ArrowIn =     2,    //!< Arrow pointing in for line endpoint
00107          MARKER_ArrowOut =    3,    //!< Arrow pointing out for line endpoint
00108          MARKER_None =        4,    //!< No marker
00109          MARKER_Circle =      5,    //!< Circle
00110          MARKER_Flat =        6,    //!< Flat line endpoint
00111          MARKER_Square =      7,    //!< Square
00112          };
00113 
00114       enum PENCOLOR {
00115          PENCOLOR_Primary,          //!< Primary tool drawing color
00116          PENCOLOR_Inactive,         //!< Color for inactive elements (eg in POLYLINE tool)
00117          PENCOLOR_Highlight,        //!< Color for highlighting
00118          PENCOLOR_COUNT             //!< Number of pens, always last
00119          };
00120 
00121       //! Snap grid definition.
00122       class SNAPGRID {
00123          public:
00124 
00125             //! Default constructor.
00126             SNAPGRID (
00127                );
00128 
00129             //! Construct with specified interval.
00130             explicit SNAPGRID (
00131                const DPOINT2D& interval
00132                );
00133 
00134             //! Construct with specified interval and transformation.
00135             SNAPGRID (
00136                const DPOINT2D& interval,
00137                const TRANS2D_AFFINE& trans      //!< Transformation from tool to snap grid coordinates
00138                );
00139 
00140             //! Adjust specified point to snap grid
00141             void Adjust (
00142                DPOINT2D& pt                     //!< Point in "tool" coordinates
00143                ) const;
00144 
00145             //! Get snap interval.
00146             const DPOINT2D& GetInterval (
00147                ) const { return (m_interval); }
00148 
00149             //! Get transformation from tool to snapgrid coordinates.
00150             const TRANS2D_AFFINE& GetTrans (
00151                ) const { return (m_trans); }
00152 
00153             //! Determine if snapgrid is valid.
00154             bool IsValid (
00155                ) const { return (m_interval.x > 0 && m_interval.y > 0); }
00156 
00157             //! Set snap interval.
00158             void SetInterval (
00159                const DPOINT2D& interval
00160                ) { m_interval = interval; }
00161 
00162             //! Set transformation from tool to snapgrid coordinates.
00163             void SetTrans (
00164                const TRANS2D_AFFINE& trans      //!< Transformation from tool to snap grid coordinates
00165                ) { m_trans = trans; }
00166 
00167          private:
00168             #ifndef GENERATING_DOXYGEN_OUTPUT
00169             DPOINT2D m_interval;
00170             TRANS2D_AFFINE m_trans;
00171             #endif // GENERATING_DOXYGEN_OUTPUT
00172          };
00173 
00174       //! Get global tool pen color reference.
00175       //! @return Color reference.
00176       static UINT32 GetPenColorRef (
00177          PENCOLOR pencolor = PENCOLOR_Primary
00178          );
00179 
00180       //! Set global tool pen color.
00181       static void SetPenColorRef (
00182          PENCOLOR pencolor,
00183          UINT32 ColorRef                        //!< Color reference
00184          );
00185 
00186       //! Destructor
00187       virtual ~TOOL_BASE () = 0;
00188 
00189       //! Activate the tool.
00190       //! If another tool is currently active on the canvas it will be automatically deactivated.
00191       void Activate (
00192          );
00193 
00194       //! Clear current tool position, erasing all graphics.
00195       void ClearPosition (
00196          );
00197 
00198       //! Create "form" with tool-specific controls.
00199       //! @return Pointer to FORM or NULL if tool has no "control" form.
00200       MGUI::FORM* CreateControlForm (
00201          MGUI::LAYOUT_PANE_BASE& ParentPane, //!< Parent pane
00202          CTRLOPT ctrlopt                     //!< Control options
00203          ) { return (v_CreateControlForm(ParentPane,ctrlopt)); }
00204 
00205       //! Create "form" with tool-specific manual-entry controls.
00206       //! @return Pointer to FORM or NULL if tool has no "manual entry" form.
00207       MGUI::FORM* CreateManualForm (
00208          MGUI::LAYOUT_PANE_BASE& ParentPane, //!< Parent pane
00209          CTRLOPT ctrlopt                     //!< Control options
00210          ) { return (v_CreateManualForm(ParentPane,ctrlopt)); }
00211 
00212       //! Deactivate this tool.
00213       void Deactivate (
00214          );
00215 
00216       //! Generate region from tool.
00217       ERRVALUE GenerateRegion (
00218          REGION2D& region                 //!< Region in 'tool' coordinates returned
00219          ) const { return (v_GenerateRegion(region)); }
00220 
00221       //! Get movement values associated with arrow keys.
00222       //! @return Values in "tool" coordinates.
00223       const DPOINT2D& GetArrowKeyDeltas (
00224          ) const { return (m_ArrowDelta); }
00225 
00226       //! Get current control options settings.
00227       CTRLOPT GetControlOptions (
00228          ) const { return (m_ctrlopt); }
00229 
00230       //! Get transformation between "tool" and "window" coordinates.
00231       const TRANS2D_AFFINE& GetTransToWindow (
00232          ) const { return (m_ToolToWindow); }
00233 
00234       //! Get "canvas" associated with tool.
00235       TOOLCANVAS* GetCanvas (
00236          ) const { return (m_canvas); }
00237 
00238       //! Get extents of canvas.
00239       void GetCanvasExtents (
00240          DRECT2D& extents
00241          ) const;
00242 
00243       //! Determine if tool controls available.
00244       bool HasControls (
00245          ) const { return (m_ControlNeed != CONTROLNEED_None); }
00246 
00247       //! Determine if has manual data entry controls.
00248       bool HasManualControls (
00249          ) const { return (m_HasManualControls); };
00250 
00251       //! Check if tool is currently "active".
00252       bool IsActive (
00253          ) const { return (m_IsActive); }
00254 
00255       //! Determine if tool is "resizable".
00256       bool IsResizable (
00257          ) const { return (m_Resizable); }
00258 
00259       //! Determine if tool is "rotatable".
00260       bool IsRotatable (
00261          ) const { return (m_Rotatable); }
00262 
00263       //! Check if tool is "suspended"
00264       bool IsSuspended (
00265          ) const { return (m_SuspendCount > 0); }
00266 
00267       //! Check if tool has a valid position set
00268       bool HasPosition (
00269          ) const { return (m_PosnSet); }
00270 
00271       //! Move the tool by the specified amount.
00272       void Move (
00273          double dx,
00274          double dy,
00275          ADJUSTFLAGS flags
00276          );
00277 
00278       //! Resize the tool.
00279       void Resize (
00280          double dx,
00281          double dy,
00282          ADJUSTFLAGS flags
00283          );
00284 
00285       //! Resume the tool after performing drawing operation on the canvas.
00286       void Resume (
00287          );
00288 
00289       //! Set movement amounts associated with arrow keys.
00290       void SetArrowKeyDeltas (
00291          double dx,
00292          double dy
00293          );
00294 
00295       //! Set whether user can start drawing a "new" tool.
00296       void SetCanStartNew (
00297          bool canstartnew
00298          ) { m_CanStartNew = canstartnew; }
00299 
00300       //! Set controls to appear on dialog when shown.
00301       //! If used, this must be called before tool is first activated.
00302       void SetControlOptions (
00303          CTRLOPT ctrlopt                        //!< Control settings
00304          ) { m_ctrlopt = ctrlopt; }
00305 
00306       //! Set whether tool is resizable.
00307       void SetResizable (
00308          bool resizable
00309          ) { m_Resizable = resizable; }
00310 
00311       //! Set whether tool is rotatable.
00312       void SetRotatable (
00313          bool rotatable
00314          ) { m_Rotatable = rotatable; }
00315 
00316       //! Set transformation between "tool" and "window" coordinates.
00317       void SetTransToWindow (
00318          const TRANS2D_AFFINE& trans
00319          );
00320 
00321       //! Determine if snap grid is currently in use.
00322       bool SnapGridIsActive (
00323          ) const { return (m_UseSnapGrid); }
00324 
00325       //! Get snap grid settings.
00326       const SNAPGRID& SnapGridGet (
00327          ) const { return (m_snapgrid); }
00328 
00329       //! Set snap grid parameters.
00330       void SnapGridSet (
00331          SNAPGRID& parms
00332          );
00333 
00334       //! Set whether to use snap grid or not.
00335       void SnapGridSetActive (
00336          bool active
00337          ) { m_UseSnapGrid = active; }
00338 
00339       //! Suspend tool prior to performing a drawing operation on the canvas.
00340       void Suspend (
00341          );
00342 
00343    protected:
00344 
00345       enum CONTROLNEED {
00346          CONTROLNEED_None,
00347          CONTROLNEED_Optional,
00348          CONTROLNEED_Required
00349          };
00350 
00351       //! Constructor
00352       explicit TOOL_BASE (
00353          TOOLCANVAS *canvas,
00354          CONTROLNEED ControlNeed,         //!< Need for control dialog or form
00355          bool HasManualControls           //!< Optional manual controls available
00356          );
00357 
00358       //! Utility methods for use by tool implementation.
00359 
00360       void AdjustBegin (CHANGETYPE changetype, bool redraw = true);
00361 
00362       void AdjustEnd (bool releasecapture = true, bool cancel = false);
00363 
00364       void ApplyMoveDeltas (
00365          DPOINT2D& point,
00366          double dx,
00367          double dy,
00368          ADJUSTFLAGS flags
00369          ) const;
00370 
00371       //! Snap point to current snap grid, if no snapping enabled point unchanged.
00372       void ApplySnap (
00373          DPOINT2D& point                     //!< Point to adjust
00374          ) const;
00375 
00376       bool CanStartNew (
00377          ) const { return (m_CanStartNew); }
00378 
00379       //! Check rectangle against tool limits
00380       int CheckBounds (const DRECT2D&, DRECT2D*) const;
00381 
00382       //! Draw a marker (MARKER...) in the position and size specified.
00383       void DrawMarker (MGD::CONTEXT *dc, const LPOINT2D& centerpoint, const LPOINT2D& dirpoint, MARKER marker, UINT16 size) const;
00384 
00385       bool GetArrowDeltas (KEYCODE, double*, double*);
00386 
00387       //! Get drawing context.
00388       //! Will set PixelFunction to Invert if modifying, Copy if not.
00389       MGD::CONTEXT* GetDrawingContext (
00390          );
00391 
00392       CHANGETYPE GetChangeType (
00393          ) const { return (m_ChangeType); }
00394 
00395       //! Determine if tool's canvas has the mouse "captured".
00396       bool IsMouseCaptured (
00397          ) const;
00398 
00399       //! Send notification that "change" action has or will occur.
00400       void NotifyChange (
00401          CHANGESEQ changeseq,                //!< Sequence
00402          CHANGETYPE changetype               //!< Type
00403          ) { v_OnNotifyChange(changeseq,changetype); }
00404 
00405       //! Restore background for entire tool canvas window.
00406       void RestoreBackground (
00407          ) const;
00408 
00409       //! Restore background for specified rectangle.
00410       void RestoreBackground (
00411          const LRECT2D& rect,                //!< Rectangle in 'canvas' coordinates to restore
00412          bool AddLineWidth = true            //!< Expand rectangle by 'LineWidth+1' to allow for wide lines
00413          ) const;
00414 
00415       void RestoreDrawingContext (
00416          );
00417 
00418       //! Set mouse cursor.
00419       void SetCursor (
00420          CURSORID cursorid
00421          ) const { m_canvas->SetCursor(cursorid); }
00422 
00423       void SetHasPosition (
00424          bool HasPosition = true
00425          ) { m_PosnSet = HasPosition; }
00426 
00427       //! Transform DPOINT2D from "tool" to "window" coordinates.
00428       LPOINT2D TransToolToWindow (
00429          const DPOINT2D& point
00430          ) const;
00431 
00432       //! Transform MGUI::POINT point in "window" to "tool" coordinates.
00433       DPOINT2D TransWindowToTool (
00434          MGUI::POINT point
00435          ) const { return (m_ToolToWindow.ConvertInverse(point.m_x,point.m_y)); }
00436 
00437       //! Transform LPOINT2D point in "window" to "tool" coordinates.
00438       DPOINT2D TransWindowToTool (
00439          const LPOINT2D& point
00440          ) const { return (m_ToolToWindow.ConvertInverse(point.x,point.y)); }
00441 
00442    private:
00443 
00444       #ifndef GENERATING_DOXYGEN_OUTPUT
00445 
00446       class TOOLDLG : public MGUI::DLGSHELL {
00447          public:
00448             TOOLDLG (TOOL_BASE& tool);
00449          private:
00450             class PAGECONTROLS : public MGUI::LAYOUT_PAGE {
00451                public:
00452                   PAGECONTROLS (TOOLDLG& dlg): m_dlg(dlg) { }
00453                   virtual ~PAGECONTROLS () { }
00454                private:
00455                   TOOLDLG& m_dlg;
00456                   virtual void OnInitPage ();
00457                };
00458             class PAGEMANUAL : public MGUI::LAYOUT_PAGE {
00459                public:
00460                   PAGEMANUAL (TOOLDLG& dlg): m_dlg(dlg) { }
00461                   virtual ~PAGEMANUAL () { }
00462                private:
00463                   TOOLDLG& m_dlg;
00464                   virtual void OnInitPage ();
00465                };
00466             TOOL_BASE& m_tool;
00467             MGUI::LAYOUT_BOOK m_TabBook;
00468             PAGECONTROLS m_PageControls;
00469             PAGECONTROLS m_PageManual;
00470             virtual ERRVALUE v_CreateContent ();
00471             friend class PAGECONTROLS;
00472             friend class PAGEMANUAL;
00473          };
00474 
00475       // Static members
00476 
00477       static UINT32 s_PenColor[PENCOLOR_COUNT];
00478 
00479       // Explicitly initialized
00480       TOOLCANVAS *m_canvas;
00481       CONTROLNEED m_ControlNeed;          //!< Need for controls
00482       bool m_HasManualControls;           //!< Tool supports manual controls
00483       INT8 m_LineWidth;                   //!< Tool line width
00484       DPOINT2D m_ArrowDelta;              //!< Increments for arrow key movement, tool coords
00485       INT32 m_SuspendCount;               //!< Number of times that this tool has been suspended
00486       CHANGETYPE m_ChangeType;            //!< Change type for use with button-up
00487       bool m_IsActive;                    //!< Tool is in use, Activate() has been called
00488       bool m_PosnSet;                     //!< Tool graphic has a position and is viewable
00489       bool m_UseSnapGrid;                 //!< Use snap grid
00490       bool m_HasArrowDeltas;              //!< Deltas for arrow key movement is set
00491       bool m_IsUserModifying;             //!< Is user modifying tool position
00492       mutable bool m_InRestoreBG;
00493       bool m_InDeactivateFunc;            //!< Deactivate() is called, avoid doing redraws
00494       bool m_CanStartNew;                 //!< User can start drawing new tool, default=true
00495       bool m_Resizable;                   //!< Tool is resizable, default=true
00496       bool m_Rotatable;                   //!< Tool is rotatable, default=true
00497       CTRLOPT m_ctrlopt;
00498       TOOLDLG m_ToolDlg;
00499 
00500       // Self-initializing
00501       TRANS2D_AFFINE m_ToolToWindow;      //!< Tool <--> Window transformation
00502       SNAPGRID m_snapgrid;          //!< Snap grid information structure
00503 
00504       void CreateToolDlg ();
00505       void DrawTool (MGD::CONTEXT*);
00506       void DrawTool (MGD::CONTEXT*, UINT32);
00507       void DrawTool (UINT32);
00508       bool OnKey (MGUI::POINT point, MGUI::KEYCODE, KEYSTATE);
00509       void SetCanvas (TOOLCANVAS *canvas) { m_canvas = canvas; }
00510 
00511       #endif // GENERATING_DOXYGEN_OUTPUT
00512 
00513       // MGUI::TOOL_BASE Overridable virtual methods.
00514 
00515       //! Create "form" with tool-specific controls.
00516       //! @return Pointer to FORM or NULL if tool has no "control" form.
00517       virtual MGUI::FORM* v_CreateControlForm (
00518          MGUI::LAYOUT_PANE_BASE& ParentPane, //!< Parent pane
00519          CTRLOPT ctrlopt                     //!< Control options
00520          );
00521 
00522       //! Create "form" with tool-specific manual-entry controls.
00523       //! @return Pointer to FORM or NULL if tool has no "manual entry" form.
00524       virtual MGUI::FORM* v_CreateManualForm (
00525          MGUI::LAYOUT_PANE_BASE& ParentPane, //!< Parent pane
00526          CTRLOPT ctrlopt                     //!< Control options
00527          );
00528 
00529       //! Do actual drawing of tool graphic.
00530       virtual void v_DoDraw (MGD::CONTEXT*) = 0;
00531 
00532       //! Move the tool.
00533       virtual void v_DoMove (double x, double y, ADJUSTFLAGS);
00534 
00535       //! Size the tool.
00536       virtual void v_DoSize (double x, double y, ADJUSTFLAGS);
00537 
00538       //! Generate region from tool.
00539       //! @return TRUE if region generated, FALSE if not, < 0 if error.
00540       virtual int v_GenerateRegion (
00541          REGION2D& region                    //!< Generated region in 'tool' coordinates returned
00542          ) const;
00543 
00544       //! Called to get title of tool control dialog.
00545       virtual MISTRING v_GetDialogTitle (
00546          ) const;
00547 
00548       //! Called when tool is "activated".
00549       virtual void v_OnActivate ();
00550 
00551       //! Called when tool is cleared.
00552       virtual void v_OnClear ();
00553 
00554       //! Called when tool is deactivated.
00555       virtual void v_OnDeactivate ();
00556 
00557       //! Called when key pressed/released.
00558       //! @return 'true' if key handled, 'false' if not.
00559       //! Should not be called directly, called by OnKey.
00560       virtual bool v_OnKey (MGUI::POINT point, MGUI::KEYCODE, KEYSTATE);
00561 
00562       //! Called when left mouse button pressed.
00563       virtual void v_OnLButtonDown (MGUI::POINT point, KEYSTATE keystate) = 0;
00564 
00565       //! Called when left mouse button released.
00566       virtual void v_OnLButtonUp (MGUI::POINT point, KEYSTATE keystate);
00567 
00568       //! Called when mouse cursor is moved.
00569       virtual void v_OnMouseMove (MGUI::POINT point, KEYSTATE keystate) = 0;
00570 
00571       //! Called when change made to tool position, shape, size, etc.
00572       virtual void v_OnNotifyChange (
00573          CHANGESEQ changeseq,                //!< Sequence
00574          CHANGETYPE changetype               //!< Type
00575          );
00576 
00577       //! Called when right mouse button pressed.
00578       //! Often overridden to show a popup menu.
00579       virtual void v_OnRButtonDown (MGUI::POINT point, KEYSTATE keystate);
00580 
00581       //! Called when right mouse button released.
00582       //! Often overridden to perform an 'apply' action.
00583       virtual void v_OnRButtonUp (MGUI::POINT point, KEYSTATE keystate);
00584 
00585       //! Called when tool is "resumed" after being suspended.
00586       virtual void v_OnResume ();
00587 
00588       //! Called when tool to window transformation is set.
00589       virtual void v_OnSetTransToWindow ();
00590 
00591       //! Called when canvas is resized.
00592       virtual void v_OnSizeCanvas ();
00593 
00594    friend class TOOL_BASE::TOOLDLG;
00595    friend class TOOLCANVAS;
00596    };
00597 DEFINE_ENUM_OPERATORS(TOOL_BASE::ADJUSTFLAGS);
00598 DEFINE_ENUM_OPERATORS(TOOL_BASE::CTRLOPT);
00599 
00600 
00601 //=====================================================================================================================
00602 //! TOOL_LIMITED - Tool with limit support
00603 class TOOL_LIMITED : public TOOL_BASE {
00604    public:
00605 
00606       //! Destructor
00607       virtual ~TOOL_LIMITED ();
00608 
00609       //! Set coordinate limits.
00610       void SetLimits (
00611          const DRECT2D& rect                    //!< Limits to set
00612          );
00613 
00614       //! Set whether limits are enforced.
00615       //! If SetLimits() has not been called then the tool will be limited to the visible canvas extent.
00616       void SetLimitsEnforced (
00617          bool enforced = true                   //!< Set if limits are enforced
00618          );
00619 
00620    protected:
00621 
00622       //! Constructor
00623       explicit TOOL_LIMITED (
00624          TOOLCANVAS *canvas,
00625          CONTROLNEED ControlNeed,         //!< Need for control dialog or form
00626          bool HasManualControls           //!< Optional manual controls available
00627          );
00628 
00629       //! Get limits.
00630       const DRECT2D& GetLimits (
00631          ) const { return (m_Limits); }
00632 
00633       //! Determine if limits are enforced.
00634       bool IsLimitsEnforced (
00635          ) const { return (m_LimitsEnforced); }
00636 
00637       //! Called when tool is "activated".
00638       //! Derived class must call base class method BEFORE performing own processing.
00639       virtual void v_OnActivate ();
00640 
00641       //! Called when tool to window transformation is set.
00642       //! Derived class must call base class method BEFORE performing own processing.
00643       virtual void v_OnSetTransToWindow ();
00644 
00645    private:
00646       #ifndef GENERATING_DOXYGEN_OUTPUT
00647       bool m_LimitsEnforced;              //!< Limits are enforced
00648       bool m_LimitsSet;                   //!< Limits have been set, otherwise defaults to window extents
00649       DRECT2D m_Limits;                   //!< Position ranges, default to entire parent window range
00650       //! TOOL_BASE overrides.
00651       virtual void v_OnSizeCanvas ();
00652       //! Methods
00653 
00654       //! Called when limits are changed.
00655       virtual void v_OnChangeLimits ();
00656 
00657       void UpdateLimits ();
00658       #endif // GENERATING_DOXYGEN_OUTPUT
00659    };
00660 
00661 //=====================================================================================================================
00662 
00663 }  // End namespace MGUI
00664 
00665 #endif   // INC_MGUI_TOOLBASE_H
00666 

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