]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/framecmn.cpp
Added missing include to os2/private.h.
[wxWidgets.git] / src / common / framecmn.cpp
index 4b12d0e9a305ce923e69d7592de2407641c80a8b..544189a24c7a68c61921e1b789029df3ab0e33c3 100644 (file)
@@ -78,6 +78,11 @@ wxFrameBase::wxFrameBase()
 #endif // wxUSE_STATUSBAR
 }
 
+wxFrameBase::~wxFrameBase()
+{
+    // this destructor is required for Darwin
+}
+
 wxFrame *wxFrameBase::New(wxWindow *parent,
                           wxWindowID id,
                           const wxString& title,
@@ -148,12 +153,13 @@ wxPoint wxFrameBase::GetClientAreaOrigin() const
     wxPoint pt = wxTopLevelWindow::GetClientAreaOrigin();
 
 #if wxUSE_TOOLBAR
-    if ( GetToolBar() && GetToolBar()->IsShown() )
+    wxToolBar *toolbar = GetToolBar();
+    if ( toolbar && toolbar->IsShown() )
     {
         int w, h;
-        GetToolBar()->GetSize(& w, & h);
+        toolbar->GetSize(&w, &h);
 
-        if ( GetToolBar()->GetWindowStyleFlag() & wxTB_VERTICAL )
+        if ( toolbar->GetWindowStyleFlag() & wxTB_VERTICAL )
         {
             pt.x += w;
         }
@@ -182,12 +188,17 @@ bool wxFrameBase::ProcessCommand(int id)
     commandEvent.SetEventObject(this);
 
     wxMenuItem *item = bar->FindItem(id);
-    if ( item && item->IsCheckable() )
+    if (item)
     {
-        item->Toggle();
+        if (!item->IsEnabled())
+            return TRUE;
 
-        // use the new value
-        commandEvent.SetInt(item->IsChecked());
+        if (item->IsCheckable())
+        {
+            item->Toggle();
+            // use the new value
+            commandEvent.SetInt(item->IsChecked());
+        }
     }
 
     return GetEventHandler()->ProcessEvent(commandEvent);
@@ -244,17 +255,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;