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