From ed1449fa491e90197b78b64b52c70910f1736dd7 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Mon, 25 Jun 2012 15:05:30 +0000 Subject: dynamic fonts' options translation git-svn-id: http://svn.miranda-ng.org/main/trunk@633 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/Alarms/frame.cpp | 63 ++++++++++++++++++------------------------------ 1 file changed, 23 insertions(+), 40 deletions(-) (limited to 'plugins/Alarms/frame.cpp') diff --git a/plugins/Alarms/frame.cpp b/plugins/Alarms/frame.cpp index 1e39c38c32..6ebb459026 100644 --- a/plugins/Alarms/frame.cpp +++ b/plugins/Alarms/frame.cpp @@ -603,47 +603,30 @@ int CreateFrame() SendMessage(hwnd_plugin, WMU_INITIALIZE, 0, 0); - if (ServiceExists(MS_FONT_REGISTER)) { - font_id.cbSize = sizeof(FontID); - strncpy(font_id.group, Translate("Frames"), sizeof(font_id.group)); - strncpy(font_id.name, Translate("Alarm Reminders"), sizeof(font_id.name)); - strncpy(font_id.dbSettingsGroup, MODULE, sizeof(font_id.dbSettingsGroup)); - strncpy(font_id.prefix, "Font", sizeof(font_id.prefix)); - font_id.order = 0; - CallService(MS_FONT_REGISTER, (WPARAM)&font_id, 0); - - framebk_colour_id.cbSize = sizeof(ColourID); - strcpy(framebk_colour_id.dbSettingsGroup, MODULE); - strcpy(framebk_colour_id.group, Translate("Frames")); - strcpy(framebk_colour_id.name, Translate("Alarm Reminders")); - strcpy(framebk_colour_id.setting, "clFrameBack"); - framebk_colour_id.defcolour = GetSysColor(COLOR_3DFACE); - framebk_colour_id.flags = 0; - framebk_colour_id.order = 0; - CallService(MS_COLOUR_REGISTER, (WPARAM)&framebk_colour_id, 0); - - LOGFONT log_font; - fontColour = CallService(MS_FONT_GET, (WPARAM)&font_id, (LPARAM)&log_font); - hFont = CreateFontIndirect(&log_font); - SendMessage(hwnd_list, WM_SETFONT, (WPARAM)hFont, (LPARAM)TRUE); - - HookEvent(ME_FONT_RELOAD, ReloadFont); - - } else { - LOGFONT lf; - SystemParametersInfo(SPI_GETICONTITLELOGFONT, sizeof(LOGFONT), &lf, FALSE); - lf.lfHeight = 10; + font_id.cbSize = sizeof(font_id); + strncpy(font_id.group, LPGEN("Frames"), sizeof(font_id.group)); + strncpy(font_id.name, LPGEN("Alarm Reminders"), sizeof(font_id.name)); + strncpy(font_id.dbSettingsGroup, MODULE, sizeof(font_id.dbSettingsGroup)); + strncpy(font_id.prefix, "Font", sizeof(font_id.prefix)); + font_id.order = 0; + FontRegister(&font_id); + + framebk_colour_id.cbSize = sizeof(ColourID); + strcpy(framebk_colour_id.dbSettingsGroup, MODULE); + strcpy(framebk_colour_id.group, LPGEN("Frames")); + strcpy(framebk_colour_id.name, LPGEN("Alarm Reminders")); + strcpy(framebk_colour_id.setting, "clFrameBack"); + framebk_colour_id.defcolour = GetSysColor(COLOR_3DFACE); + framebk_colour_id.flags = 0; + framebk_colour_id.order = 0; + ColourRegister(&framebk_colour_id); - HDC hdc = GetDC(0); - lf.lfHeight = -MulDiv(lf.lfHeight,GetDeviceCaps(hdc, LOGPIXELSY), 72); - ReleaseDC(0, hdc); - - hFont = CreateFontIndirect(&lf); - - //fontColour = GetSysColor(COLOR_WINDOWTEXT); - // match clist 'normal contact' colour if no font service - fontColour = (COLORREF)DBGetContactSettingDword(0, "CLC", "Font0Col", GetSysColor(COLOR_WINDOWTEXT)); - } + LOGFONT log_font; + fontColour = CallService(MS_FONT_GET, (WPARAM)&font_id, (LPARAM)&log_font); + hFont = CreateFontIndirect(&log_font); + SendMessage(hwnd_list, WM_SETFONT, (WPARAM)hFont, (LPARAM)TRUE); + + HookEvent(ME_FONT_RELOAD, ReloadFont); // create the brush used for the background in the absence of clist_modern skinning features - match clist bk_brush = CreateSolidBrush(DBGetContactSettingDword(0, "Alarm", "clFrameBack", GetSysColor(COLOR_3DFACE))); -- cgit v1.2.3