// Modified by:
// Created: 04/01/98
// RCS-ID: $Id$
-// Copyright: (c) Julian Smart and Markus Holzem
-// Licence: wxWindows license
+// Copyright: (c) Julian Smart
+// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
// ============================================================================
// ressources
// ----------------------------------------------------------------------------
// the application icon
-#ifdef __WXGTK__
+#if defined(__WXGTK__) || defined(__WXMOTIF__)
#include "mondrian.xpm"
#endif
{
// menu items
Minimal_Quit = 1,
- Minimal_About,
- Minimal_Test1,
- Minimal_Test2,
-
- // controls start here (the numbers are, of course, arbitrary)
- Minimal_Text = 1000,
+ Minimal_About
};
// ----------------------------------------------------------------------------
MyFrame::MyFrame(const wxString& title, const wxPoint& pos, const wxSize& size)
: wxFrame((wxFrame *)NULL, -1, title, pos, size)
{
+#ifdef __WXMAC__
+ // we need this in order to allow the about menu relocation, since ABOUT is not the default id of the about menu
+ wxApp::s_macAboutMenuItemId = Minimal_About ;
+#endif
+
// set the frame icon
SetIcon(wxICON(mondrian));
// create a menu bar
- wxMenu *menuFile = new wxMenu;
-
- menuFile->Append(Minimal_About, "&About...");
+ wxMenu *menuFile = new wxMenu("", wxMENU_TEAROFF);
+
+#ifdef __WXMAC__
+ // since the about should be in the help menu for auto-relocation we have to do a little more...
+ wxMenu *helpMenu = new wxMenu("", wxMENU_TEAROFF);
+ helpMenu->Append(Minimal_About, "&About...\tCntrl+A", "Show about dialog");
+#else
+ menuFile->Append(Minimal_About, "&About...\tCtrl-A", "Show about dialog");
menuFile->AppendSeparator();
- menuFile->Append(Minimal_Quit, "E&xit");
+#endif
+ menuFile->Append(Minimal_Quit, "E&xit\tAlt-X", "Quit this program");
// now append the freshly created menu to the menu bar...
- wxMenuBar *menuBar = new wxMenuBar;
+ wxMenuBar *menuBar = new wxMenuBar();
menuBar->Append(menuFile, "&File");
+#ifdef __WXMAC__
+ menuBar->Append(helpMenu, "&Help");
+#endif
// ... and attach this menu bar to the frame
SetMenuBar(menuBar);
+#if wxUSE_STATUSBAR
// create a status bar just for fun (by default with 1 pane only)
CreateStatusBar(2);
SetStatusText("Welcome to wxWindows!");
+#endif // wxUSE_STATUSBAR
}
void MyFrame::OnAbout(wxCommandEvent& WXUNUSED(event))
{
- wxMessageBox("This is a minimal sample\nA second line in the message box",
- "About Minimal", wxOK | wxICON_INFORMATION, this);
+ wxString msg;
+ msg.Printf( _T("This is the about dialog of minimal sample.\n")
+ _T("Welcome to %s")
+#ifdef wxBETA_NUMBER
+ _T(" (beta %d)!")
+#endif // wxBETA_NUMBER
+ , wxVERSION_STRING
+#ifdef wxBETA_NUMBER
+ , wxBETA_NUMBER
+#endif // wxBETA_NUMBER
+ );
+
+ wxMessageBox(msg, "About Minimal", wxOK | wxICON_INFORMATION, this);
}