Commit aef6e3d2 authored by André Hentschel's avatar André Hentschel Committed by Alexandre Julliard

user32: Use a macro instead of direct values.

parent dcfdfbaa
...@@ -31,7 +31,6 @@ ...@@ -31,7 +31,6 @@
* Styles * Styles
* - BS_NOTIFY: is it complete? * - BS_NOTIFY: is it complete?
* - BS_RIGHTBUTTON: same as BS_LEFTTEXT * - BS_RIGHTBUTTON: same as BS_LEFTTEXT
* - BS_TYPEMASK
* *
* Messages * Messages
* - WM_CHAR: Checks a (manual or automatic) check box on '+' or '=', clears it on '-' key. * - WM_CHAR: Checks a (manual or automatic) check box on '+' or '=', clears it on '-' key.
...@@ -191,7 +190,7 @@ static inline void set_button_font( HWND hwnd, HFONT font ) ...@@ -191,7 +190,7 @@ static inline void set_button_font( HWND hwnd, HFONT font )
static inline UINT get_button_type( LONG window_style ) static inline UINT get_button_type( LONG window_style )
{ {
return (window_style & 0x0f); return (window_style & BS_TYPEMASK);
} }
/* paint a button of any type */ /* paint a button of any type */
...@@ -273,8 +272,8 @@ LRESULT ButtonWndProc_common(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam, ...@@ -273,8 +272,8 @@ LRESULT ButtonWndProc_common(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam,
/* XP turns a BS_USERBUTTON into BS_PUSHBUTTON */ /* XP turns a BS_USERBUTTON into BS_PUSHBUTTON */
if (btn_type == BS_USERBUTTON ) if (btn_type == BS_USERBUTTON )
{ {
style = (style & ~0x0f) | BS_PUSHBUTTON; style = (style & ~BS_TYPEMASK) | BS_PUSHBUTTON;
WIN_SetStyle( hWnd, style, 0x0f & ~style ); WIN_SetStyle( hWnd, style, BS_TYPEMASK & ~style );
} }
set_button_state( hWnd, BUTTON_UNCHECKED ); set_button_state( hWnd, BUTTON_UNCHECKED );
return 0; return 0;
...@@ -459,10 +458,10 @@ LRESULT ButtonWndProc_common(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam, ...@@ -459,10 +458,10 @@ LRESULT ButtonWndProc_common(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam,
break; break;
case BM_SETSTYLE: case BM_SETSTYLE:
if ((wParam & 0x0f) >= MAX_BTN_TYPE) break; if ((wParam & BS_TYPEMASK) >= MAX_BTN_TYPE) break;
btn_type = wParam & 0x0f; btn_type = wParam & BS_TYPEMASK;
style = (style & ~0x0f) | btn_type; style = (style & ~BS_TYPEMASK) | btn_type;
WIN_SetStyle( hWnd, style, 0x0f & ~style ); WIN_SetStyle( hWnd, style, BS_TYPEMASK & ~style );
/* Only redraw if lParam flag is set.*/ /* Only redraw if lParam flag is set.*/
if (lParam) if (lParam)
...@@ -547,7 +546,7 @@ static UINT BUTTON_BStoDT( DWORD style, DWORD ex_style ) ...@@ -547,7 +546,7 @@ static UINT BUTTON_BStoDT( DWORD style, DWORD ex_style )
/* "Convert" pushlike buttons to pushbuttons */ /* "Convert" pushlike buttons to pushbuttons */
if (style & BS_PUSHLIKE) if (style & BS_PUSHLIKE)
style &= ~0x0F; style &= ~BS_TYPEMASK;
if (!(style & BS_MULTILINE)) if (!(style & BS_MULTILINE))
dtStyle |= DT_SINGLELINE; dtStyle |= DT_SINGLELINE;
...@@ -988,7 +987,7 @@ static void BUTTON_CheckAutoRadioButton( HWND hwnd ) ...@@ -988,7 +987,7 @@ static void BUTTON_CheckAutoRadioButton( HWND hwnd )
{ {
if (!sibling) break; if (!sibling) break;
if ((hwnd != sibling) && if ((hwnd != sibling) &&
((GetWindowLongW( sibling, GWL_STYLE) & 0x0f) == BS_AUTORADIOBUTTON)) ((GetWindowLongW( sibling, GWL_STYLE) & BS_TYPEMASK) == BS_AUTORADIOBUTTON))
SendMessageW( sibling, BM_SETCHECK, BUTTON_UNCHECKED, 0 ); SendMessageW( sibling, BM_SETCHECK, BUTTON_UNCHECKED, 0 );
sibling = GetNextDlgGroupItem( parent, sibling, FALSE ); sibling = GetNextDlgGroupItem( parent, sibling, FALSE );
} while (sibling != start); } while (sibling != start);
......
...@@ -711,6 +711,7 @@ typedef struct tagWINDOWPLACEMENT ...@@ -711,6 +711,7 @@ typedef struct tagWINDOWPLACEMENT
#define BS_USERBUTTON 0x00000008L #define BS_USERBUTTON 0x00000008L
#define BS_AUTORADIOBUTTON 0x00000009L #define BS_AUTORADIOBUTTON 0x00000009L
#define BS_OWNERDRAW 0x0000000BL #define BS_OWNERDRAW 0x0000000BL
#define BS_TYPEMASK 0x0000000FL
#define BS_LEFTTEXT 0x00000020L #define BS_LEFTTEXT 0x00000020L
#define BS_RIGHTBUTTON BS_LEFTTEXT #define BS_RIGHTBUTTON BS_LEFTTEXT
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment