// event handlers (these functions should _not_ be virtual)
void OnQuit(wxCommandEvent& event);
void OnAbout(wxCommandEvent& event);
+#if wxUSE_LOG
void OnLogs(wxCommandEvent& event);
+#endif // wxUSE_LOG
void OnBrowser(wxCommandEvent& event);
void OnPlugProvider(wxCommandEvent& event);
};
// ----------------------------------------------------------------------------
-// event tables and other macros for wxWindows
+// event tables and other macros for wxWidgets
// ----------------------------------------------------------------------------
BEGIN_EVENT_TABLE(MyFrame, wxFrame)
EVT_MENU(ID_Quit, MyFrame::OnQuit)
+#if wxUSE_LOG
EVT_MENU(ID_Logs, MyFrame::OnLogs)
+#endif // wxUSE_LOG
EVT_MENU(wxID_ABOUT, MyFrame::OnAbout)
EVT_MENU(ID_Browser, MyFrame::OnBrowser)
EVT_MENU(ID_PlugProvider, MyFrame::OnPlugProvider)
// create the main application window
MyFrame *frame = new MyFrame(_T("wxArtProvider sample"),
wxPoint(50, 50), wxSize(450, 340));
- frame->Show(TRUE);
- return TRUE;
+ frame->Show(true);
+ return true;
}
// ----------------------------------------------------------------------------
// frame constructor
MyFrame::MyFrame(const wxString& title, const wxPoint& pos, const wxSize& size, long style)
- : wxFrame(NULL, -1, title, pos, size, style)
+ : wxFrame(NULL, wxID_ANY, title, pos, size, style)
{
SetIcon(wxICON(mondrian));
menuFile->AppendCheckItem(ID_PlugProvider, _T("&Plug-in art provider"), _T("Enable custom art provider"));
menuFile->AppendSeparator();
+#if wxUSE_LOG
menuFile->Append(ID_Logs, _T("&Logging test"), _T("Show some logging output"));
+#endif // wxUSE_LOG
menuFile->Append(ID_Browser, _T("&Resources browser"), _T("Browse all available icons"));
menuFile->AppendSeparator();
void MyFrame::OnQuit(wxCommandEvent& WXUNUSED(event))
{
- // TRUE is to force the frame to close
- Close(TRUE);
+ // true is to force the frame to close
+ Close(true);
}
+#if wxUSE_LOG
void MyFrame::OnLogs(wxCommandEvent& WXUNUSED(event))
{
wxLogMessage(_T("Some information."));
wxLog::GetActiveTarget()->Flush();
wxLogMessage(_T("Check/uncheck 'File/Plug-in art provider' and try again."));
}
+#endif // wxUSE_LOG
void MyFrame::OnAbout(wxCommandEvent& WXUNUSED(event))
{
msg.Printf( _T("This is the about dialog of wxArtProvider sample.\n")
_T("Welcome to %s"), wxVERSION_STRING);
- wxMessageBox(msg, _T("About Minimal"), wxOK | wxICON_INFORMATION, this);
+ wxMessageBox(msg, _T("About wxArtProvider sample"),
+ wxOK | wxICON_INFORMATION, this);
}
void MyFrame::OnBrowser(wxCommandEvent& WXUNUSED(event))