X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/fba1b53b8706bc416db7f068c51f01658a621dcd..6e724836cbab943577776e7da03a3157b31fa5c1:/samples/dialogs/dialogs.cpp?ds=sidebyside diff --git a/samples/dialogs/dialogs.cpp b/samples/dialogs/dialogs.cpp index 5d36625f14..96d05b980d 100644 --- a/samples/dialogs/dialogs.cpp +++ b/samples/dialogs/dialogs.cpp @@ -9,7 +9,7 @@ // Licence: wxWindows license ///////////////////////////////////////////////////////////////////////////// -#ifdef __GNUG__ +#if defined(__GNUG__) && !defined(__APPLE__) #pragma implementation #pragma interface #endif @@ -25,6 +25,10 @@ #include "wx/wx.h" #endif +#ifdef __WXWINCE__ +#include "wx/msw/wince/time.h" +#endif + #include "wx/colordlg.h" #include "wx/filedlg.h" #include "wx/dirdlg.h" @@ -44,7 +48,7 @@ #define wxUSE_DIRDLGG 0 -#if !defined(__WXMSW__) || defined(wxUSE_DIRDLGG) && wxUSE_DIRDLGG +#if !(defined(__WXMSW__) || defined(__WXMAC__)) || wxUSE_DIRDLGG #include "wx/generic/dirdlgg.h" #endif @@ -238,7 +242,7 @@ void MyFrame::ChooseColour(wxCommandEvent& WXUNUSED(event) ) wxColourData retData = dialog.GetColourData(); col = retData.GetColour(); myCanvas->SetBackgroundColour(col); - myCanvas->Clear(); + myCanvas->ClearBackground(); myCanvas->Refresh(); } } @@ -284,7 +288,7 @@ void MyFrame::ChooseColourGeneric(wxCommandEvent& WXUNUSED(event)) wxColour col = retData.GetColour(); // wxBrush *brush = wxTheBrushList->FindOrCreateBrush(&col, wxSOLID); myCanvas->SetBackgroundColour(col); - myCanvas->Clear(); + myCanvas->ClearBackground(); myCanvas->Refresh(); } dialog->Destroy(); @@ -308,7 +312,7 @@ void MyFrame::ChooseFontGeneric(wxCommandEvent& WXUNUSED(event) ) } #endif // wxTEST_GENERIC_DIALOGS_IN_MSW -void MyFrame::LogDialog(wxCommandEvent& event) +void MyFrame::LogDialog(wxCommandEvent& WXUNUSED(event)) { // calling wxYield() (as ~wxBusyCursor does) shouldn't result in messages // being flushed -- test it @@ -514,8 +518,14 @@ void MyFrame::FileOpen2(wxCommandEvent& WXUNUSED(event) ) void MyFrame::FilesOpen(wxCommandEvent& WXUNUSED(event) ) { + wxString wildcards = +#ifdef __WXMOTIF__ + _T("C++ files (*.cpp)|*.cpp"); +#else + _T("All files (*.*)|*.*|C++ files (*.h;*.cpp)|*.h;*.cpp"); +#endif wxFileDialog dialog(this, _T("Testing open multiple file dialog"), - _T(""), _T(""), wxFileSelectorDefaultWildcardStr, + _T(""), _T(""), wildcards, wxMULTIPLE); if (dialog.ShowModal() == wxID_OK) @@ -534,6 +544,8 @@ void MyFrame::FilesOpen(wxCommandEvent& WXUNUSED(event) ) msg += s; } + s.Printf(_T("Filter index: %d"), dialog.GetFilterIndex()); + msg += s; wxMessageDialog dialog2(this, msg, _T("Selected files")); dialog2.ShowModal(); @@ -586,7 +598,7 @@ void MyFrame::DirChooseNew(wxCommandEvent& WXUNUSED(event) ) void MyFrame::GenericDirChoose(wxCommandEvent& WXUNUSED(event) ) { -#if !defined(__WXMSW__) || defined(wxUSE_DIRDLGG) && wxUSE_DIRDLGG +#if !(defined(__WXMSW__) || defined(__WXMAC__)) || wxUSE_DIRDLGG // pass some initial dir to wxDirDialog wxString dirHome; wxGetHomeDir(&dirHome); @@ -631,7 +643,7 @@ void MyFrame::ModelessDlg(wxCommandEvent& event) } } -void MyFrame::ShowTip(wxCommandEvent& event) +void MyFrame::ShowTip(wxCommandEvent& WXUNUSED(event)) { #if wxUSE_STARTUP_TIPS static size_t s_index = (size_t)-1;