X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/edd802c67c82f95d773635a813645287a47594e4..05159a2750ed2cc5945a85bc5fc6849ad1a30e75:/src/common/wincmn.cpp diff --git a/src/common/wincmn.cpp b/src/common/wincmn.cpp index 205402dd18..7c40f7ce74 100644 --- a/src/common/wincmn.cpp +++ b/src/common/wincmn.cpp @@ -470,6 +470,15 @@ void wxWindowBase::Fit() //else: do nothing if we have no children } +// fits virtual size (ie. scrolled area etc.) around children +void wxWindowBase::FitInside() +{ + if ( GetChildren().GetCount() > 0 ) + { + SetVirtualSize( GetBestVirtualSize() ); + } +} + // return the size best suited for the current window wxSize wxWindowBase::DoGetBestSize() const { @@ -593,8 +602,6 @@ void wxWindowBase::SetVirtualSizeHints( int minW, int minH, m_maxVirtualWidth = maxW; m_minVirtualHeight = minH; m_maxVirtualHeight = maxH; - - SetVirtualSize( GetClientSize() ); } void wxWindowBase::DoSetVirtualSize( int x, int y ) @@ -1757,10 +1764,16 @@ void wxWindowBase::UpdateWindowUI() #if wxUSE_TEXTCTRL wxTextCtrl *text = wxDynamicCast(control, wxTextCtrl); if ( text ) - text->SetValue(event.GetText()); + { + if ( event.GetText() != text->GetValue() ) + text->SetValue(event.GetText()); + } else #endif // wxUSE_TEXTCTRL - control->SetLabel(event.GetText()); + { + if ( event.GetText() != control->GetLabel() ) + control->SetLabel(event.GetText()); + } } }