Mercurial > dwindows
comparison win/dw.c @ 411:a3a299455c67
Added parsing for " Bold" and " Italic" in the font name so it behaves
like OS/2.
author | bsmith@81767d24-ef19-dc11-ae90-00e081727c95 |
---|---|
date | Tue, 13 May 2003 05:51:01 +0000 |
parents | a7a561103eac |
children | 2a55f61714fd |
comparison
equal
deleted
inserted
replaced
410:47273b6a8500 | 411:a3a299455c67 |
---|---|
3342 _do_resize(mybox, rect.right - rect.left, rect.bottom - rect.top); | 3342 _do_resize(mybox, rect.right - rect.left, rect.bottom - rect.top); |
3343 ShowWindow(istoplevel ? mybox->items[0].hwnd : handle, SW_SHOW); | 3343 ShowWindow(istoplevel ? mybox->items[0].hwnd : handle, SW_SHOW); |
3344 } | 3344 } |
3345 } | 3345 } |
3346 | 3346 |
3347 int instring(char *text, char *buffer) | |
3348 { | |
3349 int z, len = strlen(text), buflen = strlen(buffer); | |
3350 | |
3351 if(buflen > len) | |
3352 { | |
3353 for(z=0;z<(buflen-len);z++) | |
3354 { | |
3355 if(memcmp(text, &buffer[z], len) == 0) | |
3356 return 1; | |
3357 } | |
3358 } | |
3359 return 0; | |
3360 } | |
3361 | |
3347 /* | 3362 /* |
3348 * Changes a window's parent to newparent. | 3363 * Changes a window's parent to newparent. |
3349 * Parameters: | 3364 * Parameters: |
3350 * handle: The window handle to destroy. | 3365 * handle: The window handle to destroy. |
3351 * newparent: The window's new parent window. | 3366 * newparent: The window's new parent window. |
3380 #endif | 3395 #endif |
3381 lf.lfHeight = size; | 3396 lf.lfHeight = size; |
3382 lf.lfWidth = 0; | 3397 lf.lfWidth = 0; |
3383 lf.lfEscapement = 0; | 3398 lf.lfEscapement = 0; |
3384 lf.lfOrientation = 0; | 3399 lf.lfOrientation = 0; |
3385 lf.lfItalic = 0; | 3400 lf.lfItalic = instring(" Italic", &fontname[z+1]); |
3386 lf.lfUnderline = 0; | 3401 lf.lfUnderline = 0; |
3387 lf.lfStrikeOut = 0; | 3402 lf.lfStrikeOut = 0; |
3388 lf.lfWeight = FW_NORMAL; | 3403 lf.lfWeight = instring(" Bold", &fontname[z+1]) ? FW_BOLD : FW_NORMAL; |
3389 lf.lfCharSet = DEFAULT_CHARSET; | 3404 lf.lfCharSet = DEFAULT_CHARSET; |
3390 lf.lfOutPrecision = 0; | 3405 lf.lfOutPrecision = 0; |
3391 lf.lfClipPrecision = 0; | 3406 lf.lfClipPrecision = 0; |
3392 lf.lfQuality = DEFAULT_QUALITY; | 3407 lf.lfQuality = DEFAULT_QUALITY; |
3393 lf.lfPitchAndFamily = DEFAULT_PITCH | FW_DONTCARE; | 3408 lf.lfPitchAndFamily = DEFAULT_PITCH | FW_DONTCARE; |