Version: 0.6.0
statusbar.h
1 /******************************************************************************
2  * Project: wxGIS (GIS Catalog)
3  * Purpose: wxGISStatusBar class.
4  * Author: Dmitry Baryshnikov (aka Bishop), polimax@mail.ru
5  ******************************************************************************
6 * Copyright (C) 2009,2012,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 "wxgis/framework/animation.h"
24 #include "wxgis/framework/progressor.h"
25 
26 #include <wx/statusbr.h>
27 
28 class WXDLLIMPEXP_GIS_FRW wxGISApplicationBase;
29 
37 enum wxGISEnumStatusBarPanels
38 {
39  enumGISStatusMain = 0x0001,
40  enumGISStatusAnimation = 0x0002,
41  enumGISStatusPosition = 0x0004,
42  enumGISStatusPagePosition = 0x0008,
43  enumGISStatusSize = 0x0010,
44  enumGISStatusCapsLock = 0x0020,
45  enumGISStatusNumLock = 0x0040,
46  enumGISStatusScrollLock = 0x0080,
47  enumGISStatusClock = 0x0100,
48  enumGISStatusProgress = 0x0200
49 };
50 
58 class WXDLLIMPEXP_GIS_FRW wxGISStatusBar : public wxStatusBar
59 {
60  DECLARE_DYNAMIC_CLASS_NO_COPY(wxGISStatusBar)
61 
62  enum
63  {
64  TIMER_ID = 1011
65  };
66 public:
68  wxGISStatusBar(wxWindow *parent, wxWindowID id, long style = wxST_SIZEGRIP, const wxString& name = wxT("statusBar"), wxDword panelsstyle = enumGISStatusMain | enumGISStatusProgress | enumGISStatusAnimation | enumGISStatusPosition);
69  ~wxGISStatusBar(void);
70 //methods
76  void SetMessage(const wxString& text, int i = 0);
82  wxString GetMessage(int i = 0) const;
87  int GetPanelPos(wxGISEnumStatusBarPanels nPanel);
93  {
94  if(m_Panels & enumGISStatusAnimation)
95  return static_cast<IProgressor*>(m_pAni);
96  return NULL;
97  };
103  {
104  if(m_Panels & enumGISStatusProgress)
105  return static_cast<IProgressor*>(m_pProgressBar);
106  return NULL;
107  };
108 
113  wxDword GetPanels(void) const { return m_Panels; };
118  void SetPanels(wxDword Panels){ m_Panels = Panels; };
119  //events
120  void OnSize(wxSizeEvent &event);
121  void OnRightDown(wxMouseEvent& event);
122  void OnTimer( wxTimerEvent & event);
123  void OnMessage(wxCommandEvent &event);
124 typedef struct _statuspanel
125  {
126  int size;
127  long style;
128  }STATUSPANEL;
129 
130 protected:
131  wxTimer m_timer;
132  wxGISAnimation* m_pAni;
133  wxGISProgressor* m_pProgressBar;
134  int m_MsgPos, m_AniPos, m_ProgressPos, m_PositionPos, m_ClockPos, m_PagePositionPos, m_SizePos, m_CapsLockPos, m_NumLockPos, m_ScrollLockPos;
135  wxGISApplicationBase* m_pApp;
136 protected:
137  wxDword m_Panels;
138 private:
139 
140  DECLARE_EVENT_TABLE()
141 };
IProgressor * GetProgressor(void) const
Get the progressor (progress bar).
Definition: statusbar.h:102
Definition: progressor.h:32
Definition: applicationbase.h:65
Definition: animation.h:33
wxDword m_Panels
Definition: statusbar.h:137
Definition: statusbar.h:58
IProgressor * GetAnimation(void) const
Get the animated progressor (rotating globe).
Definition: statusbar.h:92
Definition: statusbar.h:124
Definition: core.h:86