From: Vadim Zeitlin Date: Thu, 17 Mar 2005 22:29:20 +0000 (+0000) Subject: GetVirtualSize() returns client size values for the m_virtualSize components which... X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/c20ab85b6051cdb2ec4282269fd7109a23cf8df9 GetVirtualSize() returns client size values for the m_virtualSize components which are not set (i.e. allow setting only one component of m_virtualSize instead of either none or both) git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@32871 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/src/common/wincmn.cpp b/src/common/wincmn.cpp index 8277a7c785..5f9a9a9ed7 100644 --- a/src/common/wincmn.cpp +++ b/src/common/wincmn.cpp @@ -811,10 +811,17 @@ void wxWindowBase::DoSetVirtualSize( int x, int y ) wxSize wxWindowBase::DoGetVirtualSize() const { - if (m_virtualSize == wxDefaultSize) - return GetClientSize(); + if ( m_virtualSize.IsFullySpecified() ) + return m_virtualSize; - return m_virtualSize; + wxSize size = GetClientSize(); + if ( m_virtualSize.x != wxDefaultCoord ) + size.x = m_virtualSize.x; + + if ( m_virtualSize.y != wxDefaultCoord ) + size.y = m_virtualSize.y; + + return size; } // ----------------------------------------------------------------------------