don't set virtual size of the window to (0, 0) if scrollbars are removed from it
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@32870 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
parent
e731c9ada2
commit
f18f464cba
@ -365,7 +365,11 @@ void wxScrollHelper::SetScrollbars(int pixelsPerUnitX,
|
||||
|
||||
// The above should arguably be deprecated, this however we still need.
|
||||
|
||||
m_targetWindow->SetVirtualSize( w, h );
|
||||
// take care not to set 0 virtual size, 0 means that we don't have any
|
||||
// scrollbars and hence we should use the real size instead of the virtual
|
||||
// one which is indicated by using wxDefaultCoord
|
||||
m_targetWindow->SetVirtualSize( w ? w : wxDefaultCoord,
|
||||
h ? h : wxDefaultCoord);
|
||||
|
||||
if (do_refresh && !noRefresh)
|
||||
m_targetWindow->Refresh(true, GetScrollRect());
|
||||
|
@ -407,7 +407,10 @@ void wxScrolledWindow::SetScrollbars( int pixelsPerUnitX, int pixelsPerUnitY,
|
||||
// a sizer might override this manual scrollbar setting in old code.
|
||||
// m_targetWindow->SetVirtualSizeHints( noUnitsX * pixelsPerUnitX, noUnitsY * pixelsPerUnitY );
|
||||
|
||||
m_targetWindow->SetVirtualSize( noUnitsX * pixelsPerUnitX, noUnitsY * pixelsPerUnitY );
|
||||
int w = noUnitsX * pixelsPerUnitX;
|
||||
int h = noUnitsY * pixelsPerUnitY;
|
||||
m_targetWindow->SetVirtualSize( w ? w : wxDefaultCoord,
|
||||
h ? h : wxDefaultCoord);
|
||||
|
||||
if (!noRefresh)
|
||||
{
|
||||
|
@ -407,7 +407,10 @@ void wxScrolledWindow::SetScrollbars( int pixelsPerUnitX, int pixelsPerUnitY,
|
||||
// a sizer might override this manual scrollbar setting in old code.
|
||||
// m_targetWindow->SetVirtualSizeHints( noUnitsX * pixelsPerUnitX, noUnitsY * pixelsPerUnitY );
|
||||
|
||||
m_targetWindow->SetVirtualSize( noUnitsX * pixelsPerUnitX, noUnitsY * pixelsPerUnitY );
|
||||
int w = noUnitsX * pixelsPerUnitX;
|
||||
int h = noUnitsY * pixelsPerUnitY;
|
||||
m_targetWindow->SetVirtualSize( w ? w : wxDefaultCoord,
|
||||
h ? h : wxDefaultCoord);
|
||||
|
||||
if (!noRefresh)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user