From d56bd75ee5bc28daddb429b1fb850854970bc5f5 Mon Sep 17 00:00:00 2001 From: Jonas Kümmerlin Date: Thu, 16 Apr 2020 11:24:43 +0200 Subject: font handling change: allow controls to inherit fonts also do it automatically when adding widget to layout, no more calling applyfonts manually --- alf/alf.h | 19 ++----------------- 1 file changed, 2 insertions(+), 17 deletions(-) (limited to 'alf/alf.h') diff --git a/alf/alf.h b/alf/alf.h index e30d360..d98dfef 100644 --- a/alf/alf.h +++ b/alf/alf.h @@ -18,7 +18,6 @@ typedef struct { void (*destroy)(void * /*closure*/, HWND /*window*/); BOOL (*close)(void * /*closure*/, HWND /*window*/); void (*postdestroy)(void * /*closure*/); - void (*applyfonts)(void * /*closure*/, HWND /*window*/, const ALFWindowFonts *fonts); LRESULT (*message)(void * /*closure*/, HWND, UINT, WPARAM, LPARAM); LRESULT (*command)(void * /*closure*/, HWND /*window*/, WORD /*notificationcode*/, WORD /*sourceid*/, HWND /*control*/); LRESULT (*notify)(void * /*closure*/, HWND /*window*/, WPARAM /*sourceid*/, NMHDR *); @@ -30,11 +29,7 @@ typedef struct { #define ALF_APPLYSIZE 0x02 #define ALF_HEXPAND 0x04 #define ALF_VEXPAND 0x08 -#define ALF_MESSAGEFONT 0x10 -#define ALF_STATUSFONT 0x20 -#define ALF_ICONTITLEFONT 0x40 -// sends a ALF_WM_APPLYFONTS message to the widget with ALFWindowFonts* lparam -#define ALF_SENDAPPLYFONTS 0x80 +#define ALF_INHERITFONT 0x10 // label style flags #define ALF_LABEL_ALIGN_LEFT 0 @@ -65,8 +60,7 @@ typedef struct { #define ALF_WM_GETLAYOUTPARAMS (ALF_WM__BASE + 13) #define ALF_WM_SETLAYOUTPARAMS (ALF_WM__BASE + 14) #define ALF_WM_GETWIDGETATPOS (ALF_WM__BASE + 15) -#define ALF_WM_APPLYFONTS (ALF_WM__BASE + 16) -#define ALF_WM_PRETRANSLATEMSG (ALF_WM__BASE + 17) +#define ALF_WM_PRETRANSLATEMSG (ALF_WM__BASE + 16) #define ALF_WM_LBL_GETSTYLE (ALF_WM__BASE + 201) #define ALF_WM_LBL_SETSTYLE (ALF_WM__BASE + 202) @@ -173,15 +167,6 @@ ALF_RecalculateLayout(HWND win); void ALF_UpdateFonts(HWND win); -// Applies window fonts to all children (depending on their layout flags). -// also calls the applyfonts() virtual function. -// -// Call this after you have added new child widgets. -// Since widget sizes depend on the assigned font, you should probably -// call ALF_RecalculateLayout() afterwards. -void -ALF_ApplyFonts(HWND win); - void ALF_ResizeWindow(HWND win, int cptWidth, int cptHeight); -- cgit v1.2.3