- Timestamp:
- Jul 4, 1999, 9:03:36 PM (26 years ago)
- Location:
- trunk/src
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/pe2lx/dialog.cpp
r259 r265 1 /* $Id: dialog.cpp,v 1. 5 1999-07-02 12:43:30sandervl Exp $ */1 /* $Id: dialog.cpp,v 1.6 1999-07-04 19:02:37 sandervl Exp $ */ 2 2 3 3 /* … … 33 33 #endif 34 34 35 #define DEFAULT_DLGFONT "9.WarpSans" 36 35 37 static int ConvertClassAndStyle(int winclass, int style, USHORT *os2class, BOOL *fIconBmp); 36 38 static int ConvertDlgStyle(int style); … … 213 215 dlgitem->offPresParams = (USHORT)((int)dlgpparam - (int)dlgt); 214 216 dlgcurdata += dlgpparam->cb + sizeof(ULONG); 215 } 217 } else 218 { //CB: set default font 219 dlgpparam = (PRESPARAMS*)dlgcurdata; 220 dlgpparam->aparam[0].id = PP_FONTNAMESIZE; 221 dlgpparam->aparam[0].cb = strlen(DEFAULT_DLGFONT)+1; 222 strcpy((char*)&dlgpparam->aparam[0].ab,DEFAULT_DLGFONT); 223 dlgpparam->cb = dlgpparam->aparam[0].cb+2*sizeof(ULONG); 224 dlgitem->offPresParams = (USHORT)((int)dlgpparam-(int)dlgt); 225 dlgt->coffPresParams++; 226 dlgcurdata += dlgpparam->cb+sizeof(dlgpparam->cb); 227 } 228 } else 229 { //CB: set default font 230 dlgpparam = (PRESPARAMS*)dlgcurdata; 231 dlgpparam->aparam[0].id = PP_FONTNAMESIZE; 232 dlgpparam->aparam[0].cb = strlen(DEFAULT_DLGFONT)+1; 233 strcpy((char*)&dlgpparam->aparam[0].ab,DEFAULT_DLGFONT); 234 dlgpparam->cb = dlgpparam->aparam[0].cb+2*sizeof(ULONG); 235 dlgitem->offPresParams = (USHORT)((int)dlgpparam-(int)dlgt); 236 dlgt->coffPresParams++; 237 dlgcurdata += dlgpparam->cb+sizeof(dlgpparam->cb); 216 238 } 217 239 dlgitem++; … … 263 285 szCaption += 2; 264 286 dlgitem->cchText = 0; 265 dlgitem->offText = 0; 287 dlgitem->offText = (USHORT)((int)dlgcurdata-(int)dlgt); 288 dlgcurdata += 1; //CB: offText == empty string 266 289 } 267 290 else { //Handle Caption … … 459 482 dlgt->coffPresParams = (USHORT)((int)dlgpparam - (int)dlgt); 460 483 dlgcurdata += dlgpparam->cb; 461 } 484 } else 485 { //CB: set default font 486 dlgpparam = (PRESPARAMS*)dlgcurdata; 487 dlgpparam->aparam[0].id = PP_FONTNAMESIZE; 488 dlgpparam->aparam[0].cb = strlen(DEFAULT_DLGFONT)+1; 489 strcpy((char*)&dlgpparam->aparam[0].ab,DEFAULT_DLGFONT); 490 dlgpparam->cb = dlgpparam->aparam[0].cb+2*sizeof(ULONG); 491 dlgitem->offPresParams = (USHORT)((int)dlgpparam-(int)dlgt); 492 dlgt->coffPresParams++; 493 dlgcurdata += dlgpparam->cb+sizeof(dlgpparam->cb); 494 } 495 } else 496 { //CB: set default font 497 dlgpparam = (PRESPARAMS*)dlgcurdata; 498 dlgpparam->aparam[0].id = PP_FONTNAMESIZE; 499 dlgpparam->aparam[0].cb = strlen(DEFAULT_DLGFONT)+1; 500 strcpy((char*)&dlgpparam->aparam[0].ab,DEFAULT_DLGFONT); 501 dlgpparam->cb = dlgpparam->aparam[0].cb+2*sizeof(ULONG); 502 dlgitem->offPresParams = (USHORT)((int)dlgpparam-(int)dlgt); 503 dlgt->coffPresParams++; 504 dlgcurdata += dlgpparam->cb+sizeof(dlgpparam->cb); 462 505 } 463 506 ctrldata = (WINDLGITEMTEMPLATEEX *)(((int)ctrldata+3) & ~3); … … 560 603 #if 0 561 604 if(style & WINBS_LEFTTEXT) 562 os2style |= ; 605 os2style |= ; //not supported 563 606 #endif 564 607 style &= 0xF; … … 860 903 // } 861 904 // else TODO: More fonts!!! 905 // "MS Sans Serif" 862 906 // return(FALSE); //not found 863 907 #else -
trunk/src/user32/USER32.DEF
r173 r265 1 ; $Id: USER32.DEF,v 1. 7 1999-06-24 08:25:21 phallerExp $1 ; $Id: USER32.DEF,v 1.8 1999-07-04 19:02:38 sandervl Exp $ 2 2 3 3 ;Created by BLAST for IBM's compiler … … 599 599 EnumDisplayMonitors = _EnumDisplayMonitors@16 @1005 600 600 601 CreateWindowProc 601 CreateWindowProc @2000 602 602 GetOS2Callback__15Win32WindowProcFv @2001 603 603 ; Wine helper function 604 604 GetSysColorPen = _GetSysColorPen@4 @2002 605 ; COMCTL32 helper functions 606 NativeDlgBoxIP = _NativeDlgBoxIP@24 @2003 607 NativeCreateDlgIP = _NativeCreateDlgIP@24 @2004 -
trunk/src/user32/dialog.cpp
r217 r265 1 /* $Id: dialog.cpp,v 1. 5 1999-06-26 13:46:21sandervl Exp $ */1 /* $Id: dialog.cpp,v 1.6 1999-07-04 19:02:38 sandervl Exp $ */ 2 2 3 3 /* … … 20 20 //****************************************************************************** 21 21 //****************************************************************************** 22 HWND WIN32API CreateDialogParamA(HINSTANCE hinst, LPCSTR lpszTemplate, 23 HWND hwndOwner, DLGPROC dlgproc, 24 22 HWND WIN32API CreateDialogParamA(HINSTANCE hinst, LPCSTR lpszTemplate, 23 HWND hwndOwner, DLGPROC dlgproc, 24 LPARAM lParamInit) 25 25 { 26 26 HWND rc; … … 31 31 WriteLog("OS2CreateDialogParamA %s\n", lpszTemplate); 32 32 #endif 33 33 lpszTemplate = (LPCSTR)ConvertNameId(hinst, (char *)lpszTemplate); 34 34 } 35 35 #ifdef DEBUG … … 38 38 39 39 if(dlgproc) { 40 41 40 dialog = new Win32WindowProc((WNDPROC)dlgproc); 41 rc = O32_CreateDialogParam(hinst, lpszTemplate, hwndOwner, (DLGPROC_O32)dialog->GetOS2Callback(), lParamInit); 42 42 } 43 43 else rc = O32_CreateDialogParam(hinst, lpszTemplate, hwndOwner, (DLGPROC_O32)O32_DefDlgProc, lParamInit); 44 44 45 45 if(rc == 0 && dialog) { 46 46 delete(dialog); 47 47 } 48 48 … … 54 54 //****************************************************************************** 55 55 //****************************************************************************** 56 HWND WIN32API CreateDialogParamW(HINSTANCE hinst, LPCWSTR lpszTemplate, 57 HWND hwndOwner, DLGPROC dlgproc, 58 56 HWND WIN32API CreateDialogParamW(HINSTANCE hinst, LPCWSTR lpszTemplate, 57 HWND hwndOwner, DLGPROC dlgproc, 58 LPARAM lParamInit) 59 59 { 60 60 HWND rc; 61 61 62 62 if((int)lpszTemplate >> 16 != 0) {//convert string name identifier to numeric id 63 63 char *astring = UnicodeToAsciiString((LPWSTR)lpszTemplate); 64 64 #ifdef DEBUG 65 65 WriteLog("OS2CreateDialogParamW %s\n", astring); 66 66 #endif 67 68 67 lpszTemplate = (LPWSTR)ConvertNameId(hinst, astring); 68 FreeAsciiString(astring); 69 69 } 70 70 #ifdef DEBUG … … 73 73 74 74 Win32WindowProc *dialog = new Win32WindowProc((WNDPROC)dlgproc); 75 75 76 76 rc = O32_CreateDialogParam(hinst, (LPCSTR)lpszTemplate, hwndOwner, (DLGPROC_O32)dialog->GetOS2Callback(), lParamInit); 77 77 if(rc == 0) { 78 78 delete(dialog); 79 79 } 80 80 … … 86 86 //****************************************************************************** 87 87 //****************************************************************************** 88 HWND WIN32API CreateDialogIndirectParamA(HINSTANCE hinst, 89 DLGTEMPLATE *dlgtemplate, 90 HWND hwndParent, DLGPROC dlgproc, 91 92 { 93 HWND 88 HWND WIN32API CreateDialogIndirectParamA(HINSTANCE hinst, 89 DLGTEMPLATE *dlgtemplate, 90 HWND hwndParent, DLGPROC dlgproc, 91 LPARAM lParamInit) 92 { 93 HWND hwnd; 94 94 DLGTEMPLATE *os2dlg; 95 95 … … 99 99 hwnd = O32_CreateDialogIndirectParam(hinst, os2dlg, hwndParent, (DLGPROC_O32)dialog->GetOS2Callback(), lParamInit); 100 100 if(hwnd == 0) { 101 101 delete(dialog); 102 102 } 103 103 #ifdef DEBUG … … 108 108 //****************************************************************************** 109 109 //****************************************************************************** 110 HWND WIN32API CreateDialogIndirectParamW(HINSTANCE hinst, 111 DLGTEMPLATE *dlgtemplate, 112 HWND hwndParent, DLGPROC dlgproc, 113 114 { 115 HWND 110 HWND WIN32API CreateDialogIndirectParamW(HINSTANCE hinst, 111 DLGTEMPLATE *dlgtemplate, 112 HWND hwndParent, DLGPROC dlgproc, 113 LPARAM lParamInit) 114 { 115 HWND hwnd; 116 116 DLGTEMPLATE *os2dlg; 117 117 … … 121 121 hwnd = O32_CreateDialogIndirectParam(hinst, os2dlg, hwndParent, (DLGPROC_O32)dialog->GetOS2Callback(), lParamInit); 122 122 if(hwnd == 0) { 123 123 delete(dialog); 124 124 } 125 125 dprintf(("CreateDialogIndirectParamW returned %X\n", hwnd)); … … 128 128 //****************************************************************************** 129 129 //****************************************************************************** 130 BOOL WIN32API DialogBoxIndirectParamA(HINSTANCE hinst, 131 DLGTEMPLATE *dlgtemplate, 132 HWND hwndParent, DLGPROC dlgproc, 133 130 BOOL WIN32API DialogBoxIndirectParamA(HINSTANCE hinst, 131 DLGTEMPLATE *dlgtemplate, 132 HWND hwndParent, DLGPROC dlgproc, 133 LPARAM lParamInit) 134 134 { 135 135 BOOL rc; … … 137 137 138 138 os2dlg = ConvertWin32DlgTemplate(dlgtemplate); 139 139 140 Win32WindowProc *dialog = new Win32WindowProc((WNDPROC)dlgproc, os2dlg); 140 141 … … 146 147 //****************************************************************************** 147 148 //****************************************************************************** 148 BOOL WIN32API DialogBoxIndirectParamW(HINSTANCE hinst, 149 DLGTEMPLATE *dlgtemplate, 150 HWND hwndParent, DLGPROC dlgproc, 151 149 BOOL WIN32API DialogBoxIndirectParamW(HINSTANCE hinst, 150 DLGTEMPLATE *dlgtemplate, 151 HWND hwndParent, DLGPROC dlgproc, 152 LPARAM lParamInit) 152 153 { 153 154 BOOL rc; … … 165 166 //****************************************************************************** 166 167 int WIN32API DialogBoxParamA(HINSTANCE hinst, LPCSTR lpszTemplate, HWND hwndOwner, 167 168 DLGPROC dlgprc, LPARAM lParamInit) 168 169 { 169 170 int rc; 170 171 171 172 if((int)lpszTemplate >> 16 != 0) {//convert string name identifier to numeric id 172 173 174 } 175 else { 176 173 dprintf(("DialogBoxParam %s\n", lpszTemplate)); 174 lpszTemplate = (LPCSTR)ConvertNameId(hinst, (char *)lpszTemplate); 175 } 176 else { 177 dprintf(("DialogBoxParam %d\n", (int)lpszTemplate)); 177 178 } 178 179 … … 185 186 //****************************************************************************** 186 187 //****************************************************************************** 187 int WIN32API DialogBoxParamW(HINSTANCE arg1, LPCWSTR arg2, HWND arg3, 188 188 int WIN32API DialogBoxParamW(HINSTANCE arg1, LPCWSTR arg2, HWND arg3, 189 DLGPROC arg4, LPARAM arg5) 189 190 { 190 191 int rc; … … 193 194 194 195 if((int)arg2 >> 16 != 0) { 195 196 astring = UnicodeToAsciiString((LPWSTR)arg2); 196 197 } 197 198 else astring = (char *)arg2; … … 200 201 Win32WindowProc *dialog = new Win32WindowProc((WNDPROC)arg4); 201 202 rc = DialogBoxParamA(arg1, astring, arg3, arg4, arg5); 202 203 if((int)astring >> 16 != 0) 203 204 if((int)astring >> 16 != 0) FreeAsciiString(astring); 204 205 205 206 dprintf(("OS2DialogBoxIndirectParamA returned %d\n", rc)); … … 208 209 } 209 210 //****************************************************************************** 210 //****************************************************************************** 211 211 // CB: Loads and starts a native OS/2 dialog with Win32 DlgProc 212 // (used in COMCTL32) 213 // full name: NativeDialogBoxIndirectParam 214 //****************************************************************************** 215 INT WINAPI NativeDlgBoxIP(HMODULE hmodule, 216 HINSTANCE hinst, LPCSTR lpszName, 217 HWND hwndParent, DLGPROC dlgproc, 218 LPARAM lParamInit) 219 { 220 BOOL rc; 221 DLGTEMPLATE *os2dlg; 222 HRSRC hRes; 223 224 dprintf(("NativeDlgBoxIP")); 225 226 hRes = O32_FindResource(hmodule,lpszName,RT_DIALOGA); 227 if (hRes == 0) return (INT)-1; 228 229 dprintf((" hRes = %d",hRes)); 230 231 os2dlg = (DLGTEMPLATE*)O32_LoadResource(hmodule,hRes); 232 if (os2dlg == NULL) return (INT)-1; 233 234 dprintf((" os2dlg = %d",os2dlg)); 235 236 Win32WindowProc *dialog = new Win32WindowProc((WNDPROC)dlgproc,os2dlg); 237 rc = O32_DialogBoxIndirectParam(hinst,os2dlg,hwndParent,(DLGPROC_O32)dialog->GetOS2Callback(),lParamInit); 238 //dialog already destroyed when this returns 239 dprintf(("NativeDlgBoxIP returned %X\n", rc)); 240 241 return rc; 242 } 243 //****************************************************************************** 244 //****************************************************************************** 245 //****************************************************************************** 246 // CB: Loads and starts a native OS/2 dialog with Win32 DlgProc 247 // (used in COMCTL32) 248 // full name: NativeCreateDialogIndirectParam 249 //****************************************************************************** 250 INT WINAPI NativeCreateDlgIP(HMODULE hmodule, 251 HINSTANCE hinst, LPCSTR lpszName, 252 HWND hwndParent, DLGPROC dlgproc, 253 LPARAM lParamInit) 254 { 255 BOOL rc; 256 DLGTEMPLATE *os2dlg; 257 HRSRC hRes; 258 259 dprintf(("NativeCreateDlgBoxIP")); 260 261 hRes = O32_FindResource(hmodule,lpszName,RT_DIALOGA); 262 if (hRes == 0) return (INT)-1; 263 264 dprintf((" hRes = %d",hRes)); 265 266 os2dlg = (DLGTEMPLATE*)O32_LoadResource(hmodule,hRes); 267 if (os2dlg == NULL) return (INT)-1; 268 269 dprintf((" os2dlg = %d",os2dlg)); 270 271 Win32WindowProc *dialog = new Win32WindowProc((WNDPROC)dlgproc,os2dlg); 272 rc = O32_CreateDialogIndirectParam(hinst,os2dlg,hwndParent,(DLGPROC_O32)dialog->GetOS2Callback(),lParamInit); 273 //dialog already destroyed when this returns 274 dprintf(("NativeDlgBoxIP returned %X\n", rc)); 275 276 return rc; 277 } 278 //****************************************************************************** 279 //****************************************************************************** -
trunk/src/user32/dlgconvert.cpp
r259 r265 1 /* $Id: dlgconvert.cpp,v 1. 6 1999-07-02 12:42:57sandervl Exp $ */1 /* $Id: dlgconvert.cpp,v 1.7 1999-07-04 19:02:38 sandervl Exp $ */ 2 2 3 3 /* … … 41 41 #endif 42 42 43 #define DEFAULT_DLGFONT "9.WarpSans" 44 43 45 static int ConvertClassAndStyle(int winclass, int style, USHORT *os2class, BOOL *fIconBmp); 44 46 static int ConvertDlgStyle(int style); … … 244 246 dlgt->coffPresParams = (int)dlgpparam; 245 247 dlgcurdata += sizeof(PRESPARAMS) + dlgpparam->aparam[0].cb - 1; 248 } else 249 { //CB: set default font 250 dlgpparam = (PRESPARAMS*)dlgcurdata; 251 dlgpparam->aparam[0].id = PP_FONTNAMESIZE; 252 dlgpparam->aparam[0].cb = strlen(DEFAULT_DLGFONT)+1; 253 strcpy((char*)&dlgpparam->aparam[0].ab,DEFAULT_DLGFONT); 254 dlgpparam->cb = dlgpparam->aparam[0].cb+2*sizeof(ULONG); 255 dlgitem->offPresParams = (USHORT)((int)dlgpparam-(int)dlgt); 256 dlgt->coffPresParams++; 257 dlgcurdata += dlgpparam->cb+sizeof(dlgpparam->cb); 246 258 } 247 259 FreeAsciiString(font); 260 } else 261 { //CB: set default font 262 dlgpparam = (PRESPARAMS*)dlgcurdata; 263 dlgpparam->aparam[0].id = PP_FONTNAMESIZE; 264 dlgpparam->aparam[0].cb = strlen(DEFAULT_DLGFONT)+1; 265 strcpy((char*)&dlgpparam->aparam[0].ab,DEFAULT_DLGFONT); 266 dlgpparam->cb = dlgpparam->aparam[0].cb+2*sizeof(ULONG); 267 dlgitem->offPresParams = (USHORT)((int)dlgpparam-(int)dlgt); 268 dlgt->coffPresParams++; 269 dlgcurdata += dlgpparam->cb+sizeof(dlgpparam->cb); 248 270 } 249 271 ctrldata = (ControlData *)(((int)ctrldata+3) & ~3); … … 300 322 if(*(USHORT *)szCaption == 0xFFFF) { 301 323 szCaption += 2; 324 dlgitem->cchText = 0; 325 dlgitem->offText = (USHORT)((int)dlgcurdata-(int)dlgt); 326 dlgcurdata += 1; //CB: offText == empty string 302 327 } 303 328 else { //Handle Caption … … 521 546 dlgt->coffPresParams = (int)dlgpparam; 522 547 dlgcurdata += sizeof(PRESPARAMS) + dlgpparam->aparam[0].cb - 1; 548 } else 549 { //CB: set default font 550 dlgpparam = (PRESPARAMS*)dlgcurdata; 551 dlgpparam->aparam[0].id = PP_FONTNAMESIZE; 552 dlgpparam->aparam[0].cb = strlen(DEFAULT_DLGFONT)+1; 553 strcpy((char*)&dlgpparam->aparam[0].ab,DEFAULT_DLGFONT); 554 dlgpparam->cb = dlgpparam->aparam[0].cb+2*sizeof(ULONG); 555 dlgitem->offPresParams = (USHORT)((int)dlgpparam-(int)dlgt); 556 dlgt->coffPresParams++; 557 dlgcurdata += dlgpparam->cb+sizeof(dlgpparam->cb); 523 558 } 524 559 FreeAsciiString(font); 560 } else 561 { //CB: set default font 562 dlgpparam = (PRESPARAMS*)dlgcurdata; 563 dlgpparam->aparam[0].id = PP_FONTNAMESIZE; 564 dlgpparam->aparam[0].cb = strlen(DEFAULT_DLGFONT)+1; 565 strcpy((char*)&dlgpparam->aparam[0].ab,DEFAULT_DLGFONT); 566 dlgpparam->cb = dlgpparam->aparam[0].cb+2*sizeof(ULONG); 567 dlgitem->offPresParams = (USHORT)((int)dlgpparam-(int)dlgt); 568 dlgt->coffPresParams++; 569 dlgcurdata += dlgpparam->cb+sizeof(dlgpparam->cb); 525 570 } 526 571 ctrldata = (WINDLGITEMTEMPLATEEX *)(((int)ctrldata+3) & ~3); -
trunk/src/user32/user32exp.def
r96 r265 1 ; $Id: user32exp.def,v 1. 4 1999-06-10 16:50:36 phallerExp $1 ; $Id: user32exp.def,v 1.5 1999-07-04 19:02:38 sandervl Exp $ 2 2 3 3 ;Created by BLAST for IBM's compiler … … 596 596 597 597 598 CreateWindowProc 599 GetOS2Callback__15Win32WindowProcFv 598 CreateWindowProc @2000 599 GetOS2Callback__15Win32WindowProcFv @2001 600 600 _GetSysColorPen@4 @2002 601 _NativeDlgBoxIP@24 @2003 602 _NativeCreateDlgIP@24 @2004 601 603 602
Note:
See TracChangeset
for help on using the changeset viewer.