Changeset 618 for trunk/dll/treecnr.c
- Timestamp:
- Apr 20, 2007, 9:19:03 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/dll/treecnr.c
r606 r618 28 28 06 Apr 07 GKY Work around PM DragInfo and DrgFreeDISH limits 29 29 06 Apr 07 GKY Add some error checking in drag/drop 30 19 Apr 07 SHL Sync with AcceptOneDrop GetOneDrop mods 31 19 Apr 07 SHL Add more drag/drop error checking 30 32 31 33 ***********************************************************************/ … … 99 101 EmphasizeButton(hwnd, emphasized); 100 102 } 101 if (AcceptOneDrop( mp1, mp2))103 if (AcceptOneDrop(hwnd, mp1, mp2)) 102 104 return MRFROM2SHORT(DOR_DROP, DO_MOVE); 103 105 return MRFROM2SHORT(DOR_NEVERDROP, 0); … … 122 124 EmphasizeButton(hwnd, emphasized); 123 125 } 124 if (GetOneDrop( mp1, mp2, szFrom, sizeof(szFrom))) {126 if (GetOneDrop(hwnd, mp1, mp2, szFrom, sizeof(szFrom))) { 125 127 MakeValidDir(szFrom); 126 128 WinSendMsg(WinQueryWindow(hwnd, QW_PARENT), … … 544 546 cni.pDragInfo = (PDRAGINFO) mp1; 545 547 li = DoFileDrop(dcd->hwndCnr, 546 547 if ( fExceedPMDrgLimit)548 549 550 551 548 dcd->directory, FALSE, MPVOID, MPFROMP(&cni)); 549 if (NumItemsToUnhilite) 550 saymsg(MB_CANCEL | MB_ICONEXCLAMATION, 551 hwnd, 552 GetPString(IDS_ERRORTEXT), 553 GetPString(IDS_EXCEEDPMDRGLMT)); 552 554 if (li) { 553 555 li->type = ((fDefaultDeletePerm) ? IDM_PERMDELETE : IDM_DELETE); … … 1254 1256 PDRAGINFO pDInfo; 1255 1257 1258 // fixme to know why - seems superfluous 1256 1259 pDInfo = ((PCNRDRAGINFO) mp2)->pDragInfo; 1257 1260 DrgAccessDraginfo(pDInfo); … … 1270 1273 1271 1274 pDInfo = ((PCNRDRAGINFO) mp2)->pDragInfo; 1272 DrgAccessDraginfo(pDInfo); 1275 if (!DrgAccessDraginfo(pDInfo)) { 1276 Win_Error(hwnd, hwnd, pszSrcFile, __LINE__, 1277 "DrgAccessDraginfo"); 1278 return (MRFROM2SHORT(DOR_NODROP, 0)); /* Drop not valid */ 1279 } 1273 1280 pci = (PCNRITEM) ((PCNRDRAGINFO) mp2)->pRecord; 1274 1281 if ((INT) pci == -1) 1275 1282 pci = NULL; 1276 1283 if (pci && (pci->flags & (RECFLAGS_ENV | RECFLAGS_NODROP))) { 1277 DrgFreeDraginfo(pDInfo);1278 return MRFROM2SHORT(DOR_NODROP, 0);1279 }1280 if (!pDInfo) {1281 1284 DrgFreeDraginfo(pDInfo); 1282 1285 return MRFROM2SHORT(DOR_NODROP, 0); … … 1315 1318 } 1316 1319 } 1317 pDItem = DrgQueryDragitemPtr(pDInfo, /* Access DRAGITEM 1318 0); /* Index to DRAGITEM 1320 pDItem = DrgQueryDragitemPtr(pDInfo, /* Access DRAGITEM */ 1321 0); /* Index to DRAGITEM */ 1319 1322 if (DrgVerifyRMF(pDItem, /* Check valid rendering */ 1320 DRM_OS2FILE, /* mechanisms and data 1321 NULL) || DrgVerifyRMF(pDItem, DRM_FM2ARCMEMBER, DRF_FM2ARCHIVE)) { /* formats 1322 DrgFreeDraginfo(pDInfo); /* Free DRAGINFO 1323 DRM_OS2FILE, /* mechanisms and data */ 1324 NULL) || DrgVerifyRMF(pDItem, DRM_FM2ARCMEMBER, DRF_FM2ARCHIVE)) { /* formats */ 1325 DrgFreeDraginfo(pDInfo); /* Free DRAGINFO */ 1323 1326 if (!pci || (INT) pci == -1) 1324 1327 return MRFROM2SHORT(DOR_DROP, DO_MOVE); … … 1328 1331 if (toupper(*pci->szFileName) < 'C') 1329 1332 return MRFROM2SHORT(DOR_DROP, DO_COPY); 1330 return MRFROM2SHORT(DOR_DROP, /* Return okay to drop 1333 return MRFROM2SHORT(DOR_DROP, /* Return okay to drop */ 1331 1334 ((fCopyDefault) ? DO_COPY : DO_MOVE)); 1332 1335 } 1333 DrgFreeDraginfo(pDInfo); /* Free DRAGINFO 1334 } 1335 return MRFROM2SHORT(DOR_NODROP, 0); /* Drop not valid 1336 DrgFreeDraginfo(pDInfo); /* Free DRAGINFO */ 1337 } 1338 return MRFROM2SHORT(DOR_NODROP, 0); /* Drop not valid */ 1336 1339 1337 1340 case CN_INITDRAG: … … 1374 1377 ULONG action = UM_ACTION; 1375 1378 1376 1377 if (fExceedPMDrgLimit)1378 1379 1380 1381 1379 li = DoFileDrop(hwnd, NULL, TRUE, mp1, mp2); 1380 if (NumItemsToUnhilite) 1381 saymsg(MB_CANCEL | MB_ICONEXCLAMATION, 1382 hwnd, 1383 GetPString(IDS_ERRORTEXT), 1384 GetPString(IDS_EXCEEDPMDRGLMT)); 1382 1385 if (li) { 1383 1386 if (!*li->targetpath) { … … 1402 1405 dcd->hwndParent, 1403 1406 DropListProc, 1404 1405 1406 1407 1408 1407 FM3ModHandle, DND_FRAME, MPFROMP(&cl)); 1408 if (li->type == DID_ERROR) 1409 Win_Error(hwnd, HWND_DESKTOP, pszSrcFile, __LINE__, 1410 "Drag & Drop Dialog"); 1411 if (!li->type) { 1409 1412 FreeListInfo(li); 1410 1413 return 0; 1411 1414 } 1412 1415 li->list = cl.list; 1413 1416 if (!li->list || !li->list[0]) { 1414 1417 FreeListInfo(li); 1415 1418 return 0; … … 1798 1801 if (drvtype & DRIVE_REMOTE) 1799 1802 driveflags[x] |= DRIVE_REMOTE; 1800 1803 if (!strcmp(FileSystem, CBSIFS)) { 1801 1804 driveflags[x] |= DRIVE_ZIPSTREAM; 1802 1803 1804 1805 1806 1807 1808 1809 1810 1811 1805 driveflags[x] &= (~DRIVE_REMOTE); 1806 } 1807 if(!strcmp(FileSystem,NDFS32)) { 1808 driveflags[x] |= DRIVE_VIRTUAL; 1809 driveflags[x] &= (~DRIVE_REMOTE); 1810 } 1811 if(!strcmp(FileSystem,RAMFS)) { 1812 driveflags[x] |= DRIVE_RAMDISK; 1813 driveflags[x] &= (~DRIVE_REMOTE); 1814 } 1812 1815 if (!strcmp(FileSystem, CDFS) || !strcmp(FileSystem, ISOFS)) 1813 1816 driveflags[x] |= (DRIVE_REMOVABLE | 1814 1815 1816 1817 DRIVE_NOTWRITEABLE | DRIVE_CDROM); 1818 if(!strcmp(FileSystem,NTFS)) 1819 driveflags[x] |= DRIVE_NOTWRITEABLE; 1817 1820 if (strcmp(FileSystem, HPFS) && 1818 1821 strcmp(FileSystem, JFS) && 1819 1822 strcmp(FileSystem, CDFS) && 1820 1821 1823 strcmp(FileSystem, ISOFS) && 1824 strcmp(FileSystem, RAMFS) && 1822 1825 strcmp(FileSystem, FAT32) && 1823 1824 1825 1826 strcmp(FileSystem, NDFS32) && 1827 strcmp(FileSystem, NTFS) && 1828 strcmp(FileSystem, HPFS386)) { 1826 1829 driveflags[x] |= DRIVE_NOLONGNAMES; 1827 1828 1830 } 1831 SelectDriveIcon(pciP); 1829 1832 WinSendMsg(hwnd, 1830 1833 CM_INVALIDATERECORD, … … 2563 2566 // Check if drive type might need update 2564 2567 if ((driveflag & (DRIVE_INVALID | DRIVE_NOPRESCAN)) || 2565 2568 (~driveflag & DRIVE_NOPRESCAN && pci->rc.hptrIcon == hptrDunno)) 2566 2569 { 2567 2570 driveflags[toupper(*pci->szFileName) - 'A'] &= … … 2569 2572 DRIVE_NOLOADSUBJS | DRIVE_NOLOADLONGS | DRIVE_NOSTATS); 2570 2573 DriveFlagsOne(toupper(*pci->szFileName) - 'A'); 2571 2574 driveflag = driveflags[toupper(*pci->szFileName) - 'A']; 2572 2575 if (driveflag & DRIVE_INVALID) 2573 2576 pci->rc.hptrIcon = hptrDunno; 2574 2577 else { 2575 2578 SelectDriveIcon(pci); 2576 2579 } 2577 2580 WinSendMsg(hwnd,
Note:
See TracChangeset
for help on using the changeset viewer.