Add a simple wxSetWindowFont() helper
This function is a just a very thin wrapper for WM_SETFONT, but it's still better to have it rather than write casts to WPARAM and MAKELPARAM() in several different places. Note that this removes the assert for font validity from wxWindow::SetFont() which really doesn't make much sense (and if we wanted to have it, it would be better to have it for all ports in wxWindowBase instead) and was never triggered since more than 20 years of its existence.
This commit is contained in:
committed by
Maarten Bent
parent
8e15849706
commit
b24d7e3ae4
@@ -965,6 +965,12 @@ WXDLLIMPEXP_CORE void wxFillLogFont(LOGFONT *logFont, const wxFont *font);
|
||||
WXDLLIMPEXP_CORE wxFont wxCreateFontFromLogFont(const LOGFONT *logFont);
|
||||
WXDLLIMPEXP_CORE wxFontEncoding wxGetFontEncFromCharSet(int charset);
|
||||
|
||||
inline void wxSetWindowFont(HWND hwnd, const wxFont& font)
|
||||
{
|
||||
::SendMessage(hwnd, WM_SETFONT,
|
||||
(WPARAM)GetHfontOf(font), MAKELPARAM(TRUE, 0));
|
||||
}
|
||||
|
||||
WXDLLIMPEXP_CORE void wxSliderEvent(WXHWND control, WXWORD wParam, WXWORD pos);
|
||||
WXDLLIMPEXP_CORE void wxScrollBarEvent(WXHWND hbar, WXWORD wParam, WXWORD pos);
|
||||
|
||||
|
Reference in New Issue
Block a user