00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef INC_MGUI_TOOLELIP_H
00022 #define INC_MGUI_TOOLELIP_H
00023
00024 #ifndef INC_MGUI_TOOLBASE_H
00025 #include <mgui/toolbase.h>
00026 #endif
00027
00028 namespace MGUI {
00029
00030
00031 class TOOL_ELLIPSE : public TOOL_BASE {
00032 public:
00033
00034
00035 explicit TOOL_ELLIPSE (
00036 TOOLCANVAS *canvas
00037 );
00038
00039
00040 virtual ~TOOL_ELLIPSE ();
00041
00042
00043 double GetAngle (
00044 ) const { return (m_angle); }
00045
00046
00047 const DPOINT2D& GetCenter (
00048 ) const { return (m_center); }
00049
00050
00051 const DPOINT2D& GetRadius (
00052 ) const { return (m_radius); }
00053
00054
00055 void SetAngle (
00056 double angle
00057 );
00058
00059
00060
00061 void SetAngleVisible (
00062 bool anglevisible = true
00063 );
00064
00065
00066 void SetCenter (
00067 const DPOINT2D& center
00068 );
00069
00070
00071
00072 void SetMarker (
00073 MARKER marker,
00074 UINT16 size = 0
00075 );
00076
00077
00078 void SetRadius (
00079 DPOINT2D& radius
00080 );
00081
00082
00083 void SetRadiusRange (
00084 double minradius,
00085 double maxradius
00086 );
00087
00088 private:
00089 #ifndef GENERATING_DOXYGEN_OUTPUT
00090
00091 enum ZONE {
00092 ZONE_NoFunction = 0,
00093 ZONE_Outside,
00094 ZONE_Inside,
00095 ZONE_ResizeX,
00096 ZONE_ResizeY,
00097 ZONE_Perimeter,
00098 ZONE_SetCenter,
00099 ZONE_Rotate,
00100 };
00101
00102 MARKER m_marker;
00103 UINT16 m_markersize;
00104 double m_minradius;
00105 double m_maxradius;
00106 bool m_anglevisible;
00107
00108 DPOINT2D m_center;
00109 DPOINT2D m_radius;
00110 double m_angle;
00111
00112 ZONE m_CursorZone;
00113 DPOINT2D m_prevpt;
00114 TRANS2D_AFFINE m_trans;
00115
00116
00117 void AdjustTool (const DPOINT2D&, bool firsttime=false);
00118 void ComputeCursorZone (const DPOINT2D&);
00119 void StartTool (const DPOINT2D&);
00120 void UpdateCursor (const DPOINT2D&) const;
00121
00122
00123 virtual void v_DoDraw (MGD::CONTEXT*);
00124 virtual void v_DoMove (double dx, double dy, ADJUSTFLAGS flags);
00125 virtual int v_GenerateRegion (REGION2D& region) const;
00126 virtual void v_OnLButtonDown (MGUI::POINT point, KEYSTATE keystate);
00127 virtual void v_OnMouseMove (MGUI::POINT point, KEYSTATE keystate);
00128 #endif // GENERATING_DOXYGEN_OUTPUT
00129 };
00130
00131
00132 }
00133
00134
00135 #endif // INC_MGUI_TOOLELIP_H