X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/8ce68f7fc03beda6b7cbfdd7180a8f7f7eee952d..302c73511a6819c5a56269ba95cb18eb11e994f0:/src/common/fldlgcmn.cpp?ds=inline diff --git a/src/common/fldlgcmn.cpp b/src/common/fldlgcmn.cpp index 7c6e7fda2c..e57a244cb3 100644 --- a/src/common/fldlgcmn.cpp +++ b/src/common/fldlgcmn.cpp @@ -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 //----------------------------------------------------------------------------