Code::Blocks
SVN r11506
|
A custom status bar which can contain controls, icons... More...
#include <cbstatusbar.h>
Classes | |
struct | cbStatusBarElement |
Public Member Functions | |
virtual void | SetStatusTextByPlugin (const wxString &text, cbPlugin *plugin) |
Sets the text for one field. More... | |
virtual wxString | GetStatusTextByPlugin (cbPlugin *plugin) const |
Returns the string associated with a status bar field. More... | |
virtual bool | GetFieldRectByPlugin (cbPlugin *plugin, wxRect &rect) const |
Returns the size and position of a field's internal bounding rectangle. More... | |
void | SetStatusWidths (int n, const int *widths) override |
void | AddField (cbPlugin *plugin, wxWindow *ctrl, int width) |
Add a new field, which contains a control, to the status bar. More... | |
void | AddField (cbPlugin *plugin, int width) |
Add a new field to the status bar. More... | |
void | RemoveField (cbPlugin *plugin) |
Remove a field from the status bar. More... | |
Public Member Functions inherited from wxStatusBar | |
wxStatusBar () | |
wxStatusBar (wxWindow *parent, wxWindowID id=wxID_ANY, long style=wxSTB_DEFAULT_STYLE, const wxString &name=wxStatusBarNameStr) | |
virtual | ~wxStatusBar () |
bool | Create (wxWindow *parent, wxWindowID id=wxID_ANY, long style=wxSTB_DEFAULT_STYLE, const wxString &name=wxStatusBarNameStr) |
virtual bool | GetFieldRect (int i, wxRect &rect) const |
int | GetFieldsCount () const |
const wxStatusBarPane & | GetField (int n) const |
wxSize | GetBorders () const |
virtual wxString | GetStatusText (int i=0) const |
int | GetStatusWidth (int n) const |
int | GetStatusStyle (int n) const |
void | PopStatusText (int field=0) |
void | PushStatusText (const wxString &string, int field=0) |
virtual void | SetFieldsCount (int number=1, const int *widths=NULL) |
virtual void | SetMinHeight (int height) |
virtual void | SetStatusStyles (int n, const int *styles) |
virtual void | SetStatusText (const wxString &text, int i=0) |
Private Types | |
typedef std::vector< cbStatusBarElement > | ElementVector |
Private Member Functions | |
cbStatusBar (wxWindow *parent, wxWindowID id, long style, const wxString &name) | |
cbStatusBar () | |
cbStatusBar (const cbStatusBar &) | |
~cbStatusBar () override | |
void | OnSize (wxSizeEvent &event) |
void | UpdateWidths () |
void | AdjustFieldsSize () |
int | GetFieldNumberOfPlugin (cbPlugin *plugin) const |
void | PushStatusText (cb_unused const wxString &text, cb_unused cbPlugin *plugin) |
void | PopStatusText (cb_unused cbPlugin *plugin) |
Private Attributes | |
ElementVector | m_Elements |
std::vector< int > | m_MainWidths |
Friends | |
class | MainFrame |
A custom status bar which can contain controls, icons...
Definition at line 18 of file cbstatusbar.h.
struct cbStatusBar::cbStatusBarElement |
Definition at line 81 of file cbstatusbar.h.
Class Members | ||
---|---|---|
wxWindow * | control | |
cbPlugin * | plugin | |
int | width |
|
private |
Definition at line 87 of file cbstatusbar.h.
|
private |
|
inlineprivate |
Definition at line 25 of file cbstatusbar.h.
References MainFrame::OnSize(), and wxStatusBar::SetStatusWidths().
|
private |
|
overrideprivate |
Definition at line 34 of file cbstatusbar.cpp.
Add a new field, which contains a control, to the status bar.
plugin | The plugin which wants to add a new statusfield |
ctrl | Pointer to the control to show on the new field. |
width | Width of the new field. See wxStatusBar::SetStatusWidths for the meaning of this parameter. |
Definition at line 72 of file cbstatusbar.cpp.
References cbStatusBar::cbStatusBarElement::control, m_Elements, cbStatusBar::cbStatusBarElement::plugin, UpdateWidths(), and cbStatusBar::cbStatusBarElement::width.
Referenced by AddField().
void cbStatusBar::AddField | ( | cbPlugin * | plugin, |
int | width | ||
) |
Add a new field to the status bar.
The field contains no control.
Definition at line 85 of file cbstatusbar.cpp.
References AddField(), and NULL.
|
private |
Definition at line 127 of file cbstatusbar.cpp.
References GetFieldRectByPlugin(), wxRect::height, m_Elements, wxRect::width, wxRect::x, and wxRect::y.
Referenced by MainFrame::DoAddPluginStatusField(), and OnSize().
|
private |
Definition at line 141 of file cbstatusbar.cpp.
References m_Elements, and m_MainWidths.
Referenced by GetFieldRectByPlugin(), GetStatusTextByPlugin(), and SetStatusTextByPlugin().
Returns the size and position of a field's internal bounding rectangle.
plugin | The plugin which wants to know its status-field size. |
rect | The rectangle values are placed in this variable. |
Definition at line 53 of file cbstatusbar.cpp.
References GetFieldNumberOfPlugin(), and wxStatusBar::GetFieldRect().
Referenced by AdjustFieldsSize().
Returns the string associated with a status bar field.
plugin | The plugin which wants to get its status text |
Definition at line 45 of file cbstatusbar.cpp.
References GetFieldNumberOfPlugin(), wxStatusBar::GetStatusText(), and wxEmptyString.
|
private |
Definition at line 105 of file cbstatusbar.cpp.
References AdjustFieldsSize().
|
inlineprivate |
Definition at line 79 of file cbstatusbar.h.
|
inlineprivate |
Definition at line 78 of file cbstatusbar.h.
void cbStatusBar::RemoveField | ( | cbPlugin * | plugin | ) |
Remove a field from the status bar.
If a control is associated wit this filed, RemoveField will destroy it.
id | The plugin which wants to remove its field |
Definition at line 90 of file cbstatusbar.cpp.
References m_Elements, and UpdateWidths().
Referenced by MainFrame::OnPluginUnloaded().
Sets the text for one field.
text | The text to be set. |
plugin | The pugin which wants to set its status text |
Definition at line 38 of file cbstatusbar.cpp.
References GetFieldNumberOfPlugin(), and wxStatusBar::SetStatusText().
|
overridevirtual |
Reimplemented from wxStatusBar.
Definition at line 61 of file cbstatusbar.cpp.
References m_MainWidths, and UpdateWidths().
|
private |
Definition at line 111 of file cbstatusbar.cpp.
References m_Elements, m_MainWidths, wxStatusBar::SetFieldsCount(), and wxStatusBar::SetStatusWidths().
Referenced by AddField(), RemoveField(), and SetStatusWidths().
|
friend |
Definition at line 21 of file cbstatusbar.h.
|
private |
Definition at line 88 of file cbstatusbar.h.
Referenced by AddField(), AdjustFieldsSize(), GetFieldNumberOfPlugin(), RemoveField(), and UpdateWidths().
|
private |
Definition at line 89 of file cbstatusbar.h.
Referenced by GetFieldNumberOfPlugin(), SetStatusWidths(), and UpdateWidths().