X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/66bd6b93005b803910caca469110495ce549599f..321db4b6bf15df209942b9c0e6c744c8e7074d1b:/samples/dialogs/dialogs.cpp diff --git a/samples/dialogs/dialogs.cpp b/samples/dialogs/dialogs.cpp index 7a501ba5ef..7477d7de43 100644 --- a/samples/dialogs/dialogs.cpp +++ b/samples/dialogs/dialogs.cpp @@ -31,7 +31,9 @@ #include #include -#if !defined(__WXMSW__) || USE_GENERIC_DIALOGS_IN_MSW +#define wxTEST_GENERIC_DIALOGS_IN_MSW 0 + +#if defined(__WXMSW__) && wxTEST_GENERIC_DIALOGS_IN_MSW #include #include #endif @@ -40,7 +42,7 @@ IMPLEMENT_APP(MyApp) -MyCanvas *myCanvas = NULL; +MyCanvas *myCanvas = (MyCanvas *) NULL; // A macro needed for some compilers (AIX) that need 'main' to be defined // in the application itself. @@ -53,21 +55,21 @@ bool MyApp::OnInit(void) m_canvasFont = *wxNORMAL_FONT; // Create the main frame window - MyFrame *frame = new MyFrame(NULL, "wxWindows dialogs example", wxPoint(50, 50), wxSize(400, 300)); + MyFrame *frame = new MyFrame((wxFrame *) NULL, (char *) "wxWindows dialogs example", wxPoint(50, 50), wxSize(400, 300)); // Make a menubar wxMenu *file_menu = new wxMenu; 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,7 +80,11 @@ 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; @@ -143,7 +149,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; @@ -288,7 +294,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