X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/4ce7b1e43fdf835a77a78765fe73de707b89e85f..0d1c8f39baaaeb7a7f757091209eab471ef5dbc4:/src/common/filepickercmn.cpp?ds=sidebyside diff --git a/src/common/filepickercmn.cpp b/src/common/filepickercmn.cpp index ddd28f6c94..3591e7d654 100644 --- a/src/common/filepickercmn.cpp +++ b/src/common/filepickercmn.cpp @@ -28,6 +28,10 @@ #include "wx/filepicker.h" +#ifndef WX_PRECOMP + #include "wx/textctrl.h" +#endif + // ============================================================================ // implementation // ============================================================================ @@ -55,6 +59,19 @@ bool wxFileDirPickerCtrlBase::CreateBase( wxWindow *parent, wxWindowID id, style, validator, name)) return false; + if (!HasFlag(wxFLP_OPEN) && !HasFlag(wxFLP_SAVE)) + m_windowStyle |= wxFLP_OPEN; // wxFD_OPEN is the default + + // check that the styles are not contradictory + wxASSERT_MSG( !(HasFlag(wxFLP_SAVE) && HasFlag(wxFLP_OPEN)), + _T("can't specify both wxFLP_SAVE and wxFLP_OPEN at once") ); + + wxASSERT_MSG( !HasFlag(wxFLP_SAVE) || !HasFlag(wxFLP_FILE_MUST_EXIST), + _T("wxFLP_FILE_MUST_EXIST can't be used with wxFLP_SAVE" ) ); + + wxASSERT_MSG( !HasFlag(wxFLP_OPEN) || !HasFlag(wxFLP_OVERWRITE_PROMPT), + _T("wxFLP_OVERWRITE_PROMPT can't be used with wxFLP_OPEN") ); + // create a wxFilePickerWidget or a wxDirPickerWidget... if (!CreatePicker(this, path, message, wildcard)) return false;