X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/a16a233822dd1ae4f862e40b077f9407f58c32ed..7f3f8f1e85e34898a30a8463ca73c86d6550548d:/src/common/wincmn.cpp?ds=inline diff --git a/src/common/wincmn.cpp b/src/common/wincmn.cpp index b337a659e4..d36b727cf0 100644 --- a/src/common/wincmn.cpp +++ b/src/common/wincmn.cpp @@ -474,7 +474,7 @@ static bool wxHasRealChildren(const wxWindowBase* win) node = node->GetNext() ) { wxWindow *win = node->GetData(); - if ( !win->IsTopLevel() && win->IsShown() + if ( !win->IsTopLevel() && win->IsShown() #if wxUSE_SCROLLBAR && !win->IsKindOf(CLASSINFO(wxScrollBar)) #endif @@ -896,6 +896,20 @@ void wxWindowBase::SendSizeEventToParent(int flags) parent->SendSizeEvent(flags); } +bool wxWindowBase::HasScrollbar(int orient) const +{ + // if scrolling in the given direction is disabled, we can't have the + // corresponding scrollbar no matter what + if ( !CanScroll(orient) ) + return false; + + const wxSize sizeVirt = GetVirtualSize(); + const wxSize sizeClient = GetClientSize(); + + return orient == wxHORIZONTAL ? sizeVirt.x > sizeClient.x + : sizeVirt.y > sizeClient.y; +} + // ---------------------------------------------------------------------------- // show/hide/enable/disable the window // ----------------------------------------------------------------------------