X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/fe9fea7ec75fe38527702b8ae7926a5609828b79..da8b1d4b3b535aba94d04494f5b6e2b3e47901ee:/include/wx/univ/statusbr.h diff --git a/include/wx/univ/statusbr.h b/include/wx/univ/statusbr.h index 5c97873fe8..52dc440acf 100644 --- a/include/wx/univ/statusbr.h +++ b/include/wx/univ/statusbr.h @@ -12,25 +12,22 @@ #ifndef _WX_UNIV_STATUSBR_H_ #define _WX_UNIV_STATUSBR_H_ -#ifdef __GNUG__ - #pragma interface "univstatusbr.h" -#endif - #include "wx/univ/inpcons.h" +#include "wx/arrstr.h" // ---------------------------------------------------------------------------- -// wxStatusBar: a window near the bottom of the frame used for status info +// wxStatusBarUniv: a window near the bottom of the frame used for status info // ---------------------------------------------------------------------------- -class WXDLLEXPORT wxStatusBarUniv : public wxStatusBarBase, - public wxInputConsumer +class WXDLLIMPEXP_CORE wxStatusBarUniv : public wxStatusBarBase, + public wxInputConsumer { public: wxStatusBarUniv() { Init(); } wxStatusBarUniv(wxWindow *parent, - wxWindowID id = -1, - long style = 0, + wxWindowID id = wxID_ANY, + long style = wxSTB_DEFAULT_STYLE, const wxString& name = wxPanelNameStr) { Init(); @@ -39,39 +36,33 @@ public: } bool Create(wxWindow *parent, - wxWindowID id = -1, - long style = 0, + wxWindowID id = wxID_ANY, + long style = wxSTB_DEFAULT_STYLE, const wxString& name = wxPanelNameStr); - // set field count/widths + // implement base class methods virtual void SetFieldsCount(int number = 1, const int *widths = NULL); virtual void SetStatusWidths(int n, const int widths[]); - // get/set the text of the given field - virtual void SetStatusText(const wxString& text, int number = 0); - virtual wxString GetStatusText(int number = 0) const; - - // Get the position and size of the field's internal bounding rectangle virtual bool GetFieldRect(int i, wxRect& rect) const; - - // sets the minimal vertical size of the status bar virtual void SetMinHeight(int height); - // get the dimensions of the horizontal and vertical borders virtual int GetBorderX() const; virtual int GetBorderY() const; + // wxInputConsumer pure virtual + virtual wxWindow *GetInputWindow() const + { return const_cast(this); } + protected: + virtual void DoUpdateStatusText(int i); + // recalculate the field widths void OnSize(wxSizeEvent& event); // draw the statusbar virtual void DoDraw(wxControlRenderer *renderer); - // wxInputConsumer pure virtual - virtual wxWindow *GetInputWindow() const - { return wxConstCast(this, wxStatusBar); } - // tell them about our preferred height virtual wxSize DoGetBestSize() const; @@ -88,15 +79,15 @@ protected: // also updates m_widthsAbs if necessary wxRect GetTotalFieldRect(wxCoord *borderBetweenFields); - // refresh the given field - void RefreshField(int i); + // get the rect for this field without ani side effects (see code) + wxRect DoGetFieldRect(int n) const; // common part of all ctors void Init(); private: - // the status fields strings - wxArrayString m_statusText; + // the current status fields strings + //wxArrayString m_statusText; // the absolute status fields widths wxArrayInt m_widthsAbs;