]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/fldlgcmn.cpp
Add component-level filtering to wxLog.
[wxWidgets.git] / src / common / fldlgcmn.cpp
index 7c6e7fda2c653ee2cd529f710fc1346f7e5e0925..b621b6a07f7ab386315cf8f6a841cbe05690953d 100644 (file)
@@ -9,13 +9,13 @@
 // Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
-#ifdef __BORLANDC__
-#pragma hdrstop
-#endif
-
 // For compilers that support precompilation, includes "wx.h".
 #include "wx/wxprec.h"
 
+#ifdef __BORLANDC__
+    #pragma hdrstop
+#endif
+
 #if wxUSE_FILEDLG
 
 #include "wx/filedlg.h"
@@ -151,12 +151,12 @@ wxString wxFileDialogBase::AppendExtension(const wxString &filePath,
     return filePath + ext;
 }
 
-bool wxFileDialogBase::SetExtraControlCreator(ExtraControlCreatorFunction c)
+bool wxFileDialogBase::SetExtraControlCreator(ExtraControlCreatorFunction creator)
 {
     wxCHECK_MSG( !m_extraControlCreator, false,
                  "wxFileDialog::SetExtraControl() called second time" );
 
-    m_extraControlCreator = c;
+    m_extraControlCreator = creator;
     return SupportsExtraControl();
 }
 
@@ -168,6 +168,18 @@ bool wxFileDialogBase::CreateExtraControl()
     return true;
 }
 
+wxSize wxFileDialogBase::GetExtraControlSize()
+{
+    if ( !m_extraControlCreator )
+        return wxDefaultSize;
+
+    // create the extra control in an empty dialog just to find its size: this
+    // is not terribly efficient but we do need to know the size before
+    // creating the native dialog and this seems to be the only way
+    wxDialog dlg(NULL, wxID_ANY, "");
+    return (*m_extraControlCreator)(&dlg)->GetSize();
+}
+
 //----------------------------------------------------------------------------
 // wxFileDialog convenience functions
 //----------------------------------------------------------------------------
@@ -301,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);
 }
 
 //----------------------------------------------------------------------------