Version: 0.6.0
gxmapview.h
1 /******************************************************************************
2  * Project: wxGIS (GIS Catalog)
3  * Purpose: wxGxMapView class.
4  * Author: Dmitry Baryshnikov (aka Bishop), polimax@mail.ru
5  ******************************************************************************
6 * Copyright (C) 2009-2013 Dmitry Baryshnikov
7 *
8 * This program is free software: you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation, either version 2 of the License, or
11 * (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License
19 * along with this program. If not, see <http://www.gnu.org/licenses/>.
20  ****************************************************************************/
21 
22 #pragma once
23 #include "wxgis/catalogui/gxview.h"
24 #include "wxgis/catalog/gxdataset.h"
25 #include "wxgis/catalogui/gxcatalogui.h"
26 #include "wxgis/catalogui/gxeventui.h"
27 #include "wxgis/cartoui/drawingmap.h"
28 #include "wxgis/core/format.h"
29 #include "wxgis/framework/statusbar.h"
30 #include "wxgis/catalogui/gxapplication.h"
31 
37  public ITrackCancel
38 {
39 public:
40  wxGxTrackCancel(wxGISStatusBar* pStatusBar)
41  {
42  m_pStatusBar = pStatusBar;
43  if(m_pStatusBar)
44  {
45  IProgressor* pAni = m_pStatusBar->GetAnimation();
46  SetProgressor(pAni);
47  }
48  }
49  virtual ~wxGxTrackCancel(void)
50  {
51  }
52  virtual void PutMessage(const wxString &sMessage, size_t nIndex, wxGISEnumMessageType eType)
53  {
54  if(m_pStatusBar && !sMessage.IsEmpty())
55  {
56  m_pStatusBar->SetMessage(sMessage);
57  }
58  }
59 protected:
60  wxGISStatusBar* m_pStatusBar;
61 };
62 
63 
68 class WXDLLIMPEXP_GIS_CLU wxGxMapView :
69  public wxGISDrawingMapView,
70  public wxGxView
71 {
72  DECLARE_DYNAMIC_CLASS(wxGxMapView)
73 public:
74  wxGxMapView(void);
75  wxGxMapView(wxWindow* parent, wxWindowID id = MAPCTRLID, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize);
76  virtual ~wxGxMapView(void);
77  //virtual void CheckOverviews(wxGISDatasetSPtr pwxGISDataset, wxString soFileName);
78  //events
79  void OnMouseMove(wxMouseEvent& event);
80  void OnMouseDown(wxMouseEvent& event);
81  void OnMouseUp(wxMouseEvent& event);
82  void OnMouseDoubleClick(wxMouseEvent& event);
83 //IGxView
84  virtual bool Create(wxWindow* parent, wxWindowID id = MAPCTRLID, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxTAB_TRAVERSAL, const wxString& name = wxT("MapView"));
85  virtual bool Activate(IApplication* const pApplication, wxXmlNode* const pConf);
86  virtual void Deactivate(void);
87  virtual bool Applies(wxGxSelection* const Selection);
88  //wxGxView
89  virtual void OnShow(bool bShow);
90  //events
91  virtual void OnSelectionChanged(wxGxSelectionEvent& event);
92 protected:
93  virtual void LoadData(long nGxObjectId);
94  virtual void LoadLayer(wxGxDataset* const pGxDataset);
95  virtual void LoadLayers(wxGxDatasetContainer* const pGxDataset);
96  virtual wxGISLayer* GetLayerFromDataset(wxGxDataset* const pGxDataset);
97 protected:
98  long m_ConnectionPointCatalogCookie, m_ConnectionPointSelectionCookie;
99  wxGxSelection* m_pSelection;
100  wxGxCatalogUI* m_pCatalog;
101 
102  long m_nParentGxObjectID;
103 
104  wxGISStatusBar* m_pStatusBar;
105  wxGxApplication* m_pApp;
106 
107  long m_nPanCmdId;
108 
109  wxGISCoordinatesFormat m_CFormat;
110 private:
111  DECLARE_EVENT_TABLE()
112 };
The GxSelection class event.
Definition: gxeventui.h:37
Definition: gxmapview.h:36
Definition: drawingmap.h:34
A TrackCancel interface class.
Definition: core.h:144
Definition: gxview.h:35
Definition: gxdataset.h:80
void SetMessage(const wxString &text, int i=0)
Put message to the status bar.
Definition: statusbar.cpp:190
Definition: layer.h:35
Definition: gxcatalogui.h:34
Definition: statusbar.h:58
The GxObject Selection class.
Definition: gxselection.h:30
IProgressor * GetAnimation(void) const
Get the animated progressor (rotating globe).
Definition: statusbar.h:92
Definition: gxdataset.h:36
Definition: core.h:86
The view for map showing.
Definition: gxmapview.h:68
Definition: app.h:32
The class to format coordinates according different masks.
Definition: format.h:69
Definition: gxapplication.h:41