]> git.saurik.com Git - wxWidgets.git/blobdiff - src/gtk/frame.cpp
better centering of text/images
[wxWidgets.git] / src / gtk / frame.cpp
index edd72807fef18284a811da432577d85b750a28cc..c018c5b1637979b8f07d53bef6296fe7cd5d804e 100644 (file)
@@ -36,7 +36,6 @@ const int wxSTATUS_HEIGHT  = 25;
 // data
 //-----------------------------------------------------------------------------
 
-extern wxList wxTopLevelWindows;
 extern wxList wxPendingDelete;
 
 //-----------------------------------------------------------------------------
@@ -641,6 +640,26 @@ wxStatusBar *wxFrame::OnCreateStatusBar( int number, long style, wxWindowID id,
     return statusBar;
 }
 
+void wxFrame::Command( int id )
+{
+    wxCommandEvent commandEvent(wxEVT_COMMAND_MENU_SELECTED, id);
+    commandEvent.SetInt( id );
+    commandEvent.SetEventObject( this );
+
+    wxMenuBar *bar = GetMenuBar();
+    if (!bar) return;
+
+    wxMenuItem *item = bar->FindItemForId(id) ;
+    if (item && item->IsCheckable())
+    {
+        bar->Check(id,!bar->Checked(id)) ;
+    }
+
+    wxEvtHandler* evtHandler = GetEventHandler();
+
+    evtHandler->ProcessEvent(commandEvent);
+}
+
 void wxFrame::SetStatusText(const wxString& text, int number)
 {
     wxASSERT_MSG( (m_widget != NULL), "invalid frame" );