]> git.saurik.com Git - wxWidgets.git/blobdiff - samples/except/except.cpp
Add a test for a tooltip for a control inside a static box.
[wxWidgets.git] / samples / except / except.cpp
index e4019f5e60196087cdbf99dc1aa483657a45a0ba..4f9ea48dbfe25b3909ad8ea111346fc3670a9a5e 100644 (file)
@@ -4,7 +4,6 @@
 // Author:      Vadim Zeitlin
 // Modified by:
 // Created:     2003-09-17
-// RCS-ID:      $Id$
 // Copyright:   (c) 2003-2005 Vadim Zeitlin
 // Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
@@ -53,7 +52,7 @@
 // ----------------------------------------------------------------------------
 
 // the application icon (under Windows and OS/2 it is in resources)
-#if defined(__WXGTK__) || defined(__WXMOTIF__) || defined(__WXMAC__) || defined(__WXX11__)
+#ifndef wxHAS_IMAGES_IN_RESOURCES
     #include "../sample.xpm"
 #endif
 
@@ -120,6 +119,7 @@ public:
     void OnThrowUnhandled(wxCommandEvent& event);
 
     void OnCrash(wxCommandEvent& event);
+    void OnTrap(wxCommandEvent& event);
 #if wxUSE_ON_FATAL_EXCEPTION
     void OnHandleCrash(wxCommandEvent& event);
 #endif
@@ -188,6 +188,7 @@ enum
     Except_ThrowObject,
     Except_ThrowUnhandled,
     Except_Crash,
+    Except_Trap,
 #if wxUSE_ON_FATAL_EXCEPTION
     Except_HandleCrash,
 #endif // wxUSE_ON_FATAL_EXCEPTION
@@ -217,6 +218,7 @@ BEGIN_EVENT_TABLE(MyFrame, wxFrame)
     EVT_MENU(Except_ThrowObject, MyFrame::OnThrowObject)
     EVT_MENU(Except_ThrowUnhandled, MyFrame::OnThrowUnhandled)
     EVT_MENU(Except_Crash, MyFrame::OnCrash)
+    EVT_MENU(Except_Trap, MyFrame::OnTrap)
 #if wxUSE_ON_FATAL_EXCEPTION
     EVT_MENU(Except_HandleCrash, MyFrame::OnHandleCrash)
 #endif // wxUSE_ON_FATAL_EXCEPTION
@@ -353,6 +355,8 @@ MyFrame::MyFrame()
     menuFile->Append(Except_ThrowUnhandled,
                         wxT("Throw &unhandled exception\tCtrl-U"));
     menuFile->Append(Except_Crash, wxT("&Crash\tCtrl-C"));
+    menuFile->Append(Except_Trap, "&Trap\tCtrl-T",
+                     "Break into the debugger (if one is running)");
     menuFile->AppendSeparator();
 #if wxUSE_ON_FATAL_EXCEPTION
     menuFile->AppendCheckItem(Except_HandleCrash, wxT("&Handle crashes\tCtrl-H"));
@@ -367,7 +371,7 @@ MyFrame::MyFrame()
     menuFile->Append(Except_Quit, wxT("E&xit\tCtrl-Q"), wxT("Quit this program"));
 
     wxMenu *helpMenu = new wxMenu;
-    helpMenu->Append(Except_About, wxT("&About...\tF1"), wxT("Show about dialog"));
+    helpMenu->Append(Except_About, wxT("&About\tF1"), wxT("Show about dialog"));
 
     // now append the freshly created menu to the menu bar...
     wxMenuBar *menuBar = new wxMenuBar();
@@ -447,6 +451,11 @@ void MyFrame::OnCrash(wxCommandEvent& WXUNUSED(event))
     DoCrash();
 }
 
+void MyFrame::OnTrap(wxCommandEvent& WXUNUSED(event))
+{
+    wxTrap();
+}
+
 #if wxUSE_ON_FATAL_EXCEPTION
 
 void MyFrame::OnHandleCrash(wxCommandEvent& event)