- Timestamp:
- Jun 17, 1999, 8:25:22 PM (26 years ago)
- Location:
- trunk/src
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/kernel32/async.cpp
r111 r112 1 /* $Id: async.cpp,v 1. 4 1999-06-17 18:21:37phaller Exp $ */1 /* $Id: async.cpp,v 1.5 1999-06-17 18:25:22 phaller Exp $ */ 2 2 3 3 /* … … 47 47 #include "unicode.h" 48 48 49 // PH: to soothe the compiler 50 #define BY_HANDLE_FILE_INFORMATION void 51 #define LPFILETIME void* 52 #define OFSTRUCT void 53 49 #include "conwin.h" // Windows Header for console only 54 50 #include "handlemanager.h" 55 51 -
trunk/src/kernel32/winexe.cpp
r111 r112 1 /* $Id: winexe.cpp,v 1. 4 1999-06-17 18:21:43phaller Exp $ */1 /* $Id: winexe.cpp,v 1.5 1999-06-17 18:25:22 phaller Exp $ */ 2 2 3 3 /* … … 31 31 #include "cio.h" 32 32 33 34 // PH: to soothe the compiler 35 #define BY_HANDLE_FILE_INFORMATION void 36 #define LPFILETIME void* 37 #define OFSTRUCT void 38 33 #include "conwin.h" // Windows Header for console only 39 34 #include "console.h" 40 35 #include "handlemanager.h" -
trunk/src/kernel32/wprocess.cpp
r111 r112 1 /* $Id: wprocess.cpp,v 1. 6 1999-06-17 18:21:43phaller Exp $ */1 /* $Id: wprocess.cpp,v 1.7 1999-06-17 18:25:22 phaller Exp $ */ 2 2 3 3 /* … … 26 26 #include "except.h" 27 27 #include "os2util.h" 28 28 29 #include "console.h" 29 30 #include "cio.h" -
trunk/src/user32/dlgconvert.cpp
r96 r112 1 /* $Id: dlgconvert.cpp,v 1. 3 1999-06-10 16:50:38phaller Exp $ */1 /* $Id: dlgconvert.cpp,v 1.4 1999-06-17 18:22:43 phaller Exp $ */ 2 2 3 3 /* … … 26 26 #define DWORD ULONG 27 27 #define LPVOID VOID * 28 #define WORD USHORT 28 #define WORD USHORT 29 29 #define WCHAR USHORT 30 30 #define HANDLE ULONG … … 65 65 PRESPARAMS *dlgpparam; 66 66 char *dlgdata, *dlgcurdata; 67 WCHAR 67 WCHAR *szCaption; 68 68 WORD *ptrArray; 69 69 char *ctrltext, *szClass, *font; … … 76 76 if(windlgex->wDlgVer == 1 && windlgex->wSignature == 0xFFFF) { 77 77 #ifdef DEBUG 78 79 #endif 80 81 } 82 83 //should be enough 78 WriteLog("ConvertWin32DlgTemplate: DLGTEMPLATEEX!\n"); 79 #endif 80 return(ConvertWin32DlgTemplateEx(windlgex)); 81 } 82 83 //should be enough 84 84 size = dhdr->NumberOfItems*sizeof(DLGTITEM) * 128; 85 85 dlgt = (DLGTEMPLATE *)malloc(sizeof(DLGTEMPLATE) + dhdr->NumberOfItems*sizeof(DLGTITEM) + size); … … 89 89 dlgcurdata = dlgdata; 90 90 91 dlgt->codepage 92 dlgt->offadlgti 91 dlgt->codepage = 437; 92 dlgt->offadlgti = 14; 93 93 dlgt->fsTemplateStatus = 1; 94 94 dlgt->iItemFocus = 65535; … … 99 99 ctrlflag = 0; 100 100 if((dhdr->lStyle & WINWS_CAPTION) == WINWS_CAPTION) { 101 102 101 ctrlflag |= FCF_TITLEBAR; 102 dlgitem->flStyle |= FS_BORDER; 103 103 } 104 104 else 105 if(dhdr->lStyle & WINWS_DLGFRAME) 106 105 if(dhdr->lStyle & WINWS_DLGFRAME) //can't have title bar 106 dlgitem->flStyle |= FS_DLGBORDER; 107 107 108 108 if((dhdr->lStyle & (WINWS_SYSMENU | WINWS_CAPTION)) == (WINWS_SYSMENU | WINWS_CAPTION)) 109 109 ctrlflag |= FCF_SYSMENU; 110 110 if(dhdr->lStyle & WINWS_VSCROLL) 111 111 ctrlflag |= FCF_VERTSCROLL; 112 112 if(dhdr->lStyle & WINWS_HSCROLL) 113 113 ctrlflag |= FCF_HORZSCROLL; 114 114 if(dhdr->lStyle & WINWS_MINIMIZEBOX) 115 115 ctrlflag |= FCF_MINBUTTON; 116 116 if(dhdr->lStyle & WINWS_MAXIMIZEBOX) 117 117 ctrlflag |= FCF_MAXBUTTON; 118 118 if(dhdr->lStyle & WINWS_THICKFRAME) 119 119 dlgitem->flStyle |= FS_SIZEBORDER; 120 120 121 121 if(ctrlflag) { 122 123 124 122 *(ULONG *)dlgcurdata = ctrlflag; 123 dlgitem->offCtlData = (USHORT)((int)dlgcurdata - (int)dlgt); 124 dlgcurdata += sizeof(ULONG); 125 125 } 126 126 else dlgitem->offCtlData = 0xFFFF; 127 dlgitem->x 128 dlgitem->y 129 dlgitem->cx 130 dlgitem->cy 127 dlgitem->x = dhdr->x; 128 dlgitem->y = dhdr->y; 129 dlgitem->cx = dhdr->cx; 130 dlgitem->cy = dhdr->cy; 131 131 dlgitem->cChildren = dhdr->NumberOfItems; 132 dlgitem->id = (USHORT)0; 132 dlgitem->id = (USHORT)0; //ord id or converted name id 133 133 dlgitem->fsItemStatus = 1; 134 dlgitem->offClassName = 1; 134 dlgitem->offClassName = 1; //WC_FRAME 135 135 136 136 #ifdef DEBUG … … 145 145 if(dhdr->fNameOrd == 0xFFFF) { 146 146 #ifdef DEBUG 147 148 #endif 149 147 WriteLog("Menu ID : %d\n", (int)*(WORD *)(dhdr+1)); 148 #endif 149 ptrArray = (WORD *)((int)dhdr + sizeof(DialogBoxHeader) + sizeof(WORD)); 150 150 } 151 151 else { 152 153 154 155 156 #ifdef DEBUG 157 158 159 160 #endif 161 162 152 if(dhdr->fNameOrd == 0) {//SvL: 0 == no menu! 153 ptrArray = (WORD *)((int)dhdr + sizeof(DialogBoxHeader)); 154 } 155 else { 156 #ifdef DEBUG 157 ctrltext = UnicodeToAsciiString((WCHAR *)&dhdr->fNameOrd); 158 WriteLog("Menu namestring : %s\n", ctrltext); 159 FreeAsciiString(ctrltext); 160 #endif 161 ptrArray = (WORD *)((int)&dhdr->fNameOrd + UniStrlen((WCHAR *)(&dhdr->fNameOrd))*2 + sizeof(WCHAR)); 162 } 163 163 } 164 164 //Class id 165 165 if(*ptrArray == 0xFFFF) { 166 166 #ifdef DEBUG 167 168 169 #endif 170 171 172 167 winclass = (int)*(WORD *)(ptrArray+1); 168 WriteLog("Class ID : %d\n", winclass); 169 #endif 170 //SvL: shouldn't happen! (at least not with this code) 171 assert(FALSE); 172 ptrArray = (WORD *)((int)ptrArray + 2*sizeof(WORD)); 173 173 } 174 174 else { 175 176 177 178 179 180 #ifdef DEBUG 181 182 #endif 183 // 184 185 186 187 188 189 190 dlgcurdata += dlgitem->cchClassName + 1;//include terminating 0 (just to be sure)191 //TODO: SvL: Can they also be system classes? 192 // 193 // 194 195 196 175 if(*ptrArray == 0) {//SvL: 0 == no class! 176 ptrArray = (WORD *)((int)ptrArray + sizeof(WORD)); 177 } 178 else { 179 szClass = UnicodeToAsciiString((WCHAR *)ptrArray); 180 #ifdef DEBUG 181 WriteLog("Class namestring : %s\n", szClass); 182 #endif 183 // cout << "Class Name : " << szClass << endl; 184 185 dlgitem->cchClassName = strlen(szClass); 186 dlgitem->offClassName = (USHORT)((int)dlgcurdata - (int)dlgt); 187 strcpy((char *)dlgcurdata, szClass); 188 //Open32 wants class name in upper case! 189 UpCase((char *)dlgcurdata); 190 dlgcurdata += dlgitem->cchClassName + 1; //include terminating 0 (just to be sure) 191 //TODO: SvL: Can they also be system classes? 192 // dlgitem->flStyle = dhdr->lStyle; 193 // dlgitem->flStyle = ConvertDlgItemStyle(dhdr->lStyle); 194 ptrArray = (WORD *)((int)ptrArray + UniStrlen((WCHAR *)(ptrArray))*2 + sizeof(WORD)); 195 FreeAsciiString(szClass); 196 } 197 197 } 198 198 … … 200 200 if(*ptrArray == 0) { 201 201 #ifdef DEBUG 202 203 #endif 204 202 WriteLog("No title\n"); 203 #endif 204 ctrldata = (ControlData *)((int)(int)ptrArray + sizeof(WORD)); 205 205 } 206 206 else { 207 208 #ifdef DEBUG 209 210 #endif 211 212 213 214 215 216 217 dlgcurdata += dlgitem->cchText + 1;//include terminating 0 (just to be sure)218 219 207 ctrltext = UnicodeToAsciiString((WCHAR *)(ptrArray)); 208 #ifdef DEBUG 209 WriteLog("Title : %s\n", ctrltext); 210 #endif 211 ctrldata = (ControlData *)((int)(int)ptrArray + UniStrlen((WCHAR *)(ptrArray))*2 + sizeof(WORD)); 212 213 if(ctrltext[0] != 0) { 214 dlgitem->cchText = strlen(ctrltext); 215 dlgitem->offText = (USHORT)((int)dlgcurdata - (int)dlgt); 216 strcpy((char *)dlgcurdata, ctrltext); 217 dlgcurdata += dlgitem->cchText + 1; //include terminating 0 (just to be sure) 218 } 219 FreeAsciiString(ctrltext); 220 220 } 221 221 dlgitem++; 222 222 223 223 if(dhdr->lStyle & DS_SETFONT) { 224 225 226 #ifdef DEBUG 227 228 224 fhdr = (FontHeader *)ctrldata; 225 font = UnicodeToAsciiString(fhdr->szFontName); 226 #ifdef DEBUG 227 WriteLog("Font Point Size : %d\n", fhdr->wPointSize); 228 WriteLog("Font Name : %s\n", font); 229 229 #endif 230 230 ctrldata = (ControlData *)((int)fhdr + sizeof(FontHeader) - 2 + UniStrlen(fhdr->szFontName)*2 + sizeof(WORD)); /*PLF Sat 97-06-21 20:22:44*/ 231 231 //TODO: no pres params yet (font in win32 dialog ignored) 232 233 234 235 236 237 238 239 240 241 242 243 232 dlgpparam = (PRESPARAMS *)dlgcurdata; 233 dlgpparam->cb = 0; 234 dlgpparam->aparam[0].id = PP_FONTNAMESIZE; 235 dlgpparam->aparam[0].cb = 0; 236 UpCase(font); 237 if(ConvertFont(font, dlgpparam, fhdr->wPointSize) == TRUE) { 238 dlgpparam->cb = sizeof(PARAM) + dlgpparam->aparam[0].cb - 1; 239 dlgpparam->aparam[0].cb = strlen(dlgpparam->aparam[0].ab) + 1; 240 dlgt->coffPresParams = (int)dlgpparam; 241 dlgcurdata += sizeof(PRESPARAMS) + dlgpparam->aparam[0].cb - 1; 242 } 243 FreeAsciiString(font); 244 244 } 245 245 ctrldata = (ControlData *)(((int)ctrldata+3) & ~3); 246 246 247 247 for(i=0;i<dhdr->NumberOfItems;i++) { 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 #ifdef DEBUG 263 264 265 266 267 268 #endif 269 270 271 272 #ifdef DEBUG 273 274 #endif 275 276 277 278 279 280 281 #ifdef DEBUG 282 283 #endif 284 285 286 287 288 289 290 dlgcurdata += dlgitem->cchClassName + 1;//include terminating 0 (just to be sure)291 //TODO: SvL: Can they also be system classes? 292 // 293 294 295 } 296 297 298 299 else {//Handle Caption300 301 302 303 304 305 306 307 308 dlgitem->cchText = strlen((char *)dlgcurdata);//one USHORT for res id309 dlgcurdata += dlgitem->cchText + 1;//include terminating 0 (just to be sure)310 311 312 313 314 315 316 dlgcurdata += dlgitem->cchText + 1;//include terminating 0 (just to be sure)317 318 319 #ifdef DEBUG 320 321 322 323 #endif 324 325 326 327 // 328 329 330 248 //save as OS/2 DLGTITEM 249 dlgitem->x = ctrldata->x; 250 //SvL: 3-8-'97 251 // OS/2 -> left bottom == origin and y coordinate == left bottom origin control 252 // Win32 -> left top == origin and y coordinate == left top origin 253 dlgitem->y = dlgt->adlgti[0].cy - ctrldata->y - ctrldata->cy; 254 dlgitem->cx = ctrldata->cx; 255 dlgitem->cy = ctrldata->cy; 256 dlgitem->id = ctrldata->wId; 257 dlgitem->offCtlData = 0xFFFF; 258 dlgitem->offPresParams = 0xFFFF; 259 260 //TODO: Extended style 261 262 #ifdef DEBUG 263 WriteLog("***** Control Style : %X\n", ctrldata->lStyle); 264 WriteLog("Extended Control Style: %X\n", ctrldata->lExtendedStyle); 265 WriteLog("Position : (%d,%d)\n", ctrldata->x, ctrldata->y); 266 WriteLog("Size : (%d,%d)\n", ctrldata->cx, ctrldata->cy); 267 WriteLog("wID : %d\n", ctrldata->wId); 268 #endif 269 winclass = 0; 270 if(ctrldata->fClassId == 0xFFFF) { 271 winclass = *(WORD *)(ctrldata+1); 272 #ifdef DEBUG 273 WriteLog("Class ID : %d\n", winclass); 274 #endif 275 szCaption = (WCHAR *)((int)ctrldata + sizeof(ControlData) + sizeof(WORD)); 276 dlgitem->flStyle = ConvertClassAndStyle(winclass, ctrldata->lStyle, &dlgitem->offClassName, &fIconBmp); 277 dlgitem->cchClassName = 0; 278 } 279 else { 280 szClass = UnicodeToAsciiString((WCHAR *)&ctrldata->fClassId); 281 #ifdef DEBUG 282 WriteLog("Class Name : %s\n", szClass); 283 #endif 284 szCaption = (WCHAR *)((int)ctrldata + sizeof(ControlData) + strlen(szClass)*2); 285 dlgitem->cchClassName = strlen(szClass); 286 dlgitem->offClassName = (USHORT)((int)dlgcurdata - (int)dlgt); 287 strcpy((char *)dlgcurdata, szClass); 288 //Open32 wants class name in upper case! 289 UpCase((char *)dlgcurdata); 290 dlgcurdata += dlgitem->cchClassName + 1; //include terminating 0 (just to be sure) 291 //TODO: SvL: Can they also be system classes? 292 // dlgitem->flStyle = ctrldata->lStyle; 293 dlgitem->flStyle = ConvertDlgItemStyle(ctrldata->lStyle) ; 294 FreeAsciiString(szClass); 295 } 296 if(*(USHORT *)szCaption == 0xFFFF) { 297 szCaption += 2; 298 } 299 else { //Handle Caption 300 ctrltext = UnicodeToAsciiString(szCaption); 301 //SvL: (16-9-'97) Convert '&' chars to '~' (for some classes) 302 ConvertCaption(winclass, ctrltext); 303 if(fIconBmp == TRUE) {//control contains bitmap or icon 304 dlgitem->offText = (USHORT)((int)dlgcurdata - (int)dlgt); 305 int resid = ConvertNameId(NULL, ctrltext); 306 *(char *)dlgcurdata = '#'; 307 itoa(resid, (char *)dlgcurdata+1, 10); 308 dlgitem->cchText = strlen((char *)dlgcurdata); //one USHORT for res id 309 dlgcurdata += dlgitem->cchText + 1; //include terminating 0 (just to be sure) 310 } 311 else { 312 if(ctrltext[0] != 0) { 313 dlgitem->cchText = strlen(ctrltext); 314 dlgitem->offText = (USHORT)((int)dlgcurdata - (int)dlgt); 315 strcpy((char *)dlgcurdata, ctrltext); 316 dlgcurdata += dlgitem->cchText + 1; //include terminating 0 (just to be sure) 317 } 318 } 319 #ifdef DEBUG 320 szClass = UnicodeToAsciiString(szCaption); 321 WriteLog("Text : %s\n", szClass); 322 FreeAsciiString(szClass); 323 #endif 324 szCaption = (WCHAR *)((int)szCaption + UniStrlen(szCaption)*2 + sizeof(WORD)); 325 } 326 327 // cout << "Extra Stuff WORD : " << *(WORD *)(szCaption) << endl; 328 ctrldata = (ControlData *)((int)szCaption + sizeof(WORD)); 329 ctrldata = (ControlData *)(((int)ctrldata+3) & ~3); 330 dlgitem++; 331 331 } 332 332 //calculate dialog box length … … 342 342 PRESPARAMS *dlgpparam; 343 343 char *dlgdata, *dlgcurdata; 344 WCHAR 344 WCHAR *szCaption; 345 345 WORD *ptrArray; 346 346 char *ctrltext, *szClass, *font; … … 351 351 BOOL fIconBmp; 352 352 353 //should be enough 353 //should be enough 354 354 size = dhdr->NumberOfItems*sizeof(DLGTITEM) * 128; 355 355 dlgt = (DLGTEMPLATE *)malloc(sizeof(DLGTEMPLATE) + dhdr->NumberOfItems*sizeof(DLGTITEM) + size); … … 359 359 dlgcurdata = dlgdata; 360 360 361 dlgt->codepage 362 dlgt->offadlgti 361 dlgt->codepage = 437; 362 dlgt->offadlgti = 14; 363 363 dlgt->fsTemplateStatus = 1; 364 364 dlgt->iItemFocus = 65535; … … 370 370 ctrlflag = 0; 371 371 if((dhdr->lStyle & WINWS_CAPTION) == WINWS_CAPTION) { 372 373 372 ctrlflag |= FCF_TITLEBAR; 373 dlgitem->flStyle |= FS_BORDER; 374 374 } 375 375 else 376 if(dhdr->lStyle & WINWS_DLGFRAME) 377 376 if(dhdr->lStyle & WINWS_DLGFRAME) //can't have title bar 377 dlgitem->flStyle |= FS_DLGBORDER; 378 378 379 379 if((dhdr->lStyle & (WINWS_SYSMENU | WINWS_CAPTION)) == (WINWS_SYSMENU | WINWS_CAPTION)) 380 380 ctrlflag |= FCF_SYSMENU; 381 381 if(dhdr->lStyle & WINWS_VSCROLL) 382 382 ctrlflag |= FCF_VERTSCROLL; 383 383 if(dhdr->lStyle & WINWS_HSCROLL) 384 384 ctrlflag |= FCF_HORZSCROLL; 385 385 if(dhdr->lStyle & WINWS_MINIMIZEBOX) 386 386 ctrlflag |= FCF_MINBUTTON; 387 387 if(dhdr->lStyle & WINWS_MAXIMIZEBOX) 388 388 ctrlflag |= FCF_MAXBUTTON; 389 389 if(dhdr->lStyle & WINWS_THICKFRAME) 390 390 dlgitem->flStyle |= FS_SIZEBORDER; 391 391 392 392 if(ctrlflag) { 393 394 395 393 *(ULONG *)dlgcurdata = ctrlflag; 394 dlgitem->offCtlData = (USHORT)((int)dlgcurdata - (int)dlgt); 395 dlgcurdata += sizeof(ULONG); 396 396 } 397 397 else dlgitem->offCtlData = 0xFFFF; 398 dlgitem->x 399 dlgitem->y 400 dlgitem->cx 401 dlgitem->cy 398 dlgitem->x = dhdr->x; 399 dlgitem->y = dhdr->y; 400 dlgitem->cx = dhdr->cx; 401 dlgitem->cy = dhdr->cy; 402 402 dlgitem->cChildren = dhdr->NumberOfItems; 403 dlgitem->id = (USHORT)0; 403 dlgitem->id = (USHORT)0; //ord id or converted name id 404 404 dlgitem->fsItemStatus = 1; 405 dlgitem->offClassName = 1; 405 dlgitem->offClassName = 1; //WC_FRAME 406 406 407 407 #ifdef DEBUG … … 416 416 if(dhdr->fNameOrd == 0xFFFF) { 417 417 #ifdef DEBUG 418 419 #endif 420 418 WriteLog("Menu ID : %d\n", (int)*(WORD *)(dhdr+1)); 419 #endif 420 ptrArray = (WORD *)((int)dhdr + sizeof(WINDLGTEMPLATEEX) + sizeof(WORD)); 421 421 } 422 422 else { 423 424 425 426 427 #ifdef DEBUG 428 429 430 431 #endif 432 433 423 if(dhdr->fNameOrd == 0) {//SvL: 0 == no menu! 424 ptrArray = (WORD *)((int)dhdr + sizeof(WINDLGTEMPLATEEX)); 425 } 426 else { 427 #ifdef DEBUG 428 ctrltext = UnicodeToAsciiString((WCHAR *)&dhdr->fNameOrd); 429 WriteLog("Menu namestring : %s\n", ctrltext); 430 FreeAsciiString(ctrltext); 431 #endif 432 ptrArray = (WORD *)((int)&dhdr->fNameOrd + UniStrlen((WCHAR *)(&dhdr->fNameOrd))*2 + sizeof(WCHAR)); 433 } 434 434 } 435 435 //Class id 436 436 if(*ptrArray == 0xFFFF) { 437 437 #ifdef DEBUG 438 439 #endif 440 438 WriteLog("Class ID : %d\n", (int)*(WORD *)(ptrArray+1)); 439 #endif 440 ptrArray = (WORD *)((int)ptrArray + 2*sizeof(WORD)); 441 441 } 442 442 else { 443 444 445 446 447 448 #ifdef DEBUG 449 450 #endif 451 // 443 if(*ptrArray == 0) {//SvL: 0 == no class! 444 ptrArray = (WORD *)((int)ptrArray + sizeof(WORD)); 445 } 446 else { 447 szClass = UnicodeToAsciiString((WCHAR *)ptrArray); 448 #ifdef DEBUG 449 WriteLog("Class namestring : %s\n", szClass); 450 #endif 451 // cout << "Class Name : " << szClass << endl; 452 452 #if 1 453 454 455 456 457 458 dlgcurdata += dlgitem->cchClassName + 1;//include terminating 0 (just to be sure)459 //TODO: SvL: Can they also be system classes? 460 // 461 // 462 #endif 463 464 465 453 dlgitem->cchClassName = strlen(szClass); 454 dlgitem->offClassName = (USHORT)((int)dlgcurdata - (int)dlgt); 455 strcpy((char *)dlgcurdata, szClass); 456 //Open32 wants class name in upper case! 457 UpCase((char *)dlgcurdata); 458 dlgcurdata += dlgitem->cchClassName + 1; //include terminating 0 (just to be sure) 459 //TODO: SvL: Can they also be system classes? 460 // dlgitem->flStyle = dhdr->lStyle; 461 // dlgitem->flStyle = ConvertDlgItemStyle(dhdr->lStyle); 462 #endif 463 ptrArray = (WORD *)((int)ptrArray + UniStrlen((WCHAR *)(ptrArray))*2 + sizeof(WORD)); 464 FreeAsciiString(szClass); 465 } 466 466 } 467 467 … … 469 469 if(*ptrArray == 0) { 470 470 #ifdef DEBUG 471 472 #endif 473 471 WriteLog("No title\n"); 472 #endif 473 ctrldata = (WINDLGITEMTEMPLATEEX *)((int)(int)ptrArray + sizeof(WORD)); 474 474 } 475 475 else { 476 477 #ifdef DEBUG 478 479 #endif 480 481 482 483 484 485 486 dlgcurdata += dlgitem->cchText + 1;//include terminating 0 (just to be sure)487 488 476 ctrltext = UnicodeToAsciiString((WCHAR *)(ptrArray)); 477 #ifdef DEBUG 478 WriteLog("Title : %s\n", ctrltext); 479 #endif 480 ctrldata = (WINDLGITEMTEMPLATEEX *)((int)(int)ptrArray + UniStrlen((WCHAR *)(ptrArray))*2 + sizeof(WORD)); 481 482 if(ctrltext[0] != 0) { 483 dlgitem->cchText = strlen(ctrltext); 484 dlgitem->offText = (USHORT)((int)dlgcurdata - (int)dlgt); 485 strcpy((char *)dlgcurdata, ctrltext); 486 dlgcurdata += dlgitem->cchText + 1; //include terminating 0 (just to be sure) 487 } 488 FreeAsciiString(ctrltext); 489 489 } 490 490 dlgitem++; 491 491 492 492 if(dhdr->lStyle & DS_SETFONT) { 493 494 495 #ifdef DEBUG 496 497 493 fhdr = (FontHeaderEx *)ctrldata; 494 font = UnicodeToAsciiString(fhdr->szFontName); 495 #ifdef DEBUG 496 WriteLog("Font Point Size : %d\n", fhdr->wPointSize); 497 WriteLog("Font Name : %s\n", font); 498 498 #endif 499 499 ctrldata = (WINDLGITEMTEMPLATEEX *)((int)fhdr + sizeof(FontHeaderEx) - 2 + UniStrlen(fhdr->szFontName)*2 + sizeof(WORD)); /*PLF Sat 97-06-21 20:22:44*/ 500 500 //TODO: no pres params yet (font in win32 dialog ignored) 501 502 503 504 505 506 507 508 509 510 511 512 501 dlgpparam = (PRESPARAMS *)dlgcurdata; 502 dlgpparam->cb = 0; 503 dlgpparam->aparam[0].id = PP_FONTNAMESIZE; 504 dlgpparam->aparam[0].cb = 0; 505 UpCase(font); 506 if(ConvertFont(font, dlgpparam, fhdr->wPointSize) == TRUE) { 507 dlgpparam->cb = sizeof(PARAM) + dlgpparam->aparam[0].cb - 1; 508 dlgpparam->aparam[0].cb = strlen(dlgpparam->aparam[0].ab) + 1; 509 dlgt->coffPresParams = (int)dlgpparam; 510 dlgcurdata += sizeof(PRESPARAMS) + dlgpparam->aparam[0].cb - 1; 511 } 512 FreeAsciiString(font); 513 513 } 514 514 ctrldata = (WINDLGITEMTEMPLATEEX *)(((int)ctrldata+3) & ~3); 515 515 516 516 for(i=0;i<dhdr->NumberOfItems;i++) { 517 518 519 520 521 522 523 524 525 526 527 528 529 530 #ifdef DEBUG 531 532 533 534 535 536 #endif 537 538 539 540 #ifdef DEBUG 541 542 #endif 543 544 545 546 547 548 549 #ifdef DEBUG 550 551 #endif 552 553 554 555 556 557 558 dlgcurdata += dlgitem->cchClassName + 1;//include terminating 0 (just to be sure)559 //TODO: SvL: Can they also be system classes? 560 // 561 562 563 } 564 565 566 567 else {//Handle Caption568 569 570 571 572 573 574 575 576 dlgitem->cchText = strlen((char *)dlgcurdata);//one USHORT for res id577 dlgcurdata += dlgitem->cchText + 1;//include terminating 0 (just to be sure)578 579 580 581 582 583 584 dlgcurdata += dlgitem->cchText + 1;//include terminating 0 (just to be sure)585 586 587 #ifdef DEBUG 588 589 590 591 #endif 592 593 594 595 // 596 597 598 517 //save as OS/2 DLGTITEM 518 dlgitem->x = ctrldata->x; 519 //SvL: 3-8-'97 520 // OS/2 -> left bottom == origin and y coordinate == left bottom origin control 521 // Win32 -> left top == origin and y coordinate == left top origin 522 dlgitem->y = dlgt->adlgti[0].cy - ctrldata->y - ctrldata->cy; 523 dlgitem->cx = ctrldata->cx; 524 dlgitem->cy = ctrldata->cy; 525 dlgitem->id = ctrldata->wId; 526 dlgitem->offCtlData = 0xFFFF; 527 dlgitem->offPresParams = 0xFFFF; 528 529 //TODO: Extended style 530 #ifdef DEBUG 531 WriteLog("***** Control Style : %X\n", ctrldata->lStyle); 532 WriteLog("Extended Control Style: %X\n", ctrldata->lExtendedStyle); 533 WriteLog("Position : (%d,%d)\n", ctrldata->x, ctrldata->y); 534 WriteLog("Size : (%d,%d)\n", ctrldata->cx, ctrldata->cy); 535 WriteLog("wID : %d\n", ctrldata->wId); 536 #endif 537 winclass = 0; 538 if(ctrldata->fClassId == 0xFFFF) { 539 winclass = *(WORD *)(ctrldata+1); 540 #ifdef DEBUG 541 WriteLog("Class ID : %d\n", winclass); 542 #endif 543 szCaption = (WCHAR *)((int)ctrldata + sizeof(WINDLGITEMTEMPLATEEX) + sizeof(WORD)); 544 dlgitem->flStyle = ConvertClassAndStyle(*(WORD *)(ctrldata+1), ctrldata->lStyle, &dlgitem->offClassName, &fIconBmp); 545 dlgitem->cchClassName = 0; 546 } 547 else { 548 szClass = UnicodeToAsciiString((WCHAR *)&ctrldata->fClassId); 549 #ifdef DEBUG 550 WriteLog("Class Name : %s\n", szClass); 551 #endif 552 szCaption = (WCHAR *)((int)ctrldata + sizeof(WINDLGITEMTEMPLATEEX) + strlen(szClass)*2); 553 dlgitem->cchClassName = strlen(szClass); 554 dlgitem->offClassName = (USHORT)((int)dlgcurdata - (int)dlgt); 555 strcpy((char *)dlgcurdata, szClass); 556 //Open32 wants class name in upper case! 557 UpCase((char *)dlgcurdata); 558 dlgcurdata += dlgitem->cchClassName + 1; //include terminating 0 (just to be sure) 559 //TODO: SvL: Can they also be system classes? 560 // dlgitem->flStyle = ctrldata->lStyle; 561 dlgitem->flStyle = ConvertDlgItemStyle(ctrldata->lStyle) ; 562 FreeAsciiString(szClass); 563 } 564 if(*(USHORT *)szCaption == 0xFFFF) { 565 szCaption += 2; 566 } 567 else { //Handle Caption 568 ctrltext = UnicodeToAsciiString(szCaption); 569 //SvL: (16-9-'97) Convert '&' chars to '~' (for some classes) 570 ConvertCaption(winclass, ctrltext); 571 if(fIconBmp == TRUE) {//control contains bitmap or icon 572 dlgitem->offText = (USHORT)((int)dlgcurdata - (int)dlgt); 573 int resid = ConvertNameId(NULL, ctrltext); 574 *(char *)dlgcurdata = '#'; 575 itoa(resid, (char *)dlgcurdata+1, 10); 576 dlgitem->cchText = strlen((char *)dlgcurdata); //one USHORT for res id 577 dlgcurdata += dlgitem->cchText + 1; //include terminating 0 (just to be sure) 578 } 579 else { 580 if(ctrltext[0] != 0) { 581 dlgitem->cchText = strlen(ctrltext); 582 dlgitem->offText = (USHORT)((int)dlgcurdata - (int)dlgt); 583 strcpy((char *)dlgcurdata, ctrltext); 584 dlgcurdata += dlgitem->cchText + 1; //include terminating 0 (just to be sure) 585 } 586 } 587 #ifdef DEBUG 588 szClass = UnicodeToAsciiString(szCaption); 589 WriteLog("Text : %s\n", szClass); 590 FreeAsciiString(szClass); 591 #endif 592 szCaption = (WCHAR *)((int)szCaption + UniStrlen(szCaption)*2 + sizeof(WORD)); 593 } 594 595 // cout << "Extra Stuff WORD : " << *(WORD *)(szCaption) << endl; 596 ctrldata = (WINDLGITEMTEMPLATEEX *)((int)szCaption + sizeof(WORD)); 597 ctrldata = (WINDLGITEMTEMPLATEEX *)(((int)ctrldata+3) & ~3); 598 dlgitem++; 599 599 } 600 600 //calculate dialog box length … … 612 612 613 613 switch(winclass) { 614 614 case WIN_BUTTON: 615 615 #if 0 616 617 618 #endif 619 616 if(style & WINBS_LEFTTEXT) 617 os2style |= ; 618 #endif 619 style &= 0xF; 620 620 //BS_TEXT, BS_BITMAP, BS_ICON, BS_MINIICON can only be used with BS_PUSHBUTTON 621 *os2class = (int)WC_BUTTON & 0xFFFF; 622 if(style == WINBS_PUSHBUTTON) 623 os2style |= BS_PUSHBUTTON; 624 else 625 if(style == WINBS_DEFPUSHBUTTON) 626 os2style |= (BS_PUSHBUTTON | BS_DEFAULT); //TODO: Correct? 627 else 628 if(style == WINBS_CHECKBOX) 629 os2style |= BS_CHECKBOX; 630 else 631 if(style == WINBS_AUTOCHECKBOX) 632 os2style |= BS_AUTOCHECKBOX; 633 else 634 if(style == WINBS_RADIOBUTTON) 635 os2style |= BS_RADIOBUTTON; 636 else 637 if(style == WINBS_3STATE) 638 os2style |= BS_3STATE; 639 else 640 if(style == WINBS_AUTO3STATE) 641 os2style |= BS_AUTO3STATE; 642 else 643 if(style == WINBS_USERBUTTON) //obsolete 644 os2style |= BS_USERBUTTON; 645 else 646 if(style == WINBS_AUTORADIOBUTTON) 647 os2style |= BS_AUTORADIOBUTTON; 648 else 649 if(style == WINBS_GROUPBOX) { 650 *os2class = (int)WC_STATIC & 0xFFFF; /*PLF Sat 97-09-20 23:58:28*/ 651 os2style |= SS_GROUPBOX; /*PLF Sun 97-09-21 00:11:07*/ 652 } 653 else 654 if(style & WINBS_OWNERDRAW) 655 os2style |= BS_USERBUTTON; //TODO:Correct?? 656 else os2style |= (BS_TEXT | BS_PUSHBUTTON); 657 os2style |= BS_AUTOSIZE; 658 break; 659 case WIN_EDIT: 660 *os2class = (int)WC_ENTRYFIELD & 0xFFFF; 661 if(style & WINES_LEFT) 662 os2style |= ES_LEFT; 663 if(style & WINES_CENTER) 664 os2style |= ES_CENTER; 665 if(style & WINES_RIGHT) 666 os2style |= ES_RIGHT; 667 #if 0 668 if(style & WINES_MULTILINE) 669 os2style |= ; 670 if(style & WINES_UPPERCASE) 671 os2style |= ; 672 if(style & WINES_LOWERCASE) 673 os2style |= ; 674 #endif 675 if(style & WINES_PASSWORD) 676 os2style |= ES_UNREADABLE; 677 #if 0 678 if(style & WINES_AUTOVSCROLL) 679 os2style |= ; 680 if(style & WINES_AUTOHSCROLL) 681 os2style |= ES_AUTOSCROLL; 682 if(style & WINES_NOHIDESEL) 683 os2style |= ; 684 if(style & WINES_OEMCONVERT) 685 os2style |= ; 686 #endif 687 if(style & WINES_READONLY) 688 os2style |= ES_READONLY; 689 #if 0 690 if(style & WINES_WANTRETURN) 691 os2style |= ; 692 #endif 693 break; 694 case WIN_STATIC: 695 *os2class = (int)WC_STATIC & 0xFFFF; 696 if(style == WINSS_LEFT) 697 os2style |= SS_TEXT | DT_LEFT; 698 else 699 if(style == WINSS_CENTER) 700 os2style |= SS_TEXT | DT_CENTER; 701 else 702 if(style == WINSS_RIGHT) 703 os2style |= SS_TEXT | DT_RIGHT; 704 else 705 if(style == WINSS_SIMPLE) 706 os2style |= SS_TEXT | DT_LEFT; 707 else 708 if(style == WINSS_ICON) { 709 os2style |= SS_ICON; 710 *fIconBmp = TRUE; 711 } 712 else 713 if(style == WINSS_BLACKRECT) 714 os2style |= SS_FGNDRECT; 715 else 716 if(style == WINSS_GRAYRECT) 717 os2style |= SS_HALFTONERECT; 718 else 719 if(style == WINSS_WHITERECT) 720 os2style |= SS_BKGNDRECT; 721 else 722 if(style == WINSS_BLACKFRAME) 723 os2style |= SS_FGNDFRAME; 724 else 725 if(style == WINSS_GRAYFRAME) 726 os2style |= SS_HALFTONEFRAME; 727 else 728 if(style == WINSS_WHITEFRAME) 729 os2style |= SS_BKGNDFRAME; 730 else os2style |= SS_TEXT; 621 *os2class = (int)WC_BUTTON & 0xFFFF; 622 if(style == WINBS_PUSHBUTTON) os2style |= BS_PUSHBUTTON; 623 else 624 if(style == WINBS_DEFPUSHBUTTON) os2style |= (BS_PUSHBUTTON | BS_DEFAULT); //TODO: Correct? 625 else 626 if(style == WINBS_CHECKBOX) os2style |= BS_CHECKBOX; 627 else 628 if(style == WINBS_AUTOCHECKBOX) os2style |= BS_AUTOCHECKBOX; 629 else 630 if(style == WINBS_RADIOBUTTON) os2style |= BS_RADIOBUTTON; 631 else 632 if(style == WINBS_3STATE) os2style |= BS_3STATE; 633 else 634 if(style == WINBS_AUTO3STATE) os2style |= BS_AUTO3STATE; 635 else 636 if(style == WINBS_USERBUTTON) os2style |= BS_USERBUTTON; //obsolete 637 else 638 if(style == WINBS_AUTORADIOBUTTON) os2style |= BS_AUTORADIOBUTTON; 639 else 640 if(style == WINBS_GROUPBOX) 641 { 642 *os2class = (int)WC_STATIC & 0xFFFF; /*PLF Sat 97-09-20 23:58:28*/ 643 os2style |= SS_GROUPBOX; /*PLF Sun 97-09-21 00:11:07*/ 644 } 645 else 646 if(style & WINBS_OWNERDRAW) os2style |= BS_USERBUTTON; //TODO:Correct?? 647 else 648 os2style |= (BS_TEXT | BS_PUSHBUTTON); 649 650 os2style |= BS_AUTOSIZE; 651 break; 652 653 /*** 654 * Edit Control 655 ***/ 656 case WIN_EDIT: 657 if (style & WINES_MULTILINE) 658 { 659 *os2class = (int)WC_MLE & 0xFFFF; 660 // if(style & WINES_LEFT) os2style |= ; 661 // if(style & WINES_CENTER) os2style |= ; 662 // if(style & WINES_RIGHT) os2style |= ; 663 // if(style & WINES_UPPERCASE) os2style |= ; 664 // if(style & WINES_LOWERCASE) os2style |= ; 665 // if(style & WINES_PASSWORD) os2style |= ; 666 // if(style & WINES_AUTOVSCROLL) os2style |= ; 667 // if(style & WINES_AUTOHSCROLL) os2style |= ; // @@@PH: experiment 668 // if(style & WINES_NOHIDESEL) os2style |= ; 669 // if(style & WINES_OEMCONVERT) os2style |= ; 670 if(style & WINES_READONLY) os2style |= MLS_READONLY; 671 // if(style & WINES_WANTRETURN) os2style |= ; 672 // if(style & WINES_NUMBER) os2style |= ; 673 if(style & WINWS_BORDER) os2style |= MLS_BORDER; // @@@PH: experiment 674 } 675 else 676 { 677 *os2class = (int)WC_ENTRYFIELD & 0xFFFF; 678 if(style & WINES_LEFT) os2style |= ES_LEFT; 679 if(style & WINES_CENTER) os2style |= ES_CENTER; 680 if(style & WINES_RIGHT) os2style |= ES_RIGHT; 681 // if(style & WINES_UPPERCASE) os2style |= ; 682 // if(style & WINES_LOWERCASE) os2style |= ; 683 if(style & WINES_PASSWORD) os2style |= ES_UNREADABLE; 684 // if(style & WINES_AUTOVSCROLL) os2style |= ; 685 if(style & WINES_AUTOHSCROLL) os2style |= ES_AUTOSCROLL; // @@@PH: experiment 686 // if(style & WINES_NOHIDESEL) os2style |= ; 687 // if(style & WINES_OEMCONVERT) os2style |= ; 688 if(style & WINES_READONLY) os2style |= ES_READONLY; 689 // if(style & WINES_WANTRETURN) os2style |= ; 690 // if(style & WINES_NUMBER) os2style |= ; 691 // if(style & WINWS_BORDER) os2style |= ; 692 } 693 break; 694 695 case WIN_STATIC: 696 *os2class = (int)WC_STATIC & 0xFFFF; 697 if(style == WINSS_LEFT) os2style |= SS_TEXT | DT_LEFT; 698 else 699 if(style == WINSS_CENTER) os2style |= SS_TEXT | DT_CENTER; 700 else 701 if(style == WINSS_RIGHT) os2style |= SS_TEXT | DT_RIGHT; 702 else 703 if(style == WINSS_SIMPLE) os2style |= SS_TEXT | DT_LEFT; 704 else 705 if(style == WINSS_ICON) 706 { 707 os2style |= SS_ICON; 708 *fIconBmp = TRUE; 709 } 710 else 711 if(style == WINSS_BLACKRECT) os2style |= SS_FGNDRECT; 712 else 713 if(style == WINSS_GRAYRECT) os2style |= SS_HALFTONERECT; 714 else 715 if(style == WINSS_WHITERECT) os2style |= SS_BKGNDRECT; 716 else 717 if(style == WINSS_BLACKFRAME) os2style |= SS_FGNDFRAME; 718 else 719 if(style == WINSS_GRAYFRAME) os2style |= SS_HALFTONEFRAME; 720 else 721 if(style == WINSS_WHITEFRAME) os2style |= SS_BKGNDFRAME; 722 else os2style |= SS_TEXT; 731 723 732 724 //TODO 733 #if 0 734 if(style == WINSS_LEFTNOWORDWRAP) 735 os2style |= ; 736 if(style == WINSS_USERITEM) 737 os2style |= ; 738 if(style == WINSS_NOPREFIX) 739 os2style |= ; 740 #endif 741 break; 742 case WIN_LISTBOX: 743 *os2class = (int)WC_LISTBOX & 0xFFFF; 744 #if 0 745 if(style & WINLBS_NOTIFY) 746 os2style |= ; 747 if(style & WINLBS_SORT) 748 os2style |= ; 749 if(style & WINLBS_NOREDRAW) 750 os2style |= ; 751 #endif 752 if(style & WINLBS_MULTIPLESEL) 753 os2style |= LS_MULTIPLESEL; 754 if(style & WINLBS_OWNERDRAWFIXED) 755 os2style |= LS_OWNERDRAW; //TODO: Correct? 756 if(style & WINLBS_OWNERDRAWVARIABLE) 757 os2style |= LS_OWNERDRAW; //TODO: Correct? 758 #if 0 759 if(style & WINLBS_HASSTRINGS) 760 os2style |= ; 761 if(style & WINLBS_USETABSTOPS) 762 os2style |= ; 763 if(style & WINLBS_NOINTEGRALHEIGHT) 764 os2style |= ; 765 if(style & WINLBS_MULTICOLUMN) 766 os2style |= ; 767 if(style & WINLBS_WANTKEYBOARDINPUT) 768 os2style |= ; 769 if(style & WINLBS_EXTENDEDSEL) 770 os2style |= LS_EXTENDEDSEL; 771 if(style & WINLBS_DISABLENOSCROLL) 772 os2style |= ; 773 #endif 774 // if(style & WINLBS_NODATA) 775 // os2style |= ; 776 break; 777 case WIN_SCROLLBAR: 778 *os2class = (int)WC_SCROLLBAR & 0xFFFF; 779 if(style & WINSBS_HORZ) 780 os2style |= SBS_HORZ; 781 else 782 if(style & WINSBS_VERT) 783 os2style |= SBS_VERT; 784 #if 0 785 if(style & WINSBS_TOPALIGN) 786 os2style |= ; 787 if(style & WINSBS_LEFTALIGN) 788 os2style |= ; 789 if(style & WINSBS_BOTTOMALIGN) 790 os2style |= ; 791 if(style & WINSBS_RIGHTALIGN) 792 os2style |= ; 793 if(style & WINSBS_SIZEBOXTOPLEFTALIGN) 794 os2style |= ; 795 if(style & WINSBS_SIZEBOXBOTTOMRIGHTALIGN) 796 os2style |= ; 797 #endif 798 if(style & WINSBS_SIZEBOX) 799 os2style |= SBS_AUTOSIZE; //TODO: Correct? 800 break; 801 case WIN_COMBOBOX: 802 *os2class = (int)WC_COMBOBOX & 0xFFFF; 803 if(style & WINCBS_SIMPLE) 804 os2style |= CBS_SIMPLE; 805 else 806 if(style & WINCBS_DROPDOWN) 807 os2style |= CBS_DROPDOWN; 808 else 809 if(style & WINCBS_DROPDOWNLIST) 810 os2style |= CBS_DROPDOWNLIST; 811 #if 0 812 if(style & WINCBS_OWNERDRAWFIXED) 813 os2style |= ; 814 if(style & WINCBS_OWNERDRAWVARIABLE) 815 os2style |= ; 816 if(style & WINCBS_AUTOHSCROLL) 817 os2style |= ; 818 if(style & WINCBS_OEMCONVERT) 819 os2style |= ; 820 if(style & WINCBS_SORT) 821 os2style |= ; 822 if(style & WINCBS_HASSTRINGS) 823 os2style |= ; 824 if(style & WINCBS_NOINTEGRALHEIGHT) 825 os2style |= ; 826 if(style & WINCBS_DISABLENOSCROLL) 827 os2style |= ; 828 #endif 829 break; 830 default: 831 //SvL:9nov97 Special class control. Just copy style 832 os2style = style; 833 break; 725 // if(style == WINSS_LEFTNOWORDWRAP) os2style |= ; 726 // if(style == WINSS_USERITEM) os2style |= ; 727 // if(style == WINSS_NOPREFIX) os2style |= ; 728 break; 729 730 case WIN_LISTBOX: 731 *os2class = (int)WC_LISTBOX & 0xFFFF; 732 // if(style & WINLBS_NOTIFY) os2style |= ; 733 // if(style & WINLBS_SORT) os2style |= ; 734 // if(style & WINLBS_NOREDRAW) os2style |= ; 735 if(style & WINLBS_MULTIPLESEL) os2style |= LS_MULTIPLESEL; 736 if(style & WINLBS_OWNERDRAWFIXED) os2style |= LS_OWNERDRAW; //TODO: Correct? 737 if(style & WINLBS_OWNERDRAWVARIABLE) os2style |= LS_OWNERDRAW; //TODO: Correct? 738 // if(style & WINLBS_HASSTRINGS) os2style |= ; 739 // if(style & WINLBS_USETABSTOPS) os2style |= ; 740 // if(style & WINLBS_NOINTEGRALHEIGHT) os2style |= ; 741 // if(style & WINLBS_MULTICOLUMN) os2style |= ; 742 // if(style & WINLBS_WANTKEYBOARDINPUT) os2style |= ; 743 // if(style & WINLBS_EXTENDEDSEL) os2style |= LS_EXTENDEDSEL; 744 // if(style & WINLBS_DISABLENOSCROLL) os2style |= ; 745 // if(style & WINLBS_NODATA) os2style |= ; 746 break; 747 748 case WIN_SCROLLBAR: 749 *os2class = (int)WC_SCROLLBAR & 0xFFFF; 750 if(style & WINSBS_HORZ) os2style |= SBS_HORZ; 751 else 752 if(style & WINSBS_VERT) os2style |= SBS_VERT; 753 754 // if(style & WINSBS_TOPALIGN) os2style |= ; 755 // if(style & WINSBS_LEFTALIGN) os2style |= ; 756 // if(style & WINSBS_BOTTOMALIGN) os2style |= ; 757 // if(style & WINSBS_RIGHTALIGN) os2style |= ; 758 // if(style & WINSBS_SIZEBOXTOPLEFTALIGN) os2style |= ; 759 // if(style & WINSBS_SIZEBOXBOTTOMRIGHTALIGN) os2style |= ; 760 if(style & WINSBS_SIZEBOX) os2style |= SBS_AUTOSIZE; //TODO: Correct? 761 break; 762 763 case WIN_COMBOBOX: 764 *os2class = (int)WC_COMBOBOX & 0xFFFF; 765 if(style & WINCBS_SIMPLE) os2style |= CBS_SIMPLE; 766 else 767 if(style & WINCBS_DROPDOWN) os2style |= CBS_DROPDOWN; 768 else 769 if(style & WINCBS_DROPDOWNLIST) os2style |= CBS_DROPDOWNLIST; 770 // if(style & WINCBS_OWNERDRAWFIXED) os2style |= ; 771 // if(style & WINCBS_OWNERDRAWVARIABLE) os2style |= ; 772 // if(style & WINCBS_AUTOHSCROLL) os2style |= ; 773 // if(style & WINCBS_OEMCONVERT) os2style |= ; 774 // if(style & WINCBS_SORT) os2style |= ; 775 // if(style & WINCBS_HASSTRINGS) os2style |= ; 776 // if(style & WINCBS_NOINTEGRALHEIGHT) os2style |= ; 777 // if(style & WINCBS_DISABLENOSCROLL) os2style |= ; 778 break; 779 780 default: 781 //SvL:9nov97 Special class control. Just copy style 782 os2style = style; 783 break; 834 784 } 835 785 return(os2style); … … 841 791 int os2style = 0; 842 792 843 /// if(style & WINWS_POPUP) 844 /// os2style |= 845 /// if(style & WINWS_CHILD) 846 /// os2style |= 847 if(style & WINWS_MINIMIZE) 848 os2style |= WS_MINIMIZED; 849 if(style & WINWS_MAXIMIZE) 850 os2style |= WS_MAXIMIZED; 851 if(style & WINWS_VISIBLE) 852 os2style |= WS_VISIBLE; 853 if(style & WINWS_DISABLED) 854 os2style |= WS_DISABLED; 855 if(style & WINWS_CLIPSIBLINGS) 856 os2style |= WS_CLIPSIBLINGS; 857 if(style & WINWS_CLIPCHILDREN) 858 os2style |= WS_CLIPCHILDREN; 859 if(style & WINWS_TABSTOP) 860 os2style |= WS_TABSTOP; 793 /// if(style & WINWS_POPUP) os2style |= 794 /// if(style & WINWS_CHILD) os2style |= 795 if(style & WINWS_MINIMIZE) os2style |= WS_MINIMIZED; 796 if(style & WINWS_MAXIMIZE) os2style |= WS_MAXIMIZED; 797 if(style & WINWS_VISIBLE) os2style |= WS_VISIBLE; 798 if(style & WINWS_DISABLED) os2style |= WS_DISABLED; 799 if(style & WINWS_CLIPSIBLINGS) os2style |= WS_CLIPSIBLINGS; 800 if(style & WINWS_CLIPCHILDREN) os2style |= WS_CLIPCHILDREN; 801 if(style & WINWS_TABSTOP) os2style |= WS_TABSTOP; 861 802 862 803 return(os2style); … … 868 809 int os2style = 0; 869 810 870 if(style & WINWS_VISIBLE) 871 os2style |= WS_VISIBLE; 872 if(style & WINWS_DISABLED) 873 os2style |= WS_DISABLED; 874 if(style & WINWS_CLIPSIBLINGS) 875 os2style |= WS_CLIPSIBLINGS; 876 if(style & WINWS_CLIPCHILDREN) 877 os2style |= WS_CLIPCHILDREN; 878 if(style & WINWS_TABSTOP) 879 os2style |= WS_TABSTOP; 880 if(style & WINWS_GROUP) 881 os2style |= WS_GROUP; 811 if(style & WINWS_VISIBLE) os2style |= WS_VISIBLE; 812 if(style & WINWS_DISABLED) os2style |= WS_DISABLED; 813 if(style & WINWS_CLIPSIBLINGS) os2style |= WS_CLIPSIBLINGS; 814 if(style & WINWS_CLIPCHILDREN) os2style |= WS_CLIPCHILDREN; 815 if(style & WINWS_TABSTOP) os2style |= WS_TABSTOP; 816 if(style & WINWS_GROUP) os2style |= WS_GROUP; 882 817 883 818 return(os2style); … … 890 825 int i, len = strlen(caption), j; 891 826 892 switch(style) { 893 case WIN_BUTTON: 894 case WIN_EDIT: 895 case WIN_LISTBOX: 896 case WIN_SCROLLBAR: 897 case WIN_COMBOBOX: 898 for(i=0;i<len;i++) { 899 if(caption[i] == '&') caption[i] = '~'; 900 } 901 break; 902 case WIN_STATIC: 903 j = 0; 904 for(i=0;i<=len;i++) { 905 if(caption[i] != '&') os2caption[j++] = caption[i]; 906 } 907 strcpy(caption, os2caption); 908 break; 909 } 827 switch(style) 828 { 829 case WIN_BUTTON: 830 case WIN_EDIT: 831 case WIN_LISTBOX: 832 case WIN_SCROLLBAR: 833 case WIN_COMBOBOX: 834 for(i=0; 835 i<len; 836 i++) 837 { 838 if(caption[i] == '&') 839 caption[i] = '~'; 840 } 841 break; 842 843 case WIN_STATIC: 844 // @@@PH: what to do if MNEMONIC style ? 845 j = 0; 846 for(i=0;i<=len;i++) 847 { 848 if(caption[i] != '&') 849 os2caption[j++] = caption[i]; 850 } 851 strcpy(caption, os2caption); 852 break; 853 } 910 854 } 911 855 //****************************************************************************** … … 916 860 917 861 if(strcmp(font, "MS SHELL DLG") == 0) { 918 919 920 921 922 862 strcpy(dlgpparam->aparam[0].ab, "System VIO"); 863 dlgpparam->aparam[0].cb = sizeof("System VIO"); 864 sprintf(fontsize, ".%d", fsize); 865 strcat(dlgpparam->aparam[0].ab, fontsize); 866 return(TRUE); 923 867 } 924 868 // else TODO: More fonts!!! 925 return(FALSE); 869 return(FALSE); //not found 926 870 } 927 871 //******************************************************************************
Note:
See TracChangeset
for help on using the changeset viewer.