Changeset 1411 for trunk/dll/treecnr.c
- Timestamp:
- Mar 29, 2009, 10:33:07 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/dll/treecnr.c
r1407 r1411 64 64 08 Mar 09 GKY Renamed commafmt.h i18nutil.h 65 65 08 Mar 09 GKY Additional strings move to PCSZs in init.c 66 12 Mar 09 SHL Use common SearchContainer 66 67 14 Mar 09 GKY Prevent execution of UM_SHOWME while drive scan is occuring 67 68 … … 625 626 # endif 626 627 if (StubbyScanCount != 0) { //prevent treeswitch from hanging fm2 during startup GKY 3-14-09 627 628 628 DosSleep(50); 629 PostMsg(hwndTree, UM_SHOWME, mp1, MPVOID); 629 630 } 630 631 dcd = INSTDATA(hwnd); … … 971 972 static APPNOTIFY *apphead = NULL, *apptail = NULL; 972 973 DIRCNRDATA *dcd = INSTDATA(hwnd); 974 PCNRITEM pci; 973 975 974 976 switch (msg) { … … 1000 1002 PostMsg(hwnd, WM_COMMAND, MPFROM2SHORT(IDM_DELETE, 0), MPVOID); 1001 1003 break; 1002 } 1003 } 1004 if (shiftstate || fNoSearch) 1005 break; 1006 if (SHORT1FROMMP(mp1) & KC_CHAR) { 1007 1008 ULONG thistime, len; 1009 SEARCHSTRING srch; 1010 PCNRITEM pci; 1011 1012 if (!dcd) 1013 break; 1014 switch (SHORT1FROMMP(mp2)) { 1015 case '\x1b': 1016 case '\r': 1017 case '\n': 1018 dcd->lasttime = 0; 1019 *dcd->szCommonName = 0; 1020 break; 1021 default: 1022 thistime = WinQueryMsgTime(WinQueryAnchorBlock(hwnd)); 1023 if (thistime > dcd->lasttime + 1250) 1024 *dcd->szCommonName = 0; 1025 dcd->lasttime = thistime; 1026 if (SHORT1FROMMP(mp2) == ' ' && !*dcd->szCommonName) 1027 break; 1028 KbdRetry: 1029 len = strlen(dcd->szCommonName); 1030 if (len >= CCHMAXPATH - 1) { 1031 *dcd->szCommonName = 0; 1032 len = 0; 1033 } 1034 dcd->szCommonName[len] = toupper(SHORT1FROMMP(mp2)); 1035 dcd->szCommonName[len + 1] = 0; 1036 memset(&srch, 0, sizeof(SEARCHSTRING)); 1037 srch.cb = (ULONG) sizeof(SEARCHSTRING); 1038 srch.pszSearch = (PSZ) dcd->szCommonName; 1039 srch.fsPrefix = TRUE; 1040 srch.fsCaseSensitive = FALSE; 1041 srch.usView = CV_ICON; 1042 pci = WinSendMsg(hwnd, 1043 CM_SEARCHSTRING, 1044 MPFROMP(&srch), MPFROMLONG(CMA_FIRST)); 1045 if (pci && (INT) pci != -1) { 1046 /* make found item current item */ 1047 WinSendMsg(hwnd, 1048 CM_SETRECORDEMPHASIS, 1049 MPFROMP(pci), MPFROM2SHORT(TRUE, CRA_CURSORED)); 1050 /* make sure that record shows in viewport */ 1051 ShowCnrRecord(hwnd, (PMINIRECORDCORE) pci); 1052 return (MRESULT) TRUE; 1053 } 1054 else { 1055 if (SHORT1FROMMP(mp2) == ' ') { 1056 dcd->szCommonName[len] = 0; 1057 break; 1058 } 1059 *dcd->szCommonName = 0; 1060 dcd->lasttime = 0; 1061 if (len) // retry as first letter if no match 1062 goto KbdRetry; 1063 } 1064 break; 1065 } 1066 } 1067 break; 1004 } // switch 1005 } 1006 1007 if (SearchContainer(hwnd, msg, mp1, mp2)) 1008 return (MRESULT)TRUE; // Avoid default handler 1009 1010 break; // Let default handler see key 1068 1011 1069 1012 case WM_MOUSEMOVE: … … 1127 1070 case UM_FILESMENU: 1128 1071 { 1129 PCNRITEM pci;1130 1072 HWND menuHwnd = (HWND) 0; 1131 1073 FSALLOCATE fsa; … … 1230 1172 WinSetWindowText(WinWindowFromID(dcd->hwndFrame, 1231 1173 MAIN_STATUS), pci->pszFileName); 1232 1233 1234 1235 1174 if (fMoreButtons && hwndName) { 1175 CHAR szDate[DATE_BUF_BYTES]; 1176 1177 DateFormat(szDate, pci->date); 1236 1178 WinSetWindowText(hwndName, pci->pszFileName); 1237 1179 sprintf(str, "%s %02u%s%02u%s%02u", szDate, 1238 1239 1180 pci->time.hours, TimeSeparator, 1181 pci->time.minutes, TimeSeparator, pci->time.seconds); 1240 1182 WinSetWindowText(hwndDate, str); 1241 1183 WinSetWindowText(hwndAttr, pci->pszDispAttr); … … 1847 1789 UnFlesh(hwnd, pci); 1848 1790 PostMsg(hwnd, UM_RESCAN, MPVOID, MPVOID); 1849 1791 if (!fAlertBeepOff) 1850 1792 DosBeep(250, 100); 1851 1793 } … … 1916 1858 !(pci->flags & RECFLAGS_ENV) && IsFullName(pci->pszFileName)) { 1917 1859 if (driveflags[toupper(*pci->pszFileName) - 'A'] & DRIVE_INVALID) { 1918 1860 if (!fAlertBeepOff) 1919 1861 DosBeep(50, 100); 1920 1862 if (hwndStatus)
Note:
See TracChangeset
for help on using the changeset viewer.