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.
This commit is contained in:
Vadim Zeitlin 2017-03-31 17:01:10 +02:00
parent 4aa2a84ac5
commit 4b7d3561d9

View File

@ -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"));
}