]> git.saurik.com Git - wxWidgets.git/commitdiff
Make it possible to close "shaped" sample from the menu.
authorVadim Zeitlin <vadim@wxwidgets.org>
Wed, 12 Oct 2011 00:35:04 +0000 (00:35 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Wed, 12 Oct 2011 00:35:04 +0000 (00:35 +0000)
The sample didn't define any handler for wxID_EXIT menu item, do add it.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@69386 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

samples/shaped/shaped.cpp

index 6e9a0d955c60f22fe617811fb033c0d0fc144957..6f7ea9fb76d1067fd21c97dd8083e4375dbd41f0 100644 (file)
@@ -91,6 +91,7 @@ private:
     void OnShowShaped(wxCommandEvent& event);
     void OnShowTransparent(wxCommandEvent& event);
     void OnShowEffect(wxCommandEvent& event);
+    void OnExit(wxCommandEvent& event);
 
     DECLARE_EVENT_TABLE()
 };
@@ -244,6 +245,7 @@ BEGIN_EVENT_TABLE(MainFrame, wxFrame)
     EVT_MENU(Show_Shaped, MainFrame::OnShowShaped)
     EVT_MENU(Show_Transparent, MainFrame::OnShowTransparent)
     EVT_MENU_RANGE(Show_Effect_First, Show_Effect_Last, MainFrame::OnShowEffect)
+    EVT_MENU(wxID_EXIT, MainFrame::OnExit)
 END_EVENT_TABLE()
 
 MainFrame::MainFrame()
@@ -350,6 +352,11 @@ void MainFrame::OnShowEffect(wxCommandEvent& event)
     new EffectFrame(this,  eff, 1000);
 }
 
+void MainFrame::OnExit(wxCommandEvent& WXUNUSED(event))
+{
+    Close();
+}
+
 // ----------------------------------------------------------------------------
 // shaped frame
 // ----------------------------------------------------------------------------