]> git.saurik.com Git - wxWidgets.git/blobdiff - samples/dialogs/dialogs.cpp
wxToggleButton on wxMac has these methods now
[wxWidgets.git] / samples / dialogs / dialogs.cpp
index 493a89b5aa6de98dd25704cf2de36f93a03813fc..d1bb2254d6991370d009f695f23e64ce91ed42d3 100644 (file)
@@ -29,6 +29,7 @@
 #include "wx/msw/wince/time.h"
 #endif
 
 #include "wx/msw/wince/time.h"
 #endif
 
+#include "wx/numdlg.h"
 #include "wx/colordlg.h"
 #include "wx/filedlg.h"
 #include "wx/dirdlg.h"
 #include "wx/colordlg.h"
 #include "wx/filedlg.h"
 #include "wx/dirdlg.h"
@@ -38,6 +39,7 @@
 #include "wx/progdlg.h"
 #include "wx/fdrepdlg.h"
 #include "wx/busyinfo.h"
 #include "wx/progdlg.h"
 #include "wx/fdrepdlg.h"
 #include "wx/busyinfo.h"
+#include "wx/image.h"
 
 #define wxTEST_GENERIC_DIALOGS_IN_MSW 0
 
 
 #define wxTEST_GENERIC_DIALOGS_IN_MSW 0
 
@@ -123,6 +125,10 @@ MyCanvas *myCanvas = (MyCanvas *) NULL;
 // `Main program' equivalent, creating windows and returning main app frame
 bool MyApp::OnInit()
 {
 // `Main program' equivalent, creating windows and returning main app frame
 bool MyApp::OnInit()
 {
+#if wxUSE_IMAGE
+    wxInitAllImageHandlers();
+#endif
+
 #if defined(__WXGTK__) && defined(wxUSE_UNICODE)
   wxConvCurrent = &wxConvLibc;
 #endif
 #if defined(__WXGTK__) && defined(wxUSE_UNICODE)
   wxConvCurrent = &wxConvLibc;
 #endif
@@ -135,7 +141,7 @@ bool MyApp::OnInit()
 
   // Make a menubar
   wxMenu *file_menu = new wxMenu;
 
   // Make a menubar
   wxMenu *file_menu = new wxMenu;
-
+  
   file_menu->Append(DIALOGS_CHOOSE_COLOUR, _T("&Choose colour"));
 
 #if defined(__WXMSW__) && wxTEST_GENERIC_DIALOGS_IN_MSW
   file_menu->Append(DIALOGS_CHOOSE_COLOUR, _T("&Choose colour"));
 
 #if defined(__WXMSW__) && wxTEST_GENERIC_DIALOGS_IN_MSW
@@ -518,8 +524,14 @@ void MyFrame::FileOpen2(wxCommandEvent& WXUNUSED(event) )
 
 void MyFrame::FilesOpen(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"),
     wxFileDialog dialog(this, _T("Testing open multiple file dialog"),
-                        _T(""), _T(""), wxFileSelectorDefaultWildcardStr,
+                        _T(""), _T(""), wildcards,
                         wxMULTIPLE);
 
     if (dialog.ShowModal() == wxID_OK)
                         wxMULTIPLE);
 
     if (dialog.ShowModal() == wxID_OK)
@@ -538,6 +550,8 @@ void MyFrame::FilesOpen(wxCommandEvent& WXUNUSED(event) )
 
             msg += s;
         }
 
             msg += s;
         }
+        s.Printf(_T("Filter index: %d"), dialog.GetFilterIndex());
+        msg += s;
 
         wxMessageDialog dialog2(this, msg, _T("Selected files"));
         dialog2.ShowModal();
 
         wxMessageDialog dialog2(this, msg, _T("Selected files"));
         dialog2.ShowModal();