From 74205969ddcbb42f948154aabc16554f027e74f3 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Mon, 17 Oct 2005 22:41:52 +0000 Subject: [PATCH] fixed Fit() to call SetClientSize() and not SetSize() git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@35923 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- docs/changes.txt | 1 + src/common/wincmn.cpp | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/docs/changes.txt b/docs/changes.txt index 1c5fc8e5f3..bc0609bfac 100644 --- a/docs/changes.txt +++ b/docs/changes.txt @@ -15,6 +15,7 @@ All (GUI): - added wxDialog::SetEscapeId() - wxItemContainerImmutable::FindString unified (affects wxRadioBox, wxListBox, wxComboBox and wxChoice) +- wxWindow::Fit() now works correctly for frames and dialogs too wxMSW: diff --git a/src/common/wincmn.cpp b/src/common/wincmn.cpp index 5e7143c74a..7a1e6e8577 100644 --- a/src/common/wincmn.cpp +++ b/src/common/wincmn.cpp @@ -528,9 +528,9 @@ void wxWindowBase::Centre(int direction) // fits the window around the children void wxWindowBase::Fit() { - if ( GetChildren().GetCount() > 0 ) + if ( !GetChildren().empty() ) { - SetSize(GetBestSize()); + SetClientSize(GetBestSize()); } //else: do nothing if we have no children } -- 2.50.0