X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/d6c9c1b71e069396bbe3850862de9aa10e6812e0..8a721b35f6aa9265584aba421f2d5c0065fe3c86:/samples/dialogs/dialogs.cpp diff --git a/samples/dialogs/dialogs.cpp b/samples/dialogs/dialogs.cpp index cafe3bdf22..632fdf155d 100644 --- a/samples/dialogs/dialogs.cpp +++ b/samples/dialogs/dialogs.cpp @@ -33,9 +33,6 @@ #include "wx/tipdlg.h" #include "wx/progdlg.h" -// New wxGenericDirCtrl -#include "wx/dirctrl.h" - #define wxTEST_GENERIC_DIALOGS_IN_MSW 0 #if defined(__WXMSW__) && wxTEST_GENERIC_DIALOGS_IN_MSW @@ -43,6 +40,11 @@ #include #endif +#if !defined(__WXMSW__) || defined(wxUSE_DIRDLGG) && wxUSE_DIRDLGG +// New wxGenericDirCtrl +#include "wx/dirctrl.h" +#endif + #include "dialogs.h" IMPLEMENT_APP(MyApp) @@ -365,12 +367,14 @@ void MyFrame::MultiChoice(wxCommandEvent& WXUNUSED(event) ) this); if ( count ) { - wxLogMessage("You selected %u items:", count); + wxString msg; + msg.Printf("You selected %u items:\n", count); for ( size_t n = 0; n < count; n++ ) { - wxLogMessage("\t%u: %u (%s)", n, selections[n], - choices[selections[n]].c_str()); + msg += wxString::Format("\t%u: %u (%s)\n", n, selections[n], + choices[selections[n]].c_str()); } + wxLogMessage(msg); } //else: cancelled or nothing selected } @@ -478,6 +482,7 @@ void MyFrame::DirChoose(wxCommandEvent& WXUNUSED(event) ) void MyFrame::GenericDirChoose(wxCommandEvent& WXUNUSED(event) ) { +#if !defined(__WXMSW__) || defined(wxUSE_DIRDLGG) && wxUSE_DIRDLGG // pass some initial dir to wxDirDialog wxString dirHome; wxGetHomeDir(&dirHome); @@ -489,6 +494,10 @@ void MyFrame::GenericDirChoose(wxCommandEvent& WXUNUSED(event) ) wxMessageDialog dialog2(this, dialog.GetPath(), "Selected path"); dialog2.ShowModal(); } +#else + wxLogError("Sorry, generic dir dialog not available:\n" + "set wxUSE_DIRDLGG to 1 and recompile"); +#endif } void MyFrame::ModalDlg(wxCommandEvent& WXUNUSED(event))