X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/ec09e18d3544bb333f367db7f7e8f410d81e5b14..4322f94f29dd668540ba31a26d08402b7e849b23:/src/common/bookctrl.cpp diff --git a/src/common/bookctrl.cpp b/src/common/bookctrl.cpp index d1e7bcbe01..ffae3d708d 100644 --- a/src/common/bookctrl.cpp +++ b/src/common/bookctrl.cpp @@ -172,7 +172,7 @@ void wxBookCtrlBase::OnHelp(wxHelpEvent& event) // if the event object == this because the book control can have other // subcontrols inside it (e.g. wxSpinButton in case of a notebook in wxUniv) wxWindow *source = wxStaticCast(event.GetEventObject(), wxWindow); - while ( source && source->GetParent() != this ) + while ( source && source != this && source->GetParent() != this ) { source = source->GetParent(); } @@ -310,6 +310,8 @@ wxRect wxBookCtrlBase::GetPageRect() const case wxBK_BOTTOM: rectPage.height -= size.y + GetInternalBorder(); + if (rectPage.height < 0) + rectPage.height = 0; break; case wxBK_LEFT: @@ -318,6 +320,8 @@ wxRect wxBookCtrlBase::GetPageRect() const case wxBK_RIGHT: rectPage.width -= size.x + GetInternalBorder(); + if (rectPage.width < 0) + rectPage.width = 0; break; }