00001
00062 #ifndef INC_GRE_UIFORMPLACES_H
00063 #define INC_GRE_UIFORMPLACES_H
00064
00065 #ifndef INC_MGUI_EDIT_H
00066 #include <mgui/edit.h>
00067 #endif
00068
00069 #ifndef INC_MGUI_FORMLIST_H
00070 #include <mgui/formlist.h>
00071 #endif
00072
00073 #ifndef INC_MGUI_TOOLBAR_H
00074 #include <mgui/toolbar.h>
00075 #endif
00076
00077 #ifndef INC_MGUI_FORMBOOK_H
00078 #include <mgui/formbook.h>
00079 #endif
00080
00081 #ifndef INC_MGUI_TREE_H
00082 #include <mgui/tree.h>
00083 #endif
00084
00085 #ifndef INC_MGUI_IMAGELST_H
00086 #include <mgui/imagelst.h>
00087 #endif
00088
00089 #ifndef INC_MGUI_FORMBTXT_H
00090 #include <mgui/formbtxt.h>
00091 #endif
00092
00093 #ifndef INC_MI32_XML_H
00094 #include <mi32/xml.h>
00095 #endif
00096
00097 #ifndef INC_MI32_COORDOP_H
00098 #include <mi32/coordop.h>
00099 #endif
00100
00101
00102 #ifndef GENERATING_DOXYGEN_OUTPUT
00103
00104 namespace GRE {
00105 class VIEW;
00106 class VIEWABLE;
00107 class GROUP;
00108 class MSG;
00109 }
00110 #endif
00111
00112
00113 namespace GRE {
00114 namespace UI {
00115
00116
00118 class FORM_PLACES : public MGUI::FORM_COMPOSITE {
00119 public:
00121 FORM_PLACES (VIEW* view, VIEWABLE* viewable);
00122
00124 virtual ~FORM_PLACES ();
00125
00127 void Create (
00128 MGUI::LAYOUT_PANE_BASE& ParentPane,
00129 INT32 width,
00130 INT32 height
00131 );
00132
00134 const SPATREF::COORDREFSYS& GetCoordRefSys () { return m_CoordRefSys; }
00135
00137 MGUI::LAYOUT_PANE& GetFormPane (
00138 ) { return (GetPane()); }
00139
00141 void SetCenter (
00142 const DPOINT2D& point
00143 ) { m_EditCenterX.SetValue(point.x, false); m_EditCenterY.SetValue(point.y, false); }
00144
00146 void SetCoordRefSys (
00147 const SPATREF::COORDREFSYS& crs
00148 ) { m_CoordRefSys = crs; UpdateCRS(); }
00149
00150 #ifndef GENERATING_DOXYGEN_OUTPUT
00151 class NameDescPair {
00152 public:
00153 char* name;
00154 char* desc;
00155 };
00156 #endif
00157
00158 private:
00159 #ifndef GENERATING_DOXYGEN_OUTPUT
00160
00161 enum CMDID {
00162 CMDID_ZoomTo = 0,
00163 CMDID_Bing,
00164 CMDID_Saved,
00165 CMDID_Query,
00166 CMDID_Preferences,
00167 CMDID_List,
00168 CMDID_Details,
00169 CMDID_ShowOutside,
00170 CMDID_AddView
00171 };
00172
00173 CMDID m_CurrentMode;
00174 int m_pagezoomtomode;
00175 int m_pagebingmode;
00176 int m_pagesavedmode;
00177
00178 MGUI::FORM_BOOK m_FormBookMode;
00179
00180
00181 static void GRECB_Viewable (const GRE::MSG *msg, void *vcb);
00182
00183 void AnalyzeCoordRefSys (SPATREF::COORDREFSYS& CoordRefSys, GROUP* group);
00184 void OnCmdRefSys ();
00185 void OnZoomToZoomToolbar (MGUI::ID id,bool ToggleOn);
00186 void OnZoomToZoom ();
00187 void UpdateCRS();
00188 void UpdateCRSControls();
00189
00190 bool m_bCRSChanged;
00191 SPATREF::COORDREFSYS m_CoordRefSys;
00192 SPATREF::COORDOP_ZONED m_CoordOpZoned;
00193
00194 MGUI::CTRL_TOOLBAR m_ToolbarModeZoomTo;
00195 MGUI::CTRL_GROUPBOX m_GbxCenter;
00196 MGUI::FORM_BUTTONTEXT m_BtxCenterRefSys;
00197 MGUI::FORM_EDIT_STRING m_EditCenterMGRS;
00198 MGUI::FORM_EDIT_NUMBER m_EditCenterY;
00199 MGUI::FORM_EDIT_NUMBER m_EditCenterX;
00200
00201
00202
00203 ERRVALUE DoQuery();
00204 bool GetCenter (DPOINT2D& center);
00205 bool GetCenter (DPOINT2D& center, const SPATREF::COORDREFSYS& crs);
00206 MGUI::FORM_LIST& GetList ();
00207 void OnAddFolder (MGUI::ID id,bool ToggleOn);
00208 bool OnClick(int itemnum, int fieldnum, const MGUI::POINT& pt, MGUI::POINTERBUTTON btn, MGUI::KEYSTATE state);
00209 bool OnDoubleClick(int itemnum, int fieldnum, const MGUI::POINT& pt, MGUI::POINTERBUTTON btn, MGUI::KEYSTATE state);
00210 bool OnDraw(MGUI::FORM_LIST::CUSTOMDRAW& customdraw);
00211 void OnMenuPreferences (MGUI::ID id,bool ToggleOn);
00212 void OnMode(MGUI::ID id,bool ToggleOn);
00213 void OnQuery();
00214 void OnQueryToolbar (MGUI::ID id,bool ToggleOn);
00215 void OnSaveView (MGUI::ID id,bool ToggleOn);
00216 bool OnToolTip(int itemnum, int fieldnum, MGUI::CTRL_TOOLTIP& tooltip);
00217 void ZoomToLocation(const DRECT2D& extents);
00218
00219 MILIST<DRECT2D> m_ExtentsList;
00220 bool m_ShowDetails;
00221 bool m_ShowLocationsOutside;
00222 int m_fieldname;
00223 int m_fieldentity;
00224 int m_fieldconfidence;
00225 int m_fieldvalid;
00226 int m_fieldcalcmethod;
00227 int m_fieldmatchcode;
00228 int m_pagelist;
00229 int m_pagedetails;
00230
00231 MGUI::CTRL_PUSHBUTTON m_QueryBtn;
00232 MGUI::CTRL_EDIT_STRING m_EditString;
00233 MGUI::CTRL_TOOLBAR m_ToolbarModeBing;
00234 MGUI::FORM_BOOK m_FormBookLists;
00235 MGUI::FORM_LIST m_FormList;
00236 MGUI::FORM_LIST m_FormDetails;
00237
00238
00239
00240 void IniRead();
00241 void IniWrite();
00242 bool OnTreeClick(MGUI::CTRL_TREE::ITEMHND item, MGUI::CTRL_TREE::HITRESULT hit, const LPOINT2D& pt, MGUI::POINTERBUTTON button, MGUI::KEYSTATE state);
00243 bool OnTreeClickDown(MGUI::CTRL_TREE::ITEMHND item, MGUI::CTRL_TREE::HITRESULT hit, const LPOINT2D& pt, MGUI::POINTERBUTTON button, MGUI::KEYSTATE state);
00244 MGUI::CUSTOMDRAW::RETVALUE OnTreeDraw(MGUI::CUSTOMDRAW_TREE& draw);
00245 void ParseNode(MGUI::CTRL_TREE::ITEMHND parent, XMLNODE* node);
00246
00247 XMLDOC m_doc;
00248 XMLDOC m_viewabledoc;
00249
00250 MGUI::CTRL_TOOLBAR m_ToolbarModeSaved;
00251 MGUI::CTRL_TREE m_Tree;
00252 MGUI::IMAGELIST m_ImageList;
00253 MGUI::CTRL_TREE::ITEMHND m_LayoutHnd;
00254 MGUI::CTRL_TREE::ITEMHND m_GroupHnd;
00255 MGUI::CTRL_TREE::ITEMHND m_ViewsHnd;
00256
00257
00258 VIEW* m_view;
00259 VIEWABLE* m_viewable;
00260
00261 #endif // GENERATING_DOXYGEN_OUTPUT
00262 };
00263
00264 }
00265 }
00266
00267 #endif // INC_GRE_UIFORMPLACES_H