12
enum wxbuildinfoformat {
15
wxString wxbuildinfo(wxbuildinfoformat format)
17
wxString wxbuild(wxVERSION_STRING);
19
if (format == long_f )
21
#if defined(__WXMSW__)
22
wxbuild << _T("-Windows");
23
#elif defined(__UNIX__)
24
wxbuild << _T("-Linux");
28
wxbuild << _T("-unicode build");
30
wxbuild << _T("-ANSI build");
31
#endif // wxUSE_UNICODE
37
//wxWidgets Application
38
class MyApp : public wxApp
41
virtual bool OnInit();
45
class MyFrame: public wxFrame
48
MyFrame(wxFrame *frame, const wxString& title);
51
void OnQuit(wxCommandEvent& event);
52
void OnAbout(wxCommandEvent& event);
53
DECLARE_EVENT_TABLE();
58
MyFrame* frame = new MyFrame(0L, _("wxWidgets Application Template"));
63
int idMenuQuit = wxNewId();
64
int idMenuAbout = wxNewId();
66
BEGIN_EVENT_TABLE(MyFrame, wxFrame)
67
EVT_MENU(idMenuQuit, MyFrame::OnQuit)
68
EVT_MENU(idMenuAbout, MyFrame::OnAbout)
71
MyFrame::MyFrame(wxFrame *frame, const wxString& title)
72
: wxFrame(frame, -1, title)
76
wxMenuBar* mbar = new wxMenuBar();
77
wxMenu* fileMenu = new wxMenu(_T(""));
78
fileMenu->Append(idMenuQuit, _("&Quit\tAlt-F4"), _("Quit the application"));
79
mbar->Append(fileMenu, _("&File"));
81
wxMenu* helpMenu = new wxMenu(_T(""));
82
helpMenu->Append(idMenuAbout, _("&About\tF1"), _("Show info about this application"));
83
mbar->Append(helpMenu, _("&Help"));
89
// create a status bar with some information about the used wxWidgets version
91
SetStatusText(_("Hello Code::Blocks user !"),0);
92
SetStatusText(wxbuildinfo(short_f),1);
93
#endif // wxUSE_STATUSBAR
100
void MyFrame::OnQuit(wxCommandEvent& event)
105
void MyFrame::OnAbout(wxCommandEvent& event)
107
wxString msg = wxbuildinfo(long_f);
108
wxMessageBox(msg, _("Welcome to..."));