]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/framecmn.cpp
fixed event processing for the target window
[wxWidgets.git] / src / common / framecmn.cpp
index 4b12d0e9a305ce923e69d7592de2407641c80a8b..fc7b2f413af0aeca6f1a6aaabd0e82c28e05a66f 100644 (file)
@@ -182,12 +182,17 @@ bool wxFrameBase::ProcessCommand(int id)
     commandEvent.SetEventObject(this);
 
     wxMenuItem *item = bar->FindItem(id);
-    if ( item && item->IsCheckable() )
+    if (item)
     {
-        item->Toggle();
-
-        // use the new value
-        commandEvent.SetInt(item->IsChecked());
+        if (!item->IsEnabled())
+            return TRUE;
+            
+        if (item->IsCheckable())
+        {
+            item->Toggle();
+            // use the new value
+            commandEvent.SetInt(item->IsChecked());
+        }
     }
 
     return GetEventHandler()->ProcessEvent(commandEvent);
@@ -244,17 +249,6 @@ wxStatusBar *wxFrameBase::OnCreateStatusBar(int number,
 {
     wxStatusBar *statusBar = new wxStatusBar(this, id, style, name);
 
-    // Set the height according to the font and the border size
-    wxClientDC dc(statusBar);
-    dc.SetFont(statusBar->GetFont());
-
-    wxCoord y;
-    dc.GetTextExtent( "X", NULL, &y );
-
-    int height = (int)( (11*y)/10 + 2*statusBar->GetBorderY());
-
-    statusBar->SetSize( -1, -1, -1, height );
-
     statusBar->SetFieldsCount(number);
 
     return statusBar;