]> git.saurik.com Git - wxWidgets.git/blobdiff - src/msw/notebook.cpp
don't refresh the menu if it's frozen
[wxWidgets.git] / src / msw / notebook.cpp
index f34fcbc97bb9ce2bcae133aec722ac69d78803e0..97e0049061ff26dfe4cf8863bf24f849c6e2f8f3 100644 (file)
@@ -594,26 +594,29 @@ void wxNotebook::SetTabSize(const wxSize& sz)
 
 wxSize wxNotebook::CalcSizeFromPage(const wxSize& sizePage) const
 {
 
 wxSize wxNotebook::CalcSizeFromPage(const wxSize& sizePage) const
 {
+    // we can't use TabCtrl_AdjustRect here because it only works for wxNB_TOP
     wxSize sizeTotal = sizePage;
 
     wxSize sizeTotal = sizePage;
 
-    // We need to make getting tab size part of the wxWidgets API.
     wxSize tabSize;
     wxSize tabSize;
-    if (GetPageCount() > 0)
+    if ( GetPageCount() > 0 )
     {
         RECT rect;
     {
         RECT rect;
-        TabCtrl_GetItemRect((HWND) GetHWND(), 0, & rect);
+        TabCtrl_GetItemRect(GetHwnd(), 0, &rect);
         tabSize.x = rect.right - rect.left;
         tabSize.y = rect.bottom - rect.top;
     }
         tabSize.x = rect.right - rect.left;
         tabSize.y = rect.bottom - rect.top;
     }
-    if ( HasFlag(wxBK_LEFT) || HasFlag(wxBK_RIGHT) )
+
+    // add an extra margin in both directions
+    const int MARGIN = 8;
+    if ( IsVertical() )
     {
     {
-        sizeTotal.x += tabSize.x + 7;
-        sizeTotal.y += 7;
+        sizeTotal.x += MARGIN;
+        sizeTotal.y += tabSize.y + MARGIN;
     }
     }
-    else
+    else // horizontal layout
     {
     {
-        sizeTotal.x += 7;
-        sizeTotal.y += tabSize.y + 7;
+        sizeTotal.x += tabSize.x + MARGIN;
+        sizeTotal.y += MARGIN;
     }
 
     return sizeTotal;
     }
 
     return sizeTotal;
@@ -1053,25 +1056,6 @@ void wxNotebook::OnSelChange(wxNotebookEvent& event)
   event.Skip();
 }
 
   event.Skip();
 }
 
-bool wxNotebook::MSWTranslateMessage(WXMSG *wxmsg)
-{
-    const MSG * const msg = (MSG *)wxmsg;
-
-    // intercept TAB, CTRL+TAB and CTRL+SHIFT+TAB for processing by wxNotebook.
-    // TAB will be passed to the currently selected page, CTRL+TAB and
-    // CTRL+SHIFT+TAB will be processed by the notebook itself. do not
-    // intercept SHIFT+TAB. This goes to the parent of the notebook which will
-    // process it.
-    if ( msg->message == WM_KEYDOWN && msg->wParam == VK_TAB &&
-            msg->hwnd == GetHwnd() &&
-                (wxIsCtrlDown() || !wxIsShiftDown()) )
-    {
-        return MSWProcessMessage(wxmsg);
-    }
-
-    return false;
-}
-
 void wxNotebook::OnNavigationKey(wxNavigationKeyEvent& event)
 {
     if ( event.IsWindowChange() ) {
 void wxNotebook::OnNavigationKey(wxNavigationKeyEvent& event)
 {
     if ( event.IsWindowChange() ) {