Ignore:
Timestamp:
Nov 2, 1999, 9:37:43 PM (26 years ago)
Author:
sandervl
Message:

Wine 991031 update

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/comdlg32/filedlgbrowser.cpp

    r1548 r1556  
    1 /* $Id: filedlgbrowser.cpp,v 1.1 1999-11-02 19:09:42 sandervl Exp $ */
    21/*
    3  *  Implementation of IShellBrowser for the File Open common dialog (990815)
     2 *  Implementation of IShellBrowser for the File Open common dialog
    43 *
    54 *
    65 */
     6
     7#include <stdio.h>
     8#ifdef __WIN32OS2__
    79// ><DJR 17.05.99 Force to use C-interfaces for now to prevent CALLBACK definition compiler error
    810#define CINTERFACE 1
    9 
    10 #include <stdio.h>
     11#include <os2win.h>
    1112#include "unknwn.h"
    12 #include <os2win.h>
    1313#include "filedlgbrowser.h"
     14#else
     15#include "unknwn.h"
     16#include "filedlgbrowser.h"
     17#include "winuser.h"
     18#endif
    1419#include "heap.h"
    15 #include "commctrl.h"
    1620#include "wine/obj_dataobject.h"
    1721#include "debugtools.h"
     
    7781
    7882HRESULT IShellBrowserImpl_ICommDlgBrowser_OnSelChange(ICommDlgBrowser *iface, IShellView *ppshv);
     83#if 0
    7984LPITEMIDLIST GetSelectedPidl(IShellView *ppshv);
     85#endif
    8086
    8187/**************************************************************************
     
    116122    sb->lpVtbl2 = &IShellBrowserImpl_ICommDlgBrowser_Vtbl;
    117123
    118     SHGetSpecialFolderLocation(hwndOwner,
     124    COMDLG32_SHGetSpecialFolderLocation(hwndOwner,
    119125                               CSIDL_DESKTOP,
    120126                               &fodInfos->ShellInfos.pidlAbsCurrent);
     
    194200    if (!--(This->ref))
    195201    {
    196       SHFree(This);
     202      COMDLG32_SHFree(This);
    197203      return 0;
    198204    }
     
    287293        }
    288294        /* create an absolute pidl */
    289         pidlTmp = ILCombine(fodInfos->ShellInfos.pidlAbsCurrent,
     295        pidlTmp = COMDLG32_PIDL_ILCombine(fodInfos->ShellInfos.pidlAbsCurrent,
    290296                                                        (LPITEMIDLIST)pidl);
    291297       
     
    302308    {
    303309        /* An absolute pidl (relative from the desktop) */
    304         pidlTmp = ILClone((LPITEMIDLIST)pidl);
     310        pidlTmp =  COMDLG32_PIDL_ILClone((LPITEMIDLIST)pidl);
    305311        psfTmp = GetShellFolderFromPidl(pidlTmp);
    306312    }
    307313
     314   
    308315    /* Retrieve the IShellFolder interface of the pidl specified folder */
    309316    if(!psfTmp)
    310317        return E_FAIL;
     318
     319    /* If the pidl to browse to is equal to the actual pidl ...
     320       do nothing and pretend you did it*/
     321    if(COMDLG32_PIDL_ILIsEqual(pidlTmp,fodInfos->ShellInfos.pidlAbsCurrent))
     322    {
     323        IShellFolder_Release(psfTmp);
     324        COMDLG32_SHFree(pidlTmp);
     325        return NOERROR;
     326    }
    311327
    312328    /* Release the current fodInfos->Shell.FOIShellFolder and update its value */
     
    349365
    350366            /* Release old pidlAbsCurrent memory and update its value */
    351             SHFree((LPVOID)fodInfos->ShellInfos.pidlAbsCurrent);
     367            COMDLG32_SHFree((LPVOID)fodInfos->ShellInfos.pidlAbsCurrent);
    352368            fodInfos->ShellInfos.pidlAbsCurrent = pidlTmp;
    353369
     
    626642        HRESULT hRes;
    627643
    628         /* Selected item is a directory so browse to it */
    629 
    630644        ULONG  ulAttr = SFGAO_FOLDER | SFGAO_HASSUBFOLDER;
    631645        IShellFolder_GetAttributesOf(fodInfos->Shell.FOIShellFolder, 1, &pidl, &ulAttr);
     
    634648        /* Tell the dialog that the user selected a file */
    635649        else
     650        {
    636651            hRes = FILEDLG95_OnOpen(This->hwndOwner);
     652        }
    637653
    638654        /* Free memory used by pidl */
    639         SHFree((LPVOID)pidl);
     655        COMDLG32_SHFree((LPVOID)pidl);
    640656
    641657        return hRes;
     
    662678            break;
    663679        case CDBOSC_KILLFOCUS:
     680            {
     681                FileOpenDlgInfos *fodInfos = (FileOpenDlgInfos *) GetPropA(This->hwndOwner,FileOpenDlgInfosStr);
     682                if(fodInfos->DlgInfos.dwDlgProp & FODPROP_SAVEDLG)
     683                    SetDlgItemTextA(fodInfos->ShellInfos.hwndOwner,IDOK,"&Save");
     684            }
    664685            break;
    665686        case CDBOSC_SELCHANGE:
     
    705726
    706727    if (SUCCEEDED(IShellFolder_GetDisplayNameOf(fodInfos->Shell.FOIShellFolder, pidl, SHGDN_FORPARSING, &str)))
    707     { if (SUCCEEDED(StrRetToStrNW(szPathW, MAX_PATH, &str, pidl)))
     728    { if (SUCCEEDED(StrRetToBufW(&str, pidl,szPathW, MAX_PATH)))
    708729      {
    709         if (PathMatchSpecW(szPathW, fodInfos->ShellInfos.lpstrCurrentFilter))
     730          if (COMDLG32_PathMatchSpecW(szPathW, fodInfos->ShellInfos.lpstrCurrentFilter))
    710731          return S_OK;
    711732      }
     
    721742{
    722743    LPITEMIDLIST pidl;
    723 
     744    FileOpenDlgInfos *fodInfos;
    724745    _ICOM_THIS_FromICommDlgBrowser(IShellBrowserImpl,iface);
    725746
     747    fodInfos = (FileOpenDlgInfos *) GetPropA(This->hwndOwner,FileOpenDlgInfosStr);
    726748    TRACE("(%p)\n", This);
    727749
     
    731753        char lpstrFileName[MAX_PATH];
    732754   
    733         FileOpenDlgInfos *fodInfos = (FileOpenDlgInfos *) GetPropA(This->hwndOwner,FileOpenDlgInfosStr);
    734 
    735755        ULONG  ulAttr = SFGAO_FOLDER | SFGAO_HASSUBFOLDER;
    736756        IShellFolder_GetAttributesOf(fodInfos->Shell.FOIShellFolder, 1, &pidl, &ulAttr);
     
    739759            if(SUCCEEDED(hRes = GetName(fodInfos->Shell.FOIShellFolder,pidl,SHGDN_NORMAL,lpstrFileName)))
    740760                SetWindowTextA(fodInfos->DlgInfos.hwndFileName,lpstrFileName);
     761            if(fodInfos->DlgInfos.dwDlgProp & FODPROP_SAVEDLG)
     762                    SetDlgItemTextA(fodInfos->ShellInfos.hwndOwner,IDOK,"&Save");
    741763        }
    742 
    743         SHFree((LPVOID)pidl);
     764        else
     765            SetDlgItemTextA(fodInfos->ShellInfos.hwndOwner,IDOK,"&Open");
     766
     767        fodInfos->DlgInfos.dwDlgProp |= FODPROP_USEVIEW;
     768
     769        COMDLG32_SHFree((LPVOID)pidl);
    744770        return hRes;
    745771    }
    746 
     772    if(fodInfos->DlgInfos.dwDlgProp & FODPROP_SAVEDLG)
     773        SetDlgItemTextA(fodInfos->ShellInfos.hwndOwner,IDOK,"&Save");
     774
     775    fodInfos->DlgInfos.dwDlgProp &= ~FODPROP_USEVIEW;
    747776    return E_FAIL;
    748777}
     
    780809            LPIDA cida = (LPIDA)GlobalLock(medium.u.hGlobal);
    781810            TRACE("cida=%p\n", cida);
    782             pidlSelected = ILClone((LPITEMIDLIST)(&((LPBYTE)cida)[cida->aoffset[1]]));
     811            pidlSelected =  COMDLG32_PIDL_ILClone((LPITEMIDLIST)(&((LPBYTE)cida)[cida->aoffset[1]]));
    783812
    784813            if(medium.pUnkForRelease)
Note: See TracChangeset for help on using the changeset viewer.