There was no event handler defined for the 'Exit' menu option

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_2_BRANCH@6975 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Guillermo Rodriguez Garcia
2000-03-28 20:51:34 +00:00
parent 970f410fba
commit 3658812d91
2 changed files with 10 additions and 3 deletions

View File

@@ -45,6 +45,7 @@
IMPLEMENT_APP(MyApp) IMPLEMENT_APP(MyApp)
BEGIN_EVENT_TABLE(MyFrame, wxFrame) BEGIN_EVENT_TABLE(MyFrame, wxFrame)
EVT_MENU (SERVER_EXIT, MyFrame::OnExit)
EVT_LISTBOX(SERVER_LISTBOX, MyFrame::OnListBoxClick) EVT_LISTBOX(SERVER_LISTBOX, MyFrame::OnListBoxClick)
END_EVENT_TABLE() END_EVENT_TABLE()
@@ -110,7 +111,7 @@ MyFrame::MyFrame(wxFrame *frame, const wxString& title)
// Make a menubar // Make a menubar
wxMenu *file_menu = new wxMenu; wxMenu *file_menu = new wxMenu;
file_menu->Append(SERVER_QUIT, "&Exit"); file_menu->Append(SERVER_EXIT, "&Exit");
wxMenuBar *menu_bar = new wxMenuBar; wxMenuBar *menu_bar = new wxMenuBar;
@@ -133,7 +134,7 @@ MyFrame::MyFrame(wxFrame *frame, const wxString& title)
} }
// Set the client process's listbox to this item // Set the client process's listbox to this item
void MyFrame::OnListBoxClick(wxCommandEvent& event) void MyFrame::OnListBoxClick(wxCommandEvent& WXUNUSED(event))
{ {
wxListBox* listBox = (wxListBox*) panel->FindWindow(SERVER_LISTBOX); wxListBox* listBox = (wxListBox*) panel->FindWindow(SERVER_LISTBOX);
if (listBox) if (listBox)
@@ -146,6 +147,11 @@ void MyFrame::OnListBoxClick(wxCommandEvent& event)
} }
} }
void MyFrame::OnExit(wxCommandEvent& WXUNUSED(event))
{
Close(TRUE);
}
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
// IPCDialogBox // IPCDialogBox
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------

View File

@@ -30,6 +30,7 @@ public:
MyFrame(wxFrame *frame, const wxString& title); MyFrame(wxFrame *frame, const wxString& title);
void OnListBoxClick(wxCommandEvent& event); void OnListBoxClick(wxCommandEvent& event);
void OnExit(wxCommandEvent& event);
private: private:
wxPanel *panel; wxPanel *panel;
@@ -76,6 +77,6 @@ private:
DECLARE_EVENT_TABLE() DECLARE_EVENT_TABLE()
}; };
#define SERVER_QUIT wxID_EXIT #define SERVER_EXIT wxID_EXIT
#define SERVER_LISTBOX 500 #define SERVER_LISTBOX 500
#define SERVER_QUIT_BUTTON 501 #define SERVER_QUIT_BUTTON 501