Version: 0.6.0
gxcontdialog.h
1 /******************************************************************************
2  * Project: wxGIS (GIS Catalog)
3  * Purpose: wxGxContainerDialog 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 #pragma once
22 
23 #include <wx/intl.h>
24 
25 #include <wx/string.h>
26 #include <wx/stattext.h>
27 #include <wx/gdicmn.h>
28 #include <wx/font.h>
29 #include <wx/colour.h>
30 #include <wx/settings.h>
31 #include <wx/treectrl.h>
32 #include <wx/toolbar.h>
33 #include <wx/sizer.h>
34 #include <wx/button.h>
35 #include <wx/dialog.h>
36 #include <wx/aui/aui.h>
37 
38 #include "wxgis/core/config.h"
39 #include "wxgis/catalogui/gxcatalogui.h"
40 #include "wxgis/catalogui/gxcontentview.h"
41 #include "wxgis/catalogui/gxtreeview.h"
42 #include "wxgis/framework/applicationbase.h"
43 #include "wxgis/version.h"
44 #include "wxgis/catalog/gxfilters.h"
45 #include "wxgis/framework/accelerator.h"
46 
47 
48 #define CONTDLG_NAME wxT("wxGISContDialog")
49 
58  public wxGxTreeView
59 {
60  DECLARE_DYNAMIC_CLASS(wxTreeContainerView)
61 public:
62  wxTreeContainerView(void);
63  wxTreeContainerView(wxWindow* parent, wxWindowID id = TREECTRLID, long style = wxTR_HAS_BUTTONS | wxTR_TWIST_BUTTONS | wxTR_NO_LINES | wxTR_SINGLE | wxTR_EDIT_LABELS);// | wxTR_HIDE_ROOT
64  virtual ~wxTreeContainerView(void);
65 //wxGxTreeViewBase
66  virtual void AddTreeItem(wxGxObject* pGxObject, wxTreeItemId hParent);
67 //wxTreeContainerView
68  virtual void AddShowFilter(wxGxObjectFilter* pFilter);
69  virtual void RemoveAllShowFilters(void);
70 //events
71  virtual void OnItemRightClick(wxTreeEvent& event){};
72  virtual void OnBeginDrag(wxTreeEvent& event){};
73  //virtual void OnActivated(wxTreeEvent& event){};
74  virtual bool CanChooseObject( wxGxObject* pObject );
75 protected:
76  wxGxObjectFiltersArray m_ShowFilter;
77 };
78 
86 class WXDLLIMPEXP_GIS_CLU wxGxContainerDialog :
87  public wxDialog,
88  public wxGISApplicationBase,
89  public wxGxApplicationBase
90 {
91  DECLARE_CLASS(wxGxContainerDialog)
92  enum
93  {
94  ID_CREATE = wxID_HIGHEST + 4001
95  };
96 public:
97  wxGxContainerDialog( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Open"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 540,338 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER );
98  virtual ~wxGxContainerDialog();
99 //wxGISApplicationBase
100  virtual wxString GetAppName(void) const{return wxString(CONTDLG_NAME);};
101  virtual wxString GetAppDisplayName(void) const { return wxString(_("NextGIS Container Dialog")); };
102  virtual wxString GetAppDisplayNameShort(void) const { return wxString(_("Container Dialog")); };
103  //wxDialog
104  int ShowModal(void);
105 //wxGxContainerDialog
106  virtual void SetButtonCaption(const wxString &sOkBtLabel);
107  virtual void SetStartingLocation(const wxString &sStartPath);
108  virtual void SetDescriptionText(const wxString &sText);
109  virtual void ShowCreateButton(bool bShow = false);
110  virtual void ShowExportFormats(bool bShow = false);
111  virtual void SetAllFilters(bool bAllFilters);
112  virtual void AddFilter(wxGxObjectFilter* pFilter, bool bDefault = false);
113  virtual void SetOwnsFilter(bool bOwnFilter){ m_bOwnFilter = bOwnFilter; };
114  virtual void SetOwnsShowFilter(bool bOwnFilter){m_bOwnShowFilter = bOwnFilter;};
115  virtual void RemoveAllFilters(void);
116  virtual void AddShowFilter(wxGxObjectFilter* pFilter);
117  virtual void RemoveAllShowFilters(void);
118  const wxGxObjectList& GetChildren() const { return m_ObjectList; };
119  virtual wxString GetName(void) const;
120  virtual wxString GetFullName(void) const;
121  virtual CPLString GetPath(void) const;
122  virtual wxGxObject* const GetLocation(void) const;
123  virtual wxGxObjectFilter* GetCurrentFilter(void) const;
124  virtual size_t GetCurrentFilterId(void) const;
125 protected:
126 // events
127  virtual void OnFilterSelect(wxCommandEvent& event);
128  virtual void OnOK(wxCommandEvent& event);
129  virtual void OnOKUI(wxUpdateUIEvent& event);
130  virtual void OnCreate(wxCommandEvent& event);
131  virtual void OnCreateUI(wxUpdateUIEvent& event);
132  virtual void OnCommand(wxCommandEvent& event);
133  virtual void OnCommandUI(wxUpdateUIEvent& event);
134  virtual void Command(wxGISCommand* pCmd);
135 protected:
136 //wxGxContainerDialog
137  virtual void OnInit();
138  virtual void SerializeFramePos(bool bSave);
139 protected:
140  wxGxCatalogUI* m_pCatalog;
141  wxGISAcceleratorTable* m_pGISAcceleratorTable;
142  wxTreeContainerView* m_pTree;
143  wxString m_sOkBtLabel;
144  wxString m_sStartPath;
145  bool m_bShowCreateButton, m_bAllFilters, m_bShowExportFormats;
146  wxGxObjectFiltersArray m_FilterArray;
147  wxGxObjectFiltersArray m_paShowFilter;
148  size_t m_nDefaultFilter;
149  wxGxObjectList m_ObjectList;
150  int m_nRetCode;
151  bool m_bOwnFilter, m_bOwnShowFilter;
152 
153 protected:
154  wxBoxSizer* bMainSizer;
155  wxStaticText* m_staticDescriptionText;
156  wxStaticText* m_staticWildText;
157  wxBoxSizer* bFooterSizer;
158  wxComboBox* m_WildcardCombo;
159  wxButton* m_CancelButton;
160  wxButton* m_CreateButton;
161  wxButton* m_OkButton;
162 private:
163  DECLARE_EVENT_TABLE()
164 };
An Interface class for GxApplication.
Definition: gxselection.h:80
Definition: applicationbase.h:65
Definition: command.h:53
The tree view in Catalog.
Definition: gxtreeview.h:121
Definition: gxcatalogui.h:34
Definition: gxcontdialog.h:57
Definition: gxfilters.h:33
Definition: accelerator.h:28
Definition: gxobject.h:37
Definition: gxcontdialog.h:86