]> git.saurik.com Git - wxWidgets.git/commitdiff
only allow selecting existing files in wxLoadFileSelector; use this function instead...
authorVadim Zeitlin <vadim@wxwidgets.org>
Fri, 12 Jun 2009 18:02:57 +0000 (18:02 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Fri, 12 Jun 2009 18:02:57 +0000 (18:02 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@61028 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

docs/changes.txt
samples/image/image.cpp
samples/toolbar/toolbar.cpp
samples/widgets/bmpcombobox.cpp
src/common/fldlgcmn.cpp

index 2f65c0efd5c7cf61189e8f5e8ec16369e506cb11..5fccff31e70560a035279d14f771ffb702ea1b24 100644 (file)
@@ -122,6 +122,8 @@ Changes in behaviour not resulting in compilation errors, please read this!
   or equivalent function should now be done into wxApp::OnEventLoopEnter().
   See wxApp::OnEventLoopEnter() and wxApp::OnEventLoopExit() docs for more info.
 
+- wxLoadFileSelector() now allows the user to select existing files only.
+
 
 Changes in behaviour which may result in compilation errors
 -----------------------------------------------------------
index b18a797ac681e90305cb642ea3c31f20d173031d..0466355e71bcccb6e5f1b13775ef61a8f835a2a6 100644 (file)
@@ -687,7 +687,7 @@ wxString MyFrame::LoadUserImage(wxImage& image)
     wxString filename;
 
 #if wxUSE_FILEDLG
-    filename = wxFileSelector(_T("Select image file"));
+    filename = wxLoadFileSelector(_T("image"), wxEmptyString);
     if ( !filename.empty() )
     {
         if ( !image.LoadFile(filename) )
@@ -796,7 +796,7 @@ void MyFrame::OnPaste(wxCommandEvent& WXUNUSED(event))
 void MyFrame::OnThumbnail( wxCommandEvent &WXUNUSED(event) )
 {
 #if wxUSE_FILEDLG
-    wxString filename = wxFileSelector(_T("Select image file"));
+    wxString filename = wxLoadFileSelector(_T("image"), wxEmptyString, wxEmptyString, this);
     if ( filename.empty() )
         return;
 
index 3b9d95cac011f33b4c550e74824cff2e538c4484..05e49a011b7af67b2e92abe1947a4f052a17fee1 100644 (file)
@@ -958,7 +958,7 @@ void MyFrame::OnToolbarBgCol(wxCommandEvent& WXUNUSED(event))
 
 void MyFrame::OnToolbarCustomBitmap(wxCommandEvent& WXUNUSED(event))
 {
-    m_pathBmp = wxFileSelector(_T("Custom bitmap path"));
+    m_pathBmp = wxLoadFileSelector(_T("custom bitmap"));
 
     RecreateToolbar();
 }
index 61ef1dac4680d8d36b0b9c85c514885b12db06ff..5a87dd263ab3d03a3edbba97e7af1adc2ff29de7 100644 (file)
@@ -882,12 +882,9 @@ wxBitmap BitmapComboBoxWidgetsPage::LoadBitmap(const wxString& WXUNUSED(filepath
 
 wxBitmap BitmapComboBoxWidgetsPage::QueryBitmap(wxString* pStr)
 {
-    wxString filepath = wxFileSelector(wxT("Choose image file"),
+    wxString filepath = wxLoadFileSelector(wxT("image"),
                                        wxEmptyString,
                                        wxEmptyString,
-                                       wxEmptyString,
-                                       wxT("*.*"),
-                                       wxFD_OPEN | wxFD_FILE_MUST_EXIST,
                                        this);
 
     wxBitmap bitmap;
index 487d426bc90e10e846cf67926d3da21db0262c4d..b621b6a07f7ab386315cf8f6a841cbe05690953d 100644 (file)
@@ -313,7 +313,8 @@ static wxString wxDefaultFileSelector(bool load,
     }
 
     return wxFileSelector(prompt, wxEmptyString, default_name, ext, wild,
-                          load ? wxFD_OPEN : wxFD_SAVE, parent);
+                          load ? (wxFD_OPEN | wxFD_FILE_MUST_EXIST) : wxFD_SAVE,
+                          parent);
 }
 
 //----------------------------------------------------------------------------