Changeset 618 for trunk/dll/mainwnd.c
- Timestamp:
- Apr 20, 2007, 9:19:03 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/dll/mainwnd.c
r606 r618 30 30 06 Apr 07 GKY Work around PM DragInfo and DrgFreeDISH limits 31 31 06 Apr 07 GKY Add some error checking in drag/drop 32 15 Apr 07 SHL mainwnd MAIN_SETUPLIST restore state not found reporting 33 19 Apr 07 SHL Sync with AcceptOneDrop GetOneDrop mods 34 20 Apr 07 SHL Avoid spurious add_udir error reports 32 35 33 36 ***********************************************************************/ … … 35 38 #define INCL_DOS 36 39 #define INCL_WIN 40 // #define INCL_WINERRORS 41 #define INCL_SHLERRORS 37 42 #define INCL_WINHELP 38 43 #define INCL_GPI … … 628 633 DrawTargetEmphasis(hwnd, emphasized); 629 634 } 630 if (AcceptOneDrop( mp1, mp2))635 if (AcceptOneDrop(hwnd, mp1, mp2)) 631 636 return MRFROM2SHORT(DOR_DROP, DO_MOVE); 632 637 return MRFROM2SHORT(DOR_NEVERDROP, 0); … … 662 667 DrawTargetEmphasis(hwnd, emphasized); 663 668 } 664 if (GetOneDrop( mp1, mp2, szFrom, sizeof(szFrom))) {669 if (GetOneDrop(hwnd, mp1, mp2, szFrom, sizeof(szFrom))) { 665 670 MakeValidDir(szFrom); 666 671 WinSetWindowText(hwnd, szFrom); … … 1233 1238 cdi.pDragInfo = mp1; 1234 1239 li = DoFileDrop(hwnd, NULL, FALSE, mp1, MPFROMP(&cdi)); 1235 if ( fExceedPMDrgLimit)1240 if (NumItemsToUnhilite) 1236 1241 saymsg(MB_CANCEL | MB_ICONEXCLAMATION, 1237 1242 hwnd, … … 1752 1757 DrawTargetEmphasis(hwnd, emphasized); 1753 1758 } 1754 if (AcceptOneDrop( mp1, mp2))1759 if (AcceptOneDrop(hwnd, mp1, mp2)) 1755 1760 return MRFROM2SHORT(DOR_DROP, DO_MOVE); 1756 1761 return MRFROM2SHORT(DOR_NEVERDROP, 0); … … 1806 1811 NULL, 1807 1812 TRUE, MPFROM2SHORT(TREE_CNR, CN_DROP), MPFROMP(&cnd)); 1808 if ( fExceedPMDrgLimit)1813 if (NumItemsToUnhilite) 1809 1814 saymsg(MB_CANCEL | MB_ICONEXCLAMATION, 1810 1815 hwnd, … … 3456 3461 DrawTargetEmphasis(hwnd, emphasized); 3457 3462 } 3458 if (AcceptOneDrop( mp1, mp2))3463 if (AcceptOneDrop(hwnd, mp1, mp2)) 3459 3464 return MRFROM2SHORT(DOR_DROP, DO_MOVE); 3460 3465 } … … 3480 3485 DrawTargetEmphasis(hwnd, emphasized); 3481 3486 } 3482 if (GetOneDrop( mp1, mp2, szFrom, sizeof(szFrom))) {3487 if (GetOneDrop(hwnd, mp1, mp2, szFrom, sizeof(szFrom))) { 3483 3488 if (MakeValidDir(szFrom) && !FindDirCnrByName(szFrom, TRUE)) { 3484 3489 OpenDirCnr((HWND) 0, hwndMain, hwndTree, FALSE, szFrom); … … 4151 4156 !DosQueryPathInfo(temp, FIL_QUERYFULLNAME, path, sizeof(path))) { 4152 4157 if (SHORT1FROMMP(mp1) == IDM_ADDTOUSERLIST) { 4153 if (!add_udir(TRUE, path)) 4154 Runtime_Error(pszSrcFile, __LINE__, "add_udir"); 4155 else { 4156 if (fUdirsChanged) 4157 save_udirs(); 4158 WinSendMsg(hwnd, UM_FILLUSERLIST, MPVOID, MPVOID); 4159 } 4158 add_udir(TRUE, path); 4159 if (fUdirsChanged) 4160 save_udirs(); 4161 WinSendMsg(hwnd, UM_FILLUSERLIST, MPVOID, MPVOID); 4160 4162 } 4161 4163 else { … … 4180 4182 WinQueryWindowText(hwndStatelist, 13, szStateName); 4181 4183 bstrip(szStateName); 4182 if (*szStateName) { 4184 // Ignore request if blank or attempting to using illegal name 4185 if (*szStateName && stricmp(szStateName, GetPString(IDS_STATETEXT))) { 4183 4186 if (SHORT1FROMMP(mp1) == IDM_SAVEDIRCNRSTATE) { 4184 4187 // Save … … 4189 4192 save_setups(); 4190 4193 } 4194 else { 4195 saymsg(MB_ENTER | MB_ICONASTERISK, hwnd, 4196 GetPString(IDS_WARNINGTEXT), 4197 GetPString(IDS_EXISTSASATEXT), szStateName, "state name"); 4198 WinSetWindowText(hwndStatelist, GetPString(IDS_STATETEXT)); 4199 } 4191 4200 } 4192 WinSetWindowText(hwndStatelist, GetPString(IDS_STATETEXT)); 4201 else { 4202 saymsg(MB_ENTER | MB_ICONASTERISK, hwnd, 4203 GetPString(IDS_WARNINGTEXT), 4204 "\"%s\" state save failed", szStateName); // 15 Apr 07 SHL failed 4205 WinSetWindowText(hwndStatelist, GetPString(IDS_STATETEXT)); 4206 } 4193 4207 } 4194 4208 else { … … 5307 5321 (CHAR *) mp1); 5308 5322 if (add_udir(FALSE, (CHAR *) mp1)) { 5309 if (fUserComboBox) { 5310 if (fAutoAddDirs) 5311 WinSendMsg(hwndUserlist, LM_INSERTITEM, 5312 MPFROM2SHORT(LIT_SORTASCENDING, 0), 5313 MPFROMP((CHAR *) mp1)); 5323 if (fUserComboBox && fAutoAddDirs) { 5324 WinSendMsg(hwndUserlist, LM_INSERTITEM, 5325 MPFROM2SHORT(LIT_SORTASCENDING, 0), 5326 MPFROMP((CHAR *) mp1)); 5314 5327 } 5315 5328 } … … 5434 5447 WinSendMsg(hwndStatelist, LM_DELETEALL, MPVOID, MPVOID); 5435 5448 if (fUserComboBox) { 5436 5437 5449 INT x; 5438 5450 … … 5704 5716 SetShiftState(); 5705 5717 size = sizeof(ULONG); 5706 sprintf(s, "%s.NumDirsLastTime", path); 5718 sprintf(s, "%s.NumDirsLastTime", path); // path is state name 5707 5719 if (!PrfQueryProfileData 5708 5720 (fmprof, FM3Str, s, (PVOID) & numsaves, &size)) 5709 Win_Error2(hwnd, hwnd, __FILE__, __LINE__, 5710 IDS_PRFQUERYPROFILEDATA); 5721 { 5722 if ((WinGetLastError(WinQueryAnchorBlock(hwnd)) & 0xffff) == PMERR_NOT_IN_IDX) { 5723 saymsg(MB_ENTER | MB_ICONASTERISK, hwnd, 5724 GetPString(IDS_WARNINGTEXT), 5725 GetPString(IDS_DOESNTEXISTTEXT), path); 5726 } 5727 else { 5728 Win_Error2(hwnd, hwnd, __FILE__, __LINE__, 5729 IDS_PRFQUERYPROFILEDATA); 5730 } 5731 } 5711 5732 else if (!numsaves) 5712 5733 Runtime_Error2(pszSrcFile, __LINE__, IDS_NODATATEXT); … … 5730 5751 } 5731 5752 } 5732 WinSetWindowText(hwndStatelist, GetPString(IDS_STATETEXT)); 5753 // fixme to hold restored state name for a while 5754 // WinSetWindowText(hwndStatelist, GetPString(IDS_STATETEXT)); // 15 Apr 07 SHL 5733 5755 } 5734 5756 else if (SHORT1FROMMP(mp1) == MAIN_CMDLIST) {
Note:
See TracChangeset
for help on using the changeset viewer.