X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/4676948b6814c97b93c431a8cbcd8c0352c87ba9..85f138db83939ce7c59a942aaecca7fa98168db3:/src/msw/dirdlg.cpp diff --git a/src/msw/dirdlg.cpp b/src/msw/dirdlg.cpp index 5f9006fa2b..f3f6771ae7 100644 --- a/src/msw/dirdlg.cpp +++ b/src/msw/dirdlg.cpp @@ -17,7 +17,7 @@ // headers // ---------------------------------------------------------------------------- -#ifdef __GNUG__ +#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) #pragma implementation "dirdlg.h" #endif @@ -70,7 +70,7 @@ #endif // ---------------------------------------------------------------------------- -// wxWindows macros +// wxWidgets macros // ---------------------------------------------------------------------------- IMPLEMENT_CLASS(wxDirDialog, wxDialog) @@ -158,10 +158,6 @@ int wxDirDialog::ShowModal() bi.ulFlags |= BIF_EDITBOX; } - // normally the commented out part should work -- but in practice - // BIF_NONEWFOLDERBUTTON doesn't have any effect (Win2k, comctl 5.81) so I - // have to disable it [for now] -#if 0 // to have the "New Folder" button we must use the "new" dialog style which // is also the only way to have a resizable dialog // @@ -169,20 +165,23 @@ int wxDirDialog::ShowModal() const bool needNewDir = HasFlag(wxDD_NEW_DIR_BUTTON); if ( (needNewDir || HasFlag(wxRESIZE_BORDER)) && (verComCtl32 >= 500) ) { - bi.ulFlags |= BIF_NEWDIALOGSTYLE; - - // we'll get the "New Folder" button by default now, don't show it if - // not needed - if ( !needNewDir ) - bi.ulFlags |= BIF_NONEWFOLDERBUTTON; - } -#else - if ( HasFlag(wxDD_NEW_DIR_BUTTON) && verComCtl32 >= 500 ) - { - // use the new style to make the "New Folder" button appear - bi.ulFlags |= BIF_NEWDIALOGSTYLE; + if (needNewDir) + { + bi.ulFlags |= BIF_NEWDIALOGSTYLE; + } + else + { + // Versions < 600 doesn't support BIF_NONEWFOLDERBUTTON + // The only way to get rid of the Make New Folder button is use + // the old dialog style which doesn't have the button thus we + // simply don't set the New Dialog Style for such comctl versions. + if (verComCtl32 >= 600) + { + bi.ulFlags |= BIF_NEWDIALOGSTYLE; + bi.ulFlags |= BIF_NONEWFOLDERBUTTON; + } + } } -#endif // do show the dialog LPITEMIDLIST pidl = SHBrowseForFolder(&bi); @@ -227,7 +226,7 @@ BrowseCallbackProc(HWND hwnd, UINT uMsg, LPARAM lp, LPARAM pData) // // wParam = TRUE => lParam is a string and not a PIDL #ifndef __WXWINCE__ - SendMessage(hwnd, BFFM_SETSELECTION, TRUE, pData); + ::SendMessage(hwnd, BFFM_SETSELECTION, TRUE, pData); #endif break;