Version: 0.6.0
gpcontrols.h
1 /******************************************************************************
2  * Project: wxGIS (GIS Toolbox)
3  * Purpose: controls classes.
4  * Author: Dmitry Baryshnikov (aka Bishop), polimax@mail.ru
5  ******************************************************************************
6 * Copyright (C) 2009-2012,2014 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 
23 #include "wxgis/geoprocessingui/geoprocessingui.h"
24 #include "wxgis/geoprocessing/gpparam.h"
25 //#include "wxgis/cartoui/tableview.h"
26 
27 #include <wx/intl.h>
28 #include <wx/bitmap.h>
29 #include <wx/image.h>
30 #include <wx/icon.h>
31 #include <wx/statbmp.h>
32 #include <wx/gdicmn.h>
33 #include <wx/font.h>
34 #include <wx/colour.h>
35 #include <wx/settings.h>
36 #include <wx/string.h>
37 #include <wx/stattext.h>
38 #include <wx/choice.h>
39 #include <wx/sizer.h>
40 #include <wx/panel.h>
41 #include <wx/grid.h>
42 #include <wx/imaglist.h>
43 
50 class WXDLLIMPEXP_GIS_GPU wxGISDTBase : public wxPanel
51 {
52  DECLARE_ABSTRACT_CLASS(wxGISDTBase)
53 public:
54  wxGISDTBase( const wxGISGPParameterArray &Params, int nParamIndex, wxWindow* parent, wxWindowID id = wxID_ANY, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxCLIP_CHILDREN | wxCLIP_SIBLINGS | wxTAB_TRAVERSAL );
55  virtual ~wxGISDTBase();
56  virtual void SetMessage(wxGISEnumGPMessageType nType = wxGISEnumGPMessageUnknown, const wxString &sMsg = wxEmptyString);
57  virtual bool Validate(void) = 0;
58  virtual wxGISGPParameter* GetParameter(void) const;
59  virtual wxGISEnumGPMessageType GetCurrentMessageType(void) const {return m_nCurrentType;};
60  virtual wxString GetCurrentMessage(void) const {return m_sCurrentMsg;};
61  virtual void OnDelete();
62  //events
63  virtual void OnParamChanged(wxGISGPParamEvent& event) = 0;
64  virtual void OnParamMsgSet(wxGISGPParamEvent& event);
65 protected:
66  wxStaticBitmap* m_StateBitmap;
67  wxStaticText* m_sParamDisplayName;
68  wxString m_sFullDisplayName;
69  wxStaticBitmap* m_bitmap;
70  wxGISGPParameter* m_pParam;
71  wxImageList m_ImageList;
72  wxGISEnumGPMessageType m_nCurrentType;
73  wxString m_sCurrentMsg;
74  wxGISGPParameterArray m_Params;
75  int m_nParamIndex;
76  long m_nAdvCookie;
77 private:
78  DECLARE_EVENT_TABLE()
79 };
80 
88 class WXDLLIMPEXP_GIS_GPU wxGISDTPath :
89  public wxGISDTBase,
90  public IViewDropTarget
91 {
92  DECLARE_CLASS(wxGISDTPath)
93  enum
94  {
95  ID_PATHCTRL = wxID_HIGHEST + 3603
96  };
97 public:
98  wxGISDTPath( const wxGISGPParameterArray &Params, int nParamIndex, wxWindow* parent, wxWindowID id = wxID_ANY, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxTAB_TRAVERSAL );
99  virtual ~wxGISDTPath();
100  //wxGISDTBase
101  virtual bool Validate(void);
102  //events
103  virtual void OnOpen(wxCommandEvent& event);
104  virtual void OnUpdateUI(wxUpdateUIEvent& event);
105  virtual void OnPathChange(wxCommandEvent& event);
106  virtual void OnParamChanged(wxGISGPParamEvent& event);
107  //IGxDropTarget
108  virtual wxDragResult OnDragOver(wxCoord x, wxCoord y, wxDragResult def);
109  virtual bool OnDropObjects(wxCoord x, wxCoord y, const wxArrayString& GxObjects, bool bIsControlOn);
110  virtual void OnLeave();
111  virtual bool CanPaste(void);
112 protected:
113  wxTextCtrl* m_PathTextCtrl;
114  wxBitmapButton* m_bpButton;
115 private:
116  DECLARE_EVENT_TABLE()
117 };
118 
126 class WXDLLIMPEXP_GIS_GPU wxGISDTFolderPath : public wxGISDTPath
127 {
128  DECLARE_CLASS(wxGISDTFolderPath)
129 public:
130  wxGISDTFolderPath( const wxGISGPParameterArray &Params, int nParamIndex, wxWindow* parent, wxWindowID id = wxID_ANY, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxTAB_TRAVERSAL );
131  virtual ~wxGISDTFolderPath();
132  //wxGISDTBase
133  virtual bool Validate(void);
134  //events
135  virtual void OnOpen(wxCommandEvent& event);
136 };
137 
145 class WXDLLIMPEXP_GIS_GPU wxGISDTDigit : public wxGISDTBase
146 {
147  DECLARE_CLASS(wxGISDTDigit)
148  enum
149  {
150  ID_DIGITCTRL = wxID_HIGHEST + 3604
151  };
152 public:
153  wxGISDTDigit( const wxGISGPParameterArray &Params, int nParamIndex, wxWindow* parent, wxWindowID id = wxID_ANY, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxTAB_TRAVERSAL );
154  virtual ~wxGISDTDigit();
155  //wxGISDTBase
156  virtual bool Validate(void);
157  //events
158  virtual void OnUpdateUI(wxUpdateUIEvent &event);
159  virtual void OnDigitChange(wxCommandEvent& event);
160  virtual void OnParamChanged(wxGISGPParamEvent &event);
161 protected:
162  wxTextCtrl* m_DigitTextCtrl;
163 private:
164  DECLARE_EVENT_TABLE()
165 };
166 
174 class WXDLLIMPEXP_GIS_GPU wxGISDTChoice : public wxGISDTBase
175 {
176  DECLARE_CLASS(wxGISDTChoice)
177 protected:
178  enum
179  {
180  ID_CHOICESTR = wxID_HIGHEST + 3605
181  };
182 public:
183  wxGISDTChoice( const wxGISGPParameterArray &Params, int nParamIndex, wxWindow* parent, wxWindowID id = wxID_ANY, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxTAB_TRAVERSAL );
184  virtual ~wxGISDTChoice();
185  //wxGISDTBase
186  virtual bool Validate(void);
187  //events
188  virtual void OnChoice(wxCommandEvent& event);
189  virtual void OnUpdateUI(wxUpdateUIEvent &event);
190  virtual void OnParamChanged(wxGISGPParamEvent &event);
191  virtual void OnParamDomAddVal(wxGISGPParamEvent &event);
192  virtual void OnParamDomClear(wxGISGPParamEvent &event);
193 protected:
194  wxChoice* m_choice;
195  wxBoxSizer* m_bPathSizer;
196 private:
197  DECLARE_EVENT_TABLE()
198 };
199 
207 class WXDLLIMPEXP_GIS_GPU wxGISDTFieldChoice : public wxGISDTChoice
208 {
209  DECLARE_CLASS(wxGISDTFieldChoice)
210 public:
211  wxGISDTFieldChoice( const wxGISGPParameterArray &Params, int nParamIndex, wxWindow* parent, wxWindowID id = wxID_ANY, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxTAB_TRAVERSAL );
212  virtual ~wxGISDTFieldChoice();
213  //wxGISDTBase
214  virtual bool Validate(void);
215  //events
216  virtual void OnChoice(wxCommandEvent& event);
217  virtual void OnParamChanged(wxGISGPParamEvent &event);
218 };
219 /*
226 class wxGISDTChoiceEditable : public wxGISDTChoice
227 {
228 public:
229  wxGISDTChoiceEditable( IGPParameter* pParam, IGxCatalog* pCatalog, wxWindow* parent, wxWindowID id = wxID_ANY, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxTAB_TRAVERSAL );
230  ~wxGISDTChoiceEditable();
231  //events
232  virtual void OnEdit(wxCommandEvent& event);
233 protected:
234  wxBitmapButton* m_bpButton;
235 
236 DECLARE_EVENT_TABLE()
237 };*/
238 
246 class WXDLLIMPEXP_GIS_GPU wxGISDTBool : public wxGISDTBase
247 {
248  DECLARE_CLASS(wxGISDTBool)
249  enum
250  {
251  ID_CHECKBOOL = wxID_HIGHEST + 3606
252  };
253 public:
254  wxGISDTBool( const wxGISGPParameterArray &Params, int nParamIndex, wxWindow* parent, wxWindowID id = wxID_ANY, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxTAB_TRAVERSAL );
255  virtual ~wxGISDTBool();
256  //wxGISDTBase
257  virtual bool Validate(void);
258  //events
259  virtual void OnClick(wxCommandEvent& event);
260  virtual void OnSize( wxSizeEvent& event );
261  virtual void OnUpdateUI(wxUpdateUIEvent &event);
262  virtual void OnParamChanged(wxGISGPParamEvent &event);
263 protected:
264  wxCheckBox* m_pCheckBox;
265 private:
266  DECLARE_EVENT_TABLE()
267 };
268 
276 class WXDLLIMPEXP_GIS_GPU wxGISDTText : public wxGISDTBase
277 {
278  DECLARE_CLASS(wxGISDTString)
279  enum
280  {
281  ID_EDITBOX = wxID_HIGHEST + 3607
282  };
283 public:
284  wxGISDTText( const wxGISGPParameterArray &Params, int nParamIndex, wxWindow* parent, wxWindowID id = wxID_ANY, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxTAB_TRAVERSAL );
285  virtual ~wxGISDTText();
286  //wxGISDTBase
287  virtual bool Validate(void);
288  //events
289  virtual void OnTextChange(wxCommandEvent& event);
290  virtual void OnUpdateUI(wxUpdateUIEvent &event);
291  virtual void OnParamChanged(wxGISGPParamEvent &event);
292 protected:
293  wxTextCtrl* m_TextCtrl;
294 private:
295  DECLARE_EVENT_TABLE()
296 };
297 
305 class WXDLLIMPEXP_GIS_GPU wxGISDTSpatRef : public wxGISDTPath
306 {
307  DECLARE_CLASS(wxGISDTSpatRef)
308 public:
309  wxGISDTSpatRef( const wxGISGPParameterArray &Params, int nParamIndex, wxWindow* parent, wxWindowID id = wxID_ANY, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxTAB_TRAVERSAL );
310  virtual ~wxGISDTSpatRef();
311  //wxGISDTBase
312  virtual bool Validate(void);
313  //events
314  virtual void OnOpen(wxCommandEvent& event);
315  virtual void OnParamChanged(wxGISGPParamEvent& event);
316  //IGxDropTarget
317  virtual bool OnDropObjects(wxCoord x, wxCoord y, const wxArrayString& GxObjects, bool bIsControlOn);
318 };
319 /*
326 class wxGISDTMultiParam : public wxGISDTBase
327 {
328  enum
329  {
330  ID_PPCTRL = wxID_HIGHEST + 3607
331  };
332 public:
333  wxGISDTMultiParam( IGPParameter* pParam, IGxCatalog* pCatalog, wxWindow* parent, wxWindowID id = wxID_ANY, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxTAB_TRAVERSAL );
334  virtual ~wxGISDTMultiParam();
335  //wxGISDTBase
336  virtual bool Validate(void);
337  virtual void UpdateValues(void);
338  virtual void UpdateControls(void);
339  //events
340  virtual void OnCellChange(wxGridEvent &event);
341  virtual void OnUpdateUI(wxUpdateUIEvent &event);
342 protected:
343  wxGrid* m_pg;
344  IGxCatalog* m_pCatalog;
345 
346  DECLARE_EVENT_TABLE()
347 };
348 /*
355 class wxGISDTList : public wxGISDTBase
356 {
357  enum
358  {
359  ID_LISTCTRL = wxID_HIGHEST + 3608
360  };
361 public:
362  wxGISDTList( IGPParameter* pParam, IGxCatalog* pCatalog, wxWindow* parent, wxWindowID id = wxID_ANY, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxTAB_TRAVERSAL );
363  virtual ~wxGISDTList();
364  virtual wxString GetValue();
365  //wxGISDTBase
366  virtual bool Validate(void);
367  virtual void UpdateValues(void);
368  virtual void UpdateControls(void);
369  //events
370  virtual void OnAdd(wxCommandEvent& event);
371  virtual void OnUpdateUI(wxUpdateUIEvent &event);
372  virtual void OnTextChange(wxCommandEvent& event);
373 protected:
374  wxTextCtrl* m_TextCtrl;
375  wxBitmapButton* m_bpButton;
376  IGxCatalog* m_pCatalog;
377 
378  DECLARE_EVENT_TABLE()
379 };
380 /*
387 class wxGISSQLQueryCtrl : public wxGISDTBase
388 {
389  enum
390  {
391  ID_LISTCTRL = wxID_HIGHEST + 3608
392  };
393 public:
394  wxGISSQLQueryCtrl( IGPParameter* pParam, IGxCatalog* pCatalog, wxWindow* parent, wxWindowID id = wxID_ANY, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxTAB_TRAVERSAL );
395  virtual ~wxGISSQLQueryCtrl();
396  //wxGISDTBase
397  virtual bool Validate(void);
398  virtual void UpdateValues(void);
399  virtual void UpdateControls(void);
400  //events
401  virtual void OnOpen(wxCommandEvent& event);
402  virtual void OnUpdateUI(wxUpdateUIEvent &event);
403 protected:
404  wxTextCtrl* m_QueryTextCtrl;
405  wxBitmapButton* m_bpButton;
406  IGxCatalog* m_pCatalog;
407 
408  DECLARE_EVENT_TABLE()
409 };
410 */
Definition: gpcontrols.h:246
Definition: gpcontrols.h:276
A Geoprocessing tools parameter class.
Definition: gpparam.h:82
Definition: gpparam.h:160
Definition: gpcontrols.h:305
Definition: gpcontrols.h:145
Definition: gpcontrols.h:88
Definition: gpcontrols.h:50
Definition: gpcontrols.h:126
Definition: gpcontrols.h:207
Definition: gpcontrols.h:174
The wxGISProcess class event.
Definition: gpparam.h:39
Definition: framework.h:59