Changeset 242
- Timestamp:
- Jan 19, 2003, 8:42:16 PM (23 years ago)
- Location:
- trunk
- Files:
-
- 4 added
- 24 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/helpers/apps.h
r223 r242 76 76 77 77 #ifdef INCL_WINPROGRAMLIST 78 // additional PROG_* flags for appQueryAppType 79 // #define PROG_XWP_DLL 998 // dynamic link library 80 // removed, PROG_DLL exists already 81 // V0.9.16 (2001-10-06) 82 83 #define PROG_WIN32 990 // added V0.9.16 (2001-12-08) [umoeller] 78 // moved extra PROG_* defs to exeh.h V1.0.1 (2003-01-17) [umoeller] 84 79 85 80 APIRET appQueryAppType(const char *pcszExecutable, 86 81 PULONG pulDosAppType, 87 82 PULONG pulWinAppType); 88 89 PCSZ appDescribeAppType(PROGCATEGORY progc);90 83 91 84 ULONG appIsWindowsApp(ULONG ulProgCategory); -
trunk/include/helpers/comctl.h
r233 r242 1195 1195 1196 1196 MRESULT ctlFormatExtFrame(HWND hwndFrame, 1197 PXFRAMECONTROLSpxfc,1197 const XFRAMECONTROLS *pxfc, 1198 1198 MPARAM mp1, 1199 1199 MPARAM mp2); 1200 1200 1201 VOID ctlCalcExtFrameRect(MPARAM mp1, 1202 MPARAM mp2, 1203 LONG lStatusBarHeight); 1201 MRESULT ctlCalcExtFrameRect(HWND hwndFrame, 1202 const XFRAMECONTROLS *pxfc, 1203 MPARAM mp1, 1204 MPARAM mp2); 1204 1205 1205 1206 HWND ctlCreateStatusBar(HWND hwndFrame, … … 1401 1402 typedef CTLMAKECOLORRECT *PCTLMAKECOLORRECT; 1402 1403 1404 /* ****************************************************************** 1405 * 1406 * Container control replacement 1407 * 1408 ********************************************************************/ 1409 1410 #define WC_CCTL_CNR "ComctlCnr" 1411 1412 MRESULT EXPENTRY fnwpCnr(HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2); 1413 1414 BOOL ctlRegisterXCnr(HAB hab); 1415 1416 1403 1417 #endif 1404 1418 -
trunk/include/helpers/exeh.h
r136 r242 7 7 * numbering. 8 8 * 9 *@@include #define INCL_WINPROGRAMLIST // for some funcs only 9 10 *@@include #include <os2.h> 10 11 *@@include #include "helpers\dosh.h" … … 231 232 typedef struct _LXHEADER 232 233 { 233 CHAR achLX[2];// 00: e32_magic "LX" or "LE" magic234 CHAR achLX[2]; // 00: e32_magic "LX" or "LE" magic 234 235 // this is "LX" for 32-bit OS/2 programs, but 235 236 // "LE" for MS-DOS progs which use this format … … 245 246 ULONG ulFlags; // 10: e32_mflags module flags 246 247 #ifndef E32NOTP // do not conflict with toolkit exe defs 247 #define E32NOTP 0x 8000L// Library Module - used as NENOTP248 #define E32NOLOAD 0x 2000L// Module not Loadable249 #define E32PMAPI 0x0 300L// Uses PM Windowing API250 #define E32PMW 0x0 200L// Compatible with PM Windowing251 #define E32NOPMW 0x0 100L// Incompatible with PM Windowing252 #define E32NOEXTFIX 0x00 20L// NO External Fixups in .EXE253 #define E32NOINTFIX 0x00 10L// NO Internal Fixups in .EXE254 #define E32SYSDLL 0x000 8L// System DLL, Internal Fixups discarded255 #define E32LIBINIT 0x000 4L// Per-Process Library Initialization248 #define E32NOTP 0x00008000L // Library Module - used as NENOTP 249 #define E32NOLOAD 0x00002000L // Module not Loadable 250 #define E32PMAPI 0x00000300L // Uses PM Windowing API 251 #define E32PMW 0x00000200L // Compatible with PM Windowing 252 #define E32NOPMW 0x00000100L // Incompatible with PM Windowing 253 #define E32NOEXTFIX 0x00000020L // NO External Fixups in .EXE 254 #define E32NOINTFIX 0x00000010L // NO Internal Fixups in .EXE 255 #define E32SYSDLL 0x00000008L // System DLL, Internal Fixups discarded 256 #define E32LIBINIT 0x00000004L // Per-Process Library Initialization 256 257 #define E32LIBTERM 0x40000000L // Per-Process Library Termination 257 #define E32APPMASK 0x0300L // Application Type Mask 258 259 #define E32APPMASK 0x00000300L // Application Type Mask 260 261 // hiword defs added V1.0.1 (2003-01-17) [umoeller] 262 #define E32PROTDLL 0x00010000L // Protected memory library module * 263 #define E32DEVICE 0x00020000L // Device driver * 264 #define E32MODEXE 0x00000000L // .EXE module * 265 #define E32MODDLL 0x00008000L // .DLL module * 266 #define E32MODPROTDLL 0x00018000L // Protected memory library module * 267 #define E32MODPDEV 0x00020000L // Physical device driver * 268 #define E32MODVDEV 0x00028000L // Virtual device driver * 269 #define E32MODMASK 0x00038000L // Module type mask * 270 #define E32NOTMPSAFE 0x00080000L // Process is multi-processor unsafe * 258 271 #endif 259 272 ULONG ulPageCount; // 14: e32_mpages no. of pages in module … … 1243 1256 APIRET exehQueryBldLevel(PEXECUTABLE pExec); 1244 1257 1258 #ifdef INCL_WINPROGRAMLIST 1259 1260 // additional PROG_* flags for exehQueryProgType; moved these here 1261 // from app.h V1.0.1 (2003-01-17) [umoeller] 1262 1263 // #define PROG_XWP_DLL 998 // dynamic link library 1264 // removed, PROG_DLL exists already 1265 // V0.9.16 (2001-10-06) 1266 1267 #define PROG_WIN32 990 // added V0.9.16 (2001-12-08) [umoeller] 1268 1269 APIRET exehQueryProgType(const EXECUTABLE *pExec, 1270 PROGCATEGORY *pulProgType); 1271 1272 PCSZ exehDescribeProgType(PROGCATEGORY progc); 1273 1274 #endif 1275 1245 1276 /* 1246 1277 *@@ FSYSMODULE: -
trunk/include/helpers/gpih.h
r232 r242 194 194 PCH pchString); 195 195 typedef GPIHCHARSTRINGPOSAT *PGPIHCHARSTRINGPOSAT; 196 197 VOID XWPENTRY gpihCalcTextExtent(HPS hps, 198 PCSZ pcsz, 199 PLONG pcx, 200 PULONG pcLines); 201 202 VOID XWPENTRY gpihDrawString(HPS hps, 203 PCSZ pcsz, 204 PRECTL prcl, 205 ULONG fl, 206 PFONTMETRICS pfm); 196 207 197 208 /* -
trunk/include/helpers/linklist.h
r174 r242 134 134 const char *function); 135 135 typedef PLINKLIST XWPENTRY LSTCREATEDEBUG(BOOL fItemsFreeable, 136 const char *file,137 unsigned long line,138 const char *function);136 const char *file, 137 unsigned long line, 138 const char *function); 139 139 typedef LSTCREATEDEBUG *PLSTCREATEDEBUG; 140 140 … … 199 199 unsigned long ulIndex); 200 200 typedef PLISTNODE XWPENTRY LSTINSERTITEMBEFORE(PLINKLIST pList, 201 void* pNewItemData,202 unsigned long ulIndex);201 void* pNewItemData, 202 unsigned long ulIndex); 203 203 typedef LSTINSERTITEMBEFORE *PLSTINSERTITEMBEFORE; 204 205 PLISTNODE XWPENTRY lstInsertItemAfterNode(PLINKLIST pList, 206 void* pNewItemData, 207 PLISTNODE pNodeInsertAfter); 208 typedef PLISTNODE XWPENTRY LSTINSERTITEMAFTERNODE(PLINKLIST pList, 209 void* pNewItemData, 210 PLISTNODE pNodeInsertAfter); 211 typedef LSTINSERTITEMAFTERNODE *PLSTINSERTITEMAFTERNODE; 204 212 205 213 BOOL XWPENTRY lstRemoveNode(PLINKLIST pList, PLISTNODE pRemoveNode); -
trunk/include/helpers/nls.h
r194 r242 90 90 } COUNTRYSETTINGS, *PCOUNTRYSETTINGS; 91 91 92 VOID XWPENTRY nlsQueryCountrySettings(PCOUNTRYSETTINGS pcs); 92 /* 93 *@@ COUNTRYAMPM: 94 * 95 *@@added V1.0.1 (2003-01-17) [umoeller] 96 */ 97 98 typedef struct _COUNTRYAMPM 99 { 100 CHAR sz2359[10], 101 sz1159[10]; 102 } COUNTRYAMPM, *PCOUNTRYAMPM; 103 104 /* 105 *@@ COUNTRYSETTINGS: 106 * second structure to finally get the AM/PM 107 * stuff right too. I suspect people have used 108 * this structure in XCenter DLLs and such so 109 * I cannot easily change it... hence a second 110 * one. 111 * 112 *@@changed V1.0.1 (2003-01-17) [umoeller] 113 */ 114 115 typedef struct _COUNTRYSETTINGS2 116 { 117 COUNTRYSETTINGS cs; 118 COUNTRYAMPM ampm; 119 } COUNTRYSETTINGS2, *PCOUNTRYSETTINGS2; 120 121 VOID XWPENTRY nlsQueryCountrySettings(PCOUNTRYSETTINGS2 pcs); 93 122 94 123 PSZ XWPENTRY nlsThousandsULong(PSZ pszTarget, ULONG ul, CHAR cThousands); … … 103 132 CHAR cThousands); 104 133 134 VOID XWPENTRY nlsDate(const COUNTRYSETTINGS2 *pcs2, 135 PSZ pszDate, 136 USHORT year, 137 BYTE month, 138 BYTE day); 139 140 VOID XWPENTRY nlsTime(const COUNTRYSETTINGS2 *pcs, 141 PSZ pszTime, 142 BYTE hours, 143 BYTE minutes, 144 BYTE seconds); 145 105 146 VOID XWPENTRY nlsFileDate(PSZ pszBuf, 106 FDATE *pfDate, 107 ULONG ulDateFormat, 108 CHAR cDateSep); 147 const FDATE *pfDate, 148 const COUNTRYSETTINGS2 *pcs); 109 149 110 150 VOID XWPENTRY nlsFileTime(PSZ pszBuf, 111 FTIME *pfTime, 112 ULONG ulTimeFormat, 113 CHAR cTimeSep); 151 const FTIME *pfTime, 152 const COUNTRYSETTINGS2 *pcs); 114 153 115 154 VOID XWPENTRY nlsDateTime(PSZ pszDate, 116 155 PSZ pszTime, 117 DATETIME *pDateTime,156 const DATETIME *pDateTime, 118 157 ULONG ulDateFormat, 119 158 CHAR cDateSep, … … 122 161 typedef VOID XWPENTRY NLSDATETIME(PSZ pszDate, 123 162 PSZ pszTime, 124 DATETIME *pDateTime,163 const DATETIME *pDateTime, 125 164 ULONG ulDateFormat, 126 165 CHAR cDateSep, … … 129 168 typedef NLSDATETIME *PNLSDATETIME; 130 169 131 ULONG nlsUpper(PSZ psz); 170 VOID XWPENTRY nlsDateTime2(PSZ pszDate, 171 PSZ pszTime, 172 const DATETIME *pDateTime, 173 const COUNTRYSETTINGS2 *pcs2); 174 typedef VOID XWPENTRY NLSDATETIME2(PSZ pszDate, 175 PSZ pszTime, 176 const DATETIME *pDateTime, 177 const COUNTRYSETTINGS2 *pcs2); 178 typedef NLSDATETIME2 *PNLSDATETIME2; 132 179 133 180 #endif 181 182 ULONG nlsUpper(PSZ psz); 134 183 135 184 #endif -
trunk/include/helpers/standards.h
r232 r242 126 126 #define STOREIFMAX(a, b) if ((a) > (b)) { b = a; } 127 127 128 #ifdef _PMPRINTF_ 129 #define PMPF_RECT(s, prect) _PmpfF(("%s: xLeft %d, xRight %d, yBottom %d, yTop %d", (s), (prect)->xLeft, (prect)->xRight, (prect)->yBottom, (prect)->yTop)) 130 #else 131 #define PMPF_RECT(s, prect) 132 #endif 133 128 134 #endif 129 135 -
trunk/include/helpers/winh.h
r239 r242 673 673 ********************************************************************/ 674 674 675 #define ID_VSCROLL 100 676 #define ID_HSCROLL 101 677 678 BOOL XWPENTRY winhCreateScrollBars(HWND hwndParent, 679 HWND *phwndV, 680 HWND *phwndH); 681 675 682 BOOL XWPENTRY winhUpdateScrollBar(HWND hwndScrollBar, 676 683 ULONG ulWinPels, … … 687 694 ULONG msg, 688 695 MPARAM mp2); 696 697 LONG XWPENTRY winhHandleScrollMsg2(HWND hwndScrollBar, 698 PLONG plCurPelsOfs, 699 LONG lWindowPels, 700 LONG lWorkareaPels, 701 USHORT usLineStepPels, 702 ULONG msg, 703 MPARAM mp2); 704 BOOL XWPENTRY winhScrollWindow(HWND hwnd2Scroll, 705 PRECTL prclClip, 706 PPOINTL pptlScroll); 689 707 690 708 BOOL XWPENTRY winhProcessScrollChars(HWND hwndClient, … … 951 969 ULONG ulID); 952 970 971 BOOL XWPENTRY winhSetParentAndOwner(HWND hwnd, 972 HWND hwndNewParent, 973 BOOL fRedraw); 974 953 975 VOID XWPENTRY winhRepaintWindows(HWND hwndParent); 954 976 -
trunk/src/helpers/_call_filedlg.c
r238 r242 13 13 #define INCL_WINBUTTONS 14 14 #define INCL_WINPOINTERS 15 #define INCL_WINSTDCNR 15 16 #define INCL_WINSTDFILE 16 17 … … 26 27 27 28 #include "helpers\call_file_dlg.c" 29 #include "helpers\cnrh.h" 28 30 #include "helpers\comctl.h" 29 31 #include "helpers\standards.h" … … 90 92 91 93 /* 92 *@@ fnwpClient:94 *@@ GROUPRECORD: 93 95 * 94 96 */ 95 97 96 MRESULT EXPENTRY fnwpClient(HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2) 98 typedef struct _GROUPRECORD 97 99 { 98 MRESULT mrc = 0; 99 100 switch (msg) 101 { 102 case WM_PAINT: 103 { 104 HPS hps; 105 RECTL rcl; 106 if (hps = WinBeginPaint(hwnd, NULLHANDLE, &rcl)) 107 { 108 gpihSwitchToRGB(hps); 109 WinFillRect(hps, &rcl, RGBCOL_DARKGRAY); 110 WinEndPaint(hps); 111 } 112 } 113 break; 114 115 default: 116 mrc = WinDefWindowProc(hwnd, msg, mp1, mp2); 117 } 118 119 return mrc; 120 } 100 RECORDCORE recc; 101 102 ULONG gid; 103 CHAR szGroupName[100]; // group name 104 PSZ pszMembers; 105 106 } GROUPRECORD, *PGROUPRECORD; 121 107 122 108 /* … … 217 203 | FCF_SHELLPOSITION 218 204 | FCF_TASKLIST, 219 XFCF_TOOLBAR | XFCF_FORCETBOWNER | XFCF_STATUSBAR,205 0, // XFCF_TOOLBAR | XFCF_FORCETBOWNER | XFCF_STATUSBAR, 220 206 WS_VISIBLE, // ulFrameStyle 221 207 "Test File Dialog", // pcszFrameTitle 222 208 0, // ulResourcesID 223 WC_CLIENT, // pcszClassClient 209 #if 1 210 WC_CCTL_CNR, 211 #else 212 WC_CONTAINER, 213 #endif 224 214 WS_VISIBLE, // flStyleClient 225 215 0, // ulID … … 248 238 ctlRegisterToolbar(hab); 249 239 ctlRegisterSeparatorLine(hab); 250 251 WinRegisterClass(hab, 252 (PSZ)WC_CLIENT, 253 fnwpClient, 254 0, 255 4); 240 ctlRegisterXCnr(hab); 256 241 257 242 sprintf(szOpen, … … 275 260 WinSetWindowText(hwndStatusBar, "Status bar"); 276 261 277 /* hwndMenu = WinCreateMenu(hwndFrame,278 NULL);279 280 hwndSubmenu = winhInsertSubmenu(hwndMenu,281 MIT_END,282 1,283 "~File",284 MIS_TEXT | MIS_SUBMENU,285 1000,286 "Open...",287 MIS_TEXT,288 0);289 290 winhInsertMenuItem(hwndSubmenu,291 MIT_END,292 SC_CLOSE,293 "~Quit",294 MIS_SYSCOMMAND | MIS_TEXT,295 0);296 */297 298 262 WinSendMsg(hwndFrame, WM_UPDATEFRAME, MPNULL, MPNULL); 263 264 { 265 XFIELDINFO xfi[4]; 266 PFIELDINFO pfi = NULL; 267 int i = 0; 268 PGROUPRECORD preccFirst; 269 270 // set up cnr details view 271 xfi[i].ulFieldOffset = FIELDOFFSET(GROUPRECORD, gid); 272 xfi[i].pszColumnTitle = "Group ID"; // @@todo localize 273 xfi[i].ulDataType = CFA_ULONG; 274 xfi[i++].ulOrientation = CFA_RIGHT; 275 276 xfi[i].ulFieldOffset = FIELDOFFSET(GROUPRECORD, recc.pszIcon); 277 xfi[i].pszColumnTitle = "Group name"; // @@todo localize 278 xfi[i].ulDataType = CFA_STRING; 279 xfi[i++].ulOrientation = CFA_CENTER; 280 281 xfi[i].ulFieldOffset = FIELDOFFSET(GROUPRECORD, pszMembers); 282 xfi[i].pszColumnTitle = "Members"; // @@todo localize 283 xfi[i].ulDataType = CFA_STRING; 284 xfi[i++].ulOrientation = CFA_LEFT; 285 286 pfi = cnrhSetFieldInfos(hwndClient, 287 xfi, 288 i, // array item count 289 TRUE, // draw lines 290 0); // return first column 291 292 BEGIN_CNRINFO() 293 { 294 cnrhSetView(CV_DETAIL | CA_DETAILSVIEWTITLES); 295 CnrInfo_.cyLineSpacing = 10; 296 ulSendFlags_ |= CMA_LINESPACING; 297 } END_CNRINFO(hwndClient); 298 299 #define RECORD_COUNT 200 300 301 if (preccFirst = (PGROUPRECORD)cnrhAllocRecords(hwndClient, 302 sizeof(GROUPRECORD), 303 RECORD_COUNT)) 304 { 305 PGROUPRECORD preccThis = preccFirst; 306 ULONG ul = 0; 307 while (preccThis) 308 { 309 preccThis->gid = ul++; 310 sprintf(preccThis->szGroupName, "group %d", preccThis->gid); 311 preccThis->recc.pszIcon = preccThis->szGroupName; 312 313 preccThis->pszMembers = "longer string than title"; 314 315 preccThis = (PGROUPRECORD)preccThis->recc.preccNextRecord; 316 } 317 318 cnrhInsertRecords(hwndClient, 319 NULL, 320 (PRECORDCORE)preccFirst, 321 TRUE, 322 NULL, 323 CRA_RECORDREADONLY, 324 RECORD_COUNT); 325 } 326 } 299 327 300 328 while (WinGetMsg(hab, &qmsg, NULLHANDLE, 0, 0)) -
trunk/src/helpers/_test_exeh.c
r209 r242 17 17 18 18 #define INCL_KBD 19 #define INCL_WINPROGRAMLIST // needed for PROGDETAILS, wppgm.h 19 20 #include <os2.h> 20 21 … … 48 49 if (!(arc = exehOpen(argv[1], &pExe))) 49 50 { 51 APIRET arc2; 52 ULONG progt; 53 54 printf("exeh: dumping base info of \"%s\"\n", argv[1]); 55 printf(" cbDosExeHeader %d\n", pExe->cbDosExeHeader); 56 printf(" ulExeFormat %d (%s)\n", 57 pExe->ulExeFormat, 58 (pExe->ulExeFormat == EXEFORMAT_OLDDOS) ? "EXEFORMAT_OLDDOS" 59 : (pExe->ulExeFormat == EXEFORMAT_NE) ? "EXEFORMAT_NE" 60 : (pExe->ulExeFormat == EXEFORMAT_PE) ? "EXEFORMAT_PE" 61 : (pExe->ulExeFormat == EXEFORMAT_LX) ? "EXEFORMAT_LX" 62 : (pExe->ulExeFormat == EXEFORMAT_TEXT_BATCH) ? "EXEFORMAT_TEXT_BATCH" 63 : (pExe->ulExeFormat == EXEFORMAT_TEXT_CMD) ? "EXEFORMAT_TEXT_CMD" 64 : (pExe->ulExeFormat == EXEFORMAT_COM) ? "EXEFORMAT_COM" 65 : "unknown" 66 ); 67 if (pExe->pLXHeader) 68 printf(" LX flags: 0x%lX\n", pExe->pLXHeader->ulFlags); 69 else if (pExe->pNEHeader) 70 printf(" NE flags: 0x%lX\n", pExe->pNEHeader->usFlags); 71 printf(" fLibrary %d\n", pExe->fLibrary); 72 printf(" f32Bits %d\n", pExe->f32Bits); 73 if (!(arc2 = exehQueryProgType(pExe, &progt))) 74 printf(" progtype: %d (%s)\n", progt, exehDescribeProgType(progt)); 75 else 76 printf(" exehQueryProgType returned %d\n", arc2); 77 printf("exeh: dumping bldlevel of \"%s\"\n", argv[1]); 78 50 79 if (!(arc = exehQueryBldLevel(pExe))) 51 80 { 52 81 #define STRINGORNA(p) ((pExe->p) ? (pExe->p) : "n/a") 53 82 54 printf("exeh: dumping bldlevel of \"%s\"\n", argv[1]);55 83 printf(" Description: \"%s\"\n", STRINGORNA(pszDescription)); 56 84 printf(" Vendor: \"%s\"\n", STRINGORNA(pszVendor)); -
trunk/src/helpers/apps.c
r229 r242 52 52 #include "helpers\dosh.h" 53 53 #include "helpers\except.h" // exception handling 54 #include "helpers\exeh.h" 54 55 #include "helpers\prfh.h" 55 56 #include "helpers\standards.h" // some standard macros … … 676 677 677 678 /* 678 *@@ PROGTYPESTRING:679 *680 *@@added V0.9.16 (2002-01-13) [umoeller]681 */682 683 typedef struct _PROGTYPESTRING684 {685 PROGCATEGORY progc;686 PCSZ pcsz;687 } PROGTYPESTRING, *PPROGTYPESTRING;688 689 PROGTYPESTRING G_aProgTypes[] =690 {691 PROG_DEFAULT, "PROG_DEFAULT",692 PROG_FULLSCREEN, "PROG_FULLSCREEN",693 PROG_WINDOWABLEVIO, "PROG_WINDOWABLEVIO",694 PROG_PM, "PROG_PM",695 PROG_GROUP, "PROG_GROUP",696 PROG_VDM, "PROG_VDM",697 // same as PROG_REAL, "PROG_REAL",698 PROG_WINDOWEDVDM, "PROG_WINDOWEDVDM",699 PROG_DLL, "PROG_DLL",700 PROG_PDD, "PROG_PDD",701 PROG_VDD, "PROG_VDD",702 PROG_WINDOW_REAL, "PROG_WINDOW_REAL",703 PROG_30_STD, "PROG_30_STD",704 // same as PROG_WINDOW_PROT, "PROG_WINDOW_PROT",705 PROG_WINDOW_AUTO, "PROG_WINDOW_AUTO",706 PROG_30_STDSEAMLESSVDM, "PROG_30_STDSEAMLESSVDM",707 // same as PROG_SEAMLESSVDM, "PROG_SEAMLESSVDM",708 PROG_30_STDSEAMLESSCOMMON, "PROG_30_STDSEAMLESSCOMMON",709 // same as PROG_SEAMLESSCOMMON, "PROG_SEAMLESSCOMMON",710 PROG_31_STDSEAMLESSVDM, "PROG_31_STDSEAMLESSVDM",711 PROG_31_STDSEAMLESSCOMMON, "PROG_31_STDSEAMLESSCOMMON",712 PROG_31_ENHSEAMLESSVDM, "PROG_31_ENHSEAMLESSVDM",713 PROG_31_ENHSEAMLESSCOMMON, "PROG_31_ENHSEAMLESSCOMMON",714 PROG_31_ENH, "PROG_31_ENH",715 PROG_31_STD, "PROG_31_STD",716 717 // Warp 4 toolkit defines, whatever these were designed for...718 #ifndef PROG_DOS_GAME719 #define PROG_DOS_GAME (PROGCATEGORY)21720 #endif721 #ifndef PROG_WIN_GAME722 #define PROG_WIN_GAME (PROGCATEGORY)22723 #endif724 #ifndef PROG_DOS_MODE725 #define PROG_DOS_MODE (PROGCATEGORY)23726 #endif727 728 PROG_DOS_GAME, "PROG_DOS_GAME",729 PROG_WIN_GAME, "PROG_WIN_GAME",730 PROG_DOS_MODE, "PROG_DOS_MODE",731 732 // added this V0.9.16 (2001-12-08) [umoeller]733 PROG_WIN32, "PROG_WIN32"734 };735 736 /*737 *@@ appDescribeAppType:738 * returns a "PROG_*" string for the given739 * program type. Useful for WPProgram setup740 * strings and such.741 *742 *@@added V0.9.16 (2001-10-06)743 */744 745 PCSZ appDescribeAppType(PROGCATEGORY progc) // in: from PROGDETAILS.progc746 {747 ULONG ul;748 for (ul = 0;749 ul < ARRAYITEMCOUNT(G_aProgTypes);750 ul++)751 {752 if (G_aProgTypes[ul].progc == progc)753 return G_aProgTypes[ul].pcsz;754 }755 756 return NULL;757 }758 759 /*760 679 *@@ appIsWindowsApp: 761 680 * checks the specified program category -
trunk/src/helpers/cctl_toolbar.c
r233 r242 354 354 } 355 355 356 static const SYSCOLORSET scsToolbarButton =356 static const SYSCOLORSET G_scsToolbarButton = 357 357 { 358 358 TRUE, // inherit presparams 359 359 360 SYSCLR_BUTTONMIDDLE, 360 361 SYSCLR_MENUTEXT … … 444 445 &pData->bd.dwd, 445 446 WinDefWindowProc, 446 & scsToolbarButton);447 &G_scsToolbarButton); 447 448 448 449 if ( (pcszText) … … 850 851 ********************************************************************/ 851 852 852 static const SYSCOLORSET scsToolbar =853 static const SYSCOLORSET G_scsToolbar = 853 854 { 854 855 TRUE, // inherit presparams … … 1020 1021 PP_BACKGROUNDCOLORINDEX, 1021 1022 FALSE, 1022 scsToolbar.lBackIndex);1023 G_scsToolbar.lBackIndex); 1023 1024 winhStorePresParam(&ppp, 1024 1025 PP_BACKGROUNDCOLOR, … … 1030 1031 PP_FOREGROUNDCOLORINDEX, 1031 1032 FALSE, 1032 scsToolbar.lForeIndex);1033 G_scsToolbar.lForeIndex); 1033 1034 winhStorePresParam(&ppp, 1034 1035 PP_FOREGROUNDCOLOR, … … 1111 1112 &pData->dwd, 1112 1113 WinDefWindowProc, 1113 & scsToolbar);1114 &G_scsToolbar); 1114 1115 1115 1116 pData->hwndControlsOwner = ptbcd->hwndControlsOwner; -
trunk/src/helpers/cctl_xframe.c
r233 r242 82 82 83 83 MRESULT ctlFormatExtFrame(HWND hwndFrame, 84 PXFRAMECONTROLSpxfc,84 const XFRAMECONTROLS *pxfc, 85 85 MPARAM mp1, 86 86 MPARAM mp2) … … 209 209 */ 210 210 211 VOID ctlCalcExtFrameRect(MPARAM mp1, 212 MPARAM mp2, 213 LONG lStatusBarHeight) 211 MRESULT ctlCalcExtFrameRect(HWND hwndFrame, 212 const XFRAMECONTROLS *pxfc, 213 MPARAM mp1, 214 MPARAM mp2) 214 215 { 215 216 PRECTL prclPassed = (PRECTL)mp1; 217 218 MRESULT mrc = pxfc->pfnwpOrig(hwndFrame, WM_CALCFRAMERECT, mp1, mp2); 216 219 217 220 if (mp2) … … 220 223 // call default window procedure to subtract child frame 221 224 // controls from the rectangle's height 222 LONG lClientHeight; 223 224 // position the static text frame extension below the client 225 lClientHeight = prclPassed->yTop - prclPassed->yBottom; 226 if (lStatusBarHeight > lClientHeight) 227 // extension is taller than client, so set client height to 0 228 prclPassed->yTop = prclPassed->yBottom; 229 else 230 { 231 // set the origin of the client and shrink it based upon the 232 // static text control's height 233 prclPassed->yBottom += lStatusBarHeight; 234 prclPassed->yTop -= lStatusBarHeight; 235 } 225 226 if (pxfc->hwndToolBar) 227 prclPassed->yTop -= pxfc->lToolBarHeight; 228 229 if (pxfc->hwndStatusBar) 230 prclPassed->yBottom += pxfc->lStatusBarHeight; 236 231 } 237 232 else … … 242 237 // set the origin of the frame and increase it based upon the 243 238 // static text control's height 244 prclPassed->yBottom -= lStatusBarHeight; 245 prclPassed->yTop += lStatusBarHeight; 239 240 if (pxfc->hwndToolBar) 241 prclPassed->yTop += pxfc->lToolBarHeight; 242 243 if (pxfc->hwndStatusBar) 244 prclPassed->yBottom -= pxfc->lStatusBarHeight; 246 245 } 246 247 return mrc; 247 248 } 248 249 … … 289 290 290 291 case WM_CALCFRAMERECT: 291 mrc = pData->xfc.pfnwpOrig(hwndFrame, msg, mp1, mp2);292 293 292 // we have a status bar: calculate its rectangle 294 ctlCalcExtFrameRect(mp1, 295 mp2, 296 STATUS_BAR_HEIGHT); 293 mrc = ctlCalcExtFrameRect(hwndFrame, 294 &pData->xfc, 295 mp1, 296 mp2); 297 297 break; 298 299 /* 300 case WM_WINDOWPOSCHANGED: 301 WinSendMsg(hwndFrame, WM_UPDATEFRAME, 0, 0); 302 break; */ 298 303 299 304 case WM_SYSCOMMAND: -
trunk/src/helpers/cnrh.c
r232 r242 168 168 BOOL fDrawLines) // in: if TRUE, we'll draw lines around the columns 169 169 { 170 PFIELDINFO p Info;170 PFIELDINFO pfi; 171 171 if ( (ppFieldInfo2) 172 && (p Info= *ppFieldInfo2)172 && (pfi = *ppFieldInfo2) 173 173 ) 174 174 { … … 177 177 flData |= CFA_HORZSEPARATOR | CFA_SEPARATOR; 178 178 179 p Info->cb = sizeof(FIELDINFO);180 p Info->flData = flData;181 p Info->flTitle = CFA_FITITLEREADONLY | ulOrientation;182 p Info->offStruct = ulFieldOffset;183 p Info->pTitleData = pszColumnTitle; // strdup removed, V0.9.1 (99-12-18) [umoeller]184 p Info->pUserData = NULL;185 p Info->cxWidth = 0;186 *ppFieldInfo2 = p Info->pNextFieldInfo;179 pfi->cb = sizeof(FIELDINFO); 180 pfi->flData = flData; 181 pfi->flTitle = CFA_FITITLEREADONLY | ulOrientation; 182 pfi->offStruct = ulFieldOffset; 183 pfi->pTitleData = pszColumnTitle; // strdup removed, V0.9.1 (99-12-18) [umoeller] 184 pfi->pUserData = NULL; 185 pfi->cxWidth = 0; 186 *ppFieldInfo2 = pfi->pNextFieldInfo; 187 187 } 188 188 } … … 342 342 343 343 // insert field infos 344 if ( cnrhInsertFieldInfos(hwndCnr,345 pFieldInfoFirst,346 ulFieldCount) == 0)344 if (!cnrhInsertFieldInfos(hwndCnr, 345 pFieldInfoFirst, 346 ulFieldCount)) 347 347 pFieldInfoReturn = NULL; 348 348 } -
trunk/src/helpers/comctl.c
r238 r242 248 248 case WM_ENABLE: 249 249 WinInvalidateRect(pdwd->hwnd, NULL, TRUE); 250 break; 251 252 case WM_WINDOWPOSCHANGED: 253 if (((PSWP)mp1)->fl & SWP_SIZE) 254 { 255 pdwd->szlWin.cx = ((PSWP)mp1)->cx; 256 pdwd->szlWin.cy = ((PSWP)mp1)->cy; 257 } 250 258 break; 251 259 -
trunk/src/helpers/exeh.c
r240 r242 45 45 #define INCL_DOSDEVIOCTL 46 46 #define INCL_DOSERRORS 47 48 #define INCL_WINPROGRAMLIST 47 49 #include <os2.h> 48 50 … … 835 837 { 836 838 APIRET arc = NO_ERROR; 839 PXFILE pFile; 840 ULONG ulNRNTOfs = 0; 837 841 838 842 if (!pExec) 839 arc = ERROR_INVALID_PARAMETER; 843 return ERROR_INVALID_PARAMETER; 844 845 pFile = pExec->pFile; 846 if (pExec->ulExeFormat == EXEFORMAT_LX) 847 { 848 // OK, LX format: 849 // check if we have a non-resident name table 850 if (pExec->pLXHeader == NULL) 851 arc = ERROR_INVALID_DATA; 852 else if (pExec->pLXHeader->ulNonResdNameTblOfs == 0) 853 arc = ERROR_INVALID_DATA; 854 else 855 ulNRNTOfs = pExec->pLXHeader->ulNonResdNameTblOfs; 856 } 857 else if (pExec->ulExeFormat == EXEFORMAT_NE) 858 { 859 // OK, NE format: 860 // check if we have a non-resident name table 861 if (pExec->pNEHeader == NULL) 862 arc = ERROR_INVALID_DATA; 863 else if (pExec->pNEHeader->ulNonResdTblOfs == 0) 864 arc = ERROR_INVALID_DATA; 865 else 866 ulNRNTOfs = pExec->pNEHeader->ulNonResdTblOfs; 867 } 840 868 else 869 // neither LX nor NE: stop 870 arc = ERROR_INVALID_EXE_SIGNATURE; 871 872 if ( (!arc) 873 && (ulNRNTOfs) 874 ) 841 875 { 842 PXFILE pFile = pExec->pFile; 843 844 ULONG ulNRNTOfs = 0; 845 846 if (pExec->ulExeFormat == EXEFORMAT_LX) 876 ULONG cb = 2000; 877 878 PSZ pszNameTable; 879 880 if (!(pszNameTable = (PSZ)malloc(2001))) 881 arc = ERROR_NOT_ENOUGH_MEMORY; 882 else 847 883 { 848 // OK, LX format: 849 // check if we have a non-resident name table 850 if (pExec->pLXHeader == NULL) 851 arc = ERROR_INVALID_DATA; 852 else if (pExec->pLXHeader->ulNonResdNameTblOfs == 0) 853 arc = ERROR_INVALID_DATA; 854 else 855 ulNRNTOfs = pExec->pLXHeader->ulNonResdNameTblOfs; 856 } 857 else if (pExec->ulExeFormat == EXEFORMAT_NE) 858 { 859 // OK, NE format: 860 // check if we have a non-resident name table 861 if (pExec->pNEHeader == NULL) 862 arc = ERROR_INVALID_DATA; 863 else if (pExec->pNEHeader->ulNonResdTblOfs == 0) 864 arc = ERROR_INVALID_DATA; 865 else 866 ulNRNTOfs = pExec->pNEHeader->ulNonResdTblOfs; 867 } 868 else 869 // neither LX nor NE: stop 870 arc = ERROR_INVALID_EXE_SIGNATURE; 871 872 if ( (!arc) 873 && (ulNRNTOfs) 874 ) 875 { 876 ULONG cb = 2000; 877 878 PSZ pszNameTable; 879 880 if (!(pszNameTable = (PSZ)malloc(2001))) 881 arc = ERROR_NOT_ENOUGH_MEMORY; 882 else 884 // V0.9.16 (2002-01-05) [umoeller]: rewrote the following 885 886 // read from offset of non-resident name table 887 if (!(arc = doshReadAt(pFile, // file is still open 888 ulNRNTOfs, // ofs determined above 889 &cb, // 2000 890 pszNameTable, 891 0))) 883 892 { 884 // V0.9.16 (2002-01-05) [umoeller]: rewrote the following 885 886 // read from offset of non-resident name table 887 if (!(arc = doshReadAt(pFile, // file is still open 888 ulNRNTOfs, // ofs determined above 889 &cb, // 2000 890 pszNameTable, 891 0))) 892 { 893 // the string is in Pascal format, so the 894 // first byte has the length 895 BYTE bLen; 896 if (!(bLen = *pszNameTable)) 897 // length byte is null: 898 arc = ERROR_INVALID_DATA; 893 // the string is in Pascal format, so the 894 // first byte has the length 895 BYTE bLen; 896 if (!(bLen = *pszNameTable)) 897 // length byte is null: 898 arc = ERROR_INVALID_DATA; 899 else 900 { 901 // now copy the string 902 if (!(pExec->pszDescription = (PSZ)malloc(bLen + 1))) 903 arc = ERROR_NOT_ENOUGH_MEMORY; 899 904 else 900 905 { 901 // now copy the string 902 if (!(pExec->pszDescription = (PSZ)malloc(bLen + 1))) 903 arc = ERROR_NOT_ENOUGH_MEMORY; 904 else 905 { 906 memcpy(pExec->pszDescription, 907 pszNameTable + 1, // skip length byte 908 bLen); // length byte 909 // terminate string 910 pExec->pszDescription[bLen] = 0; 911 912 ParseBldLevel(pExec); 913 } 906 memcpy(pExec->pszDescription, 907 pszNameTable + 1, // skip length byte 908 bLen); // length byte 909 // terminate string 910 pExec->pszDescription[bLen] = 0; 911 912 ParseBldLevel(pExec); 914 913 } 915 914 } 916 917 free(pszNameTable);918 915 } 916 917 free(pszNameTable); 919 918 } 920 } // end if (!pExec)919 } 921 920 922 921 return arc; 922 } 923 924 /* 925 *@@ exehQueryProgType: 926 * attempts to sets *pulProgType to a PROGTYPE constant. 927 * 928 * Returns: 929 * 930 * -- NO_ERROR 931 * 932 * -- ERROR_INVALID_PARAMETER; 933 * 934 *@@added V1.0.1 (2003-01-17) [umoeller] 935 *@@changed V1.0.1 (2003-01-17) [umoeller]: now correctly returning PROG_PDD/VDD for NE and LX @@fixes 343 936 */ 937 938 APIRET exehQueryProgType(const EXECUTABLE *pExec, 939 PROGCATEGORY *pulProgType) 940 { 941 APIRET arc = NO_ERROR; 942 943 if (!pExec) 944 return ERROR_INVALID_PARAMETER; 945 946 // now we have the PEXECUTABLE: 947 // check what we found 948 switch (pExec->ulOS) 949 { 950 case EXEOS_DOS3: 951 case EXEOS_DOS4: 952 *pulProgType = PROG_WINDOWEDVDM; 953 break; 954 955 case EXEOS_OS2: 956 switch (pExec->ulExeFormat) 957 { 958 case EXEFORMAT_LX: 959 switch (pExec->pLXHeader->ulFlags & E32MODMASK) 960 { 961 case E32MODPDEV: 962 *pulProgType = PROG_PDD; 963 break; 964 965 case E32MODVDEV: 966 *pulProgType = PROG_VDD; 967 break; 968 969 case E32MODDLL: 970 case E32MODPROTDLL: 971 *pulProgType = PROG_DLL; 972 break; 973 974 default: 975 // all bits clear: --> real executable 976 switch (pExec->pLXHeader->ulFlags & E32APPMASK) 977 { 978 case E32PMAPI: 979 // _Pmpf((" LX OS2 PM")); 980 *pulProgType = PROG_PM; 981 break; 982 983 case E32PMW: 984 // _Pmpf((" LX OS2 VIO")); 985 *pulProgType = PROG_WINDOWABLEVIO; 986 break; 987 988 case E32NOPMW: 989 // _Pmpf((" LX OS2 FULLSCREEN")); 990 *pulProgType = PROG_FULLSCREEN; 991 break; 992 993 default: 994 // _Pmpf((" LX OS2 FULLSCREEN")); 995 *pulProgType = PROG_FULLSCREEN; 996 break; 997 } 998 break; // executable 999 } 1000 break; 1001 1002 case EXEFORMAT_NE: 1003 if (pExec->fLibrary) 1004 { 1005 // there is no flag in the NE header for whether 1006 // this is a device driver, so rely on extension 1007 // V1.0.1 (2003-01-17) [umoeller] 1008 PSZ p; 1009 if ( (p = doshGetExtension(pExec->pFile->pszFilename)) 1010 && ( (!stricmp(p, "ADD")) 1011 || (!stricmp(p, "DMD")) 1012 || (!stricmp(p, "FLT")) 1013 || (!stricmp(p, "IFS")) 1014 || (!stricmp(p, "SNP")) 1015 || (!stricmp(p, "SYS")) 1016 ) 1017 ) 1018 *pulProgType = PROG_PDD; 1019 // there can be no 16-bit VDDs, so this must be a PDD 1020 else 1021 *pulProgType = PROG_DLL; 1022 } 1023 else switch (pExec->pNEHeader->usFlags & NEAPPTYP) 1024 { 1025 case NEWINCOMPAT: 1026 // _Pmpf((" NE OS2 VIO")); 1027 *pulProgType = PROG_WINDOWABLEVIO; 1028 break; 1029 1030 case NEWINAPI: 1031 // _Pmpf((" NE OS2 PM")); 1032 *pulProgType = PROG_PM; 1033 break; 1034 1035 case NENOTWINCOMPAT: 1036 default: 1037 // _Pmpf((" NE OS2 FULLSCREEN")); 1038 *pulProgType = PROG_FULLSCREEN; 1039 break; 1040 } 1041 break; 1042 1043 case EXEFORMAT_COM: 1044 *pulProgType = PROG_WINDOWABLEVIO; 1045 break; 1046 1047 default: 1048 arc = ERROR_INVALID_EXE_SIGNATURE; 1049 } 1050 break; 1051 1052 case EXEOS_WIN16: 1053 case EXEOS_WIN386: 1054 // _Pmpf((" WIN16")); 1055 *pulProgType = PROG_31_ENHSEAMLESSCOMMON; 1056 break; 1057 1058 case EXEOS_WIN32_GUI: 1059 case EXEOS_WIN32_CLI: 1060 // _Pmpf((" WIN32")); 1061 *pulProgType = PROG_WIN32; 1062 break; 1063 1064 default: 1065 arc = ERROR_INVALID_EXE_SIGNATURE; 1066 } 1067 1068 return arc; 1069 } 1070 1071 /* 1072 *@@ PROGTYPESTRING: 1073 * 1074 *@@added V0.9.16 (2002-01-13) [umoeller] 1075 */ 1076 1077 typedef struct _PROGTYPESTRING 1078 { 1079 PROGCATEGORY progc; 1080 PCSZ pcsz; 1081 } PROGTYPESTRING, *PPROGTYPESTRING; 1082 1083 PROGTYPESTRING G_aProgTypes[] = 1084 { 1085 PROG_DEFAULT, "PROG_DEFAULT", 1086 PROG_FULLSCREEN, "PROG_FULLSCREEN", 1087 PROG_WINDOWABLEVIO, "PROG_WINDOWABLEVIO", 1088 PROG_PM, "PROG_PM", 1089 PROG_GROUP, "PROG_GROUP", 1090 PROG_VDM, "PROG_VDM", 1091 // same as PROG_REAL, "PROG_REAL", 1092 PROG_WINDOWEDVDM, "PROG_WINDOWEDVDM", 1093 PROG_DLL, "PROG_DLL", 1094 PROG_PDD, "PROG_PDD", 1095 PROG_VDD, "PROG_VDD", 1096 PROG_WINDOW_REAL, "PROG_WINDOW_REAL", 1097 PROG_30_STD, "PROG_30_STD", 1098 // same as PROG_WINDOW_PROT, "PROG_WINDOW_PROT", 1099 PROG_WINDOW_AUTO, "PROG_WINDOW_AUTO", 1100 PROG_30_STDSEAMLESSVDM, "PROG_30_STDSEAMLESSVDM", 1101 // same as PROG_SEAMLESSVDM, "PROG_SEAMLESSVDM", 1102 PROG_30_STDSEAMLESSCOMMON, "PROG_30_STDSEAMLESSCOMMON", 1103 // same as PROG_SEAMLESSCOMMON, "PROG_SEAMLESSCOMMON", 1104 PROG_31_STDSEAMLESSVDM, "PROG_31_STDSEAMLESSVDM", 1105 PROG_31_STDSEAMLESSCOMMON, "PROG_31_STDSEAMLESSCOMMON", 1106 PROG_31_ENHSEAMLESSVDM, "PROG_31_ENHSEAMLESSVDM", 1107 PROG_31_ENHSEAMLESSCOMMON, "PROG_31_ENHSEAMLESSCOMMON", 1108 PROG_31_ENH, "PROG_31_ENH", 1109 PROG_31_STD, "PROG_31_STD", 1110 1111 // Warp 4 toolkit defines, whatever these were designed for... 1112 #ifndef PROG_DOS_GAME 1113 #define PROG_DOS_GAME (PROGCATEGORY)21 1114 #endif 1115 #ifndef PROG_WIN_GAME 1116 #define PROG_WIN_GAME (PROGCATEGORY)22 1117 #endif 1118 #ifndef PROG_DOS_MODE 1119 #define PROG_DOS_MODE (PROGCATEGORY)23 1120 #endif 1121 1122 PROG_DOS_GAME, "PROG_DOS_GAME", 1123 PROG_WIN_GAME, "PROG_WIN_GAME", 1124 PROG_DOS_MODE, "PROG_DOS_MODE", 1125 1126 // added this V0.9.16 (2001-12-08) [umoeller] 1127 PROG_WIN32, "PROG_WIN32" 1128 }; 1129 1130 /* 1131 *@@ exehDescribeProgType: 1132 * returns a "PROG_*" string for the given 1133 * program type. Useful for WPProgram setup 1134 * strings and such. 1135 * 1136 *@@added V0.9.16 (2001-10-06) 1137 *@@changed V1.0.1 (2003-01-17) [umoeller]: moved this here from apps.c 1138 */ 1139 1140 PCSZ exehDescribeProgType(PROGCATEGORY progc) // in: from PROGDETAILS.progc 1141 { 1142 ULONG ul; 1143 for (ul = 0; 1144 ul < ARRAYITEMCOUNT(G_aProgTypes); 1145 ul++) 1146 { 1147 if (G_aProgTypes[ul].progc == progc) 1148 return G_aProgTypes[ul].pcsz; 1149 } 1150 1151 return NULL; 923 1152 } 924 1153 -
trunk/src/helpers/gpih.c
r240 r242 61 61 #endif 62 62 #include "helpers\dosh.h" 63 #include "helpers\gpih.h" 63 64 #include "helpers\winh.h" 64 #include "helpers\ gpih.h"65 #include "helpers\stringh.h" 65 66 66 67 #pragma hdrstop … … 459 460 */ 460 461 461 VOID gpihDrawThickFrame(HPS hps, 462 PRECTL prcl, 463 ULONG ulWidth) 462 VOID gpihDrawThickFrame(HPS hps, // in: presentation space for output 463 PRECTL prcl, // in: rectangle to draw (inclusive) 464 ULONG ulWidth) // in: line width (>= 1) 464 465 { 465 466 ULONG ul = 0; … … 506 507 */ 507 508 508 VOID gpihDraw3DFrame2(HPS hps, 509 PRECTL prcl, // in: rectangle (inclusive)510 USHORT usWidth, // in: line width (>= 1)511 LONG lColorLeft, // in: color to use for left and top; e.g. SYSCLR_BUTTONLIGHT512 LONG lColorRight) // in: color to use for right and bottom; e.g. SYSCLR_BUTTONDARK509 VOID gpihDraw3DFrame2(HPS hps, // in: presentation space for output 510 PRECTL prcl, // in: rectangle (inclusive) 511 USHORT usWidth, // in: line width (>= 1) 512 LONG lColorLeft, // in: color to use for left and top; e.g. SYSCLR_BUTTONLIGHT 513 LONG lColorRight) // in: color to use for right and bottom; e.g. SYSCLR_BUTTONDARK 513 514 { 514 515 USHORT us; … … 553 554 */ 554 555 555 VOID gpihDraw3DFrame(HPS hps, 556 VOID gpihDraw3DFrame(HPS hps, // in: presentation space for output 556 557 PRECTL prcl, // in: rectangle (inclusive) 557 558 USHORT usWidth, // in: line width (>= 1) … … 576 577 */ 577 578 578 LONG gpihCharStringPosAt(HPS hps, 579 LONG gpihCharStringPosAt(HPS hps, // in: presentation space for output 579 580 PPOINTL pptlStart, 580 581 PRECTL prclRect, … … 628 629 629 630 /* 631 *@@ gpihCalcTextExtent: 632 * 633 *@@added V1.0.1 (2003-01-17) [umoeller] 634 */ 635 636 VOID gpihCalcTextExtent(HPS hps, // in: presentation space for output 637 PCSZ pcsz, // in: string to test 638 PLONG pcx, // out: max width occupied by a line in the string 639 PULONG pcLines) // out: no. of lines 640 { 641 LONG cxLineThis; 642 PCSZ pThis = pcsz; 643 *pcx = 0; 644 645 *pcLines = 0; 646 647 if (!pThis) 648 return; 649 650 while (*pThis) 651 { 652 ULONG lenThis; 653 PCSZ pNext = strhFindEOL(pThis, &lenThis); 654 655 ++(*pcLines); 656 657 if (lenThis) 658 { 659 POINTL aptl[TXTBOX_COUNT]; 660 GpiQueryTextBox(hps, 661 lenThis, 662 (PCH)pThis, 663 TXTBOX_COUNT, 664 aptl); 665 666 cxLineThis = aptl[TXTBOX_TOPRIGHT].x - aptl[TXTBOX_BOTTOMLEFT].x; 667 668 if (cxLineThis > *pcx) 669 *pcx = cxLineThis; 670 } 671 672 if (*pNext == '\r') 673 pNext++; 674 pThis = pNext; 675 } 676 } 677 678 /* 679 *@@ gpihDrawString: 680 * replacement for WinDrawText that can still align 681 * properly with multi-line strings. 682 * 683 * fl works as with WinDrawText, that is: 684 * 685 * -- specify one of DT_LEFT, DT_CENTER, DT_RIGHT; 686 * 687 * -- specifiy one of DT_TOP, DT_VCENTER, DT_BOTTOM. 688 * 689 * The alignment definitions are: 690 * 691 * -- DT_LEFT 0x00000000 692 * -- DT_CENTER 0x00000100 693 * -- DT_RIGHT 0x00000200 694 * -- DT_TOP 0x00000000 695 * -- DT_VCENTER 0x00000400 696 * -- DT_BOTTOM 0x00000800 697 * 698 * Other flags: 699 * 700 * -- DT_QUERYEXTENT 0x00000002 (not supported) 701 * -- DT_UNDERSCORE 0x00000010 (not supported) 702 * -- DT_STRIKEOUT 0x00000020 (not supported) 703 * -- DT_TEXTATTRS 0x00000040 (always enabled) 704 * -- DT_EXTERNALLEADING 0x00000080 (not supported) 705 * -- DT_HALFTONE 0x00001000 (not supported) 706 * -- DT_MNEMONIC 0x00002000 (not supported) 707 * -- DT_WORDBREAK 0x00004000 (always enabled) 708 * -- DT_ERASERECT 0x00008000 (not supported) 709 * 710 *@@added V1.0.1 (2003-01-17) [umoeller] 711 */ 712 713 VOID gpihDrawString(HPS hps, // in: presentation space for output 714 PCSZ pcsz, // in: string to test 715 PRECTL prcl, // in: clipping rectangle (inclusive!) 716 ULONG fl, // in: alignment flags 717 PFONTMETRICS pfm) 718 { 719 PCSZ pThis = pcsz; 720 POINTL ptlRun, 721 ptlUse; 722 LONG cxRect, 723 cyRect, 724 cyString; 725 726 if (!pThis || !prcl || !pfm) 727 return; 728 729 ptlRun.x = prcl->xLeft; 730 ptlRun.y = prcl->yTop; 731 732 cxRect = prcl->xRight - prcl->xLeft + 1; 733 cyRect = prcl->yTop - prcl->yBottom + 1; 734 735 // vertical alignment: 736 if (fl & (DT_VCENTER | DT_BOTTOM)) 737 { 738 ULONG cLines = strhCount(pcsz, '\n') + 1; 739 cyString = cLines * (pfm->lMaxBaselineExt + pfm->lExternalLeading); 740 741 if (fl & DT_VCENTER) 742 ptlRun.y += (cyRect - cyString) / 2; 743 else 744 ptlRun.y += cyRect - cyString; 745 } 746 747 while (*pThis) 748 { 749 ULONG lenThis; 750 PCSZ pNext = strhFindEOL(pThis, &lenThis); 751 752 ptlRun.y -= pfm->lMaxBaselineExt; 753 754 if (lenThis) 755 { 756 // horizontal alignment: 757 if (!(fl & (DT_CENTER | DT_RIGHT))) 758 ptlUse.x = ptlRun.x; 759 else 760 { 761 POINTL aptl[TXTBOX_COUNT]; 762 LONG cxString; 763 GpiQueryTextBox(hps, 764 lenThis, 765 (PCH)pThis, 766 TXTBOX_COUNT, 767 aptl); 768 769 cxString = aptl[TXTBOX_TOPRIGHT].x - aptl[TXTBOX_BOTTOMLEFT].x; 770 771 if (fl & DT_CENTER) 772 ptlUse.x = ptlRun.x + (cxRect - cxString) / 2; 773 else 774 // right 775 ptlUse.x = ptlRun.x + cxRect - cxString; 776 } 777 778 ptlUse.y = ptlRun.y + pfm->lMaxDescender; 779 780 GpiCharStringPosAt(hps, 781 &ptlUse, 782 prcl, 783 CHS_CLIP, 784 lenThis, 785 (PCH)pThis, 786 NULL); 787 } 788 789 ptlRun.y -= pfm->lExternalLeading; 790 791 if (*pNext == '\r') 792 pNext++; 793 pThis = pNext; 794 } 795 } 796 797 /* 630 798 *@@ gpihFillBackground: 631 799 * fills the specified rectangle in the way … … 647 815 */ 648 816 649 VOID gpihFillBackground(HPS hps, // in: PS to paint into817 VOID gpihFillBackground(HPS hps, // in: presentation space for output 650 818 PRECTL prcl, // in: rectangle (inclusive!) 651 819 PBKGNDINFO pInfo) // in: background into … … 818 986 */ 819 987 820 BOOL gpihMatchFont(HPS hps, 821 LONG lSize, // in: font point size822 BOOL fFamily, // in: if TRUE, pszName specifies font family;823 // if FALSE, pszName specifies font face824 const char *pcszName, // in: font family or face name (without point size)825 USHORT usFormat, // in: none, one or several of:826 // -- FATTR_SEL_ITALIC827 // -- FATTR_SEL_UNDERSCORE (underline)828 // -- FATTR_SEL_BOLD829 // -- FATTR_SEL_STRIKEOUT830 // -- FATTR_SEL_OUTLINE (hollow)831 FATTRS *pfa, // out: font attributes if found988 BOOL gpihMatchFont(HPS hps, // in: presentation space for output 989 LONG lSize, // in: font point size 990 BOOL fFamily, // in: if TRUE, pszName specifies font family; 991 // if FALSE, pszName specifies font face 992 const char *pcszName, // in: font family or face name (without point size) 993 USHORT usFormat, // in: none, one or several of: 994 // -- FATTR_SEL_ITALIC 995 // -- FATTR_SEL_UNDERSCORE (underline) 996 // -- FATTR_SEL_BOLD 997 // -- FATTR_SEL_STRIKEOUT 998 // -- FATTR_SEL_OUTLINE (hollow) 999 FATTRS *pfa, // out: font attributes if found 832 1000 PFONTMETRICS pFontMetrics) // out: font metrics of created font (optional) 833 1001 { … … 1130 1298 */ 1131 1299 1132 LONG gpihQueryNextFontID(HPS hps) 1300 LONG gpihQueryNextFontID(HPS hps) // in: presentation space for output 1133 1301 { 1134 1302 LONG lcidNext = -1; … … 1228 1396 */ 1229 1397 1230 LONG gpihCreateFont(HPS hps, 1398 LONG gpihCreateFont(HPS hps, // in: presentation space for output 1231 1399 FATTRS *pfa) 1232 1400 { … … 1404 1572 */ 1405 1573 1406 LONG gpihFindFont(HPS hps, // in: HPS for font selection1574 LONG gpihFindFont(HPS hps, // in: presentation space for output 1407 1575 LONG lSize, // in: font point size 1408 1576 BOOL fFamily, // in: if TRUE, pszName specifies font family; … … 1595 1763 */ 1596 1764 1597 LONG gpihQueryLineSpacing(HPS hps) 1765 LONG gpihQueryLineSpacing(HPS hps) // in: presentation space for output 1598 1766 { 1599 1767 FONTMETRICS fm; -
trunk/src/helpers/helpers_pre.in
r232 r242 86 86 $(OUTPUTDIR)\cctl_chart.obj\ 87 87 $(OUTPUTDIR)\cctl_checkcnr.obj\ 88 $(OUTPUTDIR)\cctl_cnr.obj\ 89 $(OUTPUTDIR)\cctl_cnr_dtls.obj\ 88 90 $(OUTPUTDIR)\cctl_combo.obj\ 89 91 $(OUTPUTDIR)\cctl_progbar.obj\ -
trunk/src/helpers/linklist.c
r238 r242 675 675 676 676 /* 677 *@@ InsertFront: 678 * 679 *@@added V1.0.1 (2003-01-17) [umoeller] 680 */ 681 682 VOID InsertFront(PLINKLIST pList, 683 PLISTNODE pNewNode) 684 { 685 if (pList->pFirst) 686 pList->pFirst->pPrevious = pNewNode; 687 688 pNewNode->pNext = pList->pFirst; 689 pNewNode->pPrevious = NULL; 690 691 pList->pFirst = pNewNode; 692 693 if (!pList->pLast) 694 // the list was empty: 695 pList->pLast = pNewNode; // V0.9.14 (2001-07-14) [umoeller] 696 697 (pList->ulCount)++; 698 } 699 700 /* 701 *@@ InsertAfterNode: 702 * 703 *@@added V1.0.1 (2003-01-17) [umoeller] 704 */ 705 706 VOID InsertAfterNode(PLINKLIST pList, 707 PLISTNODE pNewNode, 708 PLISTNODE pNodeInsertAfter) 709 { 710 // 1) set pointers for new node 711 pNewNode->pPrevious = pNodeInsertAfter; 712 pNewNode->pNext = pNodeInsertAfter->pNext; 713 714 // 2) adjust next item 715 // so that it points to the new node 716 if (pNodeInsertAfter->pNext) 717 pNodeInsertAfter->pNext->pPrevious = pNewNode; 718 719 // 3) adjust previous item 720 // so that it points to the new node 721 pNodeInsertAfter->pNext = pNewNode; 722 723 // 4) adjust last item, if necessary 724 if (pList->pLast == pNodeInsertAfter) 725 pList->pLast = pNewNode; 726 727 (pList->ulCount)++; 728 } 729 730 /* 677 731 *@@ lstInsertItemBefore: 678 732 * this inserts a new node to the list. As opposed to … … 699 753 700 754 PLISTNODE lstInsertItemBefore(PLINKLIST pList, 701 void* pNewItemData, //data to store in list node702 unsigned long ulIndex) 755 void* pNewItemData, // in: data to store in list node 756 unsigned long ulIndex) // in: index before which to insert 703 757 { 704 758 PLISTNODE pNewNode = NULL; … … 715 769 { 716 770 // insert at beginning: 717 if (pList->pFirst) 718 pList->pFirst->pPrevious = pNewNode; 719 720 pNewNode->pNext = pList->pFirst; 721 pNewNode->pPrevious = NULL; 722 723 pList->pFirst = pNewNode; 724 725 if (!pList->pLast) 726 // the list was empty: 727 pList->pLast = pNewNode; // V0.9.14 (2001-07-14) [umoeller] 728 729 (pList->ulCount)++; 771 InsertFront(pList, 772 pNewNode); 730 773 } 731 774 else … … 735 778 736 779 if (pNodeInsertAfter = lstNodeFromIndex(pList, 737 (ulIndex - 1)))780 ulIndex - 1)) 738 781 { 739 // 1) set pointers for new node 740 pNewNode->pPrevious = pNodeInsertAfter; 741 pNewNode->pNext = pNodeInsertAfter->pNext; 742 743 // 2) adjust next item 744 // so that it points to the new node 745 if (pNodeInsertAfter->pNext) 746 pNodeInsertAfter->pNext->pPrevious = pNewNode; 747 748 // 3) adjust previous item 749 // so that it points to the new node 750 pNodeInsertAfter->pNext = pNewNode; 751 752 // 4) adjust last item, if necessary 753 if (pList->pLast == pNodeInsertAfter) 754 pList->pLast = pNewNode; 755 756 (pList->ulCount)++; 782 InsertAfterNode(pList, 783 pNewNode, 784 pNodeInsertAfter); 757 785 } 758 786 else … … 763 791 } 764 792 } 793 } 794 795 return pNewNode; 796 } 797 798 /* 799 *@@ lstInsertItemAfterNode: 800 * this inserts a new node to the list. As opposed to 801 * lstAppendItem, the new node can be appended anywhere 802 * in the list, that is, it will be appended AFTER 803 * the given existing list node. 804 * 805 * If pNodeAfter is NULL, the new item will be made the 806 * first item. 807 * 808 * As opposed to lstInsertItemBefore, this does not 809 * need to traverse the list, so it is very quick. 810 * 811 * This returns the LISTNODE of the new list item, 812 * or NULL upon errors. 813 * 814 *@@added V1.0.1 (2003-01-17) [umoeller] 815 */ 816 817 PLISTNODE lstInsertItemAfterNode(PLINKLIST pList, 818 void* pNewItemData, // in: data to store in list node 819 PLISTNODE pNodeInsertAfter) // in: node to insert after or NULL to make new node the first 820 { 821 PLISTNODE pNewNode = NULL; 822 823 if ( (pList) 824 && (pList->ulMagic == LINKLISTMAGIC) 825 && (pNewNode = (PLISTNODE)malloc(sizeof(LISTNODE))) 826 ) 827 { 828 memset(pNewNode, 0, sizeof(LISTNODE)); 829 pNewNode->pItemData = pNewItemData; 830 831 if (!pNodeInsertAfter) 832 // insert at beginning: 833 InsertFront(pList, 834 pNewNode); 835 else 836 InsertAfterNode(pList, 837 pNewNode, 838 pNodeInsertAfter); 765 839 } 766 840 -
trunk/src/helpers/makefile
r232 r242 234 234 $(TESTCASE_DIR)\datetime.obj \ 235 235 $(TESTCASE_DIR)\tree.obj \ 236 $(TESTCASE_DIR)\gpih.obj 236 $(TESTCASE_DIR)\gpih.obj \ 237 $(TESTCASE_DIR)\prfh.obj \ 238 $(TESTCASE_DIR)\nls.obj \ 239 $(TESTCASE_DIR)\nlscache.obj 237 240 238 241 $(TESTCASE_DIR)\dialog.obj: ..\..\include\helpers\dialog.h … … 264 267 FDLG_TEST_OBJS = \ 265 268 $(TESTCASE_DIR)\comctl.obj \ 269 $(TESTCASE_DIR)\cctl_cnr.obj \ 270 $(TESTCASE_DIR)\cctl_cnr_dtls.obj \ 266 271 $(TESTCASE_DIR)\cctl_toolbar.obj \ 267 272 $(TESTCASE_DIR)\cctl_tooltip.obj \ 268 273 $(TESTCASE_DIR)\cctl_xframe.obj \ 274 $(TESTCASE_DIR)\cnrh.obj \ 269 275 $(TESTCASE_DIR)\dosh.obj \ 270 276 $(TESTCASE_DIR)\gpih.obj \ … … 273 279 $(TESTCASE_DIR)\stringh.obj \ 274 280 $(TESTCASE_DIR)\xstring.obj \ 281 $(TESTCASE_DIR)\prfh.obj \ 282 $(TESTCASE_DIR)\tree.obj \ 283 $(TESTCASE_DIR)\nls.obj \ 284 $(TESTCASE_DIR)\nlscache.obj \ 275 285 $(TESTCASE_DIR)\_call_filedlg.obj 276 286 -
trunk/src/helpers/nls.c
r222 r242 349 349 350 350 /* 351 *@@ nlsGetAMPM: 352 * 353 *@@added V1.0.1 (2003-01-17) [umoeller] 354 */ 355 356 VOID nlsGetAMPM(PCOUNTRYAMPM pampm) 357 { 358 PrfQueryProfileString(HINI_USER, 359 "PM_National", 360 "s2359", // key 361 "PM", // default 362 pampm->sz2359, 363 sizeof(pampm->sz2359)); 364 365 PrfQueryProfileString(HINI_USER, 366 "PM_National", 367 "s1159", // key 368 "AM", // default 369 pampm->sz1159, 370 sizeof(pampm->sz1159)); 371 } 372 373 /* 351 374 *@@ nlsQueryCountrySettings: 352 375 * this returns the most frequently used country settings … … 369 392 */ 370 393 371 VOID nlsQueryCountrySettings(PCOUNTRYSETTINGS pcs) 372 { 373 if (pcs) 374 { 394 VOID nlsQueryCountrySettings(PCOUNTRYSETTINGS2 pcs2) 395 { 396 if (pcs2) 397 { 398 PCOUNTRYSETTINGS pcs = &pcs2->cs; 375 399 pcs->ulDateFormat = PrfQueryProfileInt(HINI_USER, 376 400 (PSZ)PMINIAPP_NATIONAL, … … 397 421 "sThousand", 398 422 ','); 423 424 nlsGetAMPM(&pcs2->ampm); 399 425 } 400 426 } … … 424 450 CHAR cThousands) // in: separator char (e.g. '.') 425 451 { 426 USHORT ust, uss, usc; 427 CHAR szTemp[40]; 428 usc = sprintf(szTemp, "%lu", ul); // V0.9.20 (2002-07-03) [umoeller] 429 430 ust = 0; 431 // usc = strlen(szTemp); 432 for (uss = 0; uss < usc; uss++) 452 CHAR szTemp[30]; 453 USHORT ust = 0, 454 uss, 455 usLen = sprintf(szTemp, "%lu", ul); // V0.9.20 (2002-07-03) [umoeller] 456 457 for (uss = 0; 458 uss < usLen; 459 ++uss) 433 460 { 434 461 if (uss) 435 if ( ((usc - uss) % 3) == 0)462 if (0 == ((usLen - uss) % 3)) 436 463 { 437 464 pszTarget[ust] = cThousands; 438 465 ust++; 439 466 } 440 pszTarget[ust] = szTemp[uss]; 441 ust++; 442 } 467 468 pszTarget[ust++] = szTemp[uss]; 469 } 470 443 471 pszTarget[ust] = '\0'; 444 472 … … 473 501 CHAR cThousands) 474 502 { 475 USHORT ust, uss, us c;503 USHORT ust, uss, usLen; 476 504 CHAR szTemp[40]; 477 us c= sprintf(szTemp, "%.0f", floor(dbl)); // V0.9.20 (2002-07-03) [umoeller]505 usLen = sprintf(szTemp, "%.0f", floor(dbl)); // V0.9.20 (2002-07-03) [umoeller] 478 506 479 507 ust = 0; 480 // usc = strlen(szTemp); 481 for (uss = 0; uss < usc; uss++) 508 for (uss = 0; uss < usLen; uss++) 482 509 { 483 510 if (uss) 484 if (((us c- uss) % 3) == 0)511 if (((usLen - uss) % 3) == 0) 485 512 { 486 513 pszTarget[ust] = cThousands; … … 547 574 * 548 575 *@@changed V0.9.0 (99-11-07) [umoeller]: now calling nlsDateTime 549 */ 550 551 VOID nlsFileDate(PSZ pszBuf, // out: string returned 552 FDATE *pfDate, // in: date information 553 ULONG ulDateFormat, // in: date format (0-3) 554 CHAR cDateSep) // in: date separator (e.g. '.') 555 { 556 DATETIME dt; 557 dt.day = pfDate->day; 558 dt.month = pfDate->month; 559 dt.year = pfDate->year + 1980; 560 561 nlsDateTime(pszBuf, 562 NULL, // no time 563 &dt, 564 ulDateFormat, 565 cDateSep, 566 0, 0); // no time 576 *@@changed V1.0.1 (2003-01-17) [umoeller]: prototype changed for optimization, this was not exported 577 */ 578 579 VOID nlsFileDate(PSZ pszBuf, // out: string returned 580 const FDATE *pfDate, // in: date information 581 const COUNTRYSETTINGS2 *pcs) 582 { 583 nlsDate(pcs, 584 pszBuf, 585 pfDate->year + 1980, 586 pfDate->month, 587 pfDate->day); 567 588 } 568 589 … … 590 611 *@@changed V0.8.5 (99-03-15) [umoeller]: fixed 12-hour crash 591 612 *@@changed V0.9.0 (99-11-07) [umoeller]: now calling nlsDateTime 613 *@@changed V1.0.1 (2003-01-17) [umoeller]: prototype changed for optimization, this was not exported 592 614 */ 593 615 594 616 VOID nlsFileTime(PSZ pszBuf, // out: string returned 595 FTIME *pfTime, // in: time information 596 ULONG ulTimeFormat, // in: 24-hour time format (0 or 1) 597 CHAR cTimeSep) // in: time separator (e.g. ':') 598 { 599 DATETIME dt; 600 dt.hours = pfTime->hours; 601 dt.minutes = pfTime->minutes; 602 dt.seconds = pfTime->twosecs * 2; 603 604 nlsDateTime(NULL, // no date 605 pszBuf, 606 &dt, 607 0, 0, // no date 608 ulTimeFormat, 609 cTimeSep); 617 const FTIME *pfTime, // in: time information 618 const COUNTRYSETTINGS2 *pcs) 619 { 620 nlsTime(pcs, 621 pszBuf, 622 pfTime->hours, 623 pfTime->minutes, 624 pfTime->twosecs * 2); 625 } 626 627 /* 628 *@@ nlsDate: 629 * 630 *@@added V1.0.1 (2003-01-17) [umoeller] 631 */ 632 633 VOID nlsDate(const COUNTRYSETTINGS2 *pcs2, 634 PSZ pszDate, // out: date string returned 635 USHORT year, 636 BYTE month, 637 BYTE day) 638 { 639 switch (pcs2->cs.ulDateFormat) 640 { 641 case 0: // mm.dd.yyyy (English) 642 sprintf(pszDate, "%02d%c%02d%c%04d", 643 month, 644 pcs2->cs.cDateSep, 645 day, 646 pcs2->cs.cDateSep, 647 year); 648 break; 649 650 case 1: // dd.mm.yyyy (e.g. German) 651 sprintf(pszDate, "%02d%c%02d%c%04d", 652 day, 653 pcs2->cs.cDateSep, 654 month, 655 pcs2->cs.cDateSep, 656 year); 657 break; 658 659 case 2: // yyyy.mm.dd (Japanese) 660 sprintf(pszDate, "%04d%c%02d%c%02d", 661 year, 662 pcs2->cs.cDateSep, 663 month, 664 pcs2->cs.cDateSep, 665 day); 666 break; 667 668 default: // yyyy.dd.mm 669 sprintf(pszDate, "%04d%c%02d%c%02d", 670 year, 671 pcs2->cs.cDateSep, 672 day, 673 pcs2->cs.cDateSep, 674 month); 675 break; 676 } 677 } 678 679 /* 680 *@@ nlsTime: 681 * 682 *@@added V1.0.1 (2003-01-17) [umoeller] 683 */ 684 685 VOID nlsTime(const COUNTRYSETTINGS2 *pcs2, 686 PSZ pszTime, // out: time string returned 687 BYTE hours, 688 BYTE minutes, 689 BYTE seconds) 690 { 691 if (!pcs2->cs.ulTimeFormat) 692 { 693 // for 12-hour clock, we need additional INI data 694 if (hours >= 12) // V0.9.16 (2001-12-05) [pr] if (hours > 12) 695 { 696 // yeah cool Paul, now we get 00:20 PM if it's 20 past noon 697 // V0.9.18 (2002-02-13) [umoeller] 698 ULONG ulHours; 699 if (!(ulHours = hours % 12)) 700 ulHours = 12; 701 702 // >= 12h: PM. 703 sprintf(pszTime, "%02d%c%02d%c%02d %s", 704 // leave 12 == 12 (not 0) 705 ulHours, 706 pcs2->cs.cTimeSep, 707 minutes, 708 pcs2->cs.cTimeSep, 709 seconds, 710 pcs2->ampm.sz2359); 711 } 712 else 713 { 714 // < 12h: AM 715 sprintf(pszTime, "%02d%c%02d%c%02d %s", 716 hours, 717 pcs2->cs.cTimeSep, 718 minutes, 719 pcs2->cs.cTimeSep, 720 seconds, 721 pcs2->ampm.sz1159); 722 } 723 } 724 else 725 // 24-hour clock 726 sprintf(pszTime, "%02d%c%02d%c%02d", 727 hours, 728 pcs2->cs.cTimeSep, 729 minutes, 730 pcs2->cs.cTimeSep, 731 seconds); 610 732 } 611 733 … … 616 738 * for more detailed parameter descriptions. 617 739 * 740 * Use of this function is deprecated. Use the 741 * speedier nlsDateTime2 instead. 742 * 618 743 *@@added V0.9.0 (99-11-07) [umoeller] 619 744 *@@changed V0.9.16 (2001-12-05) [pr]: fixed AM/PM hour bug 620 745 *@@changed V0.9.18 (2002-02-13) [umoeller]: fixed AM/PM hour bug fix 746 *@@changed V1.0.1 (2003-01-17) [umoeller]: extracted nlsDate, nlsTime 621 747 */ 622 748 623 749 VOID nlsDateTime(PSZ pszDate, // out: date string returned (can be NULL) 624 750 PSZ pszTime, // out: time string returned (can be NULL) 625 DATETIME *pDateTime, // in: date/time information751 const DATETIME *pDateTime, // in: date/time information 626 752 ULONG ulDateFormat, // in: date format (0-3); see nlsFileDate 627 753 CHAR cDateSep, // in: date separator (e.g. '.') … … 629 755 CHAR cTimeSep) // in: time separator (e.g. ':') 630 756 { 757 COUNTRYSETTINGS2 cs2; 631 758 if (pszDate) 632 759 { 633 switch (ulDateFormat) 634 { 635 case 0: // mm.dd.yyyy (English) 636 sprintf(pszDate, "%02d%c%02d%c%04d", 637 pDateTime->month, 638 cDateSep, 639 pDateTime->day, 640 cDateSep, 641 pDateTime->year); 642 break; 643 644 case 1: // dd.mm.yyyy (e.g. German) 645 sprintf(pszDate, "%02d%c%02d%c%04d", 646 pDateTime->day, 647 cDateSep, 648 pDateTime->month, 649 cDateSep, 650 pDateTime->year); 651 break; 652 653 case 2: // yyyy.mm.dd (Japanese) 654 sprintf(pszDate, "%04d%c%02d%c%02d", 655 pDateTime->year, 656 cDateSep, 657 pDateTime->month, 658 cDateSep, 659 pDateTime->day); 660 break; 661 662 default: // yyyy.dd.mm 663 sprintf(pszDate, "%04d%c%02d%c%02d", 664 pDateTime->year, 665 cDateSep, 666 pDateTime->day, 667 cDateSep, 668 pDateTime->month); 669 break; 670 } 760 cs2.cs.ulDateFormat = ulDateFormat; 761 cs2.cs.cDateSep = cDateSep; 762 nlsDate(&cs2, 763 pszDate, // out: date string returned 764 pDateTime->year, 765 pDateTime->month, 766 pDateTime->day); 671 767 } 672 768 673 769 if (pszTime) 674 770 { 675 if (ulTimeFormat == 0) 676 { 677 // for 12-hour clock, we need additional INI data 678 CHAR szAMPM[10] = "err"; 679 680 if (pDateTime->hours >= 12) // V0.9.16 (2001-12-05) [pr] if (pDateTime->hours > 12) 681 { 682 // yeah cool Paul, now we get 00:20 PM if it's 20 past noon 683 // V0.9.18 (2002-02-13) [umoeller] 684 ULONG ulHours; 685 if (!(ulHours = pDateTime->hours % 12)) 686 ulHours = 12; 687 688 // >= 12h: PM. 689 PrfQueryProfileString(HINI_USER, 690 "PM_National", 691 "s2359", // key 692 "PM", // default 693 szAMPM, sizeof(szAMPM)-1); 694 sprintf(pszTime, "%02d%c%02d%c%02d %s", 695 // leave 12 == 12 (not 0) 696 ulHours, 697 cTimeSep, 698 pDateTime->minutes, 699 cTimeSep, 700 pDateTime->seconds, 701 szAMPM); 702 } 703 else 704 { 705 // < 12h: AM 706 PrfQueryProfileString(HINI_USER, 707 "PM_National", 708 "s1159", // key 709 "AM", // default 710 szAMPM, sizeof(szAMPM)-1); 711 sprintf(pszTime, "%02d%c%02d%c%02d %s", 712 pDateTime->hours, 713 cTimeSep, 714 pDateTime->minutes, 715 cTimeSep, 716 pDateTime->seconds, 717 szAMPM); 718 } 719 } 720 else 721 // 24-hour clock 722 sprintf(pszTime, "%02d%c%02d%c%02d", 723 pDateTime->hours, 724 cTimeSep, 725 pDateTime->minutes, 726 cTimeSep, 727 pDateTime->seconds); 771 cs2.cs.ulTimeFormat = ulTimeFormat; 772 cs2.cs.cTimeSep = cTimeSep; 773 nlsGetAMPM(&cs2.ampm); 774 nlsTime(&cs2, 775 pszTime, 776 pDateTime->hours, 777 pDateTime->minutes, 778 pDateTime->seconds); 728 779 } 729 780 } … … 752 803 } 753 804 805 /* 806 *@@ nlsDateTime2: 807 * speedier version of nlsDateTime that caches 808 * all information and needs _no_ Prf* call 809 * any more. 810 * 811 *@@added V1.0.1 (2003-01-17) [umoeller] 812 */ 813 814 VOID nlsDateTime2(PSZ pszDate, 815 PSZ pszTime, 816 const DATETIME *pDateTime, 817 const COUNTRYSETTINGS2 *pcs2) 818 { 819 if (pszDate) 820 nlsDate(pcs2, 821 pszDate, 822 pDateTime->year, 823 pDateTime->month, 824 pDateTime->day); 825 826 if (pszTime) 827 nlsTime(pcs2, 828 pszTime, 829 pDateTime->hours, 830 pDateTime->minutes, 831 pDateTime->seconds); 832 } 833 754 834 CHAR G_szUpperMap[257]; 755 835 BOOL G_fUpperMapInited = FALSE; -
trunk/src/helpers/stringh.c
r240 r242 456 456 CHAR c) 457 457 { 458 P SZ p = (PSZ)pszSearch;459 ULONG 458 PCSZ p = pszSearch; 459 ULONG ulCount = 0; 460 460 while (TRUE) 461 461 { 462 p = strchr(p, c); 463 if (p) 464 { 465 ulCount++; 466 p++; 467 } 468 else 469 break; 470 } 471 return ulCount; 462 if (!(p = strchr(p, c))) 463 return ulCount; 464 465 ulCount++; 466 p++; 467 } 472 468 } 473 469 -
trunk/src/helpers/textview.c
r229 r242 1890 1890 1891 1891 } TEXTVIEWWINDATA, *PTEXTVIEWWINDATA; 1892 1893 #define ID_VSCROLL 1001894 #define ID_HSCROLL 1011895 1892 1896 1893 /* … … 2327 2324 // can be NULL 2328 2325 PCREATESTRUCT pcs = (PCREATESTRUCT)mp2; 2329 SBCDATA sbcd;2330 2326 2331 2327 MRESULT mrc = (MRESULT)TRUE; // error … … 2383 2379 ptxvd->rclViewReal.yTop = pcs->cy; 2384 2380 2385 sbcd.cb = sizeof(SBCDATA); 2386 sbcd.sHilite = 0; 2387 sbcd.posFirst = 0; 2388 sbcd.posLast = 100; 2389 sbcd.posThumb = 30; 2390 sbcd.cVisible = 50; 2391 sbcd.cTotal = 50; 2392 2393 ptxvd->hwndVScroll = WinCreateWindow(hwndTextView, 2394 WC_SCROLLBAR, 2395 "", 2396 SBS_VERT | SBS_THUMBSIZE | WS_VISIBLE, 2397 10, 10, 2398 20, 100, 2399 hwndTextView, // owner 2400 HWND_TOP, 2401 ID_VSCROLL, 2402 &sbcd, 2403 0); 2381 winhCreateScrollBars(hwndTextView, 2382 &ptxvd->hwndVScroll, 2383 &ptxvd->hwndHScroll); 2384 2404 2385 fShow = ((ptxvd->flStyle & XS_VSCROLL) != 0); 2405 2386 WinShowWindow(ptxvd->hwndVScroll, fShow); 2406 2387 ptxvd->fVScrollVisible = fShow; 2407 2388 2408 ptxvd->hwndHScroll = WinCreateWindow(hwndTextView,2409 WC_SCROLLBAR,2410 "",2411 SBS_THUMBSIZE | WS_VISIBLE,2412 10, 10,2413 20, 100,2414 hwndTextView, // owner2415 HWND_TOP,2416 ID_HSCROLL,2417 &sbcd,2418 0);2419 2389 fShow = ((ptxvd->flStyle & XS_HSCROLL) != 0); 2420 2390 WinShowWindow(ptxvd->hwndHScroll, fShow); -
trunk/src/helpers/winh.c
r239 r242 1896 1896 1897 1897 /* 1898 *@@ winhCreateScrollBars: 1899 * creates two scroll bars with an arbitrary 1900 * position for later use with winhUpdateScrollBar. 1901 * 1902 *@@added V1.0.1 (2003-01-17) [umoeller] 1903 */ 1904 1905 BOOL winhCreateScrollBars(HWND hwndParent, 1906 HWND *phwndV, // out: vertical scroll bar 1907 HWND *phwndH) // out: horizontal scroll bar 1908 { 1909 SBCDATA sbcd; 1910 sbcd.cb = sizeof(SBCDATA); 1911 sbcd.sHilite = 0; 1912 sbcd.posFirst = 0; 1913 sbcd.posLast = 100; 1914 sbcd.posThumb = 30; 1915 sbcd.cVisible = 50; 1916 sbcd.cTotal = 50; 1917 1918 return ( (*phwndV = WinCreateWindow(hwndParent, 1919 WC_SCROLLBAR, 1920 "", 1921 SBS_VERT | SBS_THUMBSIZE | WS_VISIBLE, 1922 10, 10, 1923 20, 100, 1924 hwndParent, // owner 1925 HWND_TOP, 1926 ID_VSCROLL, 1927 &sbcd, 1928 0)) 1929 && (*phwndH = WinCreateWindow(hwndParent, 1930 WC_SCROLLBAR, 1931 "", 1932 SBS_THUMBSIZE | WS_VISIBLE, 1933 10, 10, 1934 20, 100, 1935 hwndParent, // owner 1936 HWND_TOP, 1937 ID_HSCROLL, 1938 &sbcd, 1939 0)) 1940 ); 1941 } 1942 1943 /* 1898 1944 *@@ winhUpdateScrollBar: 1899 1945 * updates the given scroll bar according to the given … … 1918 1964 * The width or height of this must be passed in ulWinPels. 1919 1965 * 1920 * -- " viewport": the entire data to be displayed, of which the1921 * "window" can only display a subrectangle, if the viewport1966 * -- "workarea": the entire data to be displayed, of which the 1967 * "window" can only display a subrectangle, if the workarea 1922 1968 * is larger than the window. 1923 1969 * 1924 * The width or height of this must be passed in ul ViewportPels.1970 * The width or height of this must be passed in ulWorkareaPels. 1925 1971 * This can be smaller than ulWinPels (if the window is larger 1926 1972 * than the data) or the same or larger than ulWinPels … … 1928 1974 * 1929 1975 * -- "window offset": the offset of the current window within 1930 * the viewport.1976 * the workarea. 1931 1977 * 1932 1978 * For horizontal scroll bars, this is the X coordinate, … … 1934 1980 * 1935 1981 * For vertical scroll bars, this is counted from the _top_ 1936 * of the viewport(0 means topmost, as opposed to OS/21982 * of the workarea (0 means topmost, as opposed to OS/2 1937 1983 * window coordinates!). This is because for vertical scroll 1938 1984 * bars controls, higher values move the thumb _down_. Yes … … 1941 1987 * The window offset is therefore always positive. 1942 1988 * 1943 * The scroll bar gets disabled if the entire viewportis visible,1944 * that is, if ul ViewportPels <= ulWinPels. In that case1989 * The scroll bar gets disabled if the entire workarea is visible, 1990 * that is, if ulWorkareaPels <= ulWinPels. In that case 1945 1991 * FALSE is returned. If (fAutoHide == TRUE), the scroll 1946 1992 * bar is not only disabled, but also hidden from the display. 1947 1993 * In that case, you will need to reformat your output because 1948 * your viewportbecomes larger without the scroll bar.1994 * your workarea becomes larger without the scroll bar. 1949 1995 * 1950 1996 * This function will set the range of the scroll bar to 0 up 1951 * to a value depending on the viewportsize. For vertical scroll1997 * to a value depending on the workarea size. For vertical scroll 1952 1998 * bars, 0 means topmost (which is kinda sick with the OS/2 1953 1999 * coordinate system), for horizontal scroll bars, 0 means leftmost. … … 1955 2001 * The maximum value of the scroll bar will be 1956 2002 * 1957 + (ul ViewportPels - ulWinPels) / usScrollUnitPels2003 + (ulWorkareaPels - ulWinPels) / usScrollUnitPels 1958 2004 * 1959 2005 * The thumb size of the scroll bar will also be adjusted 1960 * based on the viewportand window size, as it should be.2006 * based on the workarea and window size, as it should be. 1961 2007 * 1962 2008 *@@added V0.9.1 (2000-02-14) [umoeller] … … 1969 2015 // visible window part (in pixels), 1970 2016 // excluding the scroll bar! 1971 ULONG ul ViewportPels, // in: dimension of total data part, of2017 ULONG ulWorkareaPels, // in: dimension of total data part, of 1972 2018 // which ulWinPels is a sub-dimension 1973 2019 // (in pixels); … … 1982 2028 // _Pmpf(("Entering winhUpdateScrollBar")); 1983 2029 1984 // for large viewports, adjust scroll bar units2030 // for large workareas, adjust scroll bar units 1985 2031 USHORT usScrollUnitPels = 1; 1986 if (ul ViewportPels > 10000)2032 if (ulWorkareaPels > 10000) 1987 2033 usScrollUnitPels = 100; 1988 2034 1989 if (ul ViewportPels > ulWinPels)2035 if (ulWorkareaPels > ulWinPels) 1990 2036 { 1991 2037 // scrollbar needed: 1992 2038 USHORT usThumbDivisorUnits = usScrollUnitPels; 1993 2039 USHORT lMaxAllowedUnitOfs; 1994 // _Pmpf(("winhUpdateScrollBar: ul ViewportPels > ulWinPels, enabling scroller"));2040 // _Pmpf(("winhUpdateScrollBar: ulWorkareaPels > ulWinPels, enabling scroller")); 1995 2041 // divisor for thumb size (below) 1996 if (ul ViewportPels > 10000)1997 // for very large viewports, we need to2042 if (ulWorkareaPels > 10000) 2043 // for very large workareas, we need to 1998 2044 // raise the divisor, because we only 1999 2045 // have a USHORT 2000 2046 usThumbDivisorUnits = usScrollUnitPels * 100; 2001 2047 2002 // viewportis larger than window:2048 // workarea is larger than window: 2003 2049 WinEnableWindow(hwndScrollBar, TRUE); 2004 2050 if (fAutoHide) … … 2006 2052 2007 2053 // calculate limit 2008 lMaxAllowedUnitOfs = ((ul ViewportPels - ulWinPels + usScrollUnitPels)2054 lMaxAllowedUnitOfs = ((ulWorkareaPels - ulWinPels + usScrollUnitPels) 2009 2055 // scroll unit is 10 2010 2056 / usScrollUnitPels); … … 2021 2067 2022 2068 // set thumb size based on ulWinPels and 2023 // ul ViewportPels2069 // ulWorkareaPels 2024 2070 WinSendMsg(hwndScrollBar, 2025 2071 SBM_SETTHUMBSIZE, 2026 2072 MPFROM2SHORT( ulWinPels / usThumbDivisorUnits, // visible 2027 ul ViewportPels / usThumbDivisorUnits), // total2073 ulWorkareaPels / usThumbDivisorUnits), // total 2028 2074 0); 2029 2075 brc = TRUE; … … 2031 2077 else 2032 2078 { 2033 // _Pmpf(("winhUpdateScrollBar: ul ViewportPels <= ulWinPels"));2034 // entire viewportis visible:2079 // _Pmpf(("winhUpdateScrollBar: ulWorkareaPels <= ulWinPels")); 2080 // entire workarea is visible: 2035 2081 WinEnableWindow(hwndScrollBar, FALSE); 2036 2082 if (fAutoHide) … … 2066 2112 * of the scroll bar is: 2067 2113 * 2068 + ul ViewportPels - (prcl2Scroll->yTop - prcl2Scroll->yBottom)2114 + ulWorkareaPels - (prcl2Scroll->yTop - prcl2Scroll->yBottom) 2069 2115 * 2070 2116 * This function also automatically changes the scroll bar 2071 * units, should you have a viewportsize which doesn't fit2117 * units, should you have a workarea size which doesn't fit 2072 2118 * into the SHORT's that the scroll bar uses internally. As 2073 2119 * a result, this function handles a the complete range of 2074 * a ULONG for the viewport.2120 * a ULONG for the workarea. 2075 2121 * 2076 2122 * Replace "bottom" and "top" with "right" and "left" for … … 2085 2131 BOOL winhHandleScrollMsg(HWND hwnd2Scroll, // in: client window to scroll 2086 2132 HWND hwndScrollBar, // in: vertical or horizontal scroll bar window 2087 PULONG pulCurPelsOfs, // in/out: current viewportoffset;2133 PULONG pulCurPelsOfs, // in/out: current workarea offset; 2088 2134 // this is updated with the proper scroll units 2089 2135 PRECTL prcl2Scroll, // in: hwnd2Scroll rectangle to scroll … … 2091 2137 // this is passed to WinScrollWindow, 2092 2138 // which considers this inclusive! 2093 LONG ul ViewportPels, // in: total viewportdimension,2139 LONG ulWorkareaPels, // in: total workarea dimension, 2094 2140 // into which *pulCurPelsOfs is an offset 2095 2141 USHORT usLineStepPels, // in: pixels to scroll line-wise … … 2106 2152 ULONG ulWinPels; 2107 2153 2108 // for large viewports, adjust scroll bar units2154 // for large workareas, adjust scroll bar units 2109 2155 USHORT usScrollUnitPels = 1; 2110 if (ul ViewportPels > 10000)2156 if (ulWorkareaPels > 10000) 2111 2157 usScrollUnitPels = 100; 2112 2158 … … 2117 2163 ulWinPels = (prcl2Scroll->xRight - prcl2Scroll->xLeft); 2118 2164 2119 lMaxAllowedUnitOfs = ((LONG)ul ViewportPels - ulWinPels) / usScrollUnitPels;2165 lMaxAllowedUnitOfs = ((LONG)ulWorkareaPels - ulWinPels) / usScrollUnitPels; 2120 2166 2121 2167 // _Pmpf(("Entering winhHandleScrollMsg")); … … 2222 2268 2223 2269 /* 2270 *@@ winhHandleScrollMsg2: 2271 * 2272 * Returns the amount of pixels to be passed to 2273 * WinScrollWindow. 2274 * 2275 *@@added V1.0.1 (2003-01-17) [umoeller] 2276 */ 2277 2278 LONG winhHandleScrollMsg2(HWND hwndScrollBar, // in: vertical or horizontal scroll bar window 2279 PLONG plCurPelsOfs, // in/out: current workarea offset; 2280 // this is updated with the proper scroll units 2281 LONG lWindowPels, // in: window cx or cy (in window coordinates); 2282 LONG lWorkareaPels, // in: total workarea dimension, 2283 // into which *plCurPelsOfs is an offset 2284 USHORT usLineStepPels, // in: pixels to scroll line-wise 2285 // (scroll bar buttons pressed) 2286 ULONG msg, // in: either WM_VSCROLL or WM_HSCROLL 2287 MPARAM mp2) // in: complete mp2 of WM_VSCROLL/WM_HSCROLL; 2288 // this has two SHORT's (usPos and usCmd), 2289 // see PMREF for details 2290 { 2291 LONG lOldPelsOfs = *plCurPelsOfs; 2292 USHORT usPosUnits = SHORT1FROMMP(mp2), // in scroll units 2293 usCmd = SHORT2FROMMP(mp2); 2294 LONG lMaxAllowedUnitOfs; 2295 2296 // for large workareas, adjust scroll bar units 2297 USHORT usScrollUnitPels = 1; 2298 if (lWorkareaPels > 10000) 2299 usScrollUnitPels = 100; 2300 2301 lMaxAllowedUnitOfs = (lWorkareaPels - lWindowPels) / usScrollUnitPels; 2302 2303 // _Pmpf(("Entering winhHandleScrollMsg")); 2304 2305 switch (usCmd) 2306 { 2307 case SB_LINEUP: 2308 if (*plCurPelsOfs > usLineStepPels) 2309 *plCurPelsOfs -= usLineStepPels; // * usScrollUnitPels); 2310 else 2311 *plCurPelsOfs = 0; 2312 break; 2313 2314 case SB_LINEDOWN: 2315 *plCurPelsOfs += usLineStepPels; // * usScrollUnitPels); 2316 break; 2317 2318 case SB_PAGEUP: 2319 if (*plCurPelsOfs > lWindowPels) 2320 *plCurPelsOfs -= lWindowPels; // convert to units 2321 else 2322 *plCurPelsOfs = 0; 2323 break; 2324 2325 case SB_PAGEDOWN: 2326 *plCurPelsOfs += lWindowPels; // convert to units 2327 break; 2328 2329 case SB_SLIDERTRACK: 2330 *plCurPelsOfs = (usPosUnits * usScrollUnitPels); 2331 // _Pmpf((" SB_SLIDERTRACK: usUnits = %d", usPosUnits)); 2332 break; 2333 2334 case SB_SLIDERPOSITION: 2335 *plCurPelsOfs = (usPosUnits * usScrollUnitPels); 2336 break; 2337 } 2338 2339 if (*plCurPelsOfs > (lMaxAllowedUnitOfs * usScrollUnitPels)) 2340 *plCurPelsOfs = (lMaxAllowedUnitOfs * usScrollUnitPels); 2341 2342 if ( (*plCurPelsOfs != lOldPelsOfs) 2343 || (*plCurPelsOfs == 0) 2344 || (*plCurPelsOfs == (lMaxAllowedUnitOfs * usScrollUnitPels)) 2345 ) 2346 { 2347 // changed: 2348 WinSendMsg(hwndScrollBar, 2349 SBM_SETPOS, 2350 (MPARAM)(*plCurPelsOfs / usScrollUnitPels), // / usScrollUnit), 2351 0); 2352 2353 if (msg == WM_VSCROLL) 2354 return (*plCurPelsOfs - lOldPelsOfs); 2355 2356 return -(*plCurPelsOfs - lOldPelsOfs); 2357 } 2358 2359 return 0; 2360 } 2361 2362 /* 2363 *@@ winhScrollWindow: 2364 * 2365 *@@added V1.0.1 (2003-01-17) [umoeller] 2366 */ 2367 2368 BOOL winhScrollWindow(HWND hwnd2Scroll, 2369 PRECTL prclClip, // clipping rectangle or NULL 2370 PPOINTL pptlScroll) 2371 { 2372 return !!WinScrollWindow(hwnd2Scroll, 2373 pptlScroll->x, 2374 pptlScroll->y, 2375 prclClip, 2376 prclClip, 2377 NULLHANDLE, // no region 2378 NULL, // no rect 2379 SW_INVALIDATERGN); 2380 } 2381 2382 /* 2224 2383 *@@ winhProcessScrollChars: 2225 2384 * helper for processing WM_CHAR messages for … … 2264 2423 MPARAM mp1, // in: WM_CHAR mp1 2265 2424 MPARAM mp2, // in: WM_CHAR mp2 2266 ULONG ulVertMax, // in: maximum viewportcy2267 ULONG ulHorzMax) // in: maximum viewportcx2425 ULONG ulVertMax, // in: maximum workarea cy 2426 ULONG ulHorzMax) // in: maximum workarea cx 2268 2427 { 2269 2428 BOOL fProcessed = FALSE; … … 3305 3464 fl |= QPF_ID2COLORINDEX; // convert indexed color 2 to RGB V0.9.20 (2002-08-04) [umoeller] 3306 3465 3307 if ( (ul = WinQueryPresParam(hwnd,3308 3309 3310 3311 3312 3313 fl)))3466 if (ul = WinQueryPresParam(hwnd, 3467 ulppRGB, 3468 ulppIndex, 3469 &attrFound, 3470 sizeof(lColorFound), 3471 &lColorFound, 3472 fl)) 3314 3473 return lColorFound; 3315 3474 } … … 4270 4429 NULL, 4271 4430 NULL); 4431 } 4432 4433 /* 4434 *@@ winhSetParentAndOwner: 4435 * switches owner _and_ parent of the given window. 4436 * 4437 *@@added V1.0.1 (2003-01-17) [umoeller] 4438 */ 4439 4440 BOOL winhSetParentAndOwner(HWND hwnd, // in: window whose parent and owner to change 4441 HWND hwndNewParent, // in: new parent and owner 4442 BOOL fRedraw) 4443 { 4444 return ( WinSetParent(hwnd, hwndNewParent, fRedraw) 4445 && WinSetOwner(hwnd, hwndNewParent) 4446 ); 4272 4447 } 4273 4448
Note:
See TracChangeset
for help on using the changeset viewer.