SendMessageW( hWnd, BM_SETCHECK, !(infoPtr->state & BST_CHECKED), 0 );
break;
case BS_AUTORADIOBUTTON:
+#ifdef __REACTOS__
+ BUTTON_CheckAutoRadioButton( hWnd );
+#else
SendMessageW( hWnd, BM_SETCHECK, TRUE, 0 );
+#endif
break;
case BS_AUTO3STATE:
SendMessageW( hWnd, BM_SETCHECK, (infoPtr->state & BST_INDETERMINATE) ? 0 :
BOOL ret = FALSE;
SIZE* pSize = (SIZE*)lParam;
+ if (!pSize)
+ {
+ return FALSE;
+ }
+
if (btn_type == BS_PUSHBUTTON ||
btn_type == BS_DEFPUSHBUTTON ||
btn_type == BS_USERBUTTON)
infoPtr->state = (infoPtr->state & ~3) | wParam;
InvalidateRect( hWnd, NULL, FALSE );
}
+#ifndef __REACTOS__
if ((btn_type == BS_AUTORADIOBUTTON) && (wParam == BST_CHECKED) && (style & WS_CHILD))
BUTTON_CheckAutoRadioButton( hWnd );
+#endif
break;
case BM_GETSTATE:
UINT dtStyle = BUTTON_BStoDT( style, ex_style );
RECT r = *rc;
INT n;
-#if !defined(_USER32_) && defined(__REACTOS__)
+#ifdef __REACTOS__
BOOL bHasIml = BUTTON_DrawIml(hdc, &infoPtr->imlData, &r, TRUE, 0);
#endif
default:
empty_rect:
-#if !defined(_USER32_) && defined(__REACTOS__)
+#ifdef __REACTOS__
if (bHasIml)
break;
#endif
return (UINT)-1;
}
-#if !defined(_USER32_) && defined(__REACTOS__)
+#ifdef __REACTOS__
if (bHasIml)
{
if (infoPtr->imlData.uAlign == BUTTON_IMAGELIST_ALIGN_LEFT)
{
case DT_TOP: r.top++; r.bottom++; break;
case DT_VCENTER: n = r.bottom - r.top;
+#ifdef __REACTOS__
+ r.top = rc->top + ((rc->bottom - 1 - rc->top) - n) / 2;
+#else
r.top = rc->top + ((rc->bottom - rc->top) - n) / 2;
+#endif
r.bottom = r.top + n; break;
case DT_BOTTOM: n = r.bottom - r.top;
r.bottom = rc->bottom - 1;
* I don't have Win31 on hand to verify that, so I leave it as is.
*/
-#if !defined(_USER32_) && defined(__REACTOS__)
+#ifdef __REACTOS__
RECT rcText = *rc;
BUTTON_DrawIml(hdc, &infoPtr->imlData, &rcText, FALSE, 0);
#endif
parent = GetParent(hwnd);
/* make sure that starting control is not disabled or invisible */
+#ifdef __REACTOS__
+ start = sibling = hwnd;
+#else
start = sibling = GetNextDlgGroupItem( parent, hwnd, TRUE );
+#endif
do
{
if (!sibling) break;
+#ifdef __REACTOS__
+ if (SendMessageW( sibling, WM_GETDLGCODE, 0, 0 ) == (DLGC_BUTTON | DLGC_RADIOBUTTON))
+ SendMessageW( sibling, BM_SETCHECK, sibling == hwnd ? BST_CHECKED : BST_UNCHECKED, 0 );
+#else
if ((hwnd != sibling) &&
((GetWindowLongW( sibling, GWL_STYLE) & BS_TYPEMASK) == BS_AUTORADIOBUTTON))
SendMessageW( sibling, BM_SETCHECK, BST_UNCHECKED, 0 );
+#endif
sibling = GetNextDlgGroupItem( parent, sibling, FALSE );
} while (sibling != start);
}
{
DrawThemeText(theme, hDC, BP_PUSHBUTTON, state, text, lstrlenW(text), dtFlags, 0, &textRect);
heap_free(text);
+#ifdef __REACTOS__
+ text = NULL;
+#endif
}
if (focused)
if (cdrf == CDRF_NOTIFYPOSTPAINT)
BUTTON_SendCustomDraw(infoPtr, hDC, CDDS_POSTPAINT, &bgRect);
cleanup:
+ if (text) heap_free(text);
#endif
if (hPrevFont) SelectObject(hDC, hPrevFont);
}
}
heap_free(text);
+#ifdef __REACTOS__
+ text = NULL;
+#endif
}
#ifdef __REACTOS__
if (cdrf == CDRF_NOTIFYPOSTPAINT)
BUTTON_SendCustomDraw(infoPtr, hDC, CDDS_POSTPAINT, &bgRect);
cleanup:
+ if (text) heap_free(text);
#endif
if (created_font) DeleteObject(font);
if (hPrevFont) SelectObject(hDC, hPrevFont);
#ifdef __REACTOS__
-void BUTTON_Unregister()
+void BUTTON_Unregister(void)
{
UnregisterClassW(WC_BUTTONW, NULL);
}
-#endif
\ No newline at end of file
+#endif