save the current status text for each pane inside wxStatusBarPane: native controls now store the (eventually) ellipsized version of the string; remove code for managing the status strings currently inside the [native|generic] control; add ellipsization support under wxMSW; now that all SetFieldsCount() implementation rrely on wxStatusBarBase::SetFieldsCount document how it behaves when adding new panes.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@58786 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -50,7 +50,6 @@ public:
|
||||
|
||||
// Set status line text
|
||||
virtual void SetStatusText(const wxString& text, int number = 0);
|
||||
virtual wxString GetStatusText(int number = 0) const;
|
||||
|
||||
// Set status line widths
|
||||
virtual void SetStatusWidths(int n, const int widths_field[]);
|
||||
@@ -97,9 +96,6 @@ protected:
|
||||
// common part of all ctors
|
||||
void Init();
|
||||
|
||||
// the array of the currently displayed strings
|
||||
wxArrayString m_statusStrings;
|
||||
|
||||
// the last known height of the client rect
|
||||
int m_lastClientHeight;
|
||||
|
||||
|
@@ -14,6 +14,8 @@
|
||||
|
||||
#if wxUSE_NATIVE_STATUSBAR
|
||||
|
||||
class WXDLLIMPEXP_CORE wxClientDC;
|
||||
|
||||
class WXDLLIMPEXP_CORE wxStatusBar : public wxStatusBarBase
|
||||
{
|
||||
public:
|
||||
@@ -39,7 +41,6 @@ public:
|
||||
|
||||
// each field of status line has it's own text
|
||||
virtual void SetStatusText(const wxString& text, int number = 0);
|
||||
virtual wxString GetStatusText(int number = 0) const;
|
||||
|
||||
// set status line fields' widths
|
||||
virtual void SetStatusWidths(int n, const int widths_field[]);
|
||||
@@ -57,17 +58,23 @@ public:
|
||||
virtual int GetBorderX() const;
|
||||
virtual int GetBorderY() const;
|
||||
|
||||
virtual bool SetFont(const wxFont& font);
|
||||
|
||||
virtual WXLRESULT MSWWindowProc(WXUINT nMsg,
|
||||
WXWPARAM wParam,
|
||||
WXLPARAM lParam);
|
||||
protected:
|
||||
void CopyFieldsWidth(const int widths[]);
|
||||
void SetFieldsWidth();
|
||||
void UpdateFieldText(int nField);
|
||||
|
||||
// override some base class virtuals
|
||||
virtual wxSize DoGetBestSize() const;
|
||||
virtual void DoMoveWindow(int x, int y, int width, int height);
|
||||
|
||||
// used by UpdateFieldText
|
||||
wxClientDC *m_pDC;
|
||||
|
||||
private:
|
||||
DECLARE_DYNAMIC_CLASS_NO_COPY(wxStatusBar)
|
||||
};
|
||||
|
@@ -28,8 +28,9 @@ class WXDLLIMPEXP_CORE wxStatusBarMac : public wxStatusBarGeneric
|
||||
long style = wxST_SIZEGRIP,
|
||||
const wxString& name = wxStatusBarNameStr);
|
||||
|
||||
virtual void DrawFieldText(wxDC& dc, int i);
|
||||
virtual void DrawField(wxDC& dc, int i);
|
||||
virtual void DrawFieldText(wxDC& dc, const wxRect& rc, int i, int textHeight);
|
||||
virtual void DrawField(wxDC& dc, int i, int textHeight);
|
||||
|
||||
virtual void SetStatusText(const wxString& text, int number = 0);
|
||||
|
||||
// Implementation
|
||||
|
@@ -39,14 +39,16 @@ class wxStatusBarPane
|
||||
{
|
||||
public:
|
||||
wxStatusBarPane(int style = wxSB_NORMAL, size_t width = 0)
|
||||
: nStyle(style), nWidth(width) {}
|
||||
: nStyle(style), nWidth(width) { arrStack.Add(wxEmptyString); }
|
||||
|
||||
int nStyle;
|
||||
int nWidth; // the width maybe negative, indicating a variable-width field
|
||||
|
||||
// this is the array of the stacked strings of this pane; note that this
|
||||
// stack does not include the string currently displayed in this pane
|
||||
// as it's stored in the native status bar control
|
||||
// stack does include also the string currently displayed in this pane
|
||||
// as the version stored in the native status bar control is possibly
|
||||
// ellipsized; note that arrStack.Last() is the top of the stack
|
||||
// (i.e. the string shown in the status bar)
|
||||
wxArrayString arrStack;
|
||||
};
|
||||
|
||||
@@ -74,8 +76,10 @@ public:
|
||||
// field text
|
||||
// ----------
|
||||
|
||||
virtual void SetStatusText(const wxString& text, int number = 0) = 0;
|
||||
virtual wxString GetStatusText(int number = 0) const = 0;
|
||||
virtual void SetStatusText(const wxString& text, int number = 0)
|
||||
{ m_panes[number].arrStack.Last() = text; }
|
||||
virtual wxString GetStatusText(int number = 0) const
|
||||
{ return m_panes[number].arrStack.Last(); }
|
||||
|
||||
void PushStatusText(const wxString& text, int number = 0);
|
||||
void PopStatusText(int number = 0);
|
||||
|
@@ -46,7 +46,6 @@ public:
|
||||
|
||||
// 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;
|
||||
@@ -96,7 +95,7 @@ protected:
|
||||
|
||||
private:
|
||||
// the current status fields strings
|
||||
wxArrayString m_statusText;
|
||||
//wxArrayString m_statusText;
|
||||
|
||||
// the absolute status fields widths
|
||||
wxArrayInt m_widthsAbs;
|
||||
|
Reference in New Issue
Block a user