Version: 0.6.0
cartocmd.h
1 /******************************************************************************
2  * Project: wxGIS (GIS Catalog)
3  * Purpose: Carto Main Commands & tools class.
4  * Author: Dmitry Baryshnikov (aka Bishop), polimax@mail.ru
5  ******************************************************************************
6 * Copyright (C) 2009,2011-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 #pragma once
22 #include "wxgis/framework/command.h"
23 #include "wxgis/framework/applicationbase.h"
24 #include "wxgis/cartoui/mapview.h"
25 #include "wxgis/cartoui/mxeventui.h"
26 #include "wxgis/cartoui/identifydlg.h"
27 
36  public wxComboBox,
37  public IToolBarControl
38 {
39  DECLARE_CLASS(wxGISRotationComboBox)
40 public:
41  wxGISRotationComboBox(wxWindow* parent, wxWindowID id, const wxString& value, const wxPoint& pos, const wxSize& size, const wxArrayString& choices, long style = wxTE_PROCESS_ENTER, const wxValidator& validator = wxDefaultValidator, const wxString& name = wxT("LocationComboBox"));
42  virtual ~wxGISRotationComboBox(void);
43  virtual void UpdateAngle(int nWinId);
44  //events
45  void OnTextEnter(wxCommandEvent& event);
46  void OnMapRotated(wxMxMapViewUIEvent& event);
47  //IToolBarControl
48  virtual void Activate(wxGISApplicationBase* pApp);
49  virtual void Deactivate(void);
50 protected:
51  //wxGISMapView* m_pMapView;
52  //long m_nConnectionPointMapCookie;
53  wxVector< std::pair<wxWindowID, long> > m_anMapWinIDs;
54 private:
55  DECLARE_EVENT_TABLE()
56 };
57 
58 enum wxGISEnumCartoMainCmdType{
59  enumGISCartoMainCmdFullExtent = 0,
60  enumGISCartoMainCmdPrevExtent,
61  enumGISCartoMainCmdNextExtent,
62  enumGISCartoMainCmdMax
63 };
64 
65 
73 class WXDLLIMPEXP_GIS_CTU wxGISCartoMainCmd :
74  public wxGISCommand
75 {
76  DECLARE_DYNAMIC_CLASS(wxGISCartoMainCmd)
77 public:
78  wxGISCartoMainCmd(void);
79  virtual ~wxGISCartoMainCmd(void);
80  //wxGISCommand
81  virtual wxIcon GetBitmap(void);
82  virtual wxString GetCaption(void);
83  virtual wxString GetCategory(void);
84  virtual bool GetChecked(void);
85  virtual bool GetEnabled(void);
86  virtual wxString GetMessage(void);
87  virtual wxGISEnumCommandKind GetKind(void);
88  virtual void OnClick(void);
89  virtual bool OnCreate(wxGISApplicationBase* pApp);
90  virtual wxString GetTooltip(void);
91  virtual unsigned char GetCount(void);
92 private:
93  wxGISApplicationBase* m_pApp;
94  wxIcon m_IconFullExt, m_IconNextExt, m_IconPrevExt;
95  wxGISMapView* m_pMapView;
96  WINDOWARRAY m_anMapWinIDs;
97 };
98 
99 enum wxGISEnumCartoMainToolType{
100  enumGISCartoMainToolZoomIn = 0,
101  enumGISCartoMainToolZoomOut,
102  enumGISCartoMainToolPan,
103  enumGISCartoMainToolIdentify,
104  enumGISCartoMainToolMax
105 };
106 
114 class WXDLLIMPEXP_GIS_CTU wxGISCartoMainTool :
115  public ITool
116 {
117  DECLARE_DYNAMIC_CLASS(wxGISCartoMainTool)
118 public:
119  wxGISCartoMainTool(void);
120  virtual ~wxGISCartoMainTool(void);
121  //ICommand
122  virtual wxIcon GetBitmap(void);
123  virtual wxString GetCaption(void);
124  virtual wxString GetCategory(void);
125  virtual bool GetChecked(void);
126  virtual bool GetEnabled(void);
127  virtual wxString GetMessage(void);
128  virtual wxGISEnumCommandKind GetKind(void);
129  virtual void OnClick(void);
130  virtual bool OnCreate(wxGISApplicationBase* pApp);
131  virtual wxString GetTooltip(void);
132  virtual unsigned char GetCount(void);
133  //ITool
134  virtual wxCursor GetCursor(void);
135  virtual void SetChecked(bool bCheck);
136  virtual void OnMouseDown(wxMouseEvent& event);
137  virtual void OnMouseUp(wxMouseEvent& event);
138  virtual void OnMouseDoubleClick(wxMouseEvent& event);
139  virtual void OnMouseMove(wxMouseEvent& event);
140 private:
141  wxGISApplicationBase* m_pApp;
142  wxIcon m_IconZoomIn, m_IconZoomOut, m_IconPan, m_IconInfo;
143  wxCursor m_CurZoomIn, m_CurZoomOut, m_CurPan1, m_CurPan2, m_CurInfo;
144  wxGISMapView* m_pMapView;
145  WINDOWARRAY m_anMapWinIDs;
146  wxAxIdentifyView* m_pIdentifyView;
147  bool m_bCheck;
148 };
149 
150 enum wxGISEnumCartoFrameToolType{
151  enumGISCartoFrameToolRotate = 0,
152  enumGISCartoFrameToolCancelRotate,
153  enumGISCartoFrameToolInputRotateAngle,
154  enumGISCartoFrameToolMax
155 };
156 
157 
165 class WXDLLIMPEXP_GIS_CTU wxGISCartoFrameTool :
166  public ITool,
167  public IToolControl
168 {
169  DECLARE_DYNAMIC_CLASS(wxGISCartoFrameTool)
170 public:
171  wxGISCartoFrameTool(void);
172  virtual ~wxGISCartoFrameTool(void);
173  //ICommand
174  virtual wxIcon GetBitmap(void);
175  virtual wxString GetCaption(void);
176  virtual wxString GetCategory(void);
177  virtual bool GetChecked(void);
178  virtual bool GetEnabled(void);
179  virtual wxString GetMessage(void);
180  virtual wxGISEnumCommandKind GetKind(void);
181  virtual void OnClick(void);
182  virtual bool OnCreate(wxGISApplicationBase* pApp);
183  virtual wxString GetTooltip(void);
184  virtual unsigned char GetCount(void);
185  //ITool
186  virtual wxCursor GetCursor(void);
187  virtual void SetChecked(bool bCheck);
188  virtual void OnMouseDown(wxMouseEvent& event);
189  virtual void OnMouseUp(wxMouseEvent& event);
190  virtual void OnMouseDoubleClick(wxMouseEvent& event);
191  virtual void OnMouseMove(wxMouseEvent& event);
192  //IToolControl
193  virtual IToolBarControl* GetControl(void);
194  virtual wxString GetToolLabel(void);
195  virtual bool HasToolLabel(void);
196 private:
197  wxGISApplicationBase* m_pApp;
198  wxIcon m_IconRotate, m_IconCancelRotate;
199  wxCursor m_CurRotate;
200  wxGISMapView* m_pMapView;
201  WINDOWARRAY m_anMapWinIDs;
202  bool m_bCheck;
203 };
204 
Definition: cartocmd.h:165
Definition: mxeventui.h:54
Definition: command.h:110
Definition: mapview.h:36
Definition: applicationbase.h:65
Definition: identifydlg.h:215
Definition: command.h:128
Definition: command.h:53
Definition: cartocmd.h:35
Definition: cartocmd.h:73
Definition: cartocmd.h:114
Definition: command.h:92