X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/b3ca7c855f89570a077738900ecef24b55929bbd..0159d534634fb2a64687efc25812676c99ac9295:/samples/dialogs/dialogs.cpp diff --git a/samples/dialogs/dialogs.cpp b/samples/dialogs/dialogs.cpp index 7549454956..0a3c4638ba 100644 --- a/samples/dialogs/dialogs.cpp +++ b/samples/dialogs/dialogs.cpp @@ -22,6 +22,7 @@ #include "../sample.xpm" +#include "wx/apptrait.h" #include "wx/datetime.h" #include "wx/image.h" #include "wx/bookctrl.h" @@ -83,10 +84,7 @@ #include "wx/fdrepdlg.h" #endif // wxUSE_FINDREPLDLG -#if wxUSE_SPINCTRL #include "wx/spinctrl.h" -#endif - #include "wx/propdlg.h" #include "dialogs.h" @@ -2327,3 +2325,31 @@ void TestMessageBoxDialog::OnClose(wxCommandEvent& WXUNUSED(event)) } #endif // USE_SETTINGS_DIALOG + +#if wxUSE_LOG + +// ---------------------------------------------------------------------------- +// custom log target +// ---------------------------------------------------------------------------- + +class MyLogGui : public wxLogGui +{ +private: + virtual void DoShowSingleLogMessage(const wxString& message, + const wxString& title, + int style) + { + wxMessageDialog dlg(NULL, message, title, + wxOK | wxCANCEL | wxCANCEL_DEFAULT | style); + dlg.SetOKCancelLabels(wxID_COPY, wxID_OK); + dlg.SetExtendedMessage("Note that this is a custom log dialog."); + dlg.ShowModal(); + } +}; + +wxLog *MyAppTraits::CreateLogTarget() +{ + return new MyLogGui; +} + +#endif // wxUSE_LOG