From 25be9c28953d3d35b3f0c95b1af4eb98fee45431 Mon Sep 17 00:00:00 2001 From: Tobias Weimer Date: Fri, 27 Jul 2012 19:16:27 +0000 Subject: - fixed font settings - fixed popups git-svn-id: http://svn.miranda-ng.org/main/trunk@1216 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/Alarms/src/alarm_win.cpp | 38 +++++++++++++++++++++----------------- plugins/Alarms/src/alarms.cpp | 19 ++++++------------- 2 files changed, 27 insertions(+), 30 deletions(-) (limited to 'plugins') diff --git a/plugins/Alarms/src/alarm_win.cpp b/plugins/Alarms/src/alarm_win.cpp index 11a29e42b5..751ff21243 100644 --- a/plugins/Alarms/src/alarm_win.cpp +++ b/plugins/Alarms/src/alarm_win.cpp @@ -10,8 +10,8 @@ HMODULE hUserDll; BOOL (WINAPI *MySetLayeredWindowAttributes)(HWND,COLORREF,BYTE,DWORD) = 0; BOOL (WINAPI *MyAnimateWindow)(HWND hWnd,DWORD dwTime,DWORD dwFlags) = 0; -FontID title_font_id, window_font_id; -ColourID bk_colour_id; +FontIDT title_font_id, window_font_id; +ColourIDT bk_colour_id; HFONT hTitleFont = 0, hWindowFont = 0; COLORREF title_font_colour, window_font_colour; HBRUSH hBackgroundBrush = 0; @@ -354,15 +354,15 @@ INT_PTR CALLBACK DlgProcAlarm(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPar int ReloadFonts(WPARAM wParam, LPARAM lParam) { LOGFONT log_font; - title_font_colour = CallService(MS_FONT_GET, (WPARAM)&title_font_id, (LPARAM)&log_font); + title_font_colour = CallService(MS_FONT_GETT, (WPARAM)&title_font_id, (LPARAM)&log_font); DeleteObject(hTitleFont); hTitleFont = CreateFontIndirect(&log_font); - window_font_colour = CallService(MS_FONT_GET, (WPARAM)&window_font_id, (LPARAM)&log_font); + window_font_colour = CallService(MS_FONT_GETT, (WPARAM)&window_font_id, (LPARAM)&log_font); DeleteObject(hWindowFont); hWindowFont = CreateFontIndirect(&log_font); - COLORREF bkCol = CallService(MS_COLOUR_GET, (WPARAM)&bk_colour_id, 0); + COLORREF bkCol = CallService(MS_COLOUR_GETT, (WPARAM)&bk_colour_id, 0); DeleteObject(hBackgroundBrush); hBackgroundBrush = CreateSolidBrush(bkCol); @@ -372,34 +372,38 @@ int ReloadFonts(WPARAM wParam, LPARAM lParam) { int AlarmWinModulesLoaded(WPARAM wParam, LPARAM lParam) { - title_font_id.cbSize = sizeof(FontID); - strcpy(title_font_id.group, Translate("Alarms")); - strcpy(title_font_id.name, Translate("Title")); + title_font_id.cbSize = sizeof(FontIDT); + _tcscpy(title_font_id.group, LPGENT("Alarms")); + _tcscpy(title_font_id.name, LPGENT("Title")); strcpy(title_font_id.dbSettingsGroup, MODULE); strcpy(title_font_id.prefix, "FontTitle"); + _tcscpy(title_font_id.backgroundGroup,LPGENT("Alarms")); + _tcscpy(title_font_id.backgroundName,LPGENT("Background")); title_font_id.flags = 0; title_font_id.order = 0; - FontRegister(&title_font_id); + FontRegisterT(&title_font_id); - window_font_id.cbSize = sizeof(FontID); - strcpy(window_font_id.group, Translate("Alarms")); - strcpy(window_font_id.name, Translate("Window")); + window_font_id.cbSize = sizeof(FontIDT); + _tcscpy(window_font_id.group, LPGENT("Alarms")); + _tcscpy(window_font_id.name, LPGENT("Window")); strcpy(window_font_id.dbSettingsGroup, MODULE); strcpy(window_font_id.prefix, "FontWindow"); + _tcscpy(window_font_id.backgroundGroup,LPGENT("Alarms")); + _tcscpy(window_font_id.backgroundName,LPGENT("Background")); window_font_id.flags = 0; window_font_id.order = 1; - FontRegister(&window_font_id); + FontRegisterT(&window_font_id); - bk_colour_id.cbSize = sizeof(ColourID); + bk_colour_id.cbSize = sizeof(ColourIDT); strcpy(bk_colour_id.dbSettingsGroup, MODULE); - strcpy(bk_colour_id.group, Translate("Alarms")); - strcpy(bk_colour_id.name, Translate("Background")); + _tcscpy(bk_colour_id.group, LPGENT("Alarms")); + _tcscpy(bk_colour_id.name, LPGENT("Background")); strcpy(bk_colour_id.setting, "BkColour"); bk_colour_id.defcolour = GetSysColor(COLOR_3DFACE); bk_colour_id.flags = 0; bk_colour_id.order = 0; - ColourRegister(&bk_colour_id); + ColourRegisterT(&bk_colour_id); ReloadFonts(0, 0); HookEvent(ME_FONT_RELOAD, ReloadFonts); diff --git a/plugins/Alarms/src/alarms.cpp b/plugins/Alarms/src/alarms.cpp index faf5d04e37..f19669ec00 100644 --- a/plugins/Alarms/src/alarms.cpp +++ b/plugins/Alarms/src/alarms.cpp @@ -55,7 +55,7 @@ extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD miranda extern "C" __declspec(dllexport) const MUUID MirandaInterfaces[] = {MIID_ALARMS, MIID_LAST}; -static int CALLBACK PopupDlgProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) +static LRESULT CALLBACK PopupDlgProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) { switch(message) { case WM_COMMAND: @@ -79,35 +79,28 @@ static int CALLBACK PopupDlgProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM void ShowPopup(HANDLE hContact, const TCHAR *msg) { if (ServiceExists(MS_POPUP_ADDPOPUP)) { POPUPDATAT ppd; - TCHAR *lpzContactName; ZeroMemory(&ppd, sizeof(ppd)); //This is always a good thing to do. ppd.lchContact = hContact; //Be sure to use a GOOD handle, since this will not be checked. ppd.lchIcon = LoadSkinnedIcon(SKINICON_EVENT_MESSAGE); - lpzContactName = (TCHAR *)CallService(MS_CLIST_GETCONTACTDISPLAYNAME, (WPARAM)hContact, GCDNF_TCHAR); + TCHAR *lpzContactName = (TCHAR *)CallService(MS_CLIST_GETCONTACTDISPLAYNAME, (WPARAM)hContact, GCDNF_TCHAR); lstrcpy(ppd.lptzContactName, lpzContactName); lstrcpy(ppd.lptzText, msg); - ppd.colorBack = GetSysColor(COLOR_BTNFACE);; + ppd.colorBack = GetSysColor(COLOR_BTNFACE); ppd.colorText = RGB(0,0,0); - ppd.PluginWindowProc = (WNDPROC)PopupDlgProc; + ppd.PluginWindowProc = PopupDlgProc; ppd.PluginData = 0; ppd.iSeconds = 3; //Now that every field has been filled, we want to see the popup. - CallService(MS_POPUP_ADDPOPUPEX, (WPARAM)&ppd, 0); + PUAddPopUpT(&ppd); } } static int PluginSendMessage(WPARAM wParam,LPARAM lParam) { - CCSDATA css; - css.hContact = (HANDLE)wParam; - css.szProtoService = PSS_MESSAGE; - css.wParam = 0; - css.lParam = lParam; - - CallService(MS_PROTO_CALLCONTACTSERVICE, 0, (LPARAM)&css); + CallContactService((HANDLE)wParam,PSS_MESSAGE,0,lParam); return 0; } -- cgit v1.2.3