Add an about button to the minimal sample for systems without menus.

On minimal ports like wxIOS no menus are available. Providing an about button allows at least a minimal user interaction in that case.
This commit is contained in:
Tobias Taschner
2016-02-11 11:32:57 +01:00
parent df5d6110df
commit 61f136700c

View File

@@ -164,6 +164,12 @@ MyFrame::MyFrame(const wxString& title)
// ... and attach this menu bar to the frame
SetMenuBar(menuBar);
#else
// If menus are not available add a button to access the about box
wxSizer* sizer = new wxBoxSizer(wxHORIZONTAL);
wxButton* aboutBtn = new wxButton(this, wxID_ANY, "About...");
aboutBtn->Bind(wxEVT_BUTTON, &MyFrame::OnAbout, this);
sizer->Add(aboutBtn, wxSizerFlags().Center());
#endif // wxUSE_MENUS
#if wxUSE_STATUSBAR