Version: 0.6.0
gxtabview.h
1 /******************************************************************************
2  * Project: wxGIS (GIS Catalog)
3  * Purpose: wxGISTabView class.
4  * Author: Dmitry Baryshnikov (aka Bishop), polimax@mail.ru
5  ******************************************************************************
6 * Copyright (C) 2009-2012 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/catalogui/gxview.h"
23 #include "wxgis/catalog/catalog.h"
24 #include "wxgis/catalogui/gxeventui.h"
25 //#include "wxgis/framework/applicationbase.h"
26 
27 #include <wx/aui/aui.h>
28 #include <wx/artprov.h>
29 #include <wx/panel.h>
30 #include <wx/gdicmn.h>
31 #include <wx/font.h>
32 #include <wx/colour.h>
33 #include <wx/settings.h>
34 #include <wx/string.h>
35 #include <wx/combobox.h>
36 #include <wx/stattext.h>
37 #include <wx/sizer.h>
38 
39 #define LISTSTR _("Content")
40 #define PREVIEWSTR _("Preview")
41 
42 class wxGxApplication;
43 
51 class wxGxTab :
52  public wxPanel,
53  public IViewDropTarget
54 {
55  DECLARE_CLASS(wxGxTab)
56 
57  enum
58  {
59  ID_WNDCHOICE = wxID_HIGHEST + 3500
60  };
61 
62 public:
63  wxGxTab(wxGxApplication* application, wxXmlNode* pTabDesc, wxWindow* parent, wxWindowID id = wxID_ANY, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxTAB_TRAVERSAL);
64  virtual ~wxGxTab(void);
65  virtual wxString GetName(void);
66  virtual wxWindow* GetWindow(int iIndex);
67  virtual wxWindow* GetCurrentWindow(void){return m_pCurrentWnd;};
68  virtual size_t GetCount(void){return m_pWindows.size();};
69  virtual bool Show(bool bShow);
70  //virtual wxWindow* GetWindowByName(wxString sName);
71  virtual void Deactivate(void);
72 //IGxDropTarget
73  virtual wxDragResult OnDragOver(wxCoord x, wxCoord y, wxDragResult def);
74  virtual bool OnDropObjects(wxCoord x, wxCoord y, const wxArrayString& GxObjects, bool bIsControlOn);
75  virtual void OnLeave();
76  virtual bool CanPaste(void);
77 //events
78  virtual void OnChoice(wxCommandEvent& event);
79  virtual void OnSelectionChanged(wxGxSelectionEvent& event);
80 protected:
81  wxVector<wxWindow*> m_pWindows;
82  wxString m_sName;
83 
84  wxPanel* m_tabwnd;
85  wxPanel* m_tabselector;
86  wxStaticText* m_staticText;
87  wxChoice* m_choice;
88  wxBoxSizer* m_bSizerMain;
89 
90  bool m_bShowChoices;
91  wxWindow *m_pCurrentWnd, *m_pNoWnd;
92 
93  wxGxApplication* m_pApp;
94 
95 DECLARE_EVENT_TABLE()
96 };
97 
105 class WXDLLIMPEXP_GIS_CLU wxGxTabView :
106  public wxAuiNotebook,
107  public wxGxView
108 {
109  DECLARE_CLASS(wxGxTabView)
110 public:
111  wxGxTabView(void);
112  wxGxTabView(wxWindow* parent, wxWindowID id = TABCTRLID, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize);
113  virtual ~wxGxTabView(void);
114  //IView
115  virtual bool Create(wxWindow* parent, wxWindowID id = TABCTRLID, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxTAB_TRAVERSAL|wxNO_FULL_REPAINT_ON_RESIZE | wxCLIP_CHILDREN, const wxString& name = wxT("TabView"));
116  virtual bool Activate(IApplication* const application, wxXmlNode* const pConf);
117  virtual void Deactivate(void);
118 //events
119  virtual void OnAUINotebookPageChanged(wxAuiNotebookEvent& event);
120  virtual void OnSelectionChanged(wxGxSelectionEvent& event);
121 protected:
122  wxVector<wxGxTab*> m_Tabs;
123  long m_ConnectionPointSelectionCookie;
124  wxGxSelection* m_pSelection;
125  wxGxApplication* m_pApp;
126 private:
127  DECLARE_EVENT_TABLE()
128 };
The GxSelection class event.
Definition: gxeventui.h:37
Definition: gxview.h:35
Definition: gxtabview.h:105
The GxObject Selection class.
Definition: gxselection.h:30
Definition: gxtabview.h:51
Definition: framework.h:59
Definition: app.h:32
Definition: gxapplication.h:41