From fdb780a69d47d6438c0116a208afad2e94476e95 Mon Sep 17 00:00:00 2001 From: Jonas Kümmerlin Date: Thu, 1 Oct 2020 15:26:49 +0200 Subject: custom button rework --- alf/alf.h | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) (limited to 'alf/alf.h') diff --git a/alf/alf.h b/alf/alf.h index e64cac7..fb9c544 100644 --- a/alf/alf.h +++ b/alf/alf.h @@ -601,15 +601,25 @@ ALF_AddRadioButton(HWND parent, WORD id, int x, int y, const TCHAR *text); HWND ALF_AddGroupBox(HWND parent, WORD id, int x, int y, const TCHAR *text); -// native buttons -HWND -ALF_AddNativeButton(HWND win, WORD id, int x, int y, const TCHAR *text); +// custom button -HWND -ALF_AddNativeCheckbox(HWND parent, WORD id, int x, int y, const TCHAR *text); +typedef SIZE (*ALFCustomButtonMeasureFunc)(HWND /*btn*/, void * /*closure*/, int /*dpi*/, HDC, HANDLE /*theme*/, int /*themePartId*/, int /*themeStateId*/); +typedef void (*ALFCustomButtonPaintFunc)(HWND /*btn*/, void * /*closure*/, int /*dpi*/, UINT /*itemState = ODS_* */, HDC, RECT * /*rcContent*/, HANDLE /*theme*/, int /*themePartId*/, int /*themeStateId*/); HWND -ALF_AddNativeRadioButton(HWND parent, WORD id, int x, int y, const TCHAR *text); +ALF_AddCustomButton(HWND win, WORD id, int x, int y, const TCHAR *text, ALFCustomButtonMeasureFunc measureFunc, ALFCustomButtonPaintFunc paintFunc, void *closure); + +SIZE +ALF_CustomButtonMeasureText(HWND btn, void *closure, int dpi, HDC hdc, HANDLE theme, int themePartId, int themeState); + +void +ALF_CustomButtonPaintText(HWND btn, void *closure, int dpi, UINT itemState, HDC hdc, RECT *rcContent, HANDLE theme, int themePartId, int themeStateId); + +SIZE +ALF_CustomButtonMeasureIcon(HWND btn, void *closure, int dpi, HDC hdc, HANDLE theme, int themePartId, int themeState); + +void +ALF_CustomButtonPaintIcon(HWND btn, void *closure, int dpi, UINT itemState, HDC hdc, RECT *rcContent, HANDLE theme, int themePartId, int themeStateId); // icons and icon widget HWND -- cgit v1.2.3