added wxFrame::Command()

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@2017 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Robert Roebling 1999-03-31 17:53:27 +00:00
parent 40c7a5fc4e
commit 30f1b5f3ef
5 changed files with 39 additions and 1 deletions

View 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.

View 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 );

View 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 );

View 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" );

View 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" );