Module: wine Branch: master Commit: bbd9e229e3c2676e9db7ce64d6a87bb75f506e84 URL: http://source.winehq.org/git/wine.git/?a=commit;h=bbd9e229e3c2676e9db7ce64d6...
Author: Alexandre Julliard julliard@winehq.org Date: Thu Apr 17 19:26:34 2008 +0200
user32: Added support for WS_EX_RIGHT in the button control.
---
dlls/user32/button.c | 8 +++++--- 1 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/dlls/user32/button.c b/dlls/user32/button.c index 27f10b7..d1ba2c1 100644 --- a/dlls/user32/button.c +++ b/dlls/user32/button.c @@ -567,9 +567,8 @@ static LRESULT WINAPI ButtonWndProcA( HWND hWnd, UINT uMsg, WPARAM wParam, LPARA
/********************************************************************** * Convert button styles to flags used by DrawText. - * TODO: handle WS_EX_RIGHT extended style. */ -static UINT BUTTON_BStoDT(DWORD style) +static UINT BUTTON_BStoDT( DWORD style, DWORD ex_style ) { UINT dtStyle = DT_NOCLIP; /* We use SelectClipRgn to limit output */
@@ -593,6 +592,8 @@ static UINT BUTTON_BStoDT(DWORD style) /* all other flavours have left aligned text */ }
+ if (ex_style & WS_EX_RIGHT) dtStyle = DT_RIGHT | (dtStyle & ~(DT_LEFT | DT_CENTER)); + /* DrawText ignores vertical alignment for multiline text, * but we use these flags to align label manually. */ @@ -626,10 +627,11 @@ static UINT BUTTON_BStoDT(DWORD style) static UINT BUTTON_CalcLabelRect(HWND hwnd, HDC hdc, RECT *rc) { LONG style = GetWindowLongW( hwnd, GWL_STYLE ); + LONG ex_style = GetWindowLongW( hwnd, GWL_EXSTYLE ); WCHAR *text; ICONINFO iconInfo; BITMAP bm; - UINT dtStyle = BUTTON_BStoDT(style); + UINT dtStyle = BUTTON_BStoDT( style, ex_style ); RECT r = *rc; INT n;