diff options
Diffstat (limited to 'alf/alf.h')
| -rw-r--r-- | alf/alf.h | 23 |
1 files changed, 18 insertions, 5 deletions
@@ -18,7 +18,7 @@ typedef struct { void (*destroy)(void * /*closure*/, HWND /*window*/); BOOL (*close)(void * /*closure*/, HWND /*window*/); void (*postdestroy)(void * /*closure*/); - void (*updatefonts)(void * /*closure*/, HWND /*window*/, const ALFWindowFonts *fonts); + 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 *); @@ -48,7 +48,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_GETWINDOWFONTS (ALF_WM__BASE + 16) +#define ALF_WM_APPLYFONTS (ALF_WM__BASE + 16) typedef struct { const TCHAR *className; @@ -131,9 +131,25 @@ ALF_WidgetHwndById(HWND win, WORD id); void ALF_RecalculateLayout(HWND win); +// Recalculates the window's DPI and all fonts and applies them to child widgets. +// ALF does this automatically on a DPI or settings change so you shouldn't have +// to call ALF_UpdateFonts(). If you have added new widgets and want to set their +// fonts, call ALF_ApplyFonts() instead. +// +// Since widget sizes depend on the assigned font, you should probably +// call ALF_RecalculateLayout() afterwards. 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); @@ -194,9 +210,6 @@ ALF_SetWidgetLayoutSize(HWND parent, HWND widget, UINT cptWidth, UINT cptHeight) HWND ALF_WidgetAtLayoutPosition(HWND parent, UINT x, UINT y); -BOOL -ALF_WindowFonts(HWND window, ALFWindowFonts *fonts); - // combo box HWND |
