Added DoGetClientBestSize() and use it for a couple of controls in wxMSW.
DoGetClientBestSize() returns the best size of the client area, without accounting for the border which is done by GetBestSize() itself and DoGetBorderSize() called from it. Use DoGetClientBestSize() in wxStaticText (where it was done insideDoGetBestSize() before) and in wxListBox, to fix its height calculation. Also use correct height of listbox items as returned by the control itself instead of trying to guess it. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@61169 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -705,9 +705,20 @@ wxSize wxWindowBase::GetEffectiveMinSize() const
|
||||
|
||||
wxSize wxWindowBase::GetBestSize() const
|
||||
{
|
||||
if ((!m_windowSizer) && (m_bestSizeCache.IsFullySpecified()))
|
||||
if ( !m_windowSizer && m_bestSizeCache.IsFullySpecified() )
|
||||
return m_bestSizeCache;
|
||||
|
||||
// call DoGetBestClientSize() first, if a derived class overrides it wants
|
||||
// it to be used
|
||||
wxSize size = DoGetBestClientSize();
|
||||
if ( size != wxDefaultSize )
|
||||
{
|
||||
size += DoGetBorderSize();
|
||||
|
||||
CacheBestSize(size);
|
||||
return size;
|
||||
}
|
||||
|
||||
return DoGetBestSize();
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user