]> git.saurik.com Git - wxWidgets.git/blobdiff - samples/dialogs/dialogs.cpp
Some tweaks to includes for compilers without precompiled headers
[wxWidgets.git] / samples / dialogs / dialogs.cpp
index 1c624e29bbf0fd66d2a7061a4a2b22ea30697075..a555d86d668886090cc0b477229087cdabc5d241 100644 (file)
@@ -31,7 +31,9 @@
 #include <wx/fontdlg.h>
 #include <wx/choicdlg.h>
 
-#if !defined(__WXMSW__) || USE_GENERIC_DIALOGS_IN_MSW
+#define wxTEST_GENERIC_DIALOGS_IN_MSW 0
+
+#if defined(__WXMSW__) && wxTEST_GENERIC_DIALOGS_IN_MSW
 #include <wx/generic/colrdlgg.h>
 #include <wx/generic/fontdlgg.h>
 #endif
@@ -60,14 +62,14 @@ bool MyApp::OnInit(void)
 
   file_menu->Append(DIALOGS_CHOOSE_COLOUR, "&Choose colour");
 
-#if !defined(__WXMSW__) || USE_GENERIC_DIALOGS_IN_MSW
+#if defined(__WXMSW__) && wxTEST_GENERIC_DIALOGS_IN_MSW
   file_menu->Append(DIALOGS_CHOOSE_COLOUR_GENERIC, "Choose colour (&generic)");
 #endif
 
   file_menu->AppendSeparator();
   file_menu->Append(DIALOGS_CHOOSE_FONT, "Choose &font");
 
-#if !defined(__WXMSW__) || USE_GENERIC_DIALOGS_IN_MSW
+#if defined(__WXMSW__) && wxTEST_GENERIC_DIALOGS_IN_MSW
   file_menu->Append(DIALOGS_CHOOSE_FONT_GENERIC, "Choose f&ont (generic)");
 
 #endif
@@ -78,11 +80,7 @@ bool MyApp::OnInit(void)
   file_menu->AppendSeparator();
   file_menu->Append(DIALOGS_FILE_OPEN,  "&Open file");
   file_menu->Append(DIALOGS_FILE_SAVE,  "Sa&ve file");
-#ifndef __WXGTK__
-  // don't add a menu entry for something that isn't in wxGTK. It only
-  // confuses the user
   file_menu->Append(DIALOGS_DIR_CHOOSE,  "&Choose a directory");
-#endif
   file_menu->AppendSeparator();
   file_menu->Append(wxID_EXIT, "E&xit");
   wxMenuBar *menu_bar = new wxMenuBar;
@@ -147,7 +145,7 @@ void MyFrame::ChooseFont(wxCommandEvent& WXUNUSED(event) )
       dialog->Close();
 }
 
-#if !defined(__WXMSW__) || USE_GENERIC_DIALOGS_IN_MSW
+#if defined(__WXMSW__) && wxTEST_GENERIC_DIALOGS_IN_MSW
 void MyFrame::ChooseColourGeneric(wxCommandEvent& WXUNUSED(event))
 {
       wxColourData data;
@@ -254,7 +252,6 @@ void MyFrame::FileSave(wxCommandEvent& WXUNUSED(event) )
 
 void MyFrame::DirChoose(wxCommandEvent& WXUNUSED(event) )
 {
-#ifndef __WXGTK__
        wxDirDialog dialog(this, "Testing directory picker", "");
 
        if (dialog.ShowModal() == wxID_OK)
@@ -262,7 +259,6 @@ void MyFrame::DirChoose(wxCommandEvent& WXUNUSED(event) )
                wxMessageDialog dialog2(this, dialog.GetPath(), "Selected path");
                dialog2.ShowModal();
        }
-#endif
 }
 
 void MyFrame::OnExit(wxCommandEvent& WXUNUSED(event) )
@@ -292,7 +288,7 @@ BEGIN_EVENT_TABLE(MyFrame, wxFrame)
        EVT_MENU(DIALOGS_FILE_OPEN,                                     MyFrame::FileOpen)
        EVT_MENU(DIALOGS_FILE_SAVE,                                     MyFrame::FileSave)
        EVT_MENU(DIALOGS_DIR_CHOOSE,                            MyFrame::DirChoose)
-#if !defined(__WXMSW__) || USE_GENERIC_DIALOGS_IN_MSW
+#if defined(__WXMSW__) && wxTEST_GENERIC_DIALOGS_IN_MSW
        EVT_MENU(DIALOGS_CHOOSE_COLOUR_GENERIC,         MyFrame::ChooseColourGeneric)
        EVT_MENU(DIALOGS_CHOOSE_FONT_GENERIC,           MyFrame::ChooseFontGeneric)
 #endif