00001
00015 #ifndef INC_MGUI_CTRLANGLE_H
00016 #define INC_MGUI_CTRLANGLE_H
00017
00018 #ifndef INC_MGUI_CANVAS_H
00019 #include <mgui/canvas.h>
00020 #endif
00021
00022 namespace MGUI {
00023
00024
00026 class CTRL_ANGLE : public MGUI::CANVAS {
00027 public:
00028
00029 enum STYLE {
00030 STYLE_Default = 0x00,
00031 STYLE_NoUserChange = 0x01,
00032 STYLE_AngleIncreasesCCW = 0x00,
00033 STYLE_AngleIncreasesCW = 0x02,
00034 };
00035
00037 CTRL_ANGLE ();
00038
00040 virtual ~CTRL_ANGLE ();
00041
00043 void Create (
00044 LAYOUT_PANE_BASE& ParentPane,
00045 int DialRadius,
00046 STYLE style,
00047 double origin = 0
00048 ) { Create(ParentPane,DialRadius,-180,180,style,origin); }
00049
00051 void Create (
00052 LAYOUT_PANE_BASE& ParentPane,
00053 int DialRadius,
00054 double MinAngle,
00055 double MaxAngle,
00056 STYLE style,
00057 double origin = 0
00058 );
00059
00061 void CreateDual (
00062 LAYOUT_PANE_BASE& ParentPane,
00063 int DialRadius,
00064 double MinAngle,
00065 double CenterValue2,
00066 double EdgeValue2,
00067 STYLE style,
00068 double origin = 0
00069 );
00070
00072 double GetAngle () const;
00073
00075 double GetValue2 () const;
00076
00078 void SetDelegateOnChangeValue (
00079 DELEGATE_VOID_NOPARMS delegate
00080 );
00081
00083 void SetDelegateOnUserChanging (
00084 DELEGATE_VOID_NOPARMS delegate
00085 );
00086
00088 void SetAngle (
00089 double angle,
00090 bool notify = true
00091 );
00092
00094 void SetValue2 (
00095 double value,
00096 bool notify = true
00097 );
00098
00100 void SetValues (
00101 double angle,
00102 double value2,
00103 bool notify = true
00104 );
00105
00106 private:
00107 #ifndef GENERATING_DOXYGEN_OUTPUT
00108 typedef CANVAS BASECLASS;
00109
00110 class PRIV;
00111 PRIV *m_pPriv;
00112
00113 virtual void v_OnPaint (MGD::CONTEXT*);
00114 virtual void v_OnPointerButtonDown (POINT, POINTERBUTTON button, KEYSTATE);
00115 virtual void v_OnPointerButtonUp (POINT, POINTERBUTTON button, KEYSTATE);
00116 virtual void v_OnPointerMove (POINT, POINTERBUTTON button, KEYSTATE, bool);
00117
00118 CTRL_ANGLE (const CTRL_ANGLE&);
00119 CTRL_ANGLE& operator= (const CTRL_ANGLE&);
00120 #endif // GENERATING_DOXYGEN_OUTPUT
00121 };
00122
00123
00124 }
00125
00126 #endif // INC_MGUI_CTRLANGLE