Mercurial > dwindows
comparison win/dw.c @ 1314:c969db49606e
Initial commit allowing dw_window_set_style() to work on menu item handles.
author | bsmith@81767d24-ef19-dc11-ae90-00e081727c95 |
---|---|
date | Fri, 04 Nov 2011 14:13:38 +0000 |
parents | 47dbe605a03f |
children | 3f1ac800bf65 |
comparison
equal
deleted
inserted
replaced
1313:9f12bc79924b | 1314:c969db49606e |
---|---|
6482 * width: New width in pixels. | 6482 * width: New width in pixels. |
6483 * height: New height in pixels. | 6483 * height: New height in pixels. |
6484 */ | 6484 */ |
6485 void API dw_window_set_style(HWND handle, ULONG style, ULONG mask) | 6485 void API dw_window_set_style(HWND handle, ULONG style, ULONG mask) |
6486 { | 6486 { |
6487 ULONG tmp, currentstyle = GetWindowLong(handle, GWL_STYLE); | 6487 ULONG tmp, currentstyle; |
6488 ColorInfo *cinfo = (ColorInfo *)GetWindowLongPtr(handle, GWLP_USERDATA); | 6488 ColorInfo *cinfo; |
6489 | |
6490 if(handle < (HWND)65536) | |
6491 { | |
6492 char buffer[31] = {0}; | |
6493 HMENU mymenu; | |
6494 ULONG id = (ULONG)handle; | |
6495 | |
6496 _snprintf(buffer, 30, "_dw_id%ld", id); | |
6497 mymenu = (HMENU)dw_window_get_data(DW_HWND_OBJECT, buffer); | |
6498 | |
6499 if(mymenu && IsMenu(mymenu)) | |
6500 dw_menu_item_set_state((HMENUI)mymenu, id, style & mask); | |
6501 return; | |
6502 } | |
6503 | |
6504 currentstyle = GetWindowLong(handle, GWL_STYLE); | |
6505 cinfo = (ColorInfo *)GetWindowLongPtr(handle, GWLP_USERDATA); | |
6489 | 6506 |
6490 tmp = currentstyle | mask; | 6507 tmp = currentstyle | mask; |
6491 tmp ^= mask; | 6508 tmp ^= mask; |
6492 tmp |= style; | 6509 tmp |= style; |
6493 | |
6494 | 6510 |
6495 /* We are using SS_NOPREFIX as a VCENTER flag */ | 6511 /* We are using SS_NOPREFIX as a VCENTER flag */ |
6496 if(tmp & SS_NOPREFIX) | 6512 if(tmp & SS_NOPREFIX) |
6497 { | 6513 { |
6498 | 6514 |