Code::Blocks  SVN r11506
cbstatusbar.h
Go to the documentation of this file.
1 /*
2  * This file is part of the Code::Blocks IDE and licensed under the GNU Lesser General Public License, version 3
3  * http://www.gnu.org/licenses/lgpl-3.0.html
4  */
5 
6 #ifndef CBSTATUSBAR_H
7 #define CBSTATUSBAR_H
8 
9 #include <vector>
10 #include <wx/statusbr.h>
11 
12 #include "settings.h"
13 
14 class cbPlugin;
15 
19 {
20 private:
21  friend class MainFrame; // gets initialized from mainframe
22 
23  // this will be used from friend mainframe
24  cbStatusBar(wxWindow* parent, wxWindowID id, long style, const wxString& name);
25  cbStatusBar() { ; };
26  cbStatusBar ( const cbStatusBar& );
27  ~cbStatusBar() override;
28 
29 public:
34  virtual void SetStatusTextByPlugin(const wxString& text, cbPlugin* plugin);
35 
40  virtual wxString GetStatusTextByPlugin(cbPlugin* plugin) const;
41 
47  virtual bool GetFieldRectByPlugin(cbPlugin *plugin, wxRect& rect) const;
48 
49  // functions used for the mainframe:
50  void SetStatusWidths(int n, const int* widths) override;
51 
57  void AddField(cbPlugin* plugin, wxWindow* ctrl, int width);
58 
62  void AddField(cbPlugin* plugin, int width);
63 
68  void RemoveField(cbPlugin* plugin);
69 
70 private:
71  // event handlers
72  void OnSize(wxSizeEvent& event);
73  void UpdateWidths();
74 
75  void AdjustFieldsSize();
76  int GetFieldNumberOfPlugin(cbPlugin* plugin) const;
77 
78  void PushStatusText(cb_unused const wxString& text, cb_unused cbPlugin *plugin) { ; };
79  void PopStatusText(cb_unused cbPlugin* plugin) { ; };
80 
82  {
83  int width;
86  };
87  typedef std::vector<cbStatusBarElement> ElementVector;
88  ElementVector m_Elements;
89  std::vector<int> m_MainWidths;
90 
91  DECLARE_EVENT_TABLE()
92 };
93 
94 #endif //CBSTATUSBAR_H
Definition: main.h:60
Base class for plugins.
Definition: cbplugin.h:84
std::vector< int > m_MainWidths
Definition: cbstatusbar.h:89
virtual void SetStatusWidths(int n, const int *widths_field)
#define DLLIMPORT
Definition: settings.h:16
std::vector< cbStatusBarElement > ElementVector
Definition: cbstatusbar.h:87
ElementVector m_Elements
Definition: cbstatusbar.h:88
A custom status bar which can contain controls, icons...
Definition: cbstatusbar.h:18
void OnSize(wxSizeEvent &event)
Definition: main.cpp:2699
void PopStatusText(cb_unused cbPlugin *plugin)
Definition: cbstatusbar.h:79
void PushStatusText(cb_unused const wxString &text, cb_unused cbPlugin *plugin)
Definition: cbstatusbar.h:78
int wxWindowID