]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/framecmn.cpp
fixed the menu bug introduced by the previous commit
[wxWidgets.git] / src / common / framecmn.cpp
index fc7b2f413af0aeca6f1a6aaabd0e82c28e05a66f..77d1c1e1c4ae9bac671b8fa4aceb18d676896402 100644 (file)
@@ -78,6 +78,11 @@ wxFrameBase::wxFrameBase()
 #endif // wxUSE_STATUSBAR
 }
 
 #endif // wxUSE_STATUSBAR
 }
 
+wxFrameBase::~wxFrameBase()
+{
+    // this destructor is required for Darwin
+}
+
 wxFrame *wxFrameBase::New(wxWindow *parent,
                           wxWindowID id,
                           const wxString& title,
 wxFrame *wxFrameBase::New(wxWindow *parent,
                           wxWindowID id,
                           const wxString& title,
@@ -147,13 +152,14 @@ wxPoint wxFrameBase::GetClientAreaOrigin() const
 {
     wxPoint pt = wxTopLevelWindow::GetClientAreaOrigin();
 
 {
     wxPoint pt = wxTopLevelWindow::GetClientAreaOrigin();
 
-#if wxUSE_TOOLBAR
-    if ( GetToolBar() && GetToolBar()->IsShown() )
+#if wxUSE_TOOLBAR && !defined(__WXUNIVERSAL__)
+    wxToolBar *toolbar = GetToolBar();
+    if ( toolbar && toolbar->IsShown() )
     {
         int w, h;
     {
         int w, h;
-        GetToolBar()->GetSize(& w, & h);
+        toolbar->GetSize(&w, &h);
 
 
-        if ( GetToolBar()->GetWindowStyleFlag() & wxTB_VERTICAL )
+        if ( toolbar->GetWindowStyleFlag() & wxTB_VERTICAL )
         {
             pt.x += w;
         }
         {
             pt.x += w;
         }
@@ -186,10 +192,11 @@ bool wxFrameBase::ProcessCommand(int id)
     {
         if (!item->IsEnabled())
             return TRUE;
     {
         if (!item->IsEnabled())
             return TRUE;
-            
+
         if (item->IsCheckable())
         {
             item->Toggle();
         if (item->IsCheckable())
         {
             item->Toggle();
+
             // use the new value
             commandEvent.SetInt(item->IsChecked());
         }
             // use the new value
             commandEvent.SetInt(item->IsChecked());
         }
@@ -403,8 +410,8 @@ void wxFrameBase::AttachMenuBar(wxMenuBar *menubar)
 {
     if ( menubar )
     {
 {
     if ( menubar )
     {
-        m_frameMenuBar = menubar;
         menubar->Attach((wxFrame *)this);
         menubar->Attach((wxFrame *)this);
+        m_frameMenuBar = menubar;
     }
 }
 
     }
 }