45#define STATE_GWL_OFFSET 0
46#define HFONT_GWL_OFFSET (sizeof(LONG))
47#define HICON_GWL_OFFSET (HFONT_GWL_OFFSET+sizeof(HFONT))
49#define UISTATE_GWL_OFFSET (HICON_GWL_OFFSET+sizeof(HICON))
50#define NB_EXTRA_BYTES (UISTATE_GWL_OFFSET+sizeof(LONG_PTR))
52#define NB_EXTRA_BYTES (HICON_GWL_OFFSET+sizeof(HICON))
56#define BUTTON_NSTATES 0x0F
57#define BUTTON_BTNPRESSED 0x40
58#define BUTTON_UNKNOWN2 0x20
59#define BUTTON_UNKNOWN3 0x10
61#define BUTTON_BMCLICK 0x100
64#define BUTTON_NOTIFY_PARENT(hWnd, code) \
66 TRACE("notification " #code " sent to hwnd=%p\n", GetParent(hWnd)); \
67 SendMessageW(GetParent(hWnd), WM_COMMAND, \
68 MAKEWPARAM(GetWindowLongPtrW((hWnd),GWLP_ID), (code)), \
80#define MAX_BTN_TYPE 16
120static const WCHAR buttonW[] = {
'B',
'u',
't',
't',
'o',
'n',0};
182 static const INT len = 512;
209 prevflags = get_ui_state(
hwnd);
211 if (prevflags !=
flags)
273 button_update_uistate(
hWnd, unicode );
530 if (
state & BUTTON_BMCLICK)
538 if (!(
state & BUTTON_BMCLICK))
break;
539 state &= ~BUTTON_BMCLICK;
574 else style &= ~WS_TABSTOP;
607 case WM_UPDATEUISTATE:
613 if (button_update_uistate(
hWnd, unicode))
662 style &= ~BS_TYPEMASK;
728 HFONT
hFont, hPrevFont = 0;
746 if (get_ui_state(
hwnd) & UISF_HIDEACCEL)
787 case DT_LEFT:
r.left++;
r.right++;
break;
790 r.right =
r.left +
n;
break;
793 r.left =
r.right -
n;
799 case DT_TOP:
r.top++;
r.bottom++;
break;
806 r.bottom =
r.top +
n;
break;
809 r.top =
r.bottom -
n;
900 UINT dtFlags, uState;
948 else if (pushedState)
965 if (dtFlags == (
UINT)-1L)
981 if (!(get_ui_state(
hwnd) & UISF_HIDEFOCUS))
1007 int delta, text_offset, checkBoxWidth, checkBoxHeight;
1052 rtext.
right -= checkBoxWidth + text_offset;
1057 rtext.
left += checkBoxWidth + text_offset;
1058 rbox.
right = checkBoxWidth;
1070 if (dtFlags != (
UINT)-1L)
1092 delta = rbox.
bottom - rbox.
top - checkBoxHeight;
1096 rbox.
bottom = rbox.
top + checkBoxHeight;
1098 rbox.
top -= -delta/2 + 1;
1099 rbox.
bottom = rbox.
top + checkBoxHeight;
1103 rbox.
top = rbox.
bottom - checkBoxHeight;
1105 rbox.
bottom += -delta/2 + 1;
1106 rbox.
top = rbox.
bottom - checkBoxHeight;
1110 int ofs = (delta / 2);
1112 rbox.
top = rbox.
bottom - checkBoxHeight;
1113 }
else if (delta < 0) {
1114 int ofs = (-delta / 2);
1115 rbox.
top -= ofs + 1;
1116 rbox.
bottom = rbox.
top + checkBoxHeight;
1123 if (dtFlags == (
UINT)-1L)
1133 if (!(get_ui_state(
hwnd) & UISF_HIDEFOCUS))
1163 if (!sibling)
break;
1171 }
while (sibling !=
start);
1207 rcFrame.
top += (
tm.tmHeight / 2) - 1;
1213 if (dtFlags != (
UINT)-1)
1263 if (!(get_ui_state(
hwnd) & UISF_HIDEFOCUS))
#define WINE_DEFAULT_DEBUG_CHANNEL(t)
LRESULT WINAPI ButtonWndProcA(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
LRESULT WINAPI ButtonWndProcW(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
#define HeapFree(x, y, z)
static void cleanup(void)
unsigned short(__cdecl typeof(TIFFCurrentDirectory))(struct tiff *)
UINT WINAPI GetDpiForWindow(_In_ HWND hWnd)
GLdouble GLdouble GLdouble r
static const WCHAR buttonW[]
VOID NTAPI NtUserNotifyWinEvent(DWORD Event, HWND hWnd, LONG idObject, LONG idChild)
INT NTAPI NtUserInternalGetWindowText(HWND hWnd, LPWSTR lpString, INT nMaxCount)
HWND NTAPI NtUserSetFocus(HWND hWnd)
BOOL NTAPI NtUserInvalidateRect(HWND hWnd, CONST RECT *lpRect, BOOL bErase)
DWORD NTAPI NtUserAlterWindowStyle(HWND hWnd, DWORD Index, LONG NewValue)
BOOL NTAPI NtUserEndPaint(HWND hWnd, CONST PAINTSTRUCT *lPs)
HDC NTAPI NtUserBeginPaint(HWND hWnd, PAINTSTRUCT *lPs)
HWND NTAPI NtUserSetCapture(HWND Wnd)
BOOL NTAPI NtUserSetWindowFNID(HWND hWnd, WORD fnID)
HDC NTAPI NtUserGetDC(HWND hWnd)
INT WINAPI DrawTextW(HDC hdc, LPCWSTR str, INT count, LPRECT rect, UINT flags)
#define BS_AUTORADIOBUTTON
_Out_opt_ int _Out_opt_ int * cy
#define BST_INDETERMINATE
DWORD WINAPI GetSysColor(_In_ int)
BOOL WINAPI IsWindow(_In_opt_ HWND)
#define WM_CTLCOLORSTATIC
#define GetWindowLongPtrW
BOOL WINAPI ReleaseCapture(void)
#define COLOR_WINDOWFRAME
LRESULT WINAPI DefWindowProcW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
LRESULT WINAPI DefWindowProcA(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
BOOL WINAPI GetIconInfo(_In_ HICON, _Out_ PICONINFO)
#define WM_CAPTURECHANGED
BOOL WINAPI DrawFrameControl(_In_ HDC, _Inout_ LPRECT, _In_ UINT, _In_ UINT)
HBRUSH WINAPI GetSysColorBrush(_In_ int)
LONG WINAPI GetWindowLongW(_In_ HWND, _In_ int)
#define DLGC_UNDEFPUSHBUTTON
HWND WINAPI GetCapture(void)
#define WM_SYSCOLORCHANGE
#define DLGC_DEFPUSHBUTTON
BOOL WINAPI PtInRect(_In_ LPCRECT, _In_ POINT)
HWND WINAPI GetNextDlgGroupItem(_In_ HWND, _In_opt_ HWND, _In_ BOOL)
#define DFCS_BUTTON3STATE
BOOL WINAPI GetClientRect(_In_ HWND, _Out_ LPRECT)
BOOL WINAPI DrawEdge(_In_ HDC, _Inout_ LPRECT, _In_ UINT, _In_ UINT)
BOOL WINAPI IntersectRect(_Out_ LPRECT, _In_ LPCRECT, _In_ LPCRECT)
BOOL WINAPI IsWindowEnabled(_In_ HWND)
HWND WINAPI GetParent(_In_ HWND)
BOOL WINAPI OffsetRect(_Inout_ LPRECT, _In_ int, _In_ int)
BOOL WINAPI DrawFocusRect(_In_ HDC, _In_ LPCRECT)
#define SetWindowLongPtrW
BOOL WINAPI InflateRect(_Inout_ LPRECT, _In_ int, _In_ int)
BOOL WINAPI DrawStateW(_In_ HDC, _In_opt_ HBRUSH, _In_opt_ DRAWSTATEPROC, _In_ LPARAM, _In_ WPARAM, _In_ int, _In_ int, _In_ int, _In_ int, _In_ UINT)
BOOL(CALLBACK * DRAWSTATEPROC)(HDC, LPARAM, WPARAM, int, int)
BOOL WINAPI IsWindowVisible(_In_ HWND)
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
BOOL WINAPI SetRect(_Out_ LPRECT, _In_ int, _In_ int, _In_ int, _In_ int)
const struct builtin_class_descr BUTTON_builtin_class
#define NtUserSetPrivateData(HWND, OFFSET, SIZE, VALUE)
#define NtUserReleaseDC(HWND, HDC)
#define NTUSER_WNDPROC_BUTTON
#define NtUserGetPrivateData(HWND, OFFSET, SIZE)
#define NtUserReleaseCapture()
COLORREF WINAPI SetDCPenColor(_In_ HDC hdc, _In_ COLORREF crColor)
HBRUSH FASTCALL GetControlColor(PWND pwndParent, PWND pwnd, HDC hdc, UINT CtlMsg)
BOOL WINAPI GetTextMetricsW(_In_ HDC, _Out_ LPTEXTMETRICW)
HGDIOBJ WINAPI GetStockObject(_In_ int)
int WINAPI GetObjectW(_In_ HANDLE h, _In_ int c, _Out_writes_bytes_opt_(c) LPVOID pv)
int WINAPI GetDeviceCaps(_In_opt_ HDC, _In_ int)
BOOL WINAPI GetCharWidthW(_In_ HDC hdc, _In_ UINT iFirst, _In_ UINT iLast, _Out_writes_(iLast+1 - iFirst) LPINT lpBuffer)
HGDIOBJ WINAPI SelectObject(_In_ HDC, _In_ HGDIOBJ)
int WINAPI FillRect(HDC, LPCRECT, HBRUSH)
BOOL WINAPI Rectangle(_In_ HDC, _In_ int, _In_ int, _In_ int, _In_ int)
int WINAPI SetBkMode(_In_ HDC, _In_ int)
COLORREF WINAPI SetTextColor(_In_ HDC, _In_ COLORREF)
int WINAPI SelectClipRgn(_In_ HDC, _In_opt_ HRGN)