From 4b7d3561d98881b0c2021285bae866cc625983d4 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Fri, 31 Mar 2017 17:01:10 +0200 Subject: [PATCH] Use standard menu IDs in the "svg" sample Don't define our own ID_XXX when the standard ones will do. Use wxID_SAVE instead of wxID_SAVEAS just because the former has a standard accelerator (Ctrl-S) while the latter does not, at least under MSW, and it's convenient to have one. --- samples/svg/svgtest.cpp | 27 +++++++-------------------- 1 file changed, 7 insertions(+), 20 deletions(-) diff --git a/samples/svg/svgtest.cpp b/samples/svg/svgtest.cpp index ac9b1404f1..b5cc272e5c 100644 --- a/samples/svg/svgtest.cpp +++ b/samples/svg/svgtest.cpp @@ -76,27 +76,14 @@ private: wxDECLARE_EVENT_TABLE(); }; -// --------------------------------------------------------------------------- -// constants -// --------------------------------------------------------------------------- - -// menu items ids - -enum -{ - ID_SAVE = 100, - ID_ABOUT, - ID_QUIT -}; - // --------------------------------------------------------------------------- // event tables // --------------------------------------------------------------------------- wxBEGIN_EVENT_TABLE(MyFrame, wxFrame) - EVT_MENU(ID_ABOUT, MyFrame::OnAbout) - EVT_MENU(ID_QUIT, MyFrame::OnQuit) - EVT_MENU(ID_SAVE, MyFrame::FileSavePicture) + EVT_MENU(wxID_ABOUT, MyFrame::OnAbout) + EVT_MENU(wxID_EXIT, MyFrame::OnQuit) + EVT_MENU(wxID_SAVE, MyFrame::FileSavePicture) wxEND_EVENT_TABLE() // =========================================================================== @@ -140,11 +127,11 @@ MyFrame::MyFrame(wxWindow *parent, const wxWindowID id, const wxString& title, // Make a menubar wxMenu *file_menu = new wxMenu; - file_menu->Append(ID_SAVE, wxT("&Save As..\tCtrl+S")); - file_menu->Append(ID_QUIT, wxT("&Exit\tAlt+X")); + file_menu->Append(wxID_SAVE); + file_menu->Append(wxID_EXIT); wxMenu *help_menu = new wxMenu; - help_menu->Append(ID_ABOUT, wxT("&About")); + help_menu->Append(wxID_ABOUT); wxMenuBar *menu_bar = new wxMenuBar; @@ -192,7 +179,7 @@ void MyFrame::OnAbout(wxCommandEvent& WXUNUSED(event)) { (void)wxMessageBox(wxT("wxWidgets SVG sample\n") wxT("Author: Chris Elliott (c) 2002-2009\n") - wxT("Usage: click File|Save As.. to Save the Selected SVG Test"), + wxT("Usage: click File|Save to Save the Selected SVG Test"), wxT("About SVG Test")); }