X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/3d49ce4485af0c6ee498193519473cd8a830bbff..386c70583a2c03548aad922205906e58555a302d:/samples/dialogs/dialogs.cpp?ds=sidebyside diff --git a/samples/dialogs/dialogs.cpp b/samples/dialogs/dialogs.cpp index f2d8a6ead2..af929a2dd4 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) @@ -264,6 +266,9 @@ void MyFrame::LogDialog(wxCommandEvent& event) wxLogMessage("This is some message - everything is ok so far."); wxLogMessage("Another message...\n... this one is on multiple lines"); wxLogWarning("And then something went wrong!"); + + // and if ~wxBusyCursor doesn't do it, then call it manually + wxYield(); } wxLogError("Intermediary error handler decided to abort."); @@ -480,6 +485,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); @@ -491,6 +497,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))