Michael Lin mlin@corvu.com.au writes:
inline static UINT get_button_type( LONG window_style ) {
- return (window_style & 0x0f);
- if ((window_style & BS_OWNERDRAW) == BS_OWNERDRAW)
return BS_OWNERDRAW;
- else
return (window_style & 0x0f);
BS_OWNERDRAW is not a bit mask, this won't work right. What is the problem you are trying to fix?
Hi Alexandre,
I was trying to make the following dialog compile and work in WINE. The dialog compiles and works in Borland.
MSGBOX_DLG DIALOG 21, 32, 168, 83 STYLE DS_MODALFRAME | 0x4L | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU CAPTION "Error" FONT 8, "MS Sans Serif" { GROUPBOX "", 101, 6, -2, 157, 61, BS_GROUPBOX | WS_CHILD | WS_VISIBLE AUTO3STATE "Text", 103, 10, 9, 149, 47, BS_OWNERDRAW | WS_CHILD | WS_VISIBLE | WS_TABSTOP PUSHBUTTON "Cancel", 111, 6, 65, 50, 14, BS_PUSHBUTTON | WS_CHILD | WS_VISIBLE | WS_GROUP | WS_TABSTOP PUSHBUTTON "Cancel", 112, 58, 65, 50, 14 PUSHBUTTON "Cancel", 113, 110, 65, 50, 14 }
Alexandre Julliard wrote:
Michael Lin mlin@corvu.com.au writes:
inline static UINT get_button_type( LONG window_style ) {
- return (window_style & 0x0f);
- if ((window_style & BS_OWNERDRAW) == BS_OWNERDRAW)
return BS_OWNERDRAW;
- else
return (window_style & 0x0f);
BS_OWNERDRAW is not a bit mask, this won't work right. What is the problem you are trying to fix?
Michael Lin mlin@corvu.com.au writes:
I was trying to make the following dialog compile and work in WINE. The dialog compiles and works in Borland.
Does the dialog compiled on Windows work on Wine? If so it's a resource compiler issue. If not, you should then write a test program that creates buttons with various styles to find out exactly how Windows handles it.
Hi Alexandre,
The dialog compiled on windows works on wine. On windows, AUTO3STATE control with BS_OWNERDRAW will have BS_OWNERDRAW button style. AUTO3STATE control without BS_OWNERDRAW will have BS_AUTO3STATE button style. So BS_OWNERDRAW will overrides all other button style as in msdn documentation says that it is not supposed to be used with any other button style.
so how does the following patch in wrc look?
Index: tools/wrc/parser.y =================================================================== RCS file: /home/wine/wine/tools/wrc/parser.y,v retrieving revision 1.49 diff -u -r1.49 parser.y --- tools/wrc/parser.y 8 Mar 2005 19:09:16 -0000 1.49 +++ tools/wrc/parser.y 23 Mar 2005 00:02:47 -0000 @@ -2062,7 +2062,11 @@
if (!ctrl->gotstyle) ctrl->style = new_style(0,0); - + + /* BS_OWNERDRAW overrides any other button style */ + if (type == CT_BUTTON && (ctrl->style->or_mask & BS_OWNERDRAW) == BS_OWNERDRAW) + special_style = BS_PUSHBUTTON; + /* combine all styles */ ctrl->style->or_mask = ctrl->style->or_mask | defaultstyle | special_style; ctrl->gotstyle = TRUE;
I will submit this patch if it looks ok. Thanks Michael
Alexandre Julliard wrote:
Michael Lin mlin@corvu.com.au writes:
I was trying to make the following dialog compile and work in WINE. The dialog compiles and works in Borland.
Does the dialog compiled on Windows work on Wine? If so it's a resource compiler issue. If not, you should then write a test program that creates buttons with various styles to find out exactly how Windows handles it.