wxControl::InvalidateBestSize();
}
+wxSize wxBookCtrlBase::CalcSizeFromPage(const wxSize& sizePage) const
+{
+ // we need to add the size of the choice control and the border between
+ const wxSize sizeController = GetControllerSize();
+
+ wxSize size = sizePage;
+ if ( IsVertical() )
+ {
+ if ( sizeController.x > sizePage.x )
+ size.x = sizeController.x;
+ size.y += sizeController.y + GetInternalBorder();
+ }
+ else // left/right aligned
+ {
+ size.x += sizeController.x + GetInternalBorder();
+ if ( sizeController.y > sizePage.y )
+ size.y = sizeController.y;
+ }
+
+ return size;
+}
+
void wxBookCtrlBase::SetPageSize(const wxSize& size)
{
SetClientSize(CalcSizeFromPage(size));
wxSize wxBookCtrlBase::GetControllerSize() const
{
- if(!m_bookctrl)
- return wxSize(0,0);
+ if ( !m_bookctrl )
+ return wxSize(0, 0);
const wxSize sizeClient = GetClientSize(),
- sizeBorder = m_bookctrl->GetSize() - m_bookctrl->GetClientSize(),
- sizeCtrl = m_bookctrl->GetBestSize() + sizeBorder;
+ sizeCtrl = m_bookctrl->GetBestSize();
wxSize size;