Version: 0.6.0
gxtoolexecview.h
1 /******************************************************************************
2  * Project: wxGIS (GIS Catalog)
3  * Purpose: wxGxToolExecuteView class.
4  * Author: Dmitry Baryshnikov (aka Bishop), polimax@mail.ru
5  ******************************************************************************
6 * Copyright (C) 2010-2011,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 
22 #pragma once
23 
24 #include "wxgis/catalogui/gxview.h"
25 #include "wxgis/catalogui/gxcatalogui.h"
26 #include "wxgis/catalog/gxevent.h"
27 #include "wxgis/catalogui/gxeventui.h"
28 #include "wxgis/catalog/gxobject.h"
29 #include "wxgis/catalogui/gxapplication.h"
30 #include "wxgis/geoprocessingui/geoprocessingui.h"
31 
32 #include "wx/listctrl.h"
33 #include "wx/imaglist.h"
34 
35 #define TOOLEXECVIEWSTYLE (wxLC_REPORT | wxBORDER_NONE | wxLC_EDIT_LABELS | wxLC_AUTOARRANGE)
36 
37 WXDLLIMPEXP_GIS_GPU int wxCALLBACK GxTaskCompareFunction(wxIntPtr item1, wxIntPtr item2, wxIntPtr sortData);
38 
46 class WXDLLIMPEXP_GIS_GPU wxGISToolExecuteView :
47  public wxListCtrl,
48  public wxGxView,
49  public IGxContentsView
50 {
51  DECLARE_CLASS(wxGISToolExecuteView)
52 public:
54  wxGISToolExecuteView(wxWindow* parent, wxWindowID id = TOOLEXECUTECTRLID, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = TOOLEXECVIEWSTYLE);
55  virtual ~wxGISToolExecuteView(void);
56  virtual void Serialize(wxXmlNode* pRootNode, bool bStore);
57  //wxListCtrl
58  bool Show(bool show);
59 //wxGxView
60  virtual bool Create(wxWindow* parent, wxWindowID id = TOOLEXECUTECTRLID, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = TOOLEXECVIEWSTYLE, const wxString& name = wxT("ToolExecuteView"));
61  virtual bool Activate(IApplication* const pApplication, wxXmlNode* const pConf);
62  virtual void Deactivate(void);
63 // IGxContentsView
64  virtual void SelectAll(void);
65  virtual void SetStyle(wxGISEnumContentsViewStyle style){};
66  virtual wxGISEnumContentsViewStyle GetStyle(void){return enumGISCVReport;};
67  virtual bool CanSetStyle(void){return false;};
68 // DropTarget
69  virtual wxDragResult OnDragOver(wxCoord x, wxCoord y, wxDragResult def);
70  virtual wxDragResult OnEnter(wxCoord x, wxCoord y, wxDragResult def);
71  virtual void OnLeave();
72  virtual bool OnDropObjects(wxCoord x, wxCoord y, long nParentPointer, const wxArrayLong& TaskIds);
73 //events
74  virtual void OnContextMenu(wxContextMenuEvent& event);
75  virtual void ShowContextMenu(const wxPoint& pos);
76  virtual void OnActivated(wxListEvent& event);
77  virtual void OnBeginLabelEdit(wxListEvent& event) = 0;
78  virtual void OnEndLabelEdit(wxListEvent& event) = 0;
79  virtual void OnSelected(wxListEvent& event);
80  virtual void OnDeselected(wxListEvent& event);
81  virtual void OnChar(wxKeyEvent& event);
82  virtual void OnBeginDrag(wxListEvent& event);
83 //events
84  virtual void OnObjectRefreshed(wxGxCatalogEvent& event);
85  virtual void OnObjectAdded(wxGxCatalogEvent& event);
86  virtual void OnObjectChanged(wxGxCatalogEvent& event) = 0;
87  virtual void OnObjectDeleted(wxGxCatalogEvent& event);
88  virtual void OnSelectionChanged(wxGxSelectionEvent& event);
89 protected:
90  virtual void AddObject(wxGxObject* pObject) = 0;
91  virtual void ResetContents(void);
92  virtual void RefreshAll(void);
93  virtual void InitColumns(void);
94 protected:
95  wxGxApplication* m_pApp;
96  long m_ConnectionPointCatalogCookie, m_ConnectionPointSelectionCookie;
97  wxGxSelection* m_pSelection;
98  wxGxCatalogUI* m_pCatalog;
99  wxGISCommand* m_pDeleteCmd;
100  long m_nParentGxObjectId;
101  wxImageList m_ImageList;
102  long m_HighLightItem;
103  bool m_bDropping;
104 private:
105  DECLARE_EVENT_TABLE()
106 };
107 
112 //typedef struct _sorttaskdata
113 //{
114 // bool bSortAsc;
115 // short currentSortCol;
116 //} SORTTASKDATA, *LPSORTTASKDATA;
117 
118 /*
119 
120 #define TOOLEXECVIEWSTYLE wxLC_REPORT | wxBORDER_NONE | wxLC_SORT_ASCENDING | wxLC_AUTOARRANGE | wxLC_VRULES | wxLC_HRULES
121 
122 class WXDLLIMPEXP_GIS_GPU wxGxToolExecuteView :
123  public wxListCtrl,
124  public wxGxView,
125  public IGxContentsView,
126  public IViewDropTarget
127 {
128  DECLARE_DYNAMIC_CLASS(wxGxToolExecuteView)
129 public:
130  wxGxToolExecuteView(void);
131  wxGxToolExecuteView(wxWindow* parent, wxWindowID id = TOOLEXECUTECTRLID, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = TOOLEXECVIEWSTYLE);
132  virtual ~wxGxToolExecuteView(void);
133  virtual void Serialize(wxXmlNode* pRootNode, bool bStore);
134  virtual void AddObject(wxGxObject* pObject);
135  virtual void ResetContents(void);
136  virtual IGxObjectSPtr const GetParentGxObject(void);
137  virtual bool Show(bool show = true);
138  virtual void HideDone(bool bHide = true);
139  virtual void SetGxToolExecute(IGxObject* pObject){m_nParentGxObjectID = pObject->GetID();};
140  virtual void RefreshAll(void);
141 //IGxView
142  virtual bool Create(wxWindow* parent, wxWindowID id = TOOLEXECUTECTRLID, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = TOOLEXECVIEWSTYLE, const wxString& name = wxT("ToolExecuteView"));
143  virtual bool Activate(IFrameApplication* application, wxXmlNode* pConf);
144  virtual void Deactivate(void);
145  virtual bool Applies(wxGxSelection* const pSelection);
146  virtual void BeginRename(IGxObject* pGxObject = NULL){};
147 // IGxContentsView
148  virtual void SelectAll(void);
149  virtual void SetStyle(wxGISEnumContentsViewStyle style){};
150  virtual wxGISEnumContentsViewStyle GetStyle(void){return enumGISCVReport;};
151  virtual bool CanSetStyle(void){return false;};
152 //IGxDropTarget
153  virtual wxDragResult OnDragOver(wxCoord x, wxCoord y, wxDragResult def);
154  virtual bool OnDropFiles(wxCoord x, wxCoord y, const wxArrayString& filenames);
155  virtual void OnLeave();
156 //events
157  virtual void OnColClick(wxListEvent& event);
158  virtual void OnContextMenu(wxContextMenuEvent& event);
159  virtual void ShowContextMenu(const wxPoint& pos);
160  virtual void SetColumnImage(int col, int image);
161  virtual void OnActivated(wxListEvent& event);
162  virtual void OnSelected(wxListEvent& event);
163  virtual void OnDeselected(wxListEvent& event);
164  virtual void OnChar(wxKeyEvent& event);
165  virtual void OnBeginDrag(wxListEvent& event);
166  virtual void OnObjectRefreshed(wxGxCatalogEvent& event);
167  virtual void OnObjectAdded(wxGxCatalogEvent& event);
168  virtual void OnObjectChanged(wxGxCatalogEvent& event);
169  virtual void OnObjectDeleted(wxGxCatalogEvent& event);
170  virtual void OnSelectionChanged(wxGxSelectionEvent& event);
171 protected:
172  virtual void FillDataArray(wxArrayString &saDataArr);
173 protected:
174  bool m_bSortAsc, m_bHideDone;
175  short m_currentSortCol;
176  wxImageList m_ImageList;
177  wxGISConnectionPointContainer* m_pConnectionPointCatalog;
178  long m_ConnectionPointCatalogCookie;
179  IGxSelection* m_pSelection;
180  wxGxCatalogUI* m_pCatalog;
181  wxGISCommand* m_pDeleteCmd;
182  long m_nParentGxObjectID;
183  long m_HighLightItem;
184 
185  DECLARE_EVENT_TABLE()
186 };
187 */
The GxSelection class event.
Definition: gxeventui.h:37
The Network event.
Definition: gxevent.h:39
Definition: command.h:53
Definition: gxtoolexecview.h:46
Definition: gxview.h:35
Definition: gxcatalogui.h:34
The GxObject Selection class.
Definition: gxselection.h:30
Definition: app.h:32
Definition: gxapplication.h:41
Definition: catalogui.h:112
Definition: gxobject.h:37