00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015 #ifndef INC_MGUI_FORM_EDIT_COORD_H
00016 #define INC_MGUI_FORM_EDIT_COORD_H
00017
00018 #ifndef INC_MGUI_FORM_H
00019 #include <mgui/form.h>
00020 #endif
00021
00022 #ifndef INC_MGUI_CTRL_H
00023 #include <mgui/ctrl.h>
00024 #endif
00025
00026 #ifndef INC_MGUI_FORMBTXT_H
00027 #include <mgui/formbtxt.h>
00028 #endif
00029
00030 #ifndef INC_MGUI_COMBOBOX_H
00031 #include <mgui/combobox.h>
00032 #endif
00033
00034 #ifndef INC_MI32_SPATREF_H
00035 #include <mi32/spatref.h>
00036 #endif
00037
00038 namespace MGUI {
00039
00040
00041
00042 class FORM_EDIT_COORD : public MGUI::FORM_COMPOSITE {
00043 public:
00044
00045
00046 FORM_EDIT_COORD (
00047 );
00048
00049
00050 virtual ~FORM_EDIT_COORD (
00051 );
00052
00053
00054 void Clear (
00055 bool notify = true
00056 );
00057
00058
00059 void Create (
00060 MGUI::LAYOUT_PANE_BASE& ParentPane,
00061 MGUI::LAYOUT_SIZEALIGN sizealign = MGUI::LAYOUT_SIZEALIGN_FixedSize
00062 );
00063
00064
00065 const DPOINT3D& GetValue (
00066 ) const { return (m_Point); }
00067
00068
00069 const SPATREF::COORDREFSYS& GetCoordRefSys (
00070 ) const { return (m_CoordRefSys); }
00071
00072
00073 bool HasValues (
00074 );
00075
00076
00077
00078 void SetValue (
00079 const DPOINT2D& Point,
00080 bool notify = true
00081 );
00082
00083
00084
00085 void SetValue (
00086 const DPOINT3D& Point,
00087 bool notify = true
00088 );
00089
00090
00091
00092 void SetCoordRefSys (
00093 const SPATREF::COORDREFSYS& CoordRefSys,
00094 bool notify = true
00095 );
00096
00097
00098 private:
00099 #ifndef GENERATING_DOXYGEN_OUTPUT
00100 SPATREF::COORDREFSYS m_CoordRefSys;
00101 DPOINT3D m_Point;
00102 bool m_bIs3D;
00103
00104 LAYOUT_PANE m_XPane;
00105 CTRL_LABEL m_XLabel;
00106 CTRL_EDIT_NUMBER_T<FORM_EDIT_COORD> m_XPrompt;
00107
00108 LAYOUT_PANE m_YPane;
00109 CTRL_LABEL m_YLabel;
00110 CTRL_EDIT_NUMBER_T<FORM_EDIT_COORD> m_YPrompt;
00111
00112 LAYOUT_PANE m_ZPane;
00113 CTRL_LABEL m_ZLabel;
00114 CTRL_EDIT_NUMBER_T<FORM_EDIT_COORD> m_ZPrompt;
00115
00116 virtual void v_OnChangeValue ();
00117
00118 void OnValueChanged ();
00119 void UpdateProjection ();
00120 #endif // GENERATING_DOXYGEN_OUTPUT
00121 };
00122
00123
00124
00125 template <class _CT> class FORM_EDIT_COORD_T : public MGUI::FORM_EDIT_COORD {
00126 public:
00127
00128
00129 explicit FORM_EDIT_COORD_T (
00130 _CT *pContainer
00131 ): m_pContainer(pContainer), m_pfOnChangeValue(0), m_pfOnChangeCoordRefSys(0)
00132 { }
00133
00134
00135
00136 void SetContainer (
00137 _CT *pContainer
00138 ) { m_pContainer = pContainer; }
00139
00140
00141 void SetFuncChangePoint (
00142 void (_CT::*pfOnChangeValue)()
00143 ) { m_pfOnChangeValue = pfOnChangeValue; };
00144
00145
00146 void SetFuncChangeCoordRefSys (
00147 void (_CT::*pfOnChangeCoordRefSys)()
00148 ) { m_pfOnChangeCoordRefSys = pfOnChangeCoordRefSys; };
00149
00150 private:
00151
00152 #ifndef GENERATING_DOXYGEN_OUTPUT
00153 _CT *m_pContainer;
00154 void (_CT::*m_pfOnChangeValue)();
00155 void (_CT::*m_pfOnChangeCoordRefSys)();
00156
00157 virtual void v_OnChangeValue (
00158 ) { if (m_pfOnChangeValue != 0) (m_pContainer->*m_pfOnChangeValue)(); }
00159
00160 virtual void v_OnChangeCoordRefSys (
00161 ) { if (m_pfOnChangeCoordRefSys != 0) (m_pContainer->*m_pfOnChangeCoordRefSys)(); }
00162 #endif // GENERATING_DOXYGEN_OUTPUT
00163 };
00164
00165 }
00166
00167 #endif // INC_MGUI_FORM_COORD_H