]> git.saurik.com Git - wxWidgets.git/blobdiff - samples/dialogs/dialogs.cpp
post wxUniv merge fixes
[wxWidgets.git] / samples / dialogs / dialogs.cpp
index f2d8a6ead2814aaa40e9744511385bbd60718a3d..632fdf155d61da75e5548413ec2020c74981a5e8 100644 (file)
@@ -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
 #include <wx/generic/fontdlgg.h>
 #endif
 
+#if !defined(__WXMSW__) || defined(wxUSE_DIRDLGG) && wxUSE_DIRDLGG
+// New wxGenericDirCtrl
+#include "wx/dirctrl.h"
+#endif
+
 #include "dialogs.h"
 
 IMPLEMENT_APP(MyApp)
@@ -480,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);
@@ -491,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))