00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024 #ifndef INC_MGUI_FORM_EDIT_RASTER_VALUE_H
00025 #define INC_MGUI_FORM_EDIT_RASTER_VALUE_H
00026
00027 #ifndef INC_MGUI_FORM_H
00028 #include <mgui/form.h>
00029 #endif
00030
00031 #ifndef INC_MGUI_CTRL_H
00032 #include <mgui/ctrl.h>
00033 #endif
00034
00035 #ifndef INC_RVC_IMAGE_H
00036 #include <rvc/image.h>
00037 #endif
00038
00039 namespace MGUI {
00040
00041
00042
00043 class FORM_EDIT_RASTER_VALUE : public MGUI::FORM_COMPOSITE {
00044 public:
00045
00046 FORM_EDIT_RASTER_VALUE (
00047 );
00048
00049
00050 virtual ~FORM_EDIT_RASTER_VALUE (
00051 );
00052
00053
00054 void Create (
00055 MGUI::LAYOUT_PANE_BASE& ParentPane,
00056 const MISTRING& label,
00057 RVC::IMAGE::CELLTYPE CellType,
00058 MGUI::LAYOUT_SIZEALIGN sizealign = MGUI::LAYOUT_SIZEALIGN_FixedSize,
00059 MGUI::CTRL_LABEL::STYLE labelstyle = MGUI::CTRL_LABEL::STYLE_LeftNoWrap
00060 );
00061
00062
00063
00064 MGUI::CTRL_LABEL& GetLabel (
00065 ) { return (m_label); }
00066
00067
00068 void GetValue (
00069 ANYRASTVALUE& value
00070 );
00071
00072 void SetCellType (
00073 RVC::IMAGE::CELLTYPE CellType
00074 );
00075
00076
00077 void SetLabel (
00078 const MISTRING& label
00079 ) { m_label.SetLabel(label); }
00080
00081
00082
00083
00084 void SetValue (
00085 const ANYRASTVALUE& value,
00086 bool notify = true
00087 );
00088
00089 protected:
00090
00091
00092
00093
00094 virtual void v_OnChangeValue ();
00095
00096 private:
00097 RVC::IMAGE::CELLTYPE m_CellType;
00098 CTRL_LABEL m_label;
00099 FORM_EDIT_NUMBER_T<FORM_EDIT_RASTER_VALUE> m_Value1;
00100 FORM_EDIT_NUMBER_T<FORM_EDIT_RASTER_VALUE> m_Value2;
00101 FORM_EDIT_NUMBER_T<FORM_EDIT_RASTER_VALUE> m_Value3;
00102 FORM_EDIT_NUMBER_T<FORM_EDIT_RASTER_VALUE> m_Value4;
00103
00104 void OnValueChanged ();
00105 };
00106
00107
00108
00109
00110 template <class _CT> class FORM_EDIT_RASTER_VALUE_T : public MGUI::FORM_EDIT_RASTER_VALUE {
00111 public:
00112
00113
00114 explicit FORM_EDIT_RASTER_VALUE_T (
00115 ): m_pContainer(0), m_pfOnChangeValue(0)
00116 { }
00117
00118
00119 void Create (
00120 MGUI::LAYOUT_PANE_BASE& ParentPane,
00121 const MISTRING& label,
00122 RVC::IMAGE::CELLTYPE CellType,
00123 _CT *pContainer,
00124 void (_CT::*pfOnChangeValue)(),
00125 MGUI::LAYOUT_SIZEALIGN sizealign = MGUI::LAYOUT_SIZEALIGN_FixedSize,
00126 MGUI::CTRL_LABEL::STYLE labelstyle = MGUI::CTRL_LABEL::STYLE_LeftNoWrap
00127 ) {
00128 m_pContainer = pContainer;
00129 m_pfOnChangeValue = pfOnChangeValue;
00130 FORM_EDIT_RASTER_VALUE::Create(ParentPane,label,CellType,sizealign,labelstyle);
00131 }
00132
00133 private:
00134
00135 _CT *m_pContainer;
00136 void (_CT::*m_pfOnChangeValue)();
00137
00138 virtual void v_OnChangeValue (
00139 ) { if (m_pfOnChangeValue != 0) (m_pContainer->*m_pfOnChangeValue)(); }
00140 };
00141
00142 }
00143
00144 #endif // INC_MGUI_FORM_EDIT_RASTER_VALUE_H