]> git.saurik.com Git - wxWidgets.git/blobdiff - samples/taskbar/tbtest.cpp
merged in the commit from the 2.2 branch
[wxWidgets.git] / samples / taskbar / tbtest.cpp
index 42ceee2723507d2e61e1df5e08257ba5d1b16a9c..45896485f1e983c9174e3bfb07e57c9e9a258a1a 100644 (file)
 #endif
 
 #ifndef WX_PRECOMP
-#include "wx.h"
+#include <wx/wx.h>
 #endif
 
-#include "wx/msw/taskbar.h"
+#include <wx/msw/taskbar.h>
 #include "tbtest.h"
 
 // Declare two frames
@@ -47,6 +47,7 @@ bool MyApp::OnInit(void)
 BEGIN_EVENT_TABLE(MyDialog, wxDialog)
     EVT_BUTTON(wxID_OK, MyDialog::OnOK)
     EVT_BUTTON(wxID_EXIT, MyDialog::OnExit)
+    EVT_CLOSE(MyDialog::OnCloseWindow)
 END_EVENT_TABLE()
 
 
@@ -102,14 +103,19 @@ BEGIN_EVENT_TABLE(MyTaskBarIcon, wxTaskBarIcon)
     EVT_MENU(PU_EXIT,    MyTaskBarIcon::OnMenuExit)
 END_EVENT_TABLE()
 
-void MyTaskBarIcon::OnMenuRestore(wxEvent& )
+void MyTaskBarIcon::OnMenuRestore(wxCommandEvent& )
 {
     dialog->Show(TRUE);
 }
 
-void MyTaskBarIcon::OnMenuExit(wxEvent& )
+void MyTaskBarIcon::OnMenuExit(wxCommandEvent& )
 {
     dialog->Close(TRUE);
+
+    // Nudge wxWindows into destroying the dialog, since
+    // with a hidden window no messages will get sent to put
+    // it into idle processing.
+    wxGetApp().ProcessIdle();
 }