Changeset 787 for trunk/dll/misc.c
- Timestamp:
- Aug 19, 2007, 11:02:37 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/dll/misc.c
r775 r787 31 31 06 Aug 07 GKY Increase Subject EA to 1024 32 32 06 Aug 07 GKY Reduce DosSleep times (ticket 148) 33 33 14 Aug 07 SHL Delete obsoletes 34 14 Aug 07 SHL Move #pragma alloc_text to end for OpenWatcom compat 34 35 35 36 ***********************************************************************/ … … 56 57 static PSZ pszSrcFile = __FILE__; 57 58 58 #pragma alloc_text(MAINWND5,SetSysMenu)59 #pragma alloc_text(MISC1,BoxWindow,PaintRecessedWindow,PostMsg,PaintSTextWindow,IsFm2Window)60 #pragma alloc_text(MISC1,FixSwitchList,FindDirCnr,CurrentRecord,SetShiftState,AddToListboxBottom)61 #pragma alloc_text(CNR_MISC1,AdjustCnrColVis,AdjustCnrColsForFSType)62 #pragma alloc_text(CNR_MISC1,AdjustCnrColsForPref,SetCnrCols)63 #pragma alloc_text(CNR_MISC2,CnrDirectEdit,OpenEdit)64 #pragma alloc_text(MISC2,SetMenuCheck,disable_menuitem,SetSortChecks)65 #pragma alloc_text(MISC2,SetDetailsSwitches,SetViewMenu)66 #pragma alloc_text(MISC3,SetupCommandMenu,AdjustDetailsSwitches)67 #pragma alloc_text(MISC3,ViewHelp,GetCmdSpec)68 #pragma alloc_text(MISC3,ExecFile,SetConditionalCascade,LoadDetailsSwitches)69 #pragma alloc_text(MISC3,FreeMallocedMem,FcloseFile)70 #pragma alloc_text(MISC4,PortholeInit,CheckMenu,Broadcast,SetupWinList,SwitchCommand)71 #pragma alloc_text(MISC6,DrawTargetEmphasis,EmphasizeButton)72 #pragma alloc_text(MISC_LIBPATH,LoadLibPath)73 #pragma alloc_text(MISC_SAY,SayView,SaySort,SayFilter)74 75 59 #ifndef BEGIN_LIBPATH 76 60 #define BEGIN_LIBPATH 1 … … 135 119 ptl.y = 1; 136 120 GpiMove(hps, &ptl); 137 GpiSetColor(hps, ((on) ? CLR_BLACK : CLR_PALEGRAY));121 GpiSetColor(hps, on ? CLR_BLACK : CLR_PALEGRAY); 138 122 ptl.x = swp.cx - 2; 139 123 ptl.y = swp.cy - 2; … … 150 134 151 135 if (hps) { 152 BoxWindow(hwnd, hps, ((on) ? CLR_BLACK : CLR_PALEGRAY));136 BoxWindow(hwnd, hps, on ? CLR_BLACK : CLR_PALEGRAY); 153 137 DrgReleasePS(hps); 154 138 } … … 214 198 do { 215 199 GpiQueryTextBox(hps, strlen(p), p, TXTBOX_COUNT, aptl); 216 if (aptl[TXTBOX_TOPRIGHT].x > (rcl.xRight - ( (p != s)? len : 0)))200 if (aptl[TXTBOX_TOPRIGHT].x > (rcl.xRight - (p != s ? len : 0))) 217 201 p++; 218 202 else … … 410 394 hasLongNames = FALSE; 411 395 } 412 pBool = (dcd) ? &dcd->detailsladate : &detailsladate; 413 AdjustCnrColVis(hwndCnr, GetPString(IDS_LADATE), 414 (*pBool) ? hasAccessDT : FALSE, FALSE); 415 pBool = (dcd) ? &dcd->detailslatime : &detailslatime; 416 AdjustCnrColVis(hwndCnr, GetPString(IDS_LATIME), 417 (*pBool) ? hasAccessDT : FALSE, FALSE); 418 pBool = (dcd) ? &dcd->detailscrdate : &detailscrdate; 419 AdjustCnrColVis(hwndCnr, GetPString(IDS_CRDATE), 420 (*pBool) ? hasCreateDT : FALSE, FALSE); 421 pBool = (dcd) ? &dcd->detailscrtime : &detailscrtime; 422 AdjustCnrColVis(hwndCnr, GetPString(IDS_CRTIME), 423 (*pBool) ? hasCreateDT : FALSE, FALSE); 424 pBool = (dcd) ? &dcd->detailslongname : &detailslongname; 425 AdjustCnrColVis(hwndCnr, GetPString(IDS_LNAME), 426 (*pBool) ? hasLongNames : FALSE, FALSE); 396 pBool = dcd ? &dcd->detailsladate : &detailsladate; 397 AdjustCnrColVis(hwndCnr, 398 GetPString(IDS_LADATE), 399 *pBool ? hasAccessDT : FALSE, 400 FALSE); 401 pBool = dcd ? &dcd->detailslatime : &detailslatime; 402 AdjustCnrColVis(hwndCnr, 403 GetPString(IDS_LATIME), 404 *pBool ? hasAccessDT : FALSE, 405 FALSE); 406 pBool = dcd ? &dcd->detailscrdate : &detailscrdate; 407 AdjustCnrColVis(hwndCnr, 408 GetPString(IDS_CRDATE), 409 *pBool ? hasCreateDT : FALSE, 410 FALSE); 411 pBool = dcd ? &dcd->detailscrtime : &detailscrtime; 412 AdjustCnrColVis(hwndCnr, 413 GetPString(IDS_CRTIME), 414 *pBool ? hasCreateDT : FALSE, 415 FALSE); 416 pBool = dcd ? &dcd->detailslongname : &detailslongname; 417 AdjustCnrColVis(hwndCnr, 418 GetPString(IDS_LNAME), 419 *pBool ? hasLongNames : FALSE, 420 FALSE); 427 421 WinSendMsg(hwndCnr, CM_INVALIDATEDETAILFIELDINFO, MPVOID, MPVOID); 428 422 } … … 532 526 pfi->flData |= CFA_FIREADONLY; 533 527 pfi->flTitle = CFA_CENTER | CFA_FITITLEREADONLY; 534 pfi->pTitleData = (isCompCnr)? GetPString(IDS_STATUS) :535 528 pfi->pTitleData = isCompCnr ? GetPString(IDS_STATUS) : 529 GetPString(IDS_SUBJ); 536 530 pfi->offStruct = FIELDOFFSET(CNRITEM, pszSubject); 537 531 … … 701 695 szSubject[retlen + 1] = 0; 702 696 //chop_at_crnl(szSubject); 703 704 697 bstrip(szSubject); 698 pci->pszSubject = xrealloc(pci->pszSubject, retlen + 1, pszSrcFile, __LINE__); 705 699 WinSetWindowText(hwndMLE, szSubject); 706 700 len = strlen(szSubject); … … 752 746 retlen = WinQueryWindowText(hwndMLE, sizeof(longname), longname); 753 747 longname[retlen + 1] = 0; 754 755 748 //chop_at_crnl(longname); 749 pci->pszLongName = xrealloc(pci->pszLongName, retlen + 1, pszSrcFile, __LINE__); 756 750 WinSetWindowText(hwndMLE, longname); 757 751 pci->pszFileName = xrealloc(pci->pszFileName, retlen + 1, pszSrcFile, __LINE__); 758 752 return (MRESULT) WriteLongName(pci->pszFileName, longname); 759 753 } 760 761 754 else { 755 WinQueryWindowText(hwndMLE, sizeof(szData), szData); 762 756 if (strchr(szData, '?') || 763 757 strchr(szData, '*') || IsRoot(pci->pszFileName)) … … 774 768 return FALSE; 775 769 if (DosQueryPathInfo(pci->pszFileName, 776 777 778 779 770 FIL_QUERYFULLNAME, szData, sizeof(szData))){ 771 pci->pszFileName = xrealloc(pci->pszFileName, sizeof(szData), pszSrcFile, __LINE__); 772 strcpy(szData, pci->pszFileName); 773 } 780 774 WinSetWindowText(hwndMLE, szData); 781 775 if (strcmp(szData, testname)) { … … 859 853 { 860 854 if (toggle) { 861 *bool = (*bool)? FALSE : TRUE;855 *bool = *bool ? FALSE : TRUE; 862 856 if (savename && *savename) 863 857 PrfWriteProfileData(fmprof, appname, savename, bool, sizeof(BOOL)); … … 943 937 lastflags = ex.flags; 944 938 return runemf2(ex.flags, hwnd, path, 945 (*ex.environment) ? ex.environment : NULL, "%s", cl) != -1; 939 *ex.environment ? ex.environment : NULL, 940 "%s", cl) != -1; 946 941 } 947 942 else if (ret != 0) … … 1045 1040 } 1046 1041 if (bool) 1047 *bool = (*bool)? FALSE : TRUE;1042 *bool = *bool ? FALSE : TRUE; 1048 1043 if (*s && bool) 1049 1044 PrfWriteProfileData(fmprof, appname, s, bool, sizeof(BOOL)); … … 1118 1113 } 1119 1114 1120 VOID FreeMallocedMem(VOID * mem)1121 {1122 /* for use by apps that don't use the DLLs runtime library */1123 free(mem);1124 }1125 1126 1115 VOID FcloseFile(FILE * fp) 1127 1116 { … … 1167 1156 "%s%s%s", 1168 1157 info->title, 1169 (x < 20)? "\tCtrl + " : NullStr,1170 (x < 20 && x > 9)? "Shift + " : NullStr);1158 x < 20 ? "\tCtrl + " : NullStr, 1159 x < 20 && x > 9 ? "Shift + " : NullStr); 1171 1160 if (x < 20) 1172 1161 sprintf(&s[strlen(s)], "%d", 1173 (( (x % 10) + 1) == 10)? 0 : (x % 10) + 1);1162 ((x % 10) + 1) == 10 ? 0 : (x % 10) + 1); 1174 1163 mi.id = IDM_COMMANDSTART + x; 1175 mi.afAttribute = (((info->flags & ONCE) != 0) ? 1176 MIA_CHECKED : 0) | 1177 (((info->flags & PROMPT) != 0) ? MIA_FRAMED : 0); 1164 mi.afAttribute = (info->flags & ONCE ? MIA_CHECKED : 0) | 1165 (info->flags & PROMPT ? MIA_FRAMED : 0); 1178 1166 mi.afStyle = MIS_TEXT; 1179 1167 if (!(x % 24) && x && info->next) … … 1378 1366 PMINIRECORDCORE CurrentRecord(HWND hwndCnr) 1379 1367 { 1380 SHORT attrib = (fSelectedAlways)? CRA_SELECTED : CRA_CURSORED;1368 SHORT attrib = fSelectedAlways ? CRA_SELECTED : CRA_CURSORED; 1381 1369 PMINIRECORDCORE pmi; 1382 1370 … … 1390 1378 break; 1391 1379 } 1392 return ((INT) 1380 return ((INT)pmi == -1) ? NULL : pmi; 1393 1381 } 1394 1382 … … 1482 1470 list[0] = filename; 1483 1471 list[1] = NULL; 1484 ExecOnList(hwnd, viewer, WINDOWED | SEPARATE | 1485 ((fViewChild) ? CHILD : 0), NULL, list, NULL); 1472 ExecOnList(hwnd, viewer, 1473 WINDOWED | SEPARATE | (fViewChild ? CHILD : 0), 1474 NULL, list, NULL); 1486 1475 return; 1487 1476 } … … 1608 1597 SetConditionalCascade(DirMenu, IDM_EDITSUBMENU, IDM_ATTRS); 1609 1598 SetConditionalCascade(DirMenu, IDM_DELETESUBMENU, 1610 (fDefaultDeletePerm) ? IDM_PERMDELETE : 1611 IDM_DELETE); 1599 fDefaultDeletePerm ? IDM_PERMDELETE : IDM_DELETE); 1612 1600 SetConditionalCascade(DirMenu, IDM_MISCSUBMENU, IDM_SIZES); 1613 1601 SetConditionalCascade(DirMenu, IDM_OPENSUBMENU, IDM_OPENWINDOW); … … 1653 1641 SetConditionalCascade(FileMenu, IDM_COLLECTMENU, IDM_COLLECT); 1654 1642 SetConditionalCascade(FileMenu, IDM_DELETESUBMENU, 1655 (fDefaultDeletePerm) ? IDM_PERMDELETE : 1656 IDM_DELETE); 1643 fDefaultDeletePerm ? IDM_PERMDELETE : IDM_DELETE); 1657 1644 SetConditionalCascade(FileMenu, IDM_OPENSUBMENU, IDM_OPENDEFAULT); 1658 1645 SetConditionalCascade(FileMenu, IDM_OBJECTSUBMENU, IDM_SHADOW); … … 1699 1686 SetConditionalCascade(CollectorFileMenu, IDM_EDITSUBMENU, IDM_EDIT); 1700 1687 SetConditionalCascade(CollectorFileMenu, IDM_DELETESUBMENU, 1701 (fDefaultDeletePerm) ? IDM_PERMDELETE : 1702 IDM_DELETE); 1688 fDefaultDeletePerm ? IDM_PERMDELETE : IDM_DELETE); 1703 1689 SetConditionalCascade(CollectorFileMenu, IDM_OPENSUBMENU, 1704 1690 IDM_OPENDEFAULT); … … 1722 1708 SetConditionalCascade(CollectorDirMenu, IDM_EDITSUBMENU, IDM_ATTRS); 1723 1709 SetConditionalCascade(CollectorDirMenu, IDM_DELETESUBMENU, 1724 (fDefaultDeletePerm) ? IDM_PERMDELETE : 1725 IDM_DELETE); 1710 fDefaultDeletePerm ? IDM_PERMDELETE : IDM_DELETE); 1726 1711 SetConditionalCascade(CollectorDirMenu, IDM_MISCSUBMENU, IDM_SIZES); 1727 1712 SetConditionalCascade(CollectorDirMenu, IDM_OPENSUBMENU, … … 1895 1880 if (s) { 1896 1881 sprintf(s, "S:%s%s", 1897 (sortflags & SORT_REVERSE) ? "^" : NullStr, 1898 (sortflags & SORT_FIRSTEXTENSION) ? GetPString(IDS_FIRSTX) : 1899 (sortflags & SORT_LASTEXTENSION) ? GetPString(IDS_LASTX) : 1900 (sortflags & SORT_SIZE) ? "Size" : 1901 (sortflags & SORT_EASIZE) ? (archive == 1902 0) ? GetPString(IDS_EASIZE) : 1903 GetPString(IDS_CSIZE) : (sortflags & SORT_LWDATE) ? (archive 1904 == 1905 0) ? 1906 GetPString(IDS_LWDATE) : GetPString(IDS_DATE) : (sortflags & 1907 SORT_LADATE) 1908 ? GetPString(IDS_LADATE) : (sortflags & SORT_CRDATE) ? 1909 GetPString(IDS_CRDATE) : (sortflags & SORT_PATHNAME) ? 1910 GetPString(IDS_PATH) : (sortflags & SORT_NOSORT) ? 1911 GetPString(IDS_NONE) : (sortflags & SORT_SUBJECT) ? 1912 GetPString(IDS_SUBJ) : GetPString(IDS_NAME)); 1882 sortflags & SORT_REVERSE ? "^" : NullStr, 1883 (sortflags & SORT_FIRSTEXTENSION) ? 1884 GetPString(IDS_FIRSTX) : (sortflags & SORT_LASTEXTENSION) ? 1885 GetPString(IDS_LASTX) : (sortflags & SORT_SIZE) ? 1886 "Size" : (sortflags & SORT_EASIZE) ? 1887 (archive == 0) ? 1888 GetPString(IDS_EASIZE) : GetPString(IDS_CSIZE) : 1889 (sortflags & SORT_LWDATE) ? 1890 (archive == 0) ? 1891 GetPString(IDS_LWDATE) : GetPString(IDS_DATE) : 1892 (sortflags & SORT_LADATE) ? 1893 GetPString(IDS_LADATE) : (sortflags & SORT_CRDATE) ? 1894 GetPString(IDS_CRDATE) : 1895 (sortflags & SORT_PATHNAME) ? 1896 GetPString(IDS_PATH) : (sortflags & SORT_NOSORT) ? 1897 GetPString(IDS_NONE) : (sortflags & SORT_SUBJECT) ? 1898 GetPString(IDS_SUBJ) : GetPString(IDS_NAME)); 1913 1899 WinSetWindowText(hwnd, s); 1914 1900 free(s); … … 2049 2035 register INT i; 2050 2036 2051 hwndTopFrame = (hwndTop) ? WinQueryWindow(hwndTop, QW_PARENT) : (HWND)0;2037 hwndTopFrame = hwndTop ? WinQueryWindow(hwndTop, QW_PARENT) : (HWND)0; 2052 2038 /* Get the switch list information */ 2053 2039 x = 0; … … 2169 2155 return ret; 2170 2156 } 2157 2158 #pragma alloc_text(MAINWND5,SetSysMenu) 2159 #pragma alloc_text(MISC1,BoxWindow,PaintRecessedWindow,PostMsg,PaintSTextWindow,IsFm2Window) 2160 #pragma alloc_text(MISC1,FixSwitchList,FindDirCnr,CurrentRecord,SetShiftState,AddToListboxBottom) 2161 #pragma alloc_text(CNR_MISC1,AdjustCnrColVis,AdjustCnrColsForFSType) 2162 #pragma alloc_text(CNR_MISC1,AdjustCnrColsForPref,SetCnrCols) 2163 #pragma alloc_text(CNR_MISC2,CnrDirectEdit,OpenEdit) 2164 #pragma alloc_text(MISC2,SetMenuCheck,disable_menuitem,SetSortChecks) 2165 #pragma alloc_text(MISC2,SetDetailsSwitches,SetViewMenu) 2166 #pragma alloc_text(MISC3,SetupCommandMenu,AdjustDetailsSwitches) 2167 #pragma alloc_text(MISC3,ViewHelp,GetCmdSpec) 2168 #pragma alloc_text(MISC3,ExecFile,SetConditionalCascade,LoadDetailsSwitches) 2169 #pragma alloc_text(MISC4,PortholeInit,CheckMenu,Broadcast,SetupWinList,SwitchCommand) 2170 #pragma alloc_text(MISC6,DrawTargetEmphasis,EmphasizeButton) 2171 #pragma alloc_text(MISC_LIBPATH,LoadLibPath) 2172 #pragma alloc_text(MISC_SAY,SayView,SaySort,SayFilter) 2173
Note:
See TracChangeset
for help on using the changeset viewer.