]> git.saurik.com Git - wxWidgets.git/commitdiff
added wxCHANGE_DIR flag support to wxMSW implementation
authorVadim Zeitlin <vadim@wxwidgets.org>
Sun, 25 Nov 2001 14:27:21 +0000 (14:27 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Sun, 25 Nov 2001 14:27:21 +0000 (14:27 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@12679 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/msw/filedlg.cpp

index 28faff8a8b98c79971046d69157b7b8d3bafdf44..28dbb46507b26efa0d60144f4ad04195ffd96d77 100644 (file)
 
 #include "wx/tokenzr.h"
 
+#ifndef OFN_EXPLORER
+    #define OFN_EXPLORER 0x00080000
+#endif
+
 // ----------------------------------------------------------------------------
 // constants
 // ----------------------------------------------------------------------------
@@ -242,12 +246,18 @@ int wxFileDialog::ShowModal()
         msw_flags |= OFN_HIDEREADONLY;
     if ( m_dialogStyle & wxFILE_MUST_EXIST )
         msw_flags |= OFN_PATHMUSTEXIST | OFN_FILEMUSTEXIST;
+
     if (m_dialogStyle & wxMULTIPLE )
-        msw_flags |=
-#if defined(OFN_EXPLORER)
-        OFN_EXPLORER |
-#endif // OFN_EXPLORER
-        OFN_ALLOWMULTISELECT;
+    {
+        // OFN_EXPLORER must always be specified with OFN_ALLOWMULTISELECT
+        msw_flags |= OFN_EXPLORER | OFN_ALLOWMULTISELECT;
+    }
+
+    // if wxCHANGE_DIR flag is not given we shouldn't change the CWD
+    if ( !(m_dialogStyle & wxCHANGE_DIR) )
+    {
+        msw_flags |= OFN_NOCHANGEDIR;
+    }
 
     OPENFILENAME of;
     wxZeroMemory(of);