// 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();
}
case wxBK_BOTTOM:
rectPage.height -= size.y + GetInternalBorder();
+ if (rectPage.height < 0)
+ rectPage.height = 0;
break;
case wxBK_LEFT:
case wxBK_RIGHT:
rectPage.width -= size.x + GetInternalBorder();
+ if (rectPage.width < 0)
+ rectPage.width = 0;
break;
}