From 170acdc90e9f92f8b8120fa6c04acdbf45c89582 Mon Sep 17 00:00:00 2001 From: Robin Dunn Date: Tue, 31 Oct 2006 08:50:17 +0000 Subject: [PATCH] GetBestFittingSize --> GetEffectiveMinSize SetBestFittingSize --> SetInitialSize SetBestSize --> SetInitialSize SetInitialBestSize --> SetInitialSize git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@42816 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- contrib/src/gizmos/statpict.cpp | 2 +- contrib/src/stc/stc.cpp | 2 +- contrib/src/stc/stc.cpp.in | 2 +- demos/forty/scoredg.cpp | 2 +- docs/changes.txt | 3 ++ docs/latex/wx/window.tex | 20 ++++++---- include/wx/bookctrl.h | 3 -- include/wx/control.h | 11 ------ include/wx/ctrlsub.h | 9 ----- include/wx/msw/radiobox.h | 3 -- include/wx/palmos/radiobox.h | 3 -- include/wx/window.h | 45 +++++++++++++++------- src/common/mediactrlcmn.cpp | 10 ++--- src/common/sizer.cpp | 2 +- src/common/wincmn.cpp | 6 +-- src/generic/buttonbar.cpp | 2 +- src/generic/calctrl.cpp | 4 +- src/generic/choicbkg.cpp | 1 - src/generic/collpaneg.cpp | 2 +- src/generic/combog.cpp | 4 +- src/generic/datectlg.cpp | 2 +- src/generic/grid.cpp | 4 +- src/generic/hyperlink.cpp | 2 +- src/generic/listctrl.cpp | 2 +- src/generic/spinctlg.cpp | 2 +- src/generic/splitter.cpp | 4 +- src/generic/treectlg.cpp | 2 +- src/gtk/animate.cpp | 2 +- src/gtk/choice.cpp | 2 +- src/gtk/clrpicker.cpp | 2 +- src/gtk/combobox.cpp | 2 +- src/gtk/control.cpp | 2 +- src/gtk/filepicker.cpp | 4 +- src/gtk/fontpicker.cpp | 2 +- src/gtk/gauge.cpp | 2 +- src/gtk/listbox.cpp | 2 +- src/gtk1/choice.cpp | 2 +- src/gtk1/combobox.cpp | 2 +- src/gtk1/control.cpp | 2 +- src/gtk1/gauge.cpp | 2 +- src/gtk1/listbox.cpp | 2 +- src/mac/carbon/checklst.cpp | 2 +- src/mac/carbon/choice.cpp | 2 +- src/mac/carbon/combobox.cpp | 2 +- src/mac/carbon/combobxc.cpp | 2 +- src/mac/carbon/listbox.cpp | 2 +- src/mac/carbon/spinctrl.cpp | 2 +- src/mac/carbon/statbmp.cpp | 2 +- src/mac/carbon/toolbar.cpp | 2 +- src/mac/carbon/window.cpp | 2 +- src/mac/classic/statbmp.cpp | 2 +- src/mac/classic/stattext.cpp | 2 +- src/msw/bmpbuttn.cpp | 2 +- src/msw/choice.cpp | 2 +- src/msw/combo.cpp | 4 +- src/msw/control.cpp | 2 +- src/msw/listbox.cpp | 2 +- src/msw/radiobox.cpp | 2 +- src/msw/spinbutt.cpp | 2 +- src/msw/spinctrl.cpp | 2 +- src/msw/statbmp.cpp | 2 +- src/msw/wince/checklst.cpp | 2 +- src/msw/wince/choicece.cpp | 2 +- src/msw/wince/textctrlce.cpp | 2 +- src/os2/choice.cpp | 2 +- src/os2/combobox.cpp | 2 +- src/palmos/control.cpp | 4 +- src/palmos/slider.cpp | 2 +- src/richtext/richtextctrl.cpp | 2 +- src/richtext/richtextstyles.cpp | 2 +- src/stc/stc.cpp | 2 +- src/stc/stc.cpp.in | 2 +- src/univ/button.cpp | 6 +-- src/univ/checkbox.cpp | 2 +- src/univ/gauge.cpp | 2 +- src/univ/listbox.cpp | 2 +- src/univ/notebook.cpp | 2 +- src/univ/scrolbar.cpp | 2 +- src/univ/slider.cpp | 2 +- src/univ/spinbutt.cpp | 2 +- src/univ/statbmp.cpp | 2 +- src/univ/stattext.cpp | 2 +- src/univ/textctrl.cpp | 2 +- src/univ/toolbar.cpp | 4 +- wxPython/demo/CustomTreeCtrl.py | 14 ------- wxPython/demo/GenericButtons.py | 7 ++-- wxPython/demo/MediaCtrl.py | 4 +- wxPython/misc/drawwidget.py | 2 +- wxPython/misc/widgetLayoutTest.py | 2 +- wxPython/src/_pycontrol.i | 2 - wxPython/src/_pywindows.i | 6 --- wxPython/src/_window.i | 12 +++--- wxPython/wx/lib/analogclock/analogclock.py | 2 +- wxPython/wx/lib/buttonpanel.py | 2 +- wxPython/wx/lib/buttons.py | 9 +++-- wxPython/wx/lib/masked/combobox.py | 4 +- wxPython/wx/lib/masked/maskededit.py | 6 +-- wxPython/wx/lib/masked/textctrl.py | 2 +- wxPython/wx/lib/scrolledpanel.py | 2 +- wxPython/wx/lib/splitter.py | 4 +- wxPython/wx/lib/statbmp.py | 4 +- wxPython/wx/lib/stattext.py | 6 +-- wxPython/wx/lib/ticker.py | 2 +- 103 files changed, 173 insertions(+), 199 deletions(-) diff --git a/contrib/src/gizmos/statpict.cpp b/contrib/src/gizmos/statpict.cpp index a6fd9f768e..b8c1cdf99d 100644 --- a/contrib/src/gizmos/statpict.cpp +++ b/contrib/src/gizmos/statpict.cpp @@ -67,7 +67,7 @@ bool wxStaticPicture::Create(wxWindow *parent, wxWindowID id, bool ret = wxControl::Create( parent, id, pos, size, style, wxDefaultValidator, name ); - SetBestSize( size ) ; + SetInitialSize( size ) ; return ret; } diff --git a/contrib/src/stc/stc.cpp b/contrib/src/stc/stc.cpp index bc54bf966c..0bf46f60b4 100644 --- a/contrib/src/stc/stc.cpp +++ b/contrib/src/stc/stc.cpp @@ -179,7 +179,7 @@ bool wxStyledTextCtrl::Create(wxWindow *parent, SetCodePage(wxSTC_CP_UTF8); #endif - SetBestFittingSize(size); + SetInitialSize(size); // Reduces flicker on GTK+/X11 SetBackgroundStyle(wxBG_STYLE_CUSTOM); diff --git a/contrib/src/stc/stc.cpp.in b/contrib/src/stc/stc.cpp.in index 2a9806a68a..d1a1701a53 100644 --- a/contrib/src/stc/stc.cpp.in +++ b/contrib/src/stc/stc.cpp.in @@ -179,7 +179,7 @@ bool wxStyledTextCtrl::Create(wxWindow *parent, SetCodePage(wxSTC_CP_UTF8); #endif - SetBestFittingSize(size); + SetInitialSize(size); // Reduces flicker on GTK+/X11 SetBackgroundStyle(wxBG_STYLE_CUSTOM); diff --git a/demos/forty/scoredg.cpp b/demos/forty/scoredg.cpp index d8344f3eb0..ecd1bb44f4 100644 --- a/demos/forty/scoredg.cpp +++ b/demos/forty/scoredg.cpp @@ -181,7 +181,7 @@ ScoreDialog::ScoreDialog(wxWindow* parent, ScoreFile* file) : ScoreCanvas* list = new ScoreCanvas(this, m_scoreFile, wxDefaultPosition, sz); #endif - list->SetBestFittingSize(sz); + list->SetInitialSize(sz); // locate and resize with sizers wxBoxSizer *topsizer = new wxBoxSizer( wxVERTICAL ); diff --git a/docs/changes.txt b/docs/changes.txt index 4d19f0f087..3401fd256d 100644 --- a/docs/changes.txt +++ b/docs/changes.txt @@ -64,6 +64,9 @@ Deprecated methods since 2.6.x and their replacements - wxGetWorkingDirectory() deprecated in favour of wxGetCwd(). - wxDC::BeginDrawing() and wxDC::EndDrawing() deprecated, don't use them. +- wxWindowBase::GetBestFittingSize --> wxWindowBase::GetEffectiveMinSize +- wxWindowBase::SetBestFittingSize --> wxWindowBase::SetInitialSize + Major new features in 2.7 release diff --git a/docs/latex/wx/window.tex b/docs/latex/wx/window.tex index 438768873c..ea2e152a50 100644 --- a/docs/latex/wx/window.tex +++ b/docs/latex/wx/window.tex @@ -758,16 +758,18 @@ background, such as a tiled bitmap. Currently the style has no effect on other p \helpref{wxWindow::GetForegroundColour}{wxwindowgetforegroundcolour},\rtfsp \helpref{wxWindow::SetBackgroundStyle}{wxwindowsetbackgroundstyle} -\membersection{wxWindow::GetBestFittingSize}\label{wxwindowgetbestfittingsize} +\membersection{wxWindow::GetEffectiveMinSize}\label{wxwindowgeteffectiveminsize} -\constfunc{wxSize}{GetBestFittingSize}{\void} +\constfunc{wxSize}{GetEffectiveMinSize}{\void} -Merges the window's best size into the min size and returns the result. +Merges the window's best size into the min size and returns the +result. This is the value used by sizers to determine the appropriate +ammount of sapce to allocate for the widget. \wxheading{See also} \helpref{wxWindow::GetBestSize}{wxwindowgetbestsize},\rtfsp -\helpref{wxWindow::SetBestFittingSize}{wxwindowsetbestfittingsize} +\helpref{wxWindow::SetInitialSize}{wxwindowsetinitialsize} \membersection{wxWindow::GetBestSize}\label{wxwindowgetbestsize} @@ -2661,9 +2663,9 @@ background, such as a tiled bitmap. Currently the style has no effect on other p \helpref{wxWindow::GetBackgroundStyle}{wxwindowgetbackgroundstyle} -\membersection{wxWindow::SetBestFittingSize}\label{wxwindowsetbestfittingsize} +\membersection{wxWindow::SetInitialSize}\label{wxwindowsetinitialsize} -\func{void}{SetBestFittingSize}{\param{const wxSize\& }{size = wxDefaultSize}} +\func{void}{SetInitialSize}{\param{const wxSize\& }{size = wxDefaultSize}} A {\it smart} SetSize that will fill in default size components with the window's {\it best} size values. Also sets the window's minsize to @@ -2672,11 +2674,15 @@ partial size is passed to this function then the sizers will use that size instead of the results of GetBestSize to determine the minimum needs of the window for layout. +Most controls will use this to set their initial size, and their min +size to the passed in value (if any.) + + \wxheading{See also} \helpref{wxWindow::SetSize}{wxwindowsetsize},\rtfsp \helpref{wxWindow::GetBestSize}{wxwindowgetbestsize},\rtfsp -\helpref{wxWindow::GetBestFittingSize}{wxwindowgetbestfittingsize} +\helpref{wxWindow::GetEffectiveMinSize}{wxwindowgeteffectiveminsize} \membersection{wxWindow::SetCaret}\label{wxwindowsetcaret} diff --git a/include/wx/bookctrl.h b/include/wx/bookctrl.h index 454e99545a..33599c7a41 100644 --- a/include/wx/bookctrl.h +++ b/include/wx/bookctrl.h @@ -276,9 +276,6 @@ protected: // helper: get the next page wrapping if we reached the end int GetNextPage(bool forward) const; - // Always rely on GetBestSize, which will look at all the pages - virtual void SetInitialBestSize(const wxSize& WXUNUSED(size)) { } - // Lay out controls void DoSize(); diff --git a/include/wx/control.h b/include/wx/control.h index aed113f803..560a476e05 100644 --- a/include/wx/control.h +++ b/include/wx/control.h @@ -84,17 +84,6 @@ protected: // initialize the common fields of wxCommandEvent void InitCommandEvent(wxCommandEvent& event) const; - // set the initial window size if none is given (i.e. at least one of the - // components of the size passed to ctor/Create() is -1) - // - // normally just calls SetBestSize() but can be overridden not to do it for - // the controls which have to do some additional initialization (e.g. add - // strings to list box) before their best size can be accurately calculated - virtual void SetInitialBestSize(const wxSize& size) - { - SetBestSize(size); - } - DECLARE_NO_COPY_CLASS(wxControlBase) }; diff --git a/include/wx/ctrlsub.h b/include/wx/ctrlsub.h index 308fb6a03a..9939f9a7df 100644 --- a/include/wx/ctrlsub.h +++ b/include/wx/ctrlsub.h @@ -189,15 +189,6 @@ public: virtual bool ShouldInheritColours() const { return false; } protected: - // we can't compute our best size before the items are added to the control - // which is done after calling SetInitialBestSize() (it is called from the - // base class ctor and the items are added in the derived class ctor), so - // don't do anything at all here as our size will be changed later anyhow - // - // of course, all derived classes *must* call SetBestSize() from their - // ctors for this to work! - virtual void SetInitialBestSize(const wxSize& WXUNUSED(size)) { } - // fill in the client object or data field of the event as appropriate // // calls InitCommandEvent() and, if n != wxNOT_FOUND, also sets the per diff --git a/include/wx/msw/radiobox.h b/include/wx/msw/radiobox.h index 60f29cb922..a301eba172 100644 --- a/include/wx/msw/radiobox.h +++ b/include/wx/msw/radiobox.h @@ -123,9 +123,6 @@ protected: // common part of all ctors void Init(); - // we can't compute our best size before the items are added to the control - virtual void SetInitialBestSize(const wxSize& WXUNUSED(size)) { } - // subclass one radio button void SubclassRadioButton(WXHWND hWndBtn); diff --git a/include/wx/palmos/radiobox.h b/include/wx/palmos/radiobox.h index fc8d8721d9..a018e6e669 100644 --- a/include/wx/palmos/radiobox.h +++ b/include/wx/palmos/radiobox.h @@ -139,9 +139,6 @@ public: void SendNotificationEvent(); protected: - // we can't compute our best size before the items are added to the control - virtual void SetInitialBestSize(const wxSize& WXUNUSED(size)) { } - // get the max size of radio buttons wxSize GetMaxButtonSize() const; diff --git a/include/wx/window.h b/include/wx/window.h index e15b3291d4..3d39594bc4 100644 --- a/include/wx/window.h +++ b/include/wx/window.h @@ -357,12 +357,15 @@ public: // This function will merge the window's best size into the window's // minimum size, giving priority to the min size components, and // returns the results. - wxSize GetBestFittingSize() const; + wxSize GetEffectiveMinSize() const; + wxDEPRECATED( wxSize GetBestFittingSize() const ); // replaced by GetEffectiveMinSize // A 'Smart' SetSize that will fill in default size values with 'best' // size. Sets the minsize to what was passed in. - void SetBestFittingSize(const wxSize& size=wxDefaultSize); + void SetInitialSize(const wxSize& size=wxDefaultSize); + wxDEPRECATED( void SetBestFittingSize(const wxSize& size=wxDefaultSize) ); // replaced by SetInitialSize + // the generic centre function - centers the window on parent by` // default or on screen if it doesn't have parent or // wxCENTER_ON_SCREEN flag is given @@ -1275,18 +1278,8 @@ protected: // recalculated each time the value is needed. wxSize m_bestSizeCache; - // keep the old name for compatibility, at least until all the internal - // usages of it are changed to SetBestFittingSize - void SetBestSize(const wxSize& size) { SetBestFittingSize(size); } - - // set the initial window size if none is given (i.e. at least one of the - // components of the size passed to ctor/Create() is wxDefaultCoord) - // - // normally just calls SetBestSize() for controls, but can be overridden - // not to do it for the controls which have to do some additional - // initialization (e.g. add strings to list box) before their best size - // can be accurately calculated - virtual void SetInitialBestSize(const wxSize& WXUNUSED(size)) {} + wxDEPRECATED( void SetBestSize(const wxSize& size) ); // use SetInitialSize + wxDEPRECATED( virtual void SetInitialBestSize(const wxSize& size) ); // use SetInitialSize @@ -1393,6 +1386,30 @@ private: DECLARE_EVENT_TABLE() }; + + +// Inlines for some deprecated methods +inline wxSize wxWindowBase::GetBestFittingSize() const +{ + return GetEffectiveMinSize(); +} + +inline void wxWindowBase::SetBestFittingSize(const wxSize& size) +{ + SetInitialSize(size); +} + +inline void wxWindowBase::SetBestSize(const wxSize& size) +{ + SetInitialSize(size); +} + +inline void wxWindowBase::SetInitialBestSize(const wxSize& size) +{ + SetInitialSize(size); +} + + // ---------------------------------------------------------------------------- // now include the declaration of wxWindow class // ---------------------------------------------------------------------------- diff --git a/src/common/mediactrlcmn.cpp b/src/common/mediactrlcmn.cpp index 2563d85a8f..b0d93db7af 100644 --- a/src/common/mediactrlcmn.cpp +++ b/src/common/mediactrlcmn.cpp @@ -115,7 +115,7 @@ bool wxMediaCtrl::Create(wxWindow* parent, wxWindowID id, } } - SetBestFittingSize(size); + SetInitialSize(size); return true; } else @@ -134,7 +134,7 @@ bool wxMediaCtrl::Create(wxWindow* parent, wxWindowID id, { if (Load(fileName)) { - SetBestFittingSize(size); + SetInitialSize(size); return true; } else @@ -142,7 +142,7 @@ bool wxMediaCtrl::Create(wxWindow* parent, wxWindowID id, } else { - SetBestFittingSize(size); + SetInitialSize(size); return true; } } @@ -178,7 +178,7 @@ bool wxMediaCtrl::Create(wxWindow* parent, wxWindowID id, return false; } - SetBestFittingSize(size); + SetInitialSize(size); return true; } else @@ -195,7 +195,7 @@ bool wxMediaCtrl::Create(wxWindow* parent, wxWindowID id, if (Load(location)) { - SetBestFittingSize(size); + SetInitialSize(size); return true; } else diff --git a/src/common/sizer.cpp b/src/common/sizer.cpp index a691f6431c..3429e7b01f 100644 --- a/src/common/sizer.cpp +++ b/src/common/sizer.cpp @@ -276,7 +276,7 @@ wxSize wxSizerItem::CalcMin() { // Since the size of the window may change during runtime, we // should use the current minimal/best size. - m_minSize = m_window->GetBestFittingSize(); + m_minSize = m_window->GetEffectiveMinSize(); } return GetMinSizeWithBorder(); diff --git a/src/common/wincmn.cpp b/src/common/wincmn.cpp index 3dc6813f7b..e37d4f0897 100644 --- a/src/common/wincmn.cpp +++ b/src/common/wincmn.cpp @@ -580,7 +580,7 @@ wxSize wxWindowBase::DoGetBestSize() const } -wxSize wxWindowBase::GetBestFittingSize() const +wxSize wxWindowBase::GetEffectiveMinSize() const { // merge the best size with the min size, giving priority to the min size wxSize min = GetMinSize(); @@ -594,14 +594,14 @@ wxSize wxWindowBase::GetBestFittingSize() const } -void wxWindowBase::SetBestFittingSize(const wxSize& size) +void wxWindowBase::SetInitialSize(const wxSize& size) { // Set the min size to the size passed in. This will usually either be // wxDefaultSize or the size passed to this window's ctor/Create function. SetMinSize(size); // Merge the size with the best size if needed - wxSize best = GetBestFittingSize(); + wxSize best = GetEffectiveMinSize(); // If the current size doesn't match then change it if (GetSize() != best) diff --git a/src/generic/buttonbar.cpp b/src/generic/buttonbar.cpp index e56e4ddce2..343e7e585a 100644 --- a/src/generic/buttonbar.cpp +++ b/src/generic/buttonbar.cpp @@ -351,7 +351,7 @@ bool wxButtonToolBar::Realize() m_needsLayout = true; DoLayout(); - SetBestSize(wxSize(m_maxWidth, m_maxHeight)); + SetInitialSize(wxSize(m_maxWidth, m_maxHeight)); return true; } diff --git a/src/generic/calctrl.cpp b/src/generic/calctrl.cpp index 59b083f668..7648d8917e 100644 --- a/src/generic/calctrl.cpp +++ b/src/generic/calctrl.cpp @@ -235,7 +235,7 @@ bool wxCalendarCtrl::Create(wxWindow *parent, // we need to set the position as well because the main control position // is not the same as the one specified in pos if we have the controls // above it - SetBestSize(size); + SetInitialSize(size); SetPosition(pos); // Since we don't paint the whole background make sure that the platform @@ -790,7 +790,7 @@ void wxCalendarCtrl::DoMoveWindow(int x, int y, int width, int height) if ( !HasFlag(wxCAL_SEQUENTIAL_MONTH_SELECTION) && m_staticMonth ) { - wxSize sizeCombo = m_comboMonth->GetBestFittingSize(); + wxSize sizeCombo = m_comboMonth->GetEffectiveMinSize(); wxSize sizeStatic = m_staticMonth->GetSize(); wxSize sizeSpin = m_spinYear->GetSize(); diff --git a/src/generic/choicbkg.cpp b/src/generic/choicbkg.cpp index 7216b152bc..096d5e4d2f 100644 --- a/src/generic/choicbkg.cpp +++ b/src/generic/choicbkg.cpp @@ -122,7 +122,6 @@ wxChoicebook::Create(wxWindow *parent, wxSize wxChoicebook::GetControllerSize() const { const wxSize sizeClient = GetClientSize(), - // sizeChoice = m_bookctrl->GetBestFittingSize(); sizeChoice = m_controlSizer->CalcMin(); wxSize size; diff --git a/src/generic/collpaneg.cpp b/src/generic/collpaneg.cpp index aaf84e4298..ad017b317f 100644 --- a/src/generic/collpaneg.cpp +++ b/src/generic/collpaneg.cpp @@ -218,7 +218,7 @@ void wxGenericCollapsiblePane::SetLabel(const wxString &label) { m_strLabel = label; m_pButton->SetLabel(GetBtnLabel()); - m_pButton->SetBestFittingSize(); + m_pButton->SetInitialSize(); Layout(); } diff --git a/src/generic/combog.cpp b/src/generic/combog.cpp index 0987c8a856..082612d098 100644 --- a/src/generic/combog.cpp +++ b/src/generic/combog.cpp @@ -187,8 +187,8 @@ bool wxGenericComboCtrl::Create(wxWindow *parent, // Set background SetBackgroundStyle( wxBG_STYLE_CUSTOM ); // for double-buffering - // SetBestSize should be called last - SetBestSize(size); + // SetInitialSize should be called last + SetInitialSize(size); return true; } diff --git a/src/generic/datectlg.cpp b/src/generic/datectlg.cpp index 7648284451..fbdbdb8bb6 100644 --- a/src/generic/datectlg.cpp +++ b/src/generic/datectlg.cpp @@ -419,7 +419,7 @@ bool wxDatePickerCtrlGeneric::Create(wxWindow *parent, m_popup->SetDateValue(date.IsValid() ? date : wxDateTime::Today()); - SetBestFittingSize(size); + SetInitialSize(size); return true; } diff --git a/src/generic/grid.cpp b/src/generic/grid.cpp index a2994e1679..8f8d30f975 100644 --- a/src/generic/grid.cpp +++ b/src/generic/grid.cpp @@ -4163,7 +4163,7 @@ wxGrid::wxGrid( wxWindow *parent, m_rowMinHeights(GRID_HASH_SIZE) { Create(); - SetBestFittingSize(size); + SetInitialSize(size); } bool wxGrid::Create(wxWindow *parent, wxWindowID id, @@ -4178,7 +4178,7 @@ bool wxGrid::Create(wxWindow *parent, wxWindowID id, m_rowMinHeights = wxLongToLongHashMap(GRID_HASH_SIZE); Create(); - SetBestFittingSize(size); + SetInitialSize(size); return true; } diff --git a/src/generic/hyperlink.cpp b/src/generic/hyperlink.cpp index de7a4336dd..21f80fc131 100644 --- a/src/generic/hyperlink.cpp +++ b/src/generic/hyperlink.cpp @@ -115,7 +115,7 @@ bool wxHyperlinkCtrl::Create(wxWindow *parent, wxWindowID id, f.SetUnderlined(true); SetFont(f); - SetBestFittingSize(size); + SetInitialSize(size); return true; } diff --git a/src/generic/listctrl.cpp b/src/generic/listctrl.cpp index d83f686fbf..3ea1dcafb6 100644 --- a/src/generic/listctrl.cpp +++ b/src/generic/listctrl.cpp @@ -4826,7 +4826,7 @@ bool wxGenericListCtrl::Create(wxWindow *parent, m_headerWin->Show( false ); } - SetBestSize(size); + SetInitialSize(size); return true; } diff --git a/src/generic/spinctlg.cpp b/src/generic/spinctlg.cpp index 409b708a0e..88de174cfd 100644 --- a/src/generic/spinctlg.cpp +++ b/src/generic/spinctlg.cpp @@ -183,7 +183,7 @@ bool wxSpinCtrl::Create(wxWindow *parent, m_btn->SetRange(min, max); m_btn->SetValue(initial); - SetBestSize(size); + SetInitialSize(size); Move(pos); // have to disable this window to avoid interfering it with message diff --git a/src/generic/splitter.cpp b/src/generic/splitter.cpp index a869918ae0..a8747b4652 100644 --- a/src/generic/splitter.cpp +++ b/src/generic/splitter.cpp @@ -884,9 +884,9 @@ wxSize wxSplitterWindow::DoGetBestSize() const // get best sizes of subwindows wxSize size1, size2; if ( m_windowOne ) - size1 = m_windowOne->GetBestFittingSize(); + size1 = m_windowOne->GetEffectiveMinSize(); if ( m_windowTwo ) - size2 = m_windowTwo->GetBestFittingSize(); + size2 = m_windowTwo->GetEffectiveMinSize(); // sum them // diff --git a/src/generic/treectlg.cpp b/src/generic/treectlg.cpp index b0e71881b0..32498c5093 100644 --- a/src/generic/treectlg.cpp +++ b/src/generic/treectlg.cpp @@ -865,7 +865,7 @@ bool wxGenericTreeCtrl::Create(wxWindow *parent, m_dottedPen = wxPen( wxT("grey"), 0, 0 ); - SetBestSize(size); + SetInitialSize(size); return true; } diff --git a/src/gtk/animate.cpp b/src/gtk/animate.cpp index e2c1333636..7b3b798c00 100644 --- a/src/gtk/animate.cpp +++ b/src/gtk/animate.cpp @@ -211,7 +211,7 @@ bool wxAnimationCtrl::Create( wxWindow *parent, wxWindowID id, m_parent->DoAddChild( this ); PostCreation(size); - SetBestSize(size); + SetInitialSize(size); if (anim.IsOk()) SetAnimation(anim); diff --git a/src/gtk/choice.cpp b/src/gtk/choice.cpp index 737522f7ad..02b6c41b2a 100644 --- a/src/gtk/choice.cpp +++ b/src/gtk/choice.cpp @@ -133,7 +133,7 @@ bool wxChoice::Create( wxWindow *parent, wxWindowID id, m_parent->DoAddChild( this ); PostCreation(size); - SetBestSize(size); // need this too because this is a wxControlWithItems + SetInitialSize(size); // need this too because this is a wxControlWithItems return true; } diff --git a/src/gtk/clrpicker.cpp b/src/gtk/clrpicker.cpp index b88a8a37aa..a8ed5ef927 100644 --- a/src/gtk/clrpicker.cpp +++ b/src/gtk/clrpicker.cpp @@ -83,7 +83,7 @@ bool wxColourButton::Create( wxWindow *parent, wxWindowID id, m_parent->DoAddChild( this ); PostCreation(size); - SetBestSize(size); + SetInitialSize(size); } else return wxGenericColourButton::Create(parent, id, col, pos, size, diff --git a/src/gtk/combobox.cpp b/src/gtk/combobox.cpp index 1f39a8f9ad..936f383894 100644 --- a/src/gtk/combobox.cpp +++ b/src/gtk/combobox.cpp @@ -378,7 +378,7 @@ bool wxComboBox::Create( wxWindow *parent, wxWindowID id, const wxString& value, // gtk_widget_set_size_request( m_widget, setsize.x, setsize.y ); } - SetBestSize(size); // need this too because this is a wxControlWithItems + SetInitialSize(size); // need this too because this is a wxControlWithItems return true; diff --git a/src/gtk/control.cpp b/src/gtk/control.cpp index 9641245f39..f940e07bdb 100644 --- a/src/gtk/control.cpp +++ b/src/gtk/control.cpp @@ -82,7 +82,7 @@ void wxControl::PostCreation(const wxSize& size) gtk_widget_ensure_style(m_widget); ApplyWidgetStyle(); - SetInitialBestSize(size); + SetInitialSize(size); } // ---------------------------------------------------------------------------- diff --git a/src/gtk/filepicker.cpp b/src/gtk/filepicker.cpp index cec62bdeb1..c79eb51426 100644 --- a/src/gtk/filepicker.cpp +++ b/src/gtk/filepicker.cpp @@ -94,7 +94,7 @@ bool wxFileButton::Create( wxWindow *parent, wxWindowID id, m_parent->DoAddChild( this ); PostCreation(size); - SetBestSize(size); + SetInitialSize(size); } else return wxGenericFileButton::Create(parent, id, label, path, message, wildcard, @@ -241,7 +241,7 @@ bool wxDirButton::Create( wxWindow *parent, wxWindowID id, m_parent->DoAddChild( this ); PostCreation(size); - SetBestSize(size); + SetInitialSize(size); } else return wxGenericDirButton::Create(parent, id, label, path, message, wildcard, diff --git a/src/gtk/fontpicker.cpp b/src/gtk/fontpicker.cpp index 88e2b93c7c..eda8022cc1 100644 --- a/src/gtk/fontpicker.cpp +++ b/src/gtk/fontpicker.cpp @@ -95,7 +95,7 @@ bool wxFontButton::Create( wxWindow *parent, wxWindowID id, m_parent->DoAddChild( this ); PostCreation(size); - SetBestSize(size); + SetInitialSize(size); } else return wxGenericFontButton::Create(parent, id, initial, pos, size, diff --git a/src/gtk/gauge.cpp b/src/gtk/gauge.cpp index e0b4b49010..7fb1828e14 100644 --- a/src/gtk/gauge.cpp +++ b/src/gtk/gauge.cpp @@ -55,7 +55,7 @@ bool wxGauge::Create( wxWindow *parent, m_parent->DoAddChild( this ); PostCreation(size); - SetBestSize(size); + SetInitialSize(size); return true; } diff --git a/src/gtk/listbox.cpp b/src/gtk/listbox.cpp index 1085290fa2..a6ec658364 100644 --- a/src/gtk/listbox.cpp +++ b/src/gtk/listbox.cpp @@ -465,7 +465,7 @@ bool wxListBox::Create( wxWindow *parent, wxWindowID id, m_parent->DoAddChild( this ); PostCreation(size); - SetBestSize(size); // need this too because this is a wxControlWithItems + SetInitialSize(size); // need this too because this is a wxControlWithItems return true; } diff --git a/src/gtk1/choice.cpp b/src/gtk1/choice.cpp index 1372a2398f..9b03f45cfe 100644 --- a/src/gtk1/choice.cpp +++ b/src/gtk1/choice.cpp @@ -146,7 +146,7 @@ bool wxChoice::Create( wxWindow *parent, wxWindowID id, m_parent->DoAddChild( this ); PostCreation(size); - SetBestSize(size); // need this too because this is a wxControlWithItems + SetInitialSize(size); // need this too because this is a wxControlWithItems return true; } diff --git a/src/gtk1/combobox.cpp b/src/gtk1/combobox.cpp index ea3d169aac..3e519a1bc0 100644 --- a/src/gtk1/combobox.cpp +++ b/src/gtk1/combobox.cpp @@ -283,7 +283,7 @@ bool wxComboBox::Create( wxWindow *parent, wxWindowID id, const wxString& value, gtk_signal_connect_after( GTK_OBJECT(combo->list), "select-child", GTK_SIGNAL_FUNC(gtk_combo_select_child_callback), (gpointer)this ); - SetBestSize(size); // need this too because this is a wxControlWithItems + SetInitialSize(size); // need this too because this is a wxControlWithItems // This is required for tool bar support // wxSize setsize = GetSize(); diff --git a/src/gtk1/control.cpp b/src/gtk1/control.cpp index f0c279a7f0..e41fdb9cbe 100644 --- a/src/gtk1/control.cpp +++ b/src/gtk1/control.cpp @@ -83,7 +83,7 @@ void wxControl::PostCreation(const wxSize& size) gtk_widget_ensure_style(m_widget); ApplyWidgetStyle(); - SetInitialBestSize(size); + SetInitialSize(size); } // ---------------------------------------------------------------------------- diff --git a/src/gtk1/gauge.cpp b/src/gtk1/gauge.cpp index f4f5e3196c..a68d74215f 100644 --- a/src/gtk1/gauge.cpp +++ b/src/gtk1/gauge.cpp @@ -52,7 +52,7 @@ bool wxGauge::Create( wxWindow *parent, m_parent->DoAddChild( this ); PostCreation(size); - SetBestSize(size); + SetInitialSize(size); return true; } diff --git a/src/gtk1/listbox.cpp b/src/gtk1/listbox.cpp index ca9fb3016c..2cf833d0ac 100644 --- a/src/gtk1/listbox.cpp +++ b/src/gtk1/listbox.cpp @@ -558,7 +558,7 @@ bool wxListBox::Create( wxWindow *parent, wxWindowID id, m_parent->DoAddChild( this ); PostCreation(size); - SetBestSize(size); // need this too because this is a wxControlWithItems + SetInitialSize(size); // need this too because this is a wxControlWithItems return true; } diff --git a/src/mac/carbon/checklst.cpp b/src/mac/carbon/checklst.cpp index 351a59bf6b..0f87743287 100644 --- a/src/mac/carbon/checklst.cpp +++ b/src/mac/carbon/checklst.cpp @@ -93,7 +93,7 @@ bool wxCheckListBox::Create( InsertItems( n , choices , 0 ); // Needed because it is a wxControlWithItems - SetBestSize( size ); + SetInitialSize( size ); return true; } diff --git a/src/mac/carbon/choice.cpp b/src/mac/carbon/choice.cpp index ff814d8561..677acc8cfe 100644 --- a/src/mac/carbon/choice.cpp +++ b/src/mac/carbon/choice.cpp @@ -101,7 +101,7 @@ bool wxChoice::Create(wxWindow *parent, SetSelection( 0 ); // Needed because it is a wxControlWithItems - SetBestSize( size ); + SetInitialSize( size ); return true; } diff --git a/src/mac/carbon/combobox.cpp b/src/mac/carbon/combobox.cpp index f2c79697b6..d3f6965aa7 100644 --- a/src/mac/carbon/combobox.cpp +++ b/src/mac/carbon/combobox.cpp @@ -394,7 +394,7 @@ bool wxComboBox::Create(wxWindow *parent, } // Needed because it is a wxControlWithItems - SetBestSize(size); + SetInitialSize(size); SetStringSelection(value); return true; diff --git a/src/mac/carbon/combobxc.cpp b/src/mac/carbon/combobxc.cpp index 0925ed43e8..9a63c93e70 100644 --- a/src/mac/carbon/combobxc.cpp +++ b/src/mac/carbon/combobxc.cpp @@ -420,7 +420,7 @@ bool wxComboBox::Create(wxWindow *parent, wxWindowID id, { m_choice->DoAppend( choices[ i ] ); } - SetBestSize(csize); // Needed because it is a wxControlWithItems + SetInitialSize(csize); // Needed because it is a wxControlWithItems #endif return true; diff --git a/src/mac/carbon/listbox.cpp b/src/mac/carbon/listbox.cpp index 69027b5391..1a50bd9dc7 100644 --- a/src/mac/carbon/listbox.cpp +++ b/src/mac/carbon/listbox.cpp @@ -89,7 +89,7 @@ bool wxListBox::Create( InsertItems( n, choices, 0 ); // Needed because it is a wxControlWithItems - SetBestSize( size ); + SetInitialSize( size ); return true; } diff --git a/src/mac/carbon/spinctrl.cpp b/src/mac/carbon/spinctrl.cpp index a9c852b7a5..63b1a7c41c 100644 --- a/src/mac/carbon/spinctrl.cpp +++ b/src/mac/carbon/spinctrl.cpp @@ -256,7 +256,7 @@ bool wxSpinCtrl::Create(wxWindow *parent, //SetSize(csize); //MacPostControlCreate(pos, csize); - SetInitialBestSize(csize); + SetInitialSize(csize); return true; } diff --git a/src/mac/carbon/statbmp.cpp b/src/mac/carbon/statbmp.cpp index 7aad88f18a..8948b0c3e5 100644 --- a/src/mac/carbon/statbmp.cpp +++ b/src/mac/carbon/statbmp.cpp @@ -50,7 +50,7 @@ bool wxStaticBitmap::Create(wxWindow *parent, wxWindowID id, m_windowStyle = style; bool ret = wxControl::Create( parent, id, pos, size, style , wxDefaultValidator , name ); - SetBestSize( size ) ; + SetInitialSize( size ) ; return ret; } diff --git a/src/mac/carbon/toolbar.cpp b/src/mac/carbon/toolbar.cpp index d4382cc137..997a557d1b 100644 --- a/src/mac/carbon/toolbar.cpp +++ b/src/mac/carbon/toolbar.cpp @@ -1240,7 +1240,7 @@ bool wxToolBar::Realize() InvalidateBestSize(); #endif - SetBestFittingSize(); + SetInitialSize(); return true; } diff --git a/src/mac/carbon/window.cpp b/src/mac/carbon/window.cpp index 5cb844f3c0..f4e4f26dbd 100644 --- a/src/mac/carbon/window.cpp +++ b/src/mac/carbon/window.cpp @@ -1095,7 +1095,7 @@ void wxWindowMac::MacPostControlCreate(const wxPoint& pos, const wxSize& size) m_peer->SetLabel( wxStripMenuCodes(m_label, wxStrip_Mnemonics) ) ; if (!m_macIsUserPane) - SetInitialBestSize(size); + SetInitialSize(size); SetCursor( *wxSTANDARD_CURSOR ) ; } diff --git a/src/mac/classic/statbmp.cpp b/src/mac/classic/statbmp.cpp index e34226021d..4192e30e3f 100644 --- a/src/mac/classic/statbmp.cpp +++ b/src/mac/classic/statbmp.cpp @@ -60,7 +60,7 @@ bool wxStaticBitmap::Create(wxWindow *parent, wxWindowID id, m_windowStyle = style; bool ret = wxControl::Create( parent, id, pos, size, style , wxDefaultValidator , name ); - SetBestSize( size ) ; + SetInitialSize( size ) ; return ret; } diff --git a/src/mac/classic/stattext.cpp b/src/mac/classic/stattext.cpp index a249f3bd58..26bcaf3344 100644 --- a/src/mac/classic/stattext.cpp +++ b/src/mac/classic/stattext.cpp @@ -49,7 +49,7 @@ bool wxStaticText::Create(wxWindow *parent, wxWindowID id, return false; } - SetBestSize( size ) ; + SetInitialSize( size ) ; return true; } diff --git a/src/msw/bmpbuttn.cpp b/src/msw/bmpbuttn.cpp index d4848e4d5f..1d16f90dab 100644 --- a/src/msw/bmpbuttn.cpp +++ b/src/msw/bmpbuttn.cpp @@ -184,7 +184,7 @@ bool wxBitmapButton::Create(wxWindow *parent, wxWindowID id, SubclassWin(m_hWnd); SetPosition(pos); - SetBestSize(size); + SetInitialSize(size); return true; } diff --git a/src/msw/choice.cpp b/src/msw/choice.cpp index 67feff0512..8fc25f779d 100644 --- a/src/msw/choice.cpp +++ b/src/msw/choice.cpp @@ -153,7 +153,7 @@ bool wxChoice::CreateAndInit(wxWindow *parent, } // and now we may finally size the control properly (if needed) - SetBestSize(size); + SetInitialSize(size); return true; } diff --git a/src/msw/combo.cpp b/src/msw/combo.cpp index 6f70e37d05..367f609c50 100644 --- a/src/msw/combo.cpp +++ b/src/msw/combo.cpp @@ -149,8 +149,8 @@ bool wxComboCtrl::Create(wxWindow *parent, // Prepare background for double-buffering SetBackgroundStyle( wxBG_STYLE_CUSTOM ); - // SetBestSize should be called last - SetBestSize(size); + // SetInitialSize should be called last + SetInitialSize(size); return true; } diff --git a/src/msw/control.cpp b/src/msw/control.cpp index 9817456107..3797cab625 100644 --- a/src/msw/control.cpp +++ b/src/msw/control.cpp @@ -196,7 +196,7 @@ bool wxControl::MSWCreateControl(const wxChar *classname, } // set the size now if no initial size specified - SetInitialBestSize(size); + SetInitialSize(size); return true; } diff --git a/src/msw/listbox.cpp b/src/msw/listbox.cpp index bc989f5d32..c48879e34b 100644 --- a/src/msw/listbox.cpp +++ b/src/msw/listbox.cpp @@ -177,7 +177,7 @@ bool wxListBox::Create(wxWindow *parent, } // now we can compute our best size correctly, so do it if necessary - SetBestSize(size); + SetInitialSize(size); return true; } diff --git a/src/msw/radiobox.cpp b/src/msw/radiobox.cpp index 94ffdaf7aa..95f6f127c4 100644 --- a/src/msw/radiobox.cpp +++ b/src/msw/radiobox.cpp @@ -211,7 +211,7 @@ bool wxRadioBox::Create(wxWindow *parent, SetSize(pos.x, pos.y, size.x, size.y); // Now that we have items determine what is the best size and set it. - SetBestSize(size); + SetInitialSize(size); return true; } diff --git a/src/msw/spinbutt.cpp b/src/msw/spinbutt.cpp index b4b9cfb1e7..4858bae02d 100644 --- a/src/msw/spinbutt.cpp +++ b/src/msw/spinbutt.cpp @@ -195,7 +195,7 @@ bool wxSpinButton::Create(wxWindow *parent, SubclassWin(m_hWnd); - SetBestSize(size); + SetInitialSize(size); return true; } diff --git a/src/msw/spinctrl.cpp b/src/msw/spinctrl.cpp index 14bdda9ae0..80d15e665b 100644 --- a/src/msw/spinctrl.cpp +++ b/src/msw/spinctrl.cpp @@ -391,7 +391,7 @@ bool wxSpinCtrl::Create(wxWindow *parent, sizeText.y = EDIT_HEIGHT_FROM_CHAR_HEIGHT(cy); } - SetBestSize(size); + SetInitialSize(size); (void)::ShowWindow(GetBuddyHwnd(), SW_SHOW); diff --git a/src/msw/statbmp.cpp b/src/msw/statbmp.cpp index 26a32bf03b..cd03008f89 100644 --- a/src/msw/statbmp.cpp +++ b/src/msw/statbmp.cpp @@ -166,7 +166,7 @@ bool wxStaticBitmap::Create(wxWindow *parent, SetImageNoCopy(image); // GetBestSize will work properly now, so set the best size if needed - SetBestSize(size); + SetInitialSize(size); return true; } diff --git a/src/msw/wince/checklst.cpp b/src/msw/wince/checklst.cpp index 24215c91f3..7f14ed6c63 100644 --- a/src/msw/wince/checklst.cpp +++ b/src/msw/wince/checklst.cpp @@ -116,7 +116,7 @@ bool wxCheckListBox::Create(wxWindow *parent, wxWindowID id, m_itemsClientData.SetCount(n); // now we can compute our best size correctly, so do it if necessary - SetBestSize(size); + SetInitialSize(size); return true; } diff --git a/src/msw/wince/choicece.cpp b/src/msw/wince/choicece.cpp index 5540dcca03..40f7dc8120 100644 --- a/src/msw/wince/choicece.cpp +++ b/src/msw/wince/choicece.cpp @@ -244,7 +244,7 @@ bool wxChoice::CreateAndInit(wxWindow *parent, sizeText.y = EDIT_HEIGHT_FROM_CHAR_HEIGHT(cy); } - SetBestSize(size); + SetInitialSize(size); (void)::ShowWindow(GetBuddyHwnd(), SW_SHOW); diff --git a/src/msw/wince/textctrlce.cpp b/src/msw/wince/textctrlce.cpp index 1a83ef5cb3..a9d97de8cc 100644 --- a/src/msw/wince/textctrlce.cpp +++ b/src/msw/wince/textctrlce.cpp @@ -256,7 +256,7 @@ bool wxTextCtrl::Create(wxWindow *parent, wxWindowID id, sizeText.y = EDIT_HEIGHT_FROM_CHAR_HEIGHT(cy); } - SetBestSize(size); + SetInitialSize(size); (void)::ShowWindow(GetBuddyHwnd(), SW_SHOW); diff --git a/src/os2/choice.cpp b/src/os2/choice.cpp index 770da88ccc..1e62c4f6c0 100644 --- a/src/os2/choice.cpp +++ b/src/os2/choice.cpp @@ -107,7 +107,7 @@ bool wxChoice::Create( int nEditHeight; wxGetCharSize( GetHWND(), NULL, &nEditHeight, &vFont ); nEditHeight = EDIT_HEIGHT_FROM_CHAR_HEIGHT(nEditHeight); - SetBestFittingSize(wxSize(-1,nEditHeight+4)); // +2x2 for the border + SetInitialSize(wxSize(-1,nEditHeight+4)); // +2x2 for the border return true; } // end of wxChoice::Create diff --git a/src/os2/combobox.cpp b/src/os2/combobox.cpp index f1862b75bf..75a0337578 100644 --- a/src/os2/combobox.cpp +++ b/src/os2/combobox.cpp @@ -167,7 +167,7 @@ bool wxComboBox::Create( int nEditHeight; wxGetCharSize( GetHWND(), NULL, &nEditHeight, &vFont ); nEditHeight = EDIT_HEIGHT_FROM_CHAR_HEIGHT(nEditHeight); - SetBestFittingSize(wxSize(-1,nEditHeight+4)); // +2x2 for the border + SetInitialSize(-1,nEditHeight+4)); // +2x2 for the border if (!rsValue.empty()) { diff --git a/src/palmos/control.cpp b/src/palmos/control.cpp index 45f5e2a571..2211ff1537 100644 --- a/src/palmos/control.cpp +++ b/src/palmos/control.cpp @@ -152,7 +152,7 @@ bool wxControl::PalmCreateControl(int style, m_palmControl = true; - SetInitialBestSize(size); + SetInitialSize(size); SetLabel(label); Show(); return true; @@ -202,7 +202,7 @@ bool wxControl::PalmCreateField(const wxString& label, m_palmField = true; - SetInitialBestSize(size); + SetInitialSize(size); SetLabel(label); Show(); return true; diff --git a/src/palmos/slider.cpp b/src/palmos/slider.cpp index fc4ab1a954..72bb092ca1 100644 --- a/src/palmos/slider.cpp +++ b/src/palmos/slider.cpp @@ -155,7 +155,7 @@ bool wxSlider::Create(wxWindow *parent, wxWindowID id, if(slider==NULL) return false; - SetInitialBestSize(size); + SetInitialSize(size); Show(); return true; } diff --git a/src/richtext/richtextctrl.cpp b/src/richtext/richtextctrl.cpp index 05f6ed4999..636c494439 100644 --- a/src/richtext/richtextctrl.cpp +++ b/src/richtext/richtextctrl.cpp @@ -157,7 +157,7 @@ bool wxRichTextCtrl::Create( wxWindow* parent, wxWindowID id, const wxString& va SetBackgroundStyle(wxBG_STYLE_CUSTOM); // Tell the sizers to use the given or best size - SetBestFittingSize(size); + SetInitialSize(size); #if wxRICHTEXT_BUFFERED_PAINTING // Create a buffer diff --git a/src/richtext/richtextstyles.cpp b/src/richtext/richtextstyles.cpp index a0817a69b2..804f28061d 100644 --- a/src/richtext/richtextstyles.cpp +++ b/src/richtext/richtextstyles.cpp @@ -737,7 +737,7 @@ bool wxRichTextStyleListCtrl::Create(wxWindow* parent, wxWindowID id, const wxPo SetBackgroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOW)); if (size != wxDefaultSize) - SetBestFittingSize(size); + SetInitialSize(size); bool showSelector = ((style & wxRICHTEXTSTYLELIST_HIDE_TYPE_SELECTOR) == 0); diff --git a/src/stc/stc.cpp b/src/stc/stc.cpp index bc54bf966c..0bf46f60b4 100644 --- a/src/stc/stc.cpp +++ b/src/stc/stc.cpp @@ -179,7 +179,7 @@ bool wxStyledTextCtrl::Create(wxWindow *parent, SetCodePage(wxSTC_CP_UTF8); #endif - SetBestFittingSize(size); + SetInitialSize(size); // Reduces flicker on GTK+/X11 SetBackgroundStyle(wxBG_STYLE_CUSTOM); diff --git a/src/stc/stc.cpp.in b/src/stc/stc.cpp.in index 2a9806a68a..d1a1701a53 100644 --- a/src/stc/stc.cpp.in +++ b/src/stc/stc.cpp.in @@ -179,7 +179,7 @@ bool wxStyledTextCtrl::Create(wxWindow *parent, SetCodePage(wxSTC_CP_UTF8); #endif - SetBestFittingSize(size); + SetInitialSize(size); // Reduces flicker on GTK+/X11 SetBackgroundStyle(wxBG_STYLE_CUSTOM); diff --git a/src/univ/button.cpp b/src/univ/button.cpp index f04966be28..c1a5aa5b20 100644 --- a/src/univ/button.cpp +++ b/src/univ/button.cpp @@ -128,9 +128,9 @@ bool wxButton::Create(wxWindow *parent, SetLabel(label); if (bitmap.Ok()) - SetImageLabel(bitmap); // SetBestSize called by SetImageLabel() + SetImageLabel(bitmap); // SetInitialSize called by SetImageLabel() else - SetBestSize(size); + SetInitialSize(size); CreateInputHandler(wxINP_HANDLER_BUTTON); @@ -327,7 +327,7 @@ void wxButton::SetImageMargins(wxCoord x, wxCoord y) m_marginBmpX = x + 2; m_marginBmpY = y + 2; - SetBestSize(wxDefaultSize); + SetInitialSize(wxDefaultSize); } void wxButton::SetDefault() diff --git a/src/univ/checkbox.cpp b/src/univ/checkbox.cpp index de5865cb84..520a2edf05 100644 --- a/src/univ/checkbox.cpp +++ b/src/univ/checkbox.cpp @@ -84,7 +84,7 @@ bool wxCheckBox::Create(wxWindow *parent, return false; SetLabel(label); - SetBestSize(size); + SetInitialSize(size); CreateInputHandler(wxINP_HANDLER_CHECKBOX); diff --git a/src/univ/gauge.cpp b/src/univ/gauge.cpp index 5043825c22..c887c2cf17 100644 --- a/src/univ/gauge.cpp +++ b/src/univ/gauge.cpp @@ -64,7 +64,7 @@ bool wxGauge::Create(wxWindow *parent, return false; } - SetBestSize(size); + SetInitialSize(size); return true; } diff --git a/src/univ/listbox.cpp b/src/univ/listbox.cpp index 0ad1318cf7..7aaa9953f3 100644 --- a/src/univ/listbox.cpp +++ b/src/univ/listbox.cpp @@ -196,7 +196,7 @@ bool wxListBox::Create(wxWindow *parent, Set(n, choices); - SetBestSize(size); + SetInitialSize(size); CreateInputHandler(wxINP_HANDLER_LISTBOX); diff --git a/src/univ/notebook.cpp b/src/univ/notebook.cpp index ebe2c8bb58..392f13c4aa 100644 --- a/src/univ/notebook.cpp +++ b/src/univ/notebook.cpp @@ -153,7 +153,7 @@ bool wxNotebook::Create(wxWindow *parent, m_sizePad = GetRenderer()->GetTabPadding(); - SetBestSize(size); + SetInitialSize(size); CreateInputHandler(wxINP_HANDLER_NOTEBOOK); diff --git a/src/univ/scrolbar.cpp b/src/univ/scrolbar.cpp index b5e1253f3d..f316f14715 100644 --- a/src/univ/scrolbar.cpp +++ b/src/univ/scrolbar.cpp @@ -146,7 +146,7 @@ bool wxScrollBar::Create(wxWindow *parent, if ( !wxControl::Create(parent, id, pos, size, style, validator, name) ) return false; - SetBestSize(size); + SetInitialSize(size); // override the cursor of the target window (if any) SetCursor(wxCURSOR_ARROW); diff --git a/src/univ/slider.cpp b/src/univ/slider.cpp index 4df2aae29a..0e29c60806 100644 --- a/src/univ/slider.cpp +++ b/src/univ/slider.cpp @@ -171,7 +171,7 @@ bool wxSlider::Create(wxWindow *parent, // call this after setting the range as the best size depends (at least if // we have wxSL_LABELS style) on the range - SetBestSize(size); + SetInitialSize(size); CreateInputHandler(wxINP_HANDLER_SLIDER); diff --git a/src/univ/spinbutt.cpp b/src/univ/spinbutt.cpp index c322345dee..e1d885795b 100644 --- a/src/univ/spinbutt.cpp +++ b/src/univ/spinbutt.cpp @@ -98,7 +98,7 @@ bool wxSpinButton::Create(wxWindow *parent, wxDefaultValidator, name) ) return false; - SetBestSize(size); + SetInitialSize(size); CreateInputHandler(wxINP_HANDLER_SPINBTN); diff --git a/src/univ/statbmp.cpp b/src/univ/statbmp.cpp index c71ce2a7b4..6059a8ab2e 100644 --- a/src/univ/statbmp.cpp +++ b/src/univ/statbmp.cpp @@ -61,7 +61,7 @@ bool wxStaticBitmap::Create(wxWindow *parent, SetBitmap(label); // and adjust our size to fit it after this - SetBestSize(size); + SetInitialSize(size); return true; } diff --git a/src/univ/stattext.cpp b/src/univ/stattext.cpp index 38da4fb592..509a5d6dde 100644 --- a/src/univ/stattext.cpp +++ b/src/univ/stattext.cpp @@ -57,7 +57,7 @@ bool wxStaticText::Create(wxWindow *parent, return false; SetLabel(label); - SetBestSize(size); + SetInitialSize(size); return true; } diff --git a/src/univ/textctrl.cpp b/src/univ/textctrl.cpp index ff7515af56..ebb49dcc83 100644 --- a/src/univ/textctrl.cpp +++ b/src/univ/textctrl.cpp @@ -740,7 +740,7 @@ bool wxTextCtrl::Create(wxWindow *parent, RecalcFontMetrics(); SetValue(value); - SetBestSize(size); + SetInitialSize(size); m_isEditable = !(style & wxTE_READONLY); diff --git a/src/univ/toolbar.cpp b/src/univ/toolbar.cpp index a83cc7fac3..fafb168d02 100644 --- a/src/univ/toolbar.cpp +++ b/src/univ/toolbar.cpp @@ -192,7 +192,7 @@ bool wxToolBar::Create(wxWindow *parent, CreateInputHandler(wxINP_HANDLER_TOOLBAR); - SetBestSize(size); + SetInitialSize(size); return true; } @@ -421,7 +421,7 @@ bool wxToolBar::Realize() m_needsLayout = true; DoLayout(); - SetBestSize(wxDefaultSize); + SetInitialSize(wxDefaultSize); return true; } diff --git a/wxPython/demo/CustomTreeCtrl.py b/wxPython/demo/CustomTreeCtrl.py index 5737a2da1c..9d816036da 100644 --- a/wxPython/demo/CustomTreeCtrl.py +++ b/wxPython/demo/CustomTreeCtrl.py @@ -1543,7 +1543,6 @@ class CustomTreeCtrl(CT.CustomTreeCtrl): self.PopupMenu(menu) menu.Destroy() - event.Skip() def OnItemBackground(self, event): @@ -1559,7 +1558,6 @@ class CustomTreeCtrl(CT.CustomTreeCtrl): col1 = data.GetColour().Get() self.SetItemBackgroundColour(self.current, col1) dlg.Destroy() - event.Skip() def OnItemForeground(self, event): @@ -1575,13 +1573,11 @@ class CustomTreeCtrl(CT.CustomTreeCtrl): col1 = data.GetColour().Get() self.SetItemTextColour(self.current, col1) dlg.Destroy() - event.Skip() def OnItemBold(self, event): self.SetItemBold(self.current, not self.itemdict["isbold"]) - event.Skip() def OnItemFont(self, event): @@ -1602,13 +1598,11 @@ class CustomTreeCtrl(CT.CustomTreeCtrl): self.SetItemFont(self.current, font) dlg.Destroy() - event.Skip() def OnItemHyperText(self, event): self.SetItemHyperText(self.current, not self.itemdict["ishtml"]) - event.Skip() def OnEnableWindow(self, event): @@ -1616,13 +1610,10 @@ class CustomTreeCtrl(CT.CustomTreeCtrl): enable = self.GetItemWindowEnabled(self.current) self.SetItemWindowEnabled(self.current, not enable) - event.Skip() - def OnDisableItem(self, event): self.EnableItem(self.current, False) - event.Skip() def OnItemIcons(self, event): @@ -1634,7 +1625,6 @@ class CustomTreeCtrl(CT.CustomTreeCtrl): dlg = TreeIcons(self, -1, bitmaps=bitmaps) wx.EndBusyCursor() dlg.ShowModal() - event.Skip() def SetNewIcons(self, bitmaps): @@ -1668,7 +1658,6 @@ class CustomTreeCtrl(CT.CustomTreeCtrl): dlg.ShowModal() dlg.Destroy() - event.Skip() def OnItemDelete(self, event): @@ -1686,7 +1675,6 @@ class CustomTreeCtrl(CT.CustomTreeCtrl): self.Delete(self.current) self.current = None - event.Skip() def OnItemPrepend(self, event): @@ -1699,7 +1687,6 @@ class CustomTreeCtrl(CT.CustomTreeCtrl): self.EnsureVisible(newitem) dlg.Destroy() - event.Skip() def OnItemAppend(self, event): @@ -1712,7 +1699,6 @@ class CustomTreeCtrl(CT.CustomTreeCtrl): self.EnsureVisible(newitem) dlg.Destroy() - event.Skip() def OnBeginEdit(self, event): diff --git a/wxPython/demo/GenericButtons.py b/wxPython/demo/GenericButtons.py index f99c65e3e6..7a08befcff 100644 --- a/wxPython/demo/GenericButtons.py +++ b/wxPython/demo/GenericButtons.py @@ -43,7 +43,6 @@ class TestPanel(wx.Panel): self.Bind(wx.EVT_BUTTON, self.OnBiggerButton, b) b.SetFont(wx.Font(20, wx.SWISS, wx.NORMAL, wx.BOLD, False)) b.SetBezelWidth(5) - ###b.SetBestSize() b.SetMinSize(wx.DefaultSize) b.SetBackgroundColour("Navy") b.SetForegroundColour(wx.WHITE) @@ -76,7 +75,7 @@ class TestPanel(wx.Panel): mask = wx.Mask(bmp, wx.BLUE) bmp.SetMask(mask) b.SetBitmapSelected(bmp) - b.SetBestSize() + b.SetInitialSize() sizer.Add(b) # A toggle button @@ -96,7 +95,7 @@ class TestPanel(wx.Panel): bmp.SetMask(mask) b.SetBitmapSelected(bmp) b.SetToggle(True) - b.SetBestSize() + b.SetInitialSize() sizer.Add(b) # A bitmap button with text. @@ -111,7 +110,7 @@ class TestPanel(wx.Panel): bmp.SetMask(mask) b.SetBitmapSelected(bmp) b.SetUseFocusIndicator(False) - b.SetBestSize() + b.SetInitialSize() sizer.Add(b) diff --git a/wxPython/demo/MediaCtrl.py b/wxPython/demo/MediaCtrl.py index 51f51ac4b2..9f624a3a18 100644 --- a/wxPython/demo/MediaCtrl.py +++ b/wxPython/demo/MediaCtrl.py @@ -95,7 +95,7 @@ class TestPanel(wx.Panel): "ERROR", wx.ICON_ERROR | wx.OK) else: - self.mc.SetBestFittingSize() + self.mc.SetInitialSize() self.GetSizer().Layout() self.slider.SetRange(0, self.mc.Length()) @@ -108,7 +108,7 @@ class TestPanel(wx.Panel): "ERROR", wx.ICON_ERROR | wx.OK) else: - self.mc.SetBestFittingSize() + self.mc.SetInitialSize() self.GetSizer().Layout() self.slider.SetRange(0, self.mc.Length()) diff --git a/wxPython/misc/drawwidget.py b/wxPython/misc/drawwidget.py index f8185ed1c4..79bb1a0358 100644 --- a/wxPython/misc/drawwidget.py +++ b/wxPython/misc/drawwidget.py @@ -299,7 +299,7 @@ class Frame(wx.Frame): w = b.GenButton(p, -1, "Generic Button") w.SetFont(wx.Font(20, wx.SWISS, wx.NORMAL, wx.BOLD, False)) w.SetBezelWidth(5) - w.SetBestSize() + w.SetInitialSize() w.SetBackgroundColour("Navy") w.SetForegroundColour(wx.WHITE) self.DoWidget(w) diff --git a/wxPython/misc/widgetLayoutTest.py b/wxPython/misc/widgetLayoutTest.py index bcb463e87c..21a61861ca 100644 --- a/wxPython/misc/widgetLayoutTest.py +++ b/wxPython/misc/widgetLayoutTest.py @@ -446,7 +446,7 @@ class SizeInfoPane(wx.Panel): self._minsize.SetValue( str(win.GetMinSize()) ) self._bestsize.SetValue( str(win.GetBestSize()) ) self._adjbstsize.SetValue( str(win.GetAdjustedBestSize()) ) - self._bestfit.SetValue( str(win.GetBestFittingSize()) ) + self._bestfit.SetValue( str(win.GetEffectiveMinSize()) ) def Clear(self): self._size.SetValue("") diff --git a/wxPython/src/_pycontrol.i b/wxPython/src/_pycontrol.i index a9ad85b4d9..bb543a1182 100644 --- a/wxPython/src/_pycontrol.i +++ b/wxPython/src/_pycontrol.i @@ -34,7 +34,6 @@ public: const wxString& name = wxPyControlNameStr) : wxControl(parent, id, pos, size, style, validator, name) {} - void SetBestSize(const wxSize& size) { wxControl::SetBestSize(size); } bool DoEraseBackground(wxDC* dc) { #ifdef __WXMSW__ @@ -133,7 +132,6 @@ public: void _setCallbackInfo(PyObject* self, PyObject* _class); - void SetBestSize(const wxSize& size); bool DoEraseBackground(wxDC* dc); void DoMoveWindow(int x, int y, int width, int height); diff --git a/wxPython/src/_pywindows.i b/wxPython/src/_pywindows.i index 9b9a06188d..1305baebd3 100644 --- a/wxPython/src/_pywindows.i +++ b/wxPython/src/_pywindows.i @@ -62,7 +62,6 @@ public: const wxString& name = wxPyPanelNameStr) : wxWindow(parent, id, pos, size, style, name) {} - void SetBestSize(const wxSize& size) { wxWindow::SetBestSize(size); } bool DoEraseBackground(wxDC* dc) { #ifdef __WXMSW__ @@ -160,7 +159,6 @@ public: void _setCallbackInfo(PyObject* self, PyObject* _class); - void SetBestSize(const wxSize& size); bool DoEraseBackground(wxDC* dc); void DoMoveWindow(int x, int y, int width, int height); @@ -245,7 +243,6 @@ public: const wxString& name = wxPyPanelNameStr) : wxPanel(parent, id, pos, size, style, name) {} - void SetBestSize(const wxSize& size) { wxPanel::SetBestSize(size); } bool DoEraseBackground(wxDC* dc) { #ifdef __WXMSW__ return wxWindow::DoEraseBackground(dc->GetHDC()); @@ -343,7 +340,6 @@ public: void _setCallbackInfo(PyObject* self, PyObject* _class); - void SetBestSize(const wxSize& size); bool DoEraseBackground(wxDC* dc); void DoMoveWindow(int x, int y, int width, int height); @@ -421,7 +417,6 @@ public: const wxString& name = wxPyPanelNameStr) : wxScrolledWindow(parent, id, pos, size, style, name) {} - void SetBestSize(const wxSize& size) { wxScrolledWindow::SetBestSize(size); } bool DoEraseBackground(wxDC* dc) { #ifdef __WXMSW__ return wxWindow::DoEraseBackground(dc->GetHDC()); @@ -518,7 +513,6 @@ public: void _setCallbackInfo(PyObject* self, PyObject* _class); - void SetBestSize(const wxSize& size); bool DoEraseBackground(wxDC* dc); void DoMoveWindow(int x, int y, int width, int height); diff --git a/wxPython/src/_window.i b/wxPython/src/_window.i index eaba0b3e0f..1fe38d6539 100644 --- a/wxPython/src/_window.i +++ b/wxPython/src/_window.i @@ -448,10 +448,10 @@ equal to -1. MoveXY); DocDeclStr( - void , SetBestFittingSize(const wxSize& size=wxDefaultSize), + void , SetInitialSize(const wxSize& size=wxDefaultSize), "A 'Smart' SetSize that will fill in default size components with the window's *best size* values. Also set's the minsize for use with sizers.", ""); - + %pythoncode { SetBestFittingSize = wx._deprecated(SetInitialSize, 'Use `SetInitialSize`') } DocDeclStr( @@ -571,19 +571,19 @@ some properties of the window change.)", ""); DocDeclStr( - wxSize , GetBestFittingSize() const, + wxSize , GetEffectiveMinSize() const, "This function will merge the window's best size into the window's minimum size, giving priority to the min size components, and returns the results. ", ""); - + %pythoncode { GetBestFittingSize = wx._deprecated(GetEffectiveMinSize, , 'Use `GetEffectiveMinSize` instead.') } %pythoncode { def GetAdjustedBestSize(self): s = self.GetBestSize() return wx.Size(max(s.width, self.GetMinWidth()), max(s.height, self.GetMinHeight())) - GetAdjustedBestSize = wx._deprecated(GetAdjustedBestSize, 'Use `GetBestFittingSize` instead.') + GetAdjustedBestSize = wx._deprecated(GetAdjustedBestSize, 'Use `GetEffectiveMinSize` instead.') } @@ -2077,7 +2077,7 @@ opaque.", ""); %property(AutoLayout, GetAutoLayout, SetAutoLayout, doc="See `GetAutoLayout` and `SetAutoLayout`"); %property(BackgroundColour, GetBackgroundColour, SetBackgroundColour, doc="See `GetBackgroundColour` and `SetBackgroundColour`"); %property(BackgroundStyle, GetBackgroundStyle, SetBackgroundStyle, doc="See `GetBackgroundStyle` and `SetBackgroundStyle`"); - %property(BestFittingSize, GetBestFittingSize, SetBestFittingSize, doc="See `GetBestFittingSize` and `SetBestFittingSize`"); + %property(EffectiveMinSize, GetEffectiveMinSize, doc="See `GetEffectiveMinSize`"); %property(BestSize, GetBestSize, doc="See `GetBestSize`"); %property(BestVirtualSize, GetBestVirtualSize, doc="See `GetBestVirtualSize`"); %property(Border, GetBorder, doc="See `GetBorder`"); diff --git a/wxPython/wx/lib/analogclock/analogclock.py b/wxPython/wx/lib/analogclock/analogclock.py index b9b256fa80..16a7c4d399 100644 --- a/wxPython/wx/lib/analogclock/analogclock.py +++ b/wxPython/wx/lib/analogclock/analogclock.py @@ -92,7 +92,7 @@ class AnalogClock(wx.PyWindow): self.Bind(wx.EVT_MENU, self._OnShowAbout, id=popup2) # Set initial size based on given size, or best size - self.SetBestFittingSize(size) + self.SetInitialSize(size) # Do initial drawing (in case there is not an initial size event) self.RecalcCoords(self.GetSize()) diff --git a/wxPython/wx/lib/buttonpanel.py b/wxPython/wx/lib/buttonpanel.py index a31eb08718..7df01da87d 100644 --- a/wxPython/wx/lib/buttonpanel.py +++ b/wxPython/wx/lib/buttonpanel.py @@ -620,7 +620,7 @@ class BPArt: if isVertical: dc.DrawLine(rect.x, coord, rect.x + rect.width, coord) else: - dc.DrawLine(coord, rect.y, coord, rect.y + rect.width) + dc.DrawLine(coord, rect.y, coord, rect.y + rect.height) rf += rstep gf += gstep diff --git a/wxPython/wx/lib/buttons.py b/wxPython/wx/lib/buttons.py index f1e2f737a8..f4b9d7b4fb 100644 --- a/wxPython/wx/lib/buttons.py +++ b/wxPython/wx/lib/buttons.py @@ -77,7 +77,7 @@ class GenButton(wx.PyControl): self.SetLabel(label) self.InheritAttributes() - self.SetBestFittingSize(size) + self.SetInitialSize(size) self.InitColours() self.Bind(wx.EVT_LEFT_DOWN, self.OnLeftDown) @@ -92,15 +92,16 @@ class GenButton(wx.PyControl): self.Bind(wx.EVT_PAINT, self.OnPaint) - def SetBestSize(self, size=None): + def SetInitialSize(self, size=None): """ Given the current font and bezel width settings, calculate and set a good size. """ if size is None: size = wx.DefaultSize - wx.PyControl.SetBestFittingSize(self, size) - + wx.PyControl.SetInitialSize(self, size) + SetBestSize = SetInitialSize + def DoGetBestSize(self): """ diff --git a/wxPython/wx/lib/masked/combobox.py b/wxPython/wx/lib/masked/combobox.py index c7c97bdc73..33ac41ad2d 100644 --- a/wxPython/wx/lib/masked/combobox.py +++ b/wxPython/wx/lib/masked/combobox.py @@ -133,7 +133,7 @@ class BaseMaskedComboBox( wx.ComboBox, MaskedEditMixin ): self.SetClientSize(self._CalcSize()) width = self.GetSize().width height = self.GetBestSize().height - self.SetBestFittingSize((width, height)) + self.SetInitialSize((width, height)) if value: @@ -189,7 +189,7 @@ class BaseMaskedComboBox( wx.ComboBox, MaskedEditMixin ): width = self.GetSize().width height = self.GetBestSize().height ## dbg('setting client size to:', (width, height)) - self.SetBestFittingSize((width, height)) + self.SetInitialSize((width, height)) def _GetSelection(self): diff --git a/wxPython/wx/lib/masked/maskededit.py b/wxPython/wx/lib/masked/maskededit.py index ec608dbf62..7127285046 100644 --- a/wxPython/wx/lib/masked/maskededit.py +++ b/wxPython/wx/lib/masked/maskededit.py @@ -1992,7 +1992,7 @@ class MaskedEditMixin: width = self.GetSize().width height = self.GetBestSize().height ## dbg('setting client size to:', (width, height)) - self.SetBestFittingSize((width, height)) + self.SetInitialSize((width, height)) # Set value/type-specific formatting self._applyFormatting() @@ -2076,7 +2076,7 @@ class MaskedEditMixin: # the outside size that does include the borders. What you are # calculating (in _CalcSize) is the client size, but the sizers # deal with the full size and so that is the minimum size that - # we need to set with SetBestFittingSize. The root of the problem is + # we need to set with SetInitialSize. The root of the problem is # that in _calcSize the current client size height is returned, # instead of a height based on the current font. So I suggest using # _calcSize to just get the width, and then use GetBestSize to @@ -2084,7 +2084,7 @@ class MaskedEditMixin: self.SetClientSize(self._CalcSize()) width = self.GetSize().width height = self.GetBestSize().height - self.SetBestFittingSize((width, height)) + self.SetInitialSize((width, height)) # Set value/type-specific formatting diff --git a/wxPython/wx/lib/masked/textctrl.py b/wxPython/wx/lib/masked/textctrl.py index 93c1a1c101..d374d7b247 100644 --- a/wxPython/wx/lib/masked/textctrl.py +++ b/wxPython/wx/lib/masked/textctrl.py @@ -239,7 +239,7 @@ class BaseMaskedTextCtrl( wx.TextCtrl, MaskedEditMixin ): width = self.GetSize().width height = self.GetBestSize().height ## dbg('setting client size to:', (width, height)) - self.SetBestFittingSize((width, height)) + self.SetInitialSize((width, height)) def Clear(self): diff --git a/wxPython/wx/lib/scrolledpanel.py b/wxPython/wx/lib/scrolledpanel.py index 122cdde7bd..1d92901f9e 100644 --- a/wxPython/wx/lib/scrolledpanel.py +++ b/wxPython/wx/lib/scrolledpanel.py @@ -38,7 +38,7 @@ class ScrolledPanel( wx.PyScrolledWindow ): wx.PyScrolledWindow.__init__(self, parent, id, pos=pos, size=size, style=style, name=name) - self.SetBestFittingSize(size) + self.SetInitialSize(size) self.Bind(wx.EVT_CHILD_FOCUS, self.OnChildFocus) diff --git a/wxPython/wx/lib/splitter.py b/wxPython/wx/lib/splitter.py index 6a819a41ac..c5e2e85f55 100644 --- a/wxPython/wx/lib/splitter.py +++ b/wxPython/wx/lib/splitter.py @@ -240,14 +240,14 @@ class MultiSplitterWindow(wx.PyPanel): sashsize = self._GetSashSize() if self._orient == wx.HORIZONTAL: for win in self._windows: - winbest = win.GetAdjustedBestSize() + winbest = win.GetEffectiveMinSize() best.width += max(self._minimumPaneSize, winbest.width) best.height = max(best.height, winbest.height) best.width += sashsize * (len(self._windows)-1) else: for win in self._windows: - winbest = win.GetAdjustedBestSize() + winbest = win.GetEffectiveMinSize() best.height += max(self._minimumPaneSize, winbest.height) best.width = max(best.width, winbest.width) best.height += sashsize * (len(self._windows)-1) diff --git a/wxPython/wx/lib/statbmp.py b/wxPython/wx/lib/statbmp.py index bd4ab44514..3585446ee6 100644 --- a/wxPython/wx/lib/statbmp.py +++ b/wxPython/wx/lib/statbmp.py @@ -27,7 +27,7 @@ class GenStaticBitmap(wx.PyControl): wx.DefaultValidator, name) self._bitmap = bitmap self.InheritAttributes() - self.SetBestFittingSize(size) + self.SetInitialSize(size) self.Bind(wx.EVT_ERASE_BACKGROUND, self.OnEraseBackground) self.Bind(wx.EVT_PAINT, self.OnPaint) @@ -35,7 +35,7 @@ class GenStaticBitmap(wx.PyControl): def SetBitmap(self, bitmap): self._bitmap = bitmap - self.SetBestFittingSize( (bitmap.GetWidth(), bitmap.GetHeight()) ) + self.SetInitialSize( (bitmap.GetWidth(), bitmap.GetHeight()) ) self.Refresh() diff --git a/wxPython/wx/lib/stattext.py b/wxPython/wx/lib/stattext.py index 1f47005e36..fddbf4e60e 100644 --- a/wxPython/wx/lib/stattext.py +++ b/wxPython/wx/lib/stattext.py @@ -36,7 +36,7 @@ class GenStaticText(wx.PyControl): wx.PyControl.SetLabel(self, label) # don't check wx.ST_NO_AUTORESIZE yet self.InheritAttributes() - self.SetBestFittingSize(size) + self.SetInitialSize(size) self.Bind(wx.EVT_PAINT, self.OnPaint) if BUFFERED: @@ -56,7 +56,7 @@ class GenStaticText(wx.PyControl): style = self.GetWindowStyleFlag() self.InvalidateBestSize() if not style & wx.ST_NO_AUTORESIZE: - self.SetBestFittingSize(self.GetBestSize()) + self.SetInitialSize(self.GetBestSize()) self.Refresh() @@ -69,7 +69,7 @@ class GenStaticText(wx.PyControl): style = self.GetWindowStyleFlag() self.InvalidateBestSize() if not style & wx.ST_NO_AUTORESIZE: - self.SetBestFittingSize(self.GetBestSize()) + self.SetInitialSize(self.GetBestSize()) self.Refresh() diff --git a/wxPython/wx/lib/ticker.py b/wxPython/wx/lib/ticker.py index 927d98082e..869e45aef4 100644 --- a/wxPython/wx/lib/ticker.py +++ b/wxPython/wx/lib/ticker.py @@ -50,7 +50,7 @@ class Ticker(wx.PyControl): self._ppf = ppf #pixels per frame self.SetDirection(direction) self.SetText(text) - self.SetBestFittingSize(size) + self.SetInitialSize(size) self.SetForegroundColour(fgcolor) self.SetBackgroundColour(bgcolor) wx.EVT_TIMER(self, -1, self.OnTick) -- 2.45.2