]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/bookctrl.cpp
Supress SetFocus() warning in wxVListBoxComboPopup
[wxWidgets.git] / src / common / bookctrl.cpp
index da06cdafeba1ce300f7bc3f26a1ccdde4ffda51b..cfc13b78a3e537c3c80629e50cfc39037a6da1eb 100644 (file)
@@ -137,6 +137,28 @@ void wxBookCtrlBase::DoInvalidateBestSize()
         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));