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
10
#include <wx/statusbr.h>
16
/** @brief A custom status bar which can contain controls, icons...
18
class DLLIMPORT cbStatusBar : public wxStatusBar
21
friend class MainFrame; // gets initialized from mainframe
23
// this will be used from friend mainframe
24
cbStatusBar(wxWindow* parent, wxWindowID id, long style, const wxString& name);
26
cbStatusBar ( const cbStatusBar& );
27
virtual ~cbStatusBar();
30
/** Sets the text for one field.
31
@param text The text to be set.
32
@param plugin The pugin which wants to set its status text
34
virtual void SetStatusTextByPlugin(const wxString& text, cbPlugin* plugin);
36
/** Returns the string associated with a status bar field.
37
@param plugin The plugin which wants to get its status text
38
@return The status field string if the field id is valid, otherwise the empty string.
40
virtual wxString GetStatusTextByPlugin(cbPlugin* plugin) const;
42
/** Returns the size and position of a field's internal bounding rectangle.
43
@param plugin The plugin which wants to know its status-field size.
44
@param rect The rectangle values are placed in this variable.
45
@return true if the field id is valid, false otherwise.
47
virtual bool GetFieldRectByPlugin(cbPlugin *plugin, wxRect& rect) const;
49
// functions used for the mainframe:
50
virtual void SetStatusWidths(int n, const int* widths);
52
/** Add a new field, which contains a control, to the status bar.
53
@param plugin The plugin which wants to add a new statusfield
54
@param ctrl Pointer to the control to show on the new field.
55
@param width Width of the new field. See wxStatusBar::SetStatusWidths for the meaning of this parameter.
57
void AddField(cbPlugin* plugin, wxWindow* ctrl, int width);
59
/** Add a new field to the status bar. The field contains no control.
60
@see cbStatusBar::AddField(cbPlugin *plugin, wxWindow *ctrl, int width) for details.
62
void AddField(cbPlugin* plugin, int width);
64
/** Remove a field from the status bar.
65
If a control is associated wit this filed, RemoveField will destroy it.
66
@param id The plugin which wants to remove its field
68
void RemoveField(cbPlugin* plugin);
72
void OnSize(wxSizeEvent& event);
75
void AdjustFieldsSize();
76
int GetFieldNumberOfPlugin(cbPlugin* plugin) const;
78
void PushStatusText(cb_unused const wxString& text, cb_unused cbPlugin *plugin) { ; };
79
void PopStatusText(cb_unused cbPlugin* plugin) { ; };
81
struct cbStatusBarElement
87
typedef std::vector<cbStatusBarElement> ElementVector;
88
ElementVector m_Elements;
89
std::vector<int> m_MainWidths;
94
#endif //CBSTATUSBAR_H