Update the field widths on demand in wxStatusBarGeneric.
This ensures that the value returned from GetFieldRect() is always up to date, even when this method is called from the user-defined wxEVT_SIZE handler, i.e. before our own OnSize() could run. Also remove the now unneeded hack with calling the base class OnSize() from the statbar sample. Closes #14268. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@71365 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -91,8 +91,9 @@ protected:
|
||||
// common part of all ctors
|
||||
void Init();
|
||||
|
||||
// the last known height of the client rect
|
||||
int m_lastClientHeight;
|
||||
// the last known size, fields widths must be updated whenever it's out of
|
||||
// date
|
||||
wxSize m_lastClientSize;
|
||||
|
||||
// the absolute widths of the status bar panes in pixels
|
||||
wxArrayInt m_widthsAbs;
|
||||
@@ -106,6 +107,9 @@ protected:
|
||||
virtual wxSize DoGetBestSize() const;
|
||||
|
||||
private:
|
||||
// Update m_lastClientSize and m_widthsAbs from the current size.
|
||||
void DoUpdateFieldWidths();
|
||||
|
||||
DECLARE_EVENT_TABLE()
|
||||
DECLARE_DYNAMIC_CLASS_NO_COPY(wxStatusBarGeneric)
|
||||
};
|
||||
|
Reference in New Issue
Block a user