00001
00040 #ifndef INC_MGUI_TOOLSELECTPOINT_H
00041 #define INC_MGUI_TOOLSELECTPOINT_H
00042
00043 #ifndef INC_MGUI_TOOLBASE_H
00044 #include <mgui/toolbase.h>
00045 #endif
00046
00047 #ifndef INC_MGUI_TIMER_H
00048 #include <mgui/timer.h>
00049 #endif
00050
00051 namespace MGUI {
00052
00053
00056 class TOOL_SELECTPOINT : public TOOL_LIMITED {
00057 public:
00058
00059 typedef fastdelegate::FastDelegate<MGUI::CURSORID(const DPOINT2D& pt, bool ButtonDown)> DELEGATE_ONGETCURSOR;
00060
00062 explicit TOOL_SELECTPOINT (
00063 TOOLCANVAS *canvas
00064 );
00065
00067 virtual ~TOOL_SELECTPOINT ();
00068
00071 const DPOINT2D& GetPointCurrent (
00072 ) const { return (m_PointCurrent); }
00073
00076 const DPOINT2D& GetPointPressed (
00077 ) const { return (m_PointPressed); }
00078
00081 void SetCursors (
00082 CURSORID CursorIdNormal,
00083 CURSORID CursorIdDown
00084 ) { m_CursorIdNormal = CursorIdNormal; m_CursorIdDown = CursorIdDown; }
00085
00087 void SetDelegateOnGetCursor (
00088 DELEGATE_ONGETCURSOR delegate,
00089 double delay = 0
00090 ) { m_DelegateOnGetCursor = delegate; m_GetCursorDelay = delay; }
00091
00092 private:
00093 #ifndef GENERATING_DOXYGEN_OUTPUT
00094
00095 CURSORID m_CursorIdNormal;
00096 CURSORID m_CursorIdDown;
00097 DELEGATE_ONGETCURSOR m_DelegateOnGetCursor;
00098 double m_GetCursorDelay;
00099 DPOINT2D m_PointCurrent;
00100 DPOINT2D m_PointPressed;
00101 bool m_IsInsideLimit;
00102 MGUI::TIMER m_Timer;
00103
00104 void ComputePointerCursor (const DPOINT2D&, bool ButtonDown = false);
00105 void OnTimer ();
00106
00107
00108 virtual void v_DoDraw ();
00109 virtual bool v_OnPointerButtonDown (MGUI::POINT point, POINTERBUTTON button, KEYSTATE keystate);
00110 virtual bool v_OnPointerButtonUp (MGUI::POINT point, POINTERBUTTON button, KEYSTATE keystate);
00111 virtual void v_OnPointerMove (MGUI::POINT point, POINTERBUTTON button, KEYSTATE keystate);
00112 #endif // GENERATING_DOXYGEN_OUTPUT
00113 };
00114
00115
00116 }
00117
00118
00119 #endif // INC_MGUI_TOOLSELECTPOINT_H