]> git.saurik.com Git - wxWidgets.git/commitdiff
added wxFrame::Command()
authorRobert Roebling <robert@roebling.de>
Wed, 31 Mar 1999 17:53:27 +0000 (17:53 +0000)
committerRobert Roebling <robert@roebling.de>
Wed, 31 Mar 1999 17:53:27 +0000 (17:53 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@2017 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

docs/gtk/install.txt
include/wx/gtk/frame.h
include/wx/gtk1/frame.h
src/gtk/frame.cpp
src/gtk1/frame.cpp

index 6aa0cd9fa116d1a310b68e1fb87415864632784f..e73c31dda6ffffd10c0d249f6147cf4a9f947cbc 100644 (file)
@@ -164,7 +164,7 @@ toolkit. You must do this by running configure with either of:
 
 The following options handle the kind of library you want to build.
 
-       --with-threads          Compile without thread support.
+       --with-threads          Compile with thread support.
 
        --without-shared        Do not create shared libraries.
 
index fc73faa091b25db875a66fb958fe0f4fc7cfa4b1..de86ad8e1a0fb8029dd60fe2516b294394e05679 100644 (file)
@@ -92,6 +92,8 @@ public:
     virtual void Maximize(bool WXUNUSED(maximize)) {}
     virtual void Restore() {}
 
+    virtual void Command( int id );
+    
     void OnCloseWindow( wxCloseEvent& event );
     void OnActivate( wxActivateEvent &WXUNUSED(event) ) { } // called from docview.cpp
     void OnSize( wxSizeEvent &event );
index fc73faa091b25db875a66fb958fe0f4fc7cfa4b1..de86ad8e1a0fb8029dd60fe2516b294394e05679 100644 (file)
@@ -92,6 +92,8 @@ public:
     virtual void Maximize(bool WXUNUSED(maximize)) {}
     virtual void Restore() {}
 
+    virtual void Command( int id );
+    
     void OnCloseWindow( wxCloseEvent& event );
     void OnActivate( wxActivateEvent &WXUNUSED(event) ) { } // called from docview.cpp
     void OnSize( wxSizeEvent &event );
index b8198a328848f2aa0d24fa230f398916a158d1c5..84899e1e489099cdb61e61836efd7e70704a18bf 100644 (file)
@@ -640,6 +640,23 @@ 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)) ;
+    }
+    GetEventHandler()->ProcessEvent(commandEvent);
+}
+
 void wxFrame::SetStatusText(const wxString& text, int number)
 {
     wxASSERT_MSG( (m_widget != NULL), "invalid frame" );
index b8198a328848f2aa0d24fa230f398916a158d1c5..84899e1e489099cdb61e61836efd7e70704a18bf 100644 (file)
@@ -640,6 +640,23 @@ 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)) ;
+    }
+    GetEventHandler()->ProcessEvent(commandEvent);
+}
+
 void wxFrame::SetStatusText(const wxString& text, int number)
 {
     wxASSERT_MSG( (m_widget != NULL), "invalid frame" );