mirror of
https://github.com/reactos/reactos.git
synced 2024-08-19 18:02:55 +00:00
[COMCTL32] -Draw button with classic style if BM_SETIMAGE was used.
svn path=/trunk/; revision=73897
This commit is contained in:
parent
f3aa1616ef
commit
777a9ec12a
|
@ -38,6 +38,7 @@ typedef void (*pfThemedPaint)(HTHEME theme, HWND hwnd, HDC hdc, ButtonState draw
|
||||||
|
|
||||||
#define STATE_GWL_OFFSET 0
|
#define STATE_GWL_OFFSET 0
|
||||||
#define HFONT_GWL_OFFSET (sizeof(LONG))
|
#define HFONT_GWL_OFFSET (sizeof(LONG))
|
||||||
|
#define HIMAGE_GWL_OFFSET (HFONT_GWL_OFFSET+sizeof(HFONT))
|
||||||
|
|
||||||
static inline LONG get_button_state( HWND hwnd )
|
static inline LONG get_button_state( HWND hwnd )
|
||||||
{
|
{
|
||||||
|
@ -320,15 +321,25 @@ static const pfThemedPaint btnThemedPaintFunc[BUTTON_TYPE + 1] =
|
||||||
|
|
||||||
BOOL BUTTON_PaintWithTheme(HTHEME theme, HWND hwnd, HDC hParamDC, LPARAM prfFlag)
|
BOOL BUTTON_PaintWithTheme(HTHEME theme, HWND hwnd, HDC hParamDC, LPARAM prfFlag)
|
||||||
{
|
{
|
||||||
DWORD dwStyle = GetWindowLongW(hwnd, GWL_STYLE);
|
DWORD dwStyle;
|
||||||
DWORD dwStyleEx = GetWindowLongW(hwnd, GWL_EXSTYLE);
|
DWORD dwStyleEx;
|
||||||
UINT dtFlags = get_drawtext_flags(dwStyle, dwStyleEx);
|
UINT dtFlags;
|
||||||
int state = get_button_state(hwnd);
|
int state;
|
||||||
ButtonState drawState;
|
ButtonState drawState;
|
||||||
pfThemedPaint paint = btnThemedPaintFunc[ dwStyle & BUTTON_TYPE ];
|
pfThemedPaint paint;
|
||||||
|
|
||||||
|
dwStyle = GetWindowLongW(hwnd, GWL_STYLE);
|
||||||
|
paint = btnThemedPaintFunc[ dwStyle & BUTTON_TYPE ];
|
||||||
if (!paint)
|
if (!paint)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
|
if (GetWindowLongPtrW( hwnd, HIMAGE_GWL_OFFSET) != 0)
|
||||||
|
return FALSE;
|
||||||
|
|
||||||
|
dwStyleEx = GetWindowLongW(hwnd, GWL_EXSTYLE);
|
||||||
|
dtFlags = get_drawtext_flags(dwStyle, dwStyleEx);
|
||||||
|
state = get_button_state(hwnd);
|
||||||
|
|
||||||
if(IsWindowEnabled(hwnd))
|
if(IsWindowEnabled(hwnd))
|
||||||
{
|
{
|
||||||
if(state & BST_PUSHED) drawState = STATE_PRESSED;
|
if(state & BST_PUSHED) drawState = STATE_PRESSED;
|
||||||
|
|
Loading…
Reference in a new issue