]> git.saurik.com Git - wxWidgets.git/commitdiff
moved button handler into the modeless dialog itself - at least like this it works
authorVadim Zeitlin <vadim@wxwidgets.org>
Mon, 20 Aug 2001 23:01:17 +0000 (23:01 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Mon, 20 Aug 2001 23:01:17 +0000 (23:01 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@11429 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

samples/dialogs/dialogs.cpp
samples/dialogs/dialogs.h

index 84ea95b342fb3742aef2bd930d7cd151dc24079d..0e04f3effa8f2fff49b7949efa04650cd8583571 100644 (file)
@@ -91,8 +91,6 @@ BEGIN_EVENT_TABLE(MyFrame, wxFrame)
     EVT_FIND_CLOSE(-1, MyFrame::OnFindDialog)
 #endif // wxUSE_FINDREPLDLG
     EVT_MENU(wxID_EXIT,                             MyFrame::OnExit)
-
-    EVT_BUTTON(DIALOGS_MODELESS_BTN,                MyFrame::OnButton)
 END_EVENT_TABLE()
 
 BEGIN_EVENT_TABLE(MyModalDialog, wxDialog)
@@ -100,6 +98,8 @@ BEGIN_EVENT_TABLE(MyModalDialog, wxDialog)
 END_EVENT_TABLE()
 
 BEGIN_EVENT_TABLE(MyModelessDialog, wxDialog)
+    EVT_BUTTON(DIALOGS_MODELESS_BTN, MyModelessDialog::OnButton)
+
     EVT_CLOSE(MyModelessDialog::OnClose)
 END_EVENT_TABLE()
 
@@ -548,12 +548,6 @@ void MyFrame::ModelessDlg(wxCommandEvent& event)
     }
 }
 
-void MyFrame::OnButton(wxCommandEvent& WXUNUSED(event))
-{
-    wxMessageBox("Button pressed in modeless dialog", "Info",
-                 wxOK | wxICON_INFORMATION, this);
-}
-
 void MyFrame::ShowTip(wxCommandEvent& event)
 {
 #if wxUSE_STARTUP_TIPS
@@ -742,6 +736,12 @@ MyModelessDialog::MyModelessDialog(wxWindow *parent)
     sizerTop->Fit(this);
 }
 
+void MyModelessDialog::OnButton(wxCommandEvent& WXUNUSED(event))
+{
+    wxMessageBox("Button pressed in modeless dialog", "Info",
+                 wxOK | wxICON_INFORMATION, this);
+}
+
 void MyModelessDialog::OnClose(wxCloseEvent& event)
 {
     if ( event.CanVeto() )
index ccf3da8b7d0eee27cf5a95c4f13ff3782b0e226f..ccd0c2018331e09eca06bb653afefcbc4f69b96b 100644 (file)
@@ -28,6 +28,7 @@ class MyModelessDialog : public wxDialog
 public:
     MyModelessDialog(wxWindow *parent);
 
+    void OnButton(wxCommandEvent& event);
     void OnClose(wxCloseEvent& event);
 
 private:
@@ -91,8 +92,6 @@ public:
 
     void OnExit(wxCommandEvent& event);
 
-    void OnButton(wxCommandEvent& event);
-
 private:
     MyModelessDialog *m_dialog;