Version: 0.6.0
applicationex.h
1 /******************************************************************************
2  * Project: wxGIS
3  * Purpose: wxGISApplicationEx class. Add AUI managed frames & etc.
4  * Author: Dmitry Baryshnikov (aka Bishop), polimax@mail.ru
5  ******************************************************************************
6 * Copyright (C) 2011-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 
23 #include "wxgis/framework/application.h"
24 
25 #include "wx/aui/aui.h"
26 #include "wx/artprov.h"
27 
28 
30 {
31  int row;
32  wxRect rect;
33  wxWindow *window;
34 
35  bool operator<(const ToolbarFitInfo &r) const
36  {
37  if (row < r.row)
38  return true;
39  else if (row == r.row)
40  return rect.x < r.rect.x;
41  else
42  return false;
43  }
44 };
45 
47 {
48  ToolbarRowInfo() {}
49  ToolbarRowInfo(int width_, int position_) : width(width_), position(position_) {}
50 
51  int width, position;
52 };
53 
54 
61 class WXDLLIMPEXP_GIS_FRW wxGISApplicationEx : public wxGISApplication
62 {
63  DECLARE_CLASS(wxGISApplicationEx)
64 public:
65  wxGISApplicationEx(wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxDEFAULT_FRAME_STYLE | wxSUNKEN_BORDER);
66  virtual ~wxGISApplicationEx(void);
67  virtual wxAuiManager* GetAuiManager(void) const{return (wxAuiManager*)&m_mgr;};
68  virtual void ShowPane(wxWindow* pWnd, bool bShow = true);
69  virtual void ShowPane(const wxString& sName, bool bShow = true);
70  virtual bool IsPaneShown(const wxString& sName);
71  //wxGISApplication
72  virtual void RemoveCommandBar(wxGISCommandBar* pBar);
73  virtual bool AddCommandBar(wxGISCommandBar* pBar);
74  //events
75  virtual void OnClose(wxCloseEvent& event);
76  //wxGISApplication
77  virtual void Customize(void);
78  virtual void FitToolbars(void);
79  virtual void OptimizeToolbars(void);
80  virtual void ShowStatusBar(bool bShow);
81  virtual void ShowApplicationWindow(wxWindow* pWnd, bool bShow = true);
82  virtual bool IsApplicationWindowShown(wxWindow* pWnd);
83  virtual wxString GetAppVersionString(void) const;
84  virtual bool CreateApp(void);
85  virtual bool SetupSys(const wxString &sSysPath);
86  virtual void SetDebugMode(bool bDebugMode);
87  virtual bool SetupLog(const wxString &sLogPath, const wxString &sNamePrefix = wxEmptyString);
88 protected:
89  virtual void SerializeFramePosEx(bool bSave = false);
90  virtual void CollectToolbars(std::set<ToolbarFitInfo> &result);
91 protected:
92  wxAuiManager m_mgr;
93 };
Definition: applicationex.h:46
Definition: applicationex.h:29
Definition: commandbar.h:60
Definition: application.h:39
Definition: applicationex.h:61