X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/94311eef78b66304c9a2f78bcbdd396c798f19a6..8f7fa6f8f9bc857cf809dcb6bf7c49227ef2ccf3:/src/msw/dirdlg.cpp diff --git a/src/msw/dirdlg.cpp b/src/msw/dirdlg.cpp index 9d79a398f1..4c8cba7388 100644 --- a/src/msw/dirdlg.cpp +++ b/src/msw/dirdlg.cpp @@ -5,7 +5,7 @@ // Modified by: // Created: 01/02/97 // RCS-ID: $Id$ -// Copyright: (c) Julian Smart and Markus Holzem +// Copyright: (c) Julian Smart // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// @@ -17,7 +17,7 @@ // headers // ---------------------------------------------------------------------------- -#ifdef __GNUG__ +#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) #pragma implementation "dirdlg.h" #endif @@ -28,7 +28,7 @@ #pragma hdrstop #endif -#if wxUSE_DIRDLG +#if wxUSE_DIRDLG && !(defined(__SMARTPHONE__) && defined(__WXWINCE__)) #if defined(__WIN95__) && !defined(__GNUWIN32_OLD__) && wxUSE_OLE @@ -42,6 +42,11 @@ #include "wx/msw/private.h" +#ifdef __WXWINCE__ +#include +#include +#include +#endif #include // Win95 shell // ---------------------------------------------------------------------------- @@ -65,7 +70,7 @@ #endif // ---------------------------------------------------------------------------- -// wxWindows macros +// wxWidgets macros // ---------------------------------------------------------------------------- IMPLEMENT_CLASS(wxDirDialog, wxDialog) @@ -135,7 +140,11 @@ int wxDirDialog::ShowModal() bi.hwndOwner = parent ? GetHwndOf(parent) : NULL; bi.pidlRoot = NULL; bi.pszDisplayName = NULL; +#ifdef __WXWINCE__ + bi.lpszTitle = m_message.mb_str(); +#else bi.lpszTitle = m_message.c_str(); +#endif bi.ulFlags = BIF_RETURNONLYFSDIRS | BIF_STATUSTEXT; bi.lpfn = BrowseCallbackProc; bi.lParam = (LPARAM)m_path.c_str(); // param for the callback @@ -149,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 // @@ -160,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); @@ -217,7 +225,9 @@ BrowseCallbackProc(HWND hwnd, UINT uMsg, LPARAM lp, LPARAM pData) // initial selection here // // wParam = TRUE => lParam is a string and not a PIDL - SendMessage(hwnd, BFFM_SETSELECTION, TRUE, pData); +#ifndef __WXWINCE__ + ::SendMessage(hwnd, BFFM_SETSELECTION, TRUE, pData); +#endif break; case BFFM_SELCHANGED: @@ -279,4 +289,4 @@ static void ItemListFree(LPITEMIDLIST pidl) #include "../generic/dirdlgg.cpp" #endif // compiler/platform on which the code here compiles -#endif // wxUSE_DIRDLG +#endif // wxUSE_DIRDLG && !(__SMARTPHONE__ && __WXWINCE__)