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/alarm_win.cpp | 69 ++++---- plugins/Alarms/frame.cpp | 63 +++----- plugins/BasicHistory/Options.cpp | 2 +- plugins/Chat/options.cpp | 12 +- plugins/Clist_classic/clcfonts.cpp | 10 +- plugins/Clist_modern/modern_clcopts.cpp | 220 ++++++++++++------------- plugins/Clist_mw/CLUIFrames/cluiframes.cpp | 24 +-- plugins/Clist_mw/clcfonts.cpp | 11 +- plugins/Clist_nicer/SRC/clui.cpp | 11 +- plugins/Console/Console.cpp | 87 +++++----- plugins/ExternalAPI/m_toptoolbar.h | 11 +- plugins/FavContacts/src/main.cpp | 12 +- plugins/Popup/src/font.cpp | 4 +- plugins/Popup/src/notifications.cpp | 4 +- plugins/Popup/src/services.cpp | 4 +- plugins/SRMM/msgoptions.cpp | 4 +- plugins/Scriver/msgoptions.cpp | 14 +- plugins/TabSRMM/chat/options.cpp | 36 ++--- plugins/TipperYM/tipper.cpp | 11 +- plugins/TooltipNotify/src/TooltipNotify.cpp | 4 +- plugins/YAPP/popups2.cpp | 241 +++++++++------------------- 21 files changed, 360 insertions(+), 494 deletions(-) (limited to 'plugins') diff --git a/plugins/Alarms/alarm_win.cpp b/plugins/Alarms/alarm_win.cpp index 30b4dd31e5..11a29e42b5 100644 --- a/plugins/Alarms/alarm_win.cpp +++ b/plugins/Alarms/alarm_win.cpp @@ -370,42 +370,39 @@ int ReloadFonts(WPARAM wParam, LPARAM lParam) { return 0; } -int AlarmWinModulesLoaded(WPARAM wParam, LPARAM lParam) { - if (ServiceExists(MS_FONT_REGISTER)) { - title_font_id.cbSize = sizeof(FontID); - strcpy(title_font_id.group, Translate("Alarms")); - strcpy(title_font_id.name, Translate("Title")); - strcpy(title_font_id.dbSettingsGroup, MODULE); - strcpy(title_font_id.prefix, "FontTitle"); - title_font_id.flags = 0; - title_font_id.order = 0; - - CallService(MS_FONT_REGISTER, (WPARAM)&title_font_id, 0); - - window_font_id.cbSize = sizeof(FontID); - strcpy(window_font_id.group, Translate("Alarms")); - strcpy(window_font_id.name, Translate("Window")); - strcpy(window_font_id.dbSettingsGroup, MODULE); - strcpy(window_font_id.prefix, "FontWindow"); - window_font_id.flags = 0; - window_font_id.order = 1; - - CallService(MS_FONT_REGISTER, (WPARAM)&window_font_id, 0); - - bk_colour_id.cbSize = sizeof(ColourID); - strcpy(bk_colour_id.dbSettingsGroup, MODULE); - strcpy(bk_colour_id.group, Translate("Alarms")); - strcpy(bk_colour_id.name, Translate("Background")); - strcpy(bk_colour_id.setting, "BkColour"); - bk_colour_id.defcolour = GetSysColor(COLOR_3DFACE); - bk_colour_id.flags = 0; - bk_colour_id.order = 0; - - CallService(MS_COLOUR_REGISTER, (WPARAM)&bk_colour_id, 0); - - ReloadFonts(0, 0); - HookEvent(ME_FONT_RELOAD, ReloadFonts); - } +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")); + strcpy(title_font_id.dbSettingsGroup, MODULE); + strcpy(title_font_id.prefix, "FontTitle"); + title_font_id.flags = 0; + title_font_id.order = 0; + FontRegister(&title_font_id); + + window_font_id.cbSize = sizeof(FontID); + strcpy(window_font_id.group, Translate("Alarms")); + strcpy(window_font_id.name, Translate("Window")); + strcpy(window_font_id.dbSettingsGroup, MODULE); + strcpy(window_font_id.prefix, "FontWindow"); + window_font_id.flags = 0; + window_font_id.order = 1; + FontRegister(&window_font_id); + + bk_colour_id.cbSize = sizeof(ColourID); + strcpy(bk_colour_id.dbSettingsGroup, MODULE); + strcpy(bk_colour_id.group, Translate("Alarms")); + strcpy(bk_colour_id.name, Translate("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); + + ReloadFonts(0, 0); + HookEvent(ME_FONT_RELOAD, ReloadFonts); return 0; } 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))); diff --git a/plugins/BasicHistory/Options.cpp b/plugins/BasicHistory/Options.cpp index be024479ee..06a64d35e4 100644 --- a/plugins/BasicHistory/Options.cpp +++ b/plugins/BasicHistory/Options.cpp @@ -272,7 +272,7 @@ void Options::Load() sprintf_s(cid.setting, SIZEOF(cid.setting), "Color%d", i); cid.order = i; cid.defcolour = g_ColorOptionsList[i].def; - CallService(MS_COLOUR_REGISTERT, (WPARAM)&cid, 0); + ColourRegisterT(&cid); } hid.dwFlags = HKD_TCHAR; diff --git a/plugins/Chat/options.cpp b/plugins/Chat/options.cpp index 77989d4b39..f8def495a0 100644 --- a/plugins/Chat/options.cpp +++ b/plugins/Chat/options.cpp @@ -391,7 +391,7 @@ void RegisterFonts( void ) _tcsncpy(fontid.backgroundName, _T("Background"), SIZEOF(fontid.backgroundName)); break; } - CallService(MS_FONT_REGISTERT, (WPARAM)&fontid, 0); + FontRegisterT(&fontid); } colourid.cbSize = sizeof(ColourIDT); @@ -402,27 +402,27 @@ void RegisterFonts( void ) _tcsncpy(colourid.name, LPGENT("Background"), SIZEOF(colourid.name)); _tcsncpy(colourid.group, LPGENT("Chat Module"), SIZEOF(colourid.group)); colourid.defcolour = GetSysColor(COLOR_WINDOW); - CallService(MS_COLOUR_REGISTERT, (WPARAM)&colourid, 0); + ColourRegisterT(&colourid); strncpy(colourid.setting, "ColorMessageBG", SIZEOF(colourid.setting)); _tcsncpy(colourid.name, LPGENT("Message Background"), SIZEOF(colourid.name)); colourid.defcolour = GetSysColor(COLOR_WINDOW); - CallService(MS_COLOUR_REGISTERT, (WPARAM)&colourid, 0); + ColourRegisterT(&colourid); strncpy(colourid.setting, "ColorNicklistBG", SIZEOF(colourid.setting)); _tcsncpy(colourid.name, LPGENT("Userlist Background"), SIZEOF(colourid.name)); colourid.defcolour = GetSysColor(COLOR_WINDOW); - CallService(MS_COLOUR_REGISTERT, (WPARAM)&colourid, 0); + ColourRegisterT(&colourid); strncpy(colourid.setting, "ColorNicklistLines", SIZEOF(colourid.setting)); _tcsncpy(colourid.name, LPGENT("Userlist Lines"), SIZEOF(colourid.name)); colourid.defcolour = GetSysColor(COLOR_INACTIVEBORDER); - CallService(MS_COLOUR_REGISTERT, (WPARAM)&colourid, 0); + ColourRegisterT(&colourid); strncpy(colourid.setting, "ColorNicklistSelectedBG", SIZEOF(colourid.setting)); _tcsncpy(colourid.name, LPGENT("Userlist Background (selected)"), SIZEOF(colourid.name)); colourid.defcolour = GetSysColor(COLOR_HIGHLIGHT); - CallService(MS_COLOUR_REGISTERT, (WPARAM)&colourid, 0); + ColourRegisterT(&colourid); } // add icons to the skinning module diff --git a/plugins/Clist_classic/clcfonts.cpp b/plugins/Clist_classic/clcfonts.cpp index 9ff56524a4..6a2f3062dc 100644 --- a/plugins/Clist_classic/clcfonts.cpp +++ b/plugins/Clist_classic/clcfonts.cpp @@ -101,7 +101,7 @@ void RegisterCListFonts() strncpy(fontid.prefix, idstr, SIZEOF(fontid.prefix)); fontid.order = fontListOrder[i]; - CallService(MS_FONT_REGISTERT, (WPARAM)&fontid, 0); + FontRegisterT(&fontid); } // and colours @@ -113,25 +113,25 @@ void RegisterCListFonts() _tcsncpy(colourid.name, LPGENT("Background"), SIZEOF(colourid.name)); _tcsncpy(colourid.group, LPGENT("Contact List"), SIZEOF(colourid.group)); colourid.defcolour = CLCDEFAULT_BKCOLOUR; - CallService(MS_COLOUR_REGISTERT, (WPARAM)&colourid, 0); + ColourRegisterT(&colourid); strncpy(colourid.setting, "SelTextColour", sizeof(colourid.setting)); _tcsncpy(colourid.name, LPGENT("Selected Text"), SIZEOF(colourid.name)); colourid.order = 1; colourid.defcolour = CLCDEFAULT_SELTEXTCOLOUR; - CallService(MS_COLOUR_REGISTERT, (WPARAM)&colourid, 0); + ColourRegisterT(&colourid); strncpy(colourid.setting, "HotTextColour", sizeof(colourid.setting)); _tcsncpy(colourid.name, LPGENT("Hottrack Text"), SIZEOF(colourid.name)); colourid.order = 1; colourid.defcolour = CLCDEFAULT_HOTTEXTCOLOUR; - CallService(MS_COLOUR_REGISTERT, (WPARAM)&colourid, 0); + ColourRegisterT(&colourid); strncpy(colourid.setting, "QuickSearchColour", sizeof(colourid.setting)); _tcsncpy(colourid.name, LPGENT("Quicksearch Text"), SIZEOF(colourid.name)); colourid.order = 1; colourid.defcolour = CLCDEFAULT_QUICKSEARCHCOLOUR; - CallService(MS_COLOUR_REGISTERT, (WPARAM)&colourid, 0); + ColourRegisterT(&colourid); HookEvent(ME_FONT_RELOAD, FS_FontsChanged); } diff --git a/plugins/Clist_modern/modern_clcopts.cpp b/plugins/Clist_modern/modern_clcopts.cpp index 4585205f2f..100076f84a 100644 --- a/plugins/Clist_modern/modern_clcopts.cpp +++ b/plugins/Clist_modern/modern_clcopts.cpp @@ -2,8 +2,8 @@ Miranda IM: the free IM client for Microsoft* Windows* -Copyright 2000-2008 Miranda ICQ/IM project, -all portions of this codebase are copyrighted to the people +Copyright 2000-2008 Miranda ICQ/IM project, +all portions of this codebase are copyrighted to the people listed in contributors.txt. This program is free software; you can redistribute it and/or @@ -82,7 +82,7 @@ static struct FontOptionsList fontOptionsList[] = { { FIDF_CLASSGENERAL, FONTID_PHONE, CLCGROUP, LPGENT( "On the phone contacts"), DEFAULT_COLOUR, DEFAULT_FAMILY, DEFAULT_CHARSET, FONTF_NORMAL, DEFAULT_SIZE, DEFAULT_EFFECT }, { FIDF_CLASSGENERAL, FONTID_LUNCH, CLCGROUP, LPGENT( "Out to lunch contacts"), DEFAULT_COLOUR, DEFAULT_FAMILY, DEFAULT_CHARSET, FONTF_NORMAL, DEFAULT_SIZE, DEFAULT_EFFECT }, { FIDF_CLASSGENERAL, FONTID_OFFLINE, CLCGROUP, LPGENT( "Offline contacts"), DEFAULT_GREYCOLOUR, DEFAULT_FAMILY, DEFAULT_CHARSET, FONTF_NORMAL, DEFAULT_SIZE, DEFAULT_EFFECT }, - { FIDF_CLASSGENERAL, FONTID_INVIS, CLCGROUP, LPGENT( "Online contacts to whom you have a different visibility"), DEFAULT_COLOUR, DEFAULT_FAMILY, DEFAULT_CHARSET, FONTF_NORMAL, DEFAULT_SIZE, DEFAULT_EFFECT }, + { FIDF_CLASSGENERAL, FONTID_INVIS, CLCGROUP, LPGENT( "Online contacts to whom you have a different visibility"), DEFAULT_COLOUR, DEFAULT_FAMILY, DEFAULT_CHARSET, FONTF_NORMAL, DEFAULT_SIZE, DEFAULT_EFFECT }, { FIDF_CLASSGENERAL, FONTID_OFFINVIS, CLCGROUP, LPGENT( "Offline contacts to whom you have a different visibility"), DEFAULT_COLOUR, DEFAULT_FAMILY, DEFAULT_CHARSET, FONTF_NORMAL, DEFAULT_SIZE, DEFAULT_EFFECT }, { FIDF_CLASSGENERAL, FONTID_NOTONLIST, CLCGROUP, LPGENT( "Contacts who are 'not on list'"), DEFAULT_COLOUR, DEFAULT_FAMILY, DEFAULT_CHARSET, FONTF_NORMAL, DEFAULT_SIZE, DEFAULT_EFFECT }, { FIDF_CLASSHEADER, FONTID_OPENGROUPS, CLCGROUP, LPGENT( "Open groups"), DEFAULT_COLOUR, DEFAULT_FAMILY, DEFAULT_CHARSET, FONTF_BOLD, DEFAULT_SIZE, DEFAULT_EFFECT }, @@ -90,11 +90,11 @@ static struct FontOptionsList fontOptionsList[] = { { FIDF_CLASSHEADER, FONTID_CLOSEDGROUPS, CLCGROUP, LPGENT( "Closed groups"), DEFAULT_COLOUR, DEFAULT_FAMILY, DEFAULT_CHARSET, FONTF_BOLD, DEFAULT_SIZE, DEFAULT_EFFECT }, { FIDF_CLASSHEADER, FONTID_CLOSEDGROUPCOUNTS, CLCGROUP, LPGENT( "Closed group member counts"), DEFAULT_COLOUR, DEFAULT_FAMILY, DEFAULT_CHARSET, FONTF_NORMAL, DEFAULT_SIZE, DEFAULT_EFFECT }, { FIDF_CLASSSMALL, FONTID_DIVIDERS, CLCGROUP, LPGENT( "Dividers"), DEFAULT_COLOUR, DEFAULT_FAMILY, DEFAULT_CHARSET, FONTF_NORMAL, DEFAULT_SIZE, DEFAULT_EFFECT }, - + { FIDF_CLASSSMALL, FONTID_SECONDLINE, CLCLINESGROUP, LPGENT( "Second line"), DEFAULT_COLOUR, DEFAULT_FAMILY, DEFAULT_CHARSET, FONTF_NORMAL, DEFAULT_SMALLSIZE, DEFAULT_EFFECT }, { FIDF_CLASSSMALL, FONTID_THIRDLINE, CLCLINESGROUP, LPGENT( "Third line"), DEFAULT_COLOUR, DEFAULT_FAMILY, DEFAULT_CHARSET, FONTF_NORMAL, DEFAULT_SMALLSIZE, DEFAULT_EFFECT }, { FIDF_CLASSSMALL, FONTID_CONTACT_TIME, CLCLINESGROUP, LPGENT( "Contact time"), DEFAULT_COLOUR, DEFAULT_FAMILY, DEFAULT_CHARSET, FONTF_NORMAL, DEFAULT_SMALLSIZE, DEFAULT_EFFECT }, - + { FIDF_CLASSGENERAL, FONTID_STATUSBAR_PROTONAME, CLCFRAMESGROUP, LPGENT( "Status bar text"), DEFAULT_COLOUR, DEFAULT_FAMILY, DEFAULT_CHARSET, FONTF_NORMAL, DEFAULT_SIZE, DEFAULT_EFFECT }, { FIDF_CLASSGENERAL, FONTID_EVENTAREA, CLCFRAMESGROUP, LPGENT( "Event area text"), DEFAULT_COLOUR, DEFAULT_FAMILY, DEFAULT_CHARSET, FONTF_NORMAL, DEFAULT_SIZE, DEFAULT_EFFECT }, { FIDF_CLASSGENERAL, FONTID_VIEMODES, CLCFRAMESGROUP, LPGENT( "Current view mode text"), DEFAULT_COLOUR, DEFAULT_FAMILY, DEFAULT_CHARSET, FONTF_NORMAL, DEFAULT_SIZE, DEFAULT_EFFECT }, @@ -134,15 +134,14 @@ void RegisterCLUIFonts( void ) if ( registered ) return; FontIDT fontid = {0}; - ColourIDT colourid = {0}; EffectIDT effectid = {0}; char idstr[10]; int i, index = 0; - fontid.cbSize = FontID_SIZEOF_V2; + fontid.cbSize = sizeof(fontid); strncpy(fontid.dbSettingsGroup, "CLC", SIZEOF(fontid.dbSettingsGroup)); - effectid.cbSize = sizeof( EffectIDT ); + effectid.cbSize = sizeof(effectid); strncpy(effectid.dbSettingsGroup, "CLC", SIZEOF(effectid.dbSettingsGroup)); for ( i = 0; i < SIZEOF(fontOptionsList); i++, index++ ) @@ -162,7 +161,7 @@ void RegisterCLUIFonts( void ) fontid.deffontsettings.style = fontOptionsList[i].defStyle; _tcsncpy(fontid.deffontsettings.szFace, fontOptionsList[i].szDefFace, SIZEOF(fontid.deffontsettings.szFace)); - CallService(MS_FONT_REGISTERT, (WPARAM)&fontid, 0); + FontRegisterT(&fontid); _tcsncpy(effectid.group, fontOptionsList[i].szGroup, SIZEOF(effectid.group)); _tcsncpy(effectid.name, fontOptionsList[i].szDescr, SIZEOF(effectid.name)); @@ -174,10 +173,11 @@ void RegisterCLUIFonts( void ) effectid.defeffect.baseColour = fontOptionsList[i].defeffect.baseColour; effectid.defeffect.secondaryColour = fontOptionsList[i].defeffect.secondaryColour; - CallService(MS_EFFECT_REGISTERT, (WPARAM)&effectid, 0); - + EffectRegisterT(&effectid); } - colourid.cbSize = sizeof( ColourIDT ); + + ColourIDT colourid = {0}; + colourid.cbSize = sizeof(colourid); for ( i = 0; i < SIZEOF( colourOptionsList); i++ ) { @@ -187,7 +187,7 @@ void RegisterCLUIFonts( void ) strncpy(colourid.dbSettingsGroup, colourOptionsList[i].chGroup, SIZEOF(colourid.dbSettingsGroup)); colourid.defcolour = colourOptionsList[i].defColour; colourid.order = i + 1; - CallService(MS_COLOUR_REGISTERT, (WPARAM)&colourid, 0); + ColourRegisterT(&colourid); } registered = true; } @@ -224,7 +224,7 @@ void GetFontSetting(int i,LOGFONT *lf,COLORREF *colour,BYTE *effect, COLORREF *e return; FontIDT fontid = {0}; - fontid.cbSize = FontID_SIZEOF_V2; + fontid.cbSize = sizeof(fontid); _tcsncpy( fontid.group, fontOptionsList[index].szGroup, SIZEOF( fontid.group )); _tcsncpy( fontid.name, fontOptionsList[index].szDescr, SIZEOF( fontid.name )); @@ -261,14 +261,14 @@ struct int nExpertControls; DWORD flag; // Expertonly } -static clist_opt_items[] = -{ +static clist_opt_items[] = +{ { LPGEN("General"), IDD_OPT_CLIST, DlgProcClistOpts, NULL, 0, 0}, { LPGEN("Tray"), IDD_OPT_TRAY, DlgProcTrayOpts, NULL, 0, 0 }, { LPGEN("List"), IDD_OPT_CLC, DlgProcClistListOpts, NULL, 0, 0 }, { LPGEN("Window"), IDD_OPT_CLUI, DlgProcClistWindowOpts, NULL, 0, 0 }, { LPGEN("Behaviour"), IDD_OPT_CLUI_2, DlgProcClistBehaviourOpts, NULL, 0, 0 }, - { LPGEN("Status Bar"), IDD_OPT_SBAR, DlgProcSBarOpts, StatusBarExpertControls, SIZEOF(StatusBarExpertControls), 0}, + { LPGEN("Status Bar"), IDD_OPT_SBAR, DlgProcSBarOpts, StatusBarExpertControls, SIZEOF(StatusBarExpertControls), 0}, { LPGEN("Additional stuff"), IDD_OPT_META_CLC, DlgProcClistAdditionalOpts, NULL, 0, 0 } }; @@ -304,11 +304,11 @@ int ClcOptInit(WPARAM wParam,LPARAM lParam) odp.flags = ODPF_BOLDGROUPS; Options_AddPage(wParam, &odp); } - + return 0; } -struct CheckBoxToStyleEx_t +struct CheckBoxToStyleEx_t { int id; DWORD flag; @@ -411,7 +411,7 @@ static INT_PTR CALLBACK DlgProcClistAdditionalOpts(HWND hwndDlg, UINT msg, WPARA CheckDlgButton(hwndDlg, IDC_DISCOVER_AWAYMSG, ModernGetSettingByte(NULL,"ModernData","InternalAwayMsgDiscovery",SETTING_INTERNALAWAYMSGREQUEST_DEFAULT) ? BST_CHECKED : BST_UNCHECKED); /// by FYR CheckDlgButton(hwndDlg, IDC_REMOVE_OFFLINE_AWAYMSG, ModernGetSettingByte(NULL,"ModernData","RemoveAwayMessageForOffline",SETTING_REMOVEAWAYMSGFOROFFLINE_DEFAULT) ? BST_CHECKED : BST_UNCHECKED); /// by FYR - SendDlgItemMessage(hwndDlg,IDC_SUBINDENTSPIN,UDM_SETBUDDY,(WPARAM)GetDlgItem(hwndDlg,IDC_SUBINDENT),0); + SendDlgItemMessage(hwndDlg,IDC_SUBINDENTSPIN,UDM_SETBUDDY,(WPARAM)GetDlgItem(hwndDlg,IDC_SUBINDENT),0); SendDlgItemMessage(hwndDlg,IDC_SUBINDENTSPIN,UDM_SETRANGE,0,MAKELONG(50,0)); SendDlgItemMessage(hwndDlg,IDC_SUBINDENTSPIN,UDM_SETPOS,0,MAKELONG(ModernGetSettingByte(NULL,"CLC","SubIndent",CLCDEFAULT_GROUPINDENT),0)); @@ -433,7 +433,7 @@ static INT_PTR CALLBACK DlgProcClistAdditionalOpts(HWND hwndDlg, UINT msg, WPARA CLUI_ShowWindowMod(GetDlgItem(hwndDlg,IDC_METAEXPAND),t); CLUI_ShowWindowMod(GetDlgItem(hwndDlg,IDC_METASUBEXTRA),t); CLUI_ShowWindowMod(GetDlgItem(hwndDlg,IDC_FRAME_META),t); - CLUI_ShowWindowMod(GetDlgItem(hwndDlg,IDC_FRAME_META_CAPT),!t); + CLUI_ShowWindowMod(GetDlgItem(hwndDlg,IDC_FRAME_META_CAPT),!t); CLUI_ShowWindowMod(GetDlgItem(hwndDlg,IDC_SUBINDENTSPIN),t); CLUI_ShowWindowMod(GetDlgItem(hwndDlg,IDC_SUBINDENT),t); CLUI_ShowWindowMod(GetDlgItem(hwndDlg,IDC_SUBIDENTCAPT),t); @@ -455,7 +455,7 @@ static INT_PTR CALLBACK DlgProcClistAdditionalOpts(HWND hwndDlg, UINT msg, WPARA return TRUE; case WM_NOTIFY: - switch(t->idFrom) + switch(t->idFrom) { case 0: switch (t->code) @@ -465,7 +465,7 @@ static INT_PTR CALLBACK DlgProcClistAdditionalOpts(HWND hwndDlg, UINT msg, WPARA ModernWriteSettingByte(NULL,"CLC","MetaDoubleClick",(BYTE)IsDlgButtonChecked(hwndDlg,IDC_METADBLCLK)); // by FYR ModernWriteSettingByte(NULL,"CLC","MetaHideExtra",(BYTE)IsDlgButtonChecked(hwndDlg,IDC_METASUBEXTRA)); // by FYR ModernWriteSettingByte(NULL,"CLC","MetaIgnoreEmptyExtra",(BYTE)IsDlgButtonChecked(hwndDlg,IDC_METASUBEXTRA_IGN)); // by FYR - ModernWriteSettingByte(NULL,"CLC","MetaHideOfflineSub",(BYTE)IsDlgButtonChecked(hwndDlg,IDC_METASUB_HIDEOFFLINE)); // by FYR + ModernWriteSettingByte(NULL,"CLC","MetaHideOfflineSub",(BYTE)IsDlgButtonChecked(hwndDlg,IDC_METASUB_HIDEOFFLINE)); // by FYR ModernWriteSettingByte(NULL,"CLC","MetaExpanding",(BYTE)IsDlgButtonChecked(hwndDlg,IDC_METAEXPAND)); ModernWriteSettingByte(NULL,"ModernData","InternalAwayMsgDiscovery",(BYTE)IsDlgButtonChecked(hwndDlg,IDC_DISCOVER_AWAYMSG)); ModernWriteSettingByte(NULL,"ModernData","RemoveAwayMessageForOffline",(BYTE)IsDlgButtonChecked(hwndDlg,IDC_REMOVE_OFFLINE_AWAYMSG)); @@ -503,7 +503,7 @@ static INT_PTR CALLBACK DlgProcClistListOpts(HWND hwndDlg, UINT msg, WPARAM wPar ImageList_AddIcon(himlCheckBoxes,LoadSmallIconShared(GetModuleHandle(NULL),MAKEINTRESOURCE(IDI_TICK))); TreeView_SetImageList(GetDlgItem(hwndDlg,IDC_GREYOUTOPTS),himlCheckBoxes,TVSIL_NORMAL); TreeView_SetImageList(GetDlgItem(hwndDlg,IDC_HIDEOFFLINEOPTS),himlCheckBoxes,TVSIL_NORMAL); - } + } { DWORD exStyle=ModernGetSettingDword(NULL,"CLC","ExStyle",GetDefaultExStyle()); for(int i=0;ipfnGetProtocolVisibility(accs[i]->szModuleName)==0 ) continue; netProtoCount++; @@ -784,7 +784,7 @@ static INT_PTR CALLBACK DlgProcClistOpts(HWND hwndDlg, UINT msg, WPARAM wParam, int i, item; int s1, s2, s3; - for (i=0; iidFrom) + switch (((LPNMHDR)lParam)->idFrom) { case 0: switch (((LPNMHDR)lParam)->code) { case PSN_APPLY: - ModernWriteSettingByte(NULL,"CList","HideOffline",(BYTE)IsDlgButtonChecked(hwndDlg,IDC_HIDEOFFLINE)); + ModernWriteSettingByte(NULL,"CList","HideOffline",(BYTE)IsDlgButtonChecked(hwndDlg,IDC_HIDEOFFLINE)); ModernWriteSettingByte(NULL,"CList","HideEmptyGroups",(BYTE)IsDlgButtonChecked(hwndDlg,IDC_HIDEEMPTYGROUPS)); ModernWriteSettingByte(NULL,"CList","UseGroups",(BYTE)!IsDlgButtonChecked(hwndDlg,IDC_DISABLEGROUPS)); ModernWriteSettingByte(NULL,"CList","ConfirmDelete",(BYTE)IsDlgButtonChecked(hwndDlg,IDC_CONFIRMDELETE)); @@ -936,7 +936,7 @@ static INT_PTR CALLBACK DlgProcTrayOpts(HWND hwndDlg, UINT msg, WPARAM wParam, L } if (-1==(int)SendDlgItemMessage(hwndDlg,IDC_PRIMARYSTATUS,CB_GETCURSEL,0,0)) SendDlgItemMessage(hwndDlg,IDC_PRIMARYSTATUS,CB_SETCURSEL,0,0); - SendDlgItemMessage(hwndDlg,IDC_BLINKSPIN,UDM_SETBUDDY,(WPARAM)GetDlgItem(hwndDlg,IDC_BLINKTIME),0); // set buddy + SendDlgItemMessage(hwndDlg,IDC_BLINKSPIN,UDM_SETBUDDY,(WPARAM)GetDlgItem(hwndDlg,IDC_BLINKTIME),0); // set buddy SendDlgItemMessage(hwndDlg,IDC_BLINKSPIN,UDM_SETRANGE,0,MAKELONG(0x3FFF,250)); SendDlgItemMessage(hwndDlg,IDC_BLINKSPIN,UDM_SETPOS,0,MAKELONG(ModernGetSettingWord(NULL,"CList","IconFlashTime",SETTING_ICONFLASHTIME_DEFAULT),0)); { @@ -945,7 +945,7 @@ static INT_PTR CALLBACK DlgProcTrayOpts(HWND hwndDlg, UINT msg, WPARAM wParam, L { EnableWindow(GetDlgItem(hwndDlg,IDC_PRIMARYSTATUS),TRUE); EnableWindow(GetDlgItem(hwndDlg,IDC_CYCLETIMESPIN),FALSE); - EnableWindow(GetDlgItem(hwndDlg,IDC_CYCLETIME),FALSE); + EnableWindow(GetDlgItem(hwndDlg,IDC_CYCLETIME),FALSE); EnableWindow(GetDlgItem(hwndDlg,IDC_ALWAYSPRIMARY),FALSE); EnableWindow(GetDlgItem(hwndDlg,IDC_ALWAYSPRIMARY),FALSE); EnableWindow(GetDlgItem(hwndDlg,IDC_CYCLE),FALSE); @@ -963,7 +963,7 @@ static INT_PTR CALLBACK DlgProcTrayOpts(HWND hwndDlg, UINT msg, WPARAM wParam, L EnableWindow(GetDlgItem(hwndDlg,IDC_SHOWNORMAL),IsDlgButtonChecked(hwndDlg,IDC_SHOWXSTATUS)); EnableWindow(GetDlgItem(hwndDlg,IDC_TRANSPARENTOVERLAY),IsDlgButtonChecked(hwndDlg,IDC_SHOWXSTATUS)&&IsDlgButtonChecked(hwndDlg,IDC_SHOWNORMAL)); } - if(LOWORD(wParam)==IDC_DONTCYCLE || LOWORD(wParam)==IDC_CYCLE || LOWORD(wParam)==IDC_MULTITRAY) + if(LOWORD(wParam)==IDC_DONTCYCLE || LOWORD(wParam)==IDC_CYCLE || LOWORD(wParam)==IDC_MULTITRAY) { EnableWindow(GetDlgItem(hwndDlg,IDC_PRIMARYSTATUS),IsDlgButtonChecked(hwndDlg,IDC_DONTCYCLE)); EnableWindow(GetDlgItem(hwndDlg,IDC_CYCLETIME),IsDlgButtonChecked(hwndDlg,IDC_CYCLE)); @@ -978,7 +978,7 @@ static INT_PTR CALLBACK DlgProcTrayOpts(HWND hwndDlg, UINT msg, WPARAM wParam, L break; case WM_NOTIFY: { - switch (((LPNMHDR)lParam)->idFrom) + switch (((LPNMHDR)lParam)->idFrom) { case 0: switch (((LPNMHDR)lParam)->code) @@ -1003,15 +1003,15 @@ static INT_PTR CALLBACK DlgProcTrayOpts(HWND hwndDlg, UINT msg, WPARAM wParam, L xOptions=IsDlgButtonChecked(hwndDlg,IDC_SHOWXSTATUS)?1:0; xOptions|=(xOptions && IsDlgButtonChecked(hwndDlg,IDC_SHOWNORMAL))?2:0; xOptions|=(xOptions && IsDlgButtonChecked(hwndDlg,IDC_TRANSPARENTOVERLAY))?4:0; - ModernWriteSettingByte(NULL,"CLUI","XStatusTray",xOptions); + ModernWriteSettingByte(NULL,"CLUI","XStatusTray",xOptions); } { int cursel = SendDlgItemMessage(hwndDlg,IDC_PRIMARYSTATUS,CB_GETCURSEL,0,0); PROTOACCOUNT* pa = (PROTOACCOUNT*)SendDlgItemMessage(hwndDlg,IDC_PRIMARYSTATUS,CB_GETITEMDATA,cursel,0); - if ( !pa ) + if ( !pa ) ModernDeleteSetting(NULL, "CList","PrimaryStatus"); - else + else ModernWriteSettingString(NULL,"CList","PrimaryStatus", pa->szModuleName); } pcli->pfnTrayIconIconsChanged(); @@ -1050,9 +1050,9 @@ static INT_PTR CALLBACK DlgProcClistBehaviourOpts(HWND hwndDlg, UINT msg, WPARAM TranslateDialogDefault(hwndDlg); CheckDlgButton(hwndDlg, IDC_CLIENTDRAG, ModernGetSettingByte(NULL,"CLUI","ClientAreaDrag",SETTING_CLIENTDRAG_DEFAULT) ? BST_CHECKED : BST_UNCHECKED); CheckDlgButton(hwndDlg, IDC_DRAGTOSCROLL, (ModernGetSettingByte(NULL,"CLUI","DragToScroll",SETTING_DRAGTOSCROLL_DEFAULT)&&!ModernGetSettingByte(NULL,"CLUI","ClientAreaDrag",SETTING_CLIENTDRAG_DEFAULT)) ? BST_CHECKED : BST_UNCHECKED); - CheckDlgButton(hwndDlg, IDC_AUTOSIZE, g_CluiData.fAutoSize ? BST_CHECKED : BST_UNCHECKED); - CheckDlgButton(hwndDlg, IDC_LOCKSIZING, ModernGetSettingByte(NULL,"CLUI","LockSize",SETTING_LOCKSIZE_DEFAULT) ? BST_CHECKED : BST_UNCHECKED); - CheckDlgButton(hwndDlg, IDC_BRINGTOFRONT, ModernGetSettingByte(NULL,"CList","BringToFront",SETTING_BRINGTOFRONT_DEFAULT) ? BST_CHECKED : BST_UNCHECKED); + CheckDlgButton(hwndDlg, IDC_AUTOSIZE, g_CluiData.fAutoSize ? BST_CHECKED : BST_UNCHECKED); + CheckDlgButton(hwndDlg, IDC_LOCKSIZING, ModernGetSettingByte(NULL,"CLUI","LockSize",SETTING_LOCKSIZE_DEFAULT) ? BST_CHECKED : BST_UNCHECKED); + CheckDlgButton(hwndDlg, IDC_BRINGTOFRONT, ModernGetSettingByte(NULL,"CList","BringToFront",SETTING_BRINGTOFRONT_DEFAULT) ? BST_CHECKED : BST_UNCHECKED); SendDlgItemMessage(hwndDlg,IDC_MAXSIZESPIN,UDM_SETRANGE,0,MAKELONG(100,0)); @@ -1142,7 +1142,7 @@ static INT_PTR CALLBACK DlgProcClistBehaviourOpts(HWND hwndDlg, UINT msg, WPARAM EnableWindow(GetDlgItem(hwndDlg,IDC_HIDEDELAY),mode!=0); EnableWindow(GetDlgItem(hwndDlg,IDC_HIDETIMESPIN2),mode!=0); EnableWindow(GetDlgItem(hwndDlg,IDC_HIDETIMESPIN3),mode!=0); - EnableWindow(GetDlgItem(hwndDlg,IDC_HIDETIMESPIN4),mode!=0); + EnableWindow(GetDlgItem(hwndDlg,IDC_HIDETIMESPIN4),mode!=0); EnableWindow(GetDlgItem(hwndDlg,IDC_HIDEDELAY2),mode!=0); EnableWindow(GetDlgItem(hwndDlg,IDC_STATIC5),mode!=0); EnableWindow(GetDlgItem(hwndDlg,IDC_STATIC6),mode!=0); @@ -1156,7 +1156,7 @@ static INT_PTR CALLBACK DlgProcClistBehaviourOpts(HWND hwndDlg, UINT msg, WPARAM return 0; // Enable apply button SendMessage(GetParent(hwndDlg), PSM_CHANGED, (WPARAM)hwndDlg, 0); - break; + break; case WM_NOTIFY: switch (((LPNMHDR)lParam)->code) { @@ -1166,11 +1166,11 @@ static INT_PTR CALLBACK DlgProcClistBehaviourOpts(HWND hwndDlg, UINT msg, WPARAM //DBWriteContactSettingByte(NULL,"CLUI","RightClientMargin",(BYTE)SendDlgItemMessage(hwndDlg,IDC_RIGHTMARGINSPIN,UDM_GETPOS,0,0)); //DBWriteContactSettingByte(NULL,"CLUI","TopClientMargin",(BYTE)SendDlgItemMessage(hwndDlg,IDC_TOPMARGINSPIN,UDM_GETPOS,0,0)); //DBWriteContactSettingByte(NULL,"CLUI","BottomClientMargin",(BYTE)SendDlgItemMessage(hwndDlg,IDC_BOTTOMMARGINSPIN,UDM_GETPOS,0,0)); - //if (g_proc_UpdateLayeredWindow!=NULL && IsDlgButtonChecked(hwndDlg,IDC_LAYERENGINE)) + //if (g_proc_UpdateLayeredWindow!=NULL && IsDlgButtonChecked(hwndDlg,IDC_LAYERENGINE)) // DBWriteContactSettingByte(NULL,"ModernData","EnableLayering",0); - //else - // DBDeleteContactSetting(NULL,"ModernData","EnableLayering"); - ModernWriteSettingByte(NULL,"ModernData","HideBehind",(BYTE)SendDlgItemMessage(hwndDlg,IDC_HIDEMETHOD,CB_GETCURSEL,0,0)); + //else + // DBDeleteContactSetting(NULL,"ModernData","EnableLayering"); + ModernWriteSettingByte(NULL,"ModernData","HideBehind",(BYTE)SendDlgItemMessage(hwndDlg,IDC_HIDEMETHOD,CB_GETCURSEL,0,0)); ModernWriteSettingWord(NULL,"ModernData","ShowDelay",(WORD)SendDlgItemMessage(hwndDlg,IDC_HIDETIMESPIN2,UDM_GETPOS,0,0)); ModernWriteSettingWord(NULL,"ModernData","HideDelay",(WORD)SendDlgItemMessage(hwndDlg,IDC_HIDETIMESPIN3,UDM_GETPOS,0,0)); ModernWriteSettingWord(NULL,"ModernData","HideBehindBorderSize",(WORD)SendDlgItemMessage(hwndDlg,IDC_HIDETIMESPIN4,UDM_GETPOS,0,0)); @@ -1181,19 +1181,19 @@ static INT_PTR CALLBACK DlgProcClistBehaviourOpts(HWND hwndDlg, UINT msg, WPARAM ModernWriteSettingByte(NULL,"CLUI","ClientAreaDrag",(BYTE)IsDlgButtonChecked(hwndDlg,IDC_CLIENTDRAG)); ModernWriteSettingByte(NULL,"CLUI","AutoSize",(BYTE)IsDlgButtonChecked(hwndDlg,IDC_AUTOSIZE)); ModernWriteSettingByte(NULL,"CLUI","LockSize",(BYTE)IsDlgButtonChecked(hwndDlg,IDC_LOCKSIZING)); - ModernWriteSettingByte(NULL,"CLUI","MaxSizeHeight",(BYTE)GetDlgItemInt(hwndDlg,IDC_MAXSIZEHEIGHT,NULL,FALSE)); - ModernWriteSettingByte(NULL,"CLUI","MinSizeHeight",(BYTE)GetDlgItemInt(hwndDlg,IDC_MINSIZEHEIGHT,NULL,FALSE)); + ModernWriteSettingByte(NULL,"CLUI","MaxSizeHeight",(BYTE)GetDlgItemInt(hwndDlg,IDC_MAXSIZEHEIGHT,NULL,FALSE)); + ModernWriteSettingByte(NULL,"CLUI","MinSizeHeight",(BYTE)GetDlgItemInt(hwndDlg,IDC_MINSIZEHEIGHT,NULL,FALSE)); ModernWriteSettingByte(NULL,"CLUI","AutoSizeUpward",(BYTE)IsDlgButtonChecked(hwndDlg,IDC_AUTOSIZEUPWARD)); ModernWriteSettingByte(NULL,"CLUI","SnapToEdges",(BYTE)IsDlgButtonChecked(hwndDlg,IDC_SNAPTOEDGES)); - - ModernWriteSettingByte(NULL,"CLUI","DockToSides",(BYTE)IsDlgButtonChecked(hwndDlg,IDC_DOCKTOSIDES)); + + ModernWriteSettingByte(NULL,"CLUI","DockToSides",(BYTE)IsDlgButtonChecked(hwndDlg,IDC_DOCKTOSIDES)); ModernWriteSettingByte(NULL,"CLUI","EventArea", (BYTE)(IsDlgButtonChecked(hwndDlg,IDC_EVENTAREA_ALWAYS)?2:(BYTE)IsDlgButtonChecked(hwndDlg,IDC_EVENTAREA)?1:0)); ModernWriteSettingByte(NULL,"CList","AutoHide",(BYTE)IsDlgButtonChecked(hwndDlg,IDC_AUTOHIDE)); - ModernWriteSettingWord(NULL,"CList","HideTime",(WORD)SendDlgItemMessage(hwndDlg,IDC_HIDETIMESPIN,UDM_GETPOS,0,0)); - CLUI_ChangeWindowMode(); + ModernWriteSettingWord(NULL,"CList","HideTime",(WORD)SendDlgItemMessage(hwndDlg,IDC_HIDETIMESPIN,UDM_GETPOS,0,0)); + CLUI_ChangeWindowMode(); SendMessage(pcli->hwndContactTree,WM_SIZE,0,0); //forces it to send a cln_listsizechanged CLUI_ReloadCLUIOptions(); EventArea_ConfigureEventArea(); @@ -1211,11 +1211,11 @@ static INT_PTR CALLBACK DlgProcClistWindowOpts(HWND hwndDlg, UINT msg, WPARAM wP BOOL fEnabled=FALSE; switch (msg) { - case WM_INITDIALOG: - + case WM_INITDIALOG: + TranslateDialogDefault(hwndDlg); g_hCLUIOptionsWnd=hwndDlg; - CheckDlgButton(hwndDlg, IDC_ONTOP, ModernGetSettingByte(NULL,"CList","OnTop",SETTING_ONTOP_DEFAULT) ? BST_CHECKED : BST_UNCHECKED); + CheckDlgButton(hwndDlg, IDC_ONTOP, ModernGetSettingByte(NULL,"CList","OnTop",SETTING_ONTOP_DEFAULT) ? BST_CHECKED : BST_UNCHECKED); { // ====== Activate/Deactivate Non-Layered items ======= fEnabled=!g_CluiData.fLayered || g_CluiData.fDisableSkinEngine; EnableWindow(GetDlgItem(hwndDlg,IDC_TOOLWND),fEnabled); @@ -1240,7 +1240,7 @@ static INT_PTR CALLBACK DlgProcClistWindowOpts(HWND hwndDlg, UINT msg, WPARAM wP CheckDlgButton(hwndDlg, IDC_SHOWCAPTION, ModernGetSettingByte(NULL,"CLUI","ShowCaption",SETTING_SHOWCAPTION_DEFAULT) ? BST_CHECKED : BST_UNCHECKED); CheckDlgButton(hwndDlg, IDC_SHOWMAINMENU, ModernGetSettingByte(NULL,"CLUI","ShowMainMenu",SETTING_SHOWMAINMENU_DEFAULT) ? BST_CHECKED : BST_UNCHECKED); //EnableWindow(GetDlgItem(hwndDlg,IDC_CLIENTDRAG),!IsDlgButtonChecked(hwndDlg,IDC_DRAGTOSCROLL)); - if (!IsDlgButtonChecked(hwndDlg,IDC_SHOWCAPTION)) + if (!IsDlgButtonChecked(hwndDlg,IDC_SHOWCAPTION)) { EnableWindow(GetDlgItem(hwndDlg,IDC_MIN2TRAY),FALSE); EnableWindow(GetDlgItem(hwndDlg,IDC_TOOLWND),FALSE); @@ -1251,10 +1251,10 @@ static INT_PTR CALLBACK DlgProcClistWindowOpts(HWND hwndDlg, UINT msg, WPARAM wP EnableWindow(GetDlgItem(hwndDlg,IDC_MIN2TRAY),FALSE); EnableWindow(GetDlgItem(hwndDlg,IDC_TOOLWND),FALSE); EnableWindow(GetDlgItem(hwndDlg,IDC_TITLETEXT),FALSE); - EnableWindow(GetDlgItem(hwndDlg,IDC_SHOWCAPTION),FALSE); + EnableWindow(GetDlgItem(hwndDlg,IDC_SHOWCAPTION),FALSE); } CheckDlgButton(hwndDlg, IDC_DROPSHADOW, ModernGetSettingByte(NULL,"CList","WindowShadow",SETTING_WINDOWSHADOW_DEFAULT) ? BST_CHECKED : BST_UNCHECKED); - CheckDlgButton(hwndDlg, IDC_ROUNDCORNERS, ModernGetSettingByte(NULL,"CLC","RoundCorners",SETTING_ROUNDCORNERS_DEFAULT) ? BST_CHECKED : BST_UNCHECKED); + CheckDlgButton(hwndDlg, IDC_ROUNDCORNERS, ModernGetSettingByte(NULL,"CLC","RoundCorners",SETTING_ROUNDCORNERS_DEFAULT) ? BST_CHECKED : BST_UNCHECKED); } // ====== End of Non-Layered Mode ===== CheckDlgButton(hwndDlg, IDC_FADEINOUT, ModernGetSettingByte(NULL,"CLUI","FadeInOut",SETTING_FADEIN_DEFAULT) ? BST_CHECKED : BST_UNCHECKED); @@ -1271,12 +1271,12 @@ static INT_PTR CALLBACK DlgProcClistWindowOpts(HWND hwndDlg, UINT msg, WPARAM wP SendDlgItemMessage(hwndDlg,IDC_RIGHTMARGINSPIN,UDM_SETPOS,0,ModernGetSettingByte(NULL,"CLUI","RightClientMargin",SETTING_RIGHTCLIENTMARIGN_DEFAULT)); SendDlgItemMessage(hwndDlg,IDC_TOPMARGINSPIN,UDM_SETPOS,0,ModernGetSettingByte(NULL,"CLUI","TopClientMargin",SETTING_TOPCLIENTMARIGN_DEFAULT)); SendDlgItemMessage(hwndDlg,IDC_BOTTOMMARGINSPIN,UDM_SETPOS,0,ModernGetSettingByte(NULL,"CLUI","BottomClientMargin",SETTING_BOTTOMCLIENTMARIGN_DEFAULT)); - - CheckDlgButton(hwndDlg, IDC_DISABLEENGINE, ModernGetSettingByte(NULL,"ModernData","DisableEngine", SETTING_DISABLESKIN_DEFAULT) ? BST_CHECKED : BST_UNCHECKED); + + CheckDlgButton(hwndDlg, IDC_DISABLEENGINE, ModernGetSettingByte(NULL,"ModernData","DisableEngine", SETTING_DISABLESKIN_DEFAULT) ? BST_CHECKED : BST_UNCHECKED); CheckDlgButton(hwndDlg, IDC_AEROGLASS, ModernGetSettingByte(NULL,"ModernData","AeroGlass",SETTING_AEROGLASS_DEFAULT) ? BST_CHECKED : BST_UNCHECKED); - + EnableWindow(GetDlgItem(hwndDlg,IDC_LAYERENGINE),(g_proc_UpdateLayeredWindow!=NULL && !ModernGetSettingByte(NULL,"ModernData","DisableEngine", SETTING_DISABLESKIN_DEFAULT))?TRUE:FALSE); - CheckDlgButton(hwndDlg, IDC_LAYERENGINE, ((ModernGetSettingByte(NULL,"ModernData","EnableLayering",SETTING_ENABLELAYERING_DEFAULT)&&g_proc_UpdateLayeredWindow!=NULL) && !ModernGetSettingByte(NULL,"ModernData","DisableEngine", SETTING_DISABLESKIN_DEFAULT)) ? BST_UNCHECKED:BST_CHECKED); + CheckDlgButton(hwndDlg, IDC_LAYERENGINE, ((ModernGetSettingByte(NULL,"ModernData","EnableLayering",SETTING_ENABLELAYERING_DEFAULT)&&g_proc_UpdateLayeredWindow!=NULL) && !ModernGetSettingByte(NULL,"ModernData","DisableEngine", SETTING_DISABLESKIN_DEFAULT)) ? BST_UNCHECKED:BST_CHECKED); { DBVARIANT dbv={0}; @@ -1348,10 +1348,10 @@ static INT_PTR CALLBACK DlgProcClistWindowOpts(HWND hwndDlg, UINT msg, WPARAM wP { // ====== Activate/Deactivate Non-Layered items ======= fEnabled=!(IsWindowEnabled(GetDlgItem(hwndDlg,IDC_LAYERENGINE)) && !IsDlgButtonChecked(hwndDlg,IDC_LAYERENGINE) && !IsDlgButtonChecked(hwndDlg,IDC_DISABLEENGINE)); - EnableWindow(GetDlgItem(hwndDlg,IDC_TOOLWND),fEnabled&&(IsDlgButtonChecked(hwndDlg,IDC_SHOWCAPTION))&&!(IsDlgButtonChecked(hwndDlg,IDC_NOBORDERWND)||IsDlgButtonChecked(hwndDlg,IDC_BORDER))); - EnableWindow(GetDlgItem(hwndDlg,IDC_MIN2TRAY),fEnabled&&(IsDlgButtonChecked(hwndDlg,IDC_TOOLWND) && IsDlgButtonChecked(hwndDlg,IDC_SHOWCAPTION)) && !(IsDlgButtonChecked(hwndDlg,IDC_NOBORDERWND)||IsDlgButtonChecked(hwndDlg,IDC_BORDER))); - EnableWindow(GetDlgItem(hwndDlg,IDC_TITLETEXT),fEnabled&&(IsDlgButtonChecked(hwndDlg,IDC_SHOWCAPTION))&&!(IsDlgButtonChecked(hwndDlg,IDC_NOBORDERWND)||IsDlgButtonChecked(hwndDlg,IDC_BORDER))); - EnableWindow(GetDlgItem(hwndDlg,IDC_SHOWCAPTION),fEnabled&&!(IsDlgButtonChecked(hwndDlg,IDC_NOBORDERWND)||IsDlgButtonChecked(hwndDlg,IDC_BORDER))); + EnableWindow(GetDlgItem(hwndDlg,IDC_TOOLWND),fEnabled&&(IsDlgButtonChecked(hwndDlg,IDC_SHOWCAPTION))&&!(IsDlgButtonChecked(hwndDlg,IDC_NOBORDERWND)||IsDlgButtonChecked(hwndDlg,IDC_BORDER))); + EnableWindow(GetDlgItem(hwndDlg,IDC_MIN2TRAY),fEnabled&&(IsDlgButtonChecked(hwndDlg,IDC_TOOLWND) && IsDlgButtonChecked(hwndDlg,IDC_SHOWCAPTION)) && !(IsDlgButtonChecked(hwndDlg,IDC_NOBORDERWND)||IsDlgButtonChecked(hwndDlg,IDC_BORDER))); + EnableWindow(GetDlgItem(hwndDlg,IDC_TITLETEXT),fEnabled&&(IsDlgButtonChecked(hwndDlg,IDC_SHOWCAPTION))&&!(IsDlgButtonChecked(hwndDlg,IDC_NOBORDERWND)||IsDlgButtonChecked(hwndDlg,IDC_BORDER))); + EnableWindow(GetDlgItem(hwndDlg,IDC_SHOWCAPTION),fEnabled&&!(IsDlgButtonChecked(hwndDlg,IDC_NOBORDERWND)||IsDlgButtonChecked(hwndDlg,IDC_BORDER))); EnableWindow(GetDlgItem(hwndDlg,IDC_BORDER),fEnabled); EnableWindow(GetDlgItem(hwndDlg,IDC_NOBORDERWND),fEnabled); EnableWindow(GetDlgItem(hwndDlg,IDC_SHOWMAINMENU),fEnabled); @@ -1368,10 +1368,10 @@ static INT_PTR CALLBACK DlgProcClistWindowOpts(HWND hwndDlg, UINT msg, WPARAM wP } else if(LOWORD(wParam)==IDC_ONDESKTOP && IsDlgButtonChecked(hwndDlg,IDC_ONDESKTOP)) { - CheckDlgButton(hwndDlg, IDC_ONTOP, BST_UNCHECKED); + CheckDlgButton(hwndDlg, IDC_ONTOP, BST_UNCHECKED); } else if(LOWORD(wParam)==IDC_ONTOP && IsDlgButtonChecked(hwndDlg,IDC_ONTOP)) { - CheckDlgButton(hwndDlg, IDC_ONDESKTOP, BST_UNCHECKED); + CheckDlgButton(hwndDlg, IDC_ONDESKTOP, BST_UNCHECKED); } else if(LOWORD(wParam)==IDC_TOOLWND) { EnableWindow(GetDlgItem(hwndDlg,IDC_MIN2TRAY),!IsDlgButtonChecked(hwndDlg,IDC_TOOLWND)); @@ -1383,16 +1383,16 @@ static INT_PTR CALLBACK DlgProcClistWindowOpts(HWND hwndDlg, UINT msg, WPARAM wP } else if(LOWORD(wParam)==IDC_NOBORDERWND ||LOWORD(wParam)==IDC_BORDER) { - EnableWindow(GetDlgItem(hwndDlg,IDC_TOOLWND),(IsDlgButtonChecked(hwndDlg,IDC_SHOWCAPTION))&&!(IsDlgButtonChecked(hwndDlg,IDC_NOBORDERWND)||IsDlgButtonChecked(hwndDlg,IDC_BORDER))); - EnableWindow(GetDlgItem(hwndDlg,IDC_MIN2TRAY),(IsDlgButtonChecked(hwndDlg,IDC_TOOLWND) && IsDlgButtonChecked(hwndDlg,IDC_SHOWCAPTION)) && !(IsDlgButtonChecked(hwndDlg,IDC_NOBORDERWND)||IsDlgButtonChecked(hwndDlg,IDC_BORDER))); - EnableWindow(GetDlgItem(hwndDlg,IDC_TITLETEXT),(IsDlgButtonChecked(hwndDlg,IDC_SHOWCAPTION))&&!(IsDlgButtonChecked(hwndDlg,IDC_NOBORDERWND)||IsDlgButtonChecked(hwndDlg,IDC_BORDER))); - EnableWindow(GetDlgItem(hwndDlg,IDC_SHOWCAPTION),!(IsDlgButtonChecked(hwndDlg,IDC_NOBORDERWND)||IsDlgButtonChecked(hwndDlg,IDC_BORDER))); + EnableWindow(GetDlgItem(hwndDlg,IDC_TOOLWND),(IsDlgButtonChecked(hwndDlg,IDC_SHOWCAPTION))&&!(IsDlgButtonChecked(hwndDlg,IDC_NOBORDERWND)||IsDlgButtonChecked(hwndDlg,IDC_BORDER))); + EnableWindow(GetDlgItem(hwndDlg,IDC_MIN2TRAY),(IsDlgButtonChecked(hwndDlg,IDC_TOOLWND) && IsDlgButtonChecked(hwndDlg,IDC_SHOWCAPTION)) && !(IsDlgButtonChecked(hwndDlg,IDC_NOBORDERWND)||IsDlgButtonChecked(hwndDlg,IDC_BORDER))); + EnableWindow(GetDlgItem(hwndDlg,IDC_TITLETEXT),(IsDlgButtonChecked(hwndDlg,IDC_SHOWCAPTION))&&!(IsDlgButtonChecked(hwndDlg,IDC_NOBORDERWND)||IsDlgButtonChecked(hwndDlg,IDC_BORDER))); + EnableWindow(GetDlgItem(hwndDlg,IDC_SHOWCAPTION),!(IsDlgButtonChecked(hwndDlg,IDC_NOBORDERWND)||IsDlgButtonChecked(hwndDlg,IDC_BORDER))); if (LOWORD(wParam)==IDC_BORDER) CheckDlgButton(hwndDlg, IDC_NOBORDERWND,BST_UNCHECKED); - else CheckDlgButton(hwndDlg, IDC_BORDER,BST_UNCHECKED); + else CheckDlgButton(hwndDlg, IDC_BORDER,BST_UNCHECKED); } if ((LOWORD(wParam)==IDC_TITLETEXT || LOWORD(wParam)==IDC_MAXSIZEHEIGHT || LOWORD(wParam)==IDC_MINSIZEHEIGHT || LOWORD(wParam)==IDC_FRAMESGAP || LOWORD(wParam)==IDC_CAPTIONSGAP || - LOWORD(wParam)==IDC_LEFTMARGIN || LOWORD(wParam)==IDC_RIGHTMARGIN|| LOWORD(wParam)==IDC_TOPMARGIN || LOWORD(wParam)==IDC_BOTTOMMARGIN) + LOWORD(wParam)==IDC_LEFTMARGIN || LOWORD(wParam)==IDC_RIGHTMARGIN|| LOWORD(wParam)==IDC_TOPMARGIN || LOWORD(wParam)==IDC_BOTTOMMARGIN) &&(HIWORD(wParam)!=EN_CHANGE || (HWND)lParam!=GetFocus())) return 0; // Enable apply button @@ -1421,10 +1421,10 @@ static INT_PTR CALLBACK DlgProcClistWindowOpts(HWND hwndDlg, UINT msg, WPARAM wP ModernWriteSettingByte(NULL,"ModernData","AeroGlass",IsDlgButtonChecked(hwndDlg,IDC_AEROGLASS)); if (!IsDlgButtonChecked(hwndDlg,IDC_DISABLEENGINE)) { - if (g_proc_UpdateLayeredWindow!=NULL && IsDlgButtonChecked(hwndDlg,IDC_LAYERENGINE)) + if (g_proc_UpdateLayeredWindow!=NULL && IsDlgButtonChecked(hwndDlg,IDC_LAYERENGINE)) ModernWriteSettingByte(NULL,"ModernData","EnableLayering",0); - else - ModernDeleteSetting(NULL,"ModernData","EnableLayering"); + else + ModernDeleteSetting(NULL,"ModernData","EnableLayering"); } g_CluiData.dwKeyColor=ModernGetSettingDword(NULL,"ModernSettings","KeyColor",(DWORD)SETTING_KEYCOLOR_DEFAULT); ModernWriteSettingByte(NULL,"CList","OnDesktop",(BYTE)IsDlgButtonChecked(hwndDlg,IDC_ONDESKTOP)); @@ -1438,7 +1438,7 @@ static INT_PTR CALLBACK DlgProcClistWindowOpts(HWND hwndDlg, UINT msg, WPARAM wP ModernWriteSettingByte(NULL,"CLUI","ShowMainMenu",(BYTE)IsDlgButtonChecked(hwndDlg,IDC_SHOWMAINMENU)); ModernWriteSettingByte(NULL,"CList","ThinBorder",(BYTE)IsDlgButtonChecked(hwndDlg,IDC_BORDER)); ModernWriteSettingByte(NULL,"CList","NoBorder",(BYTE)IsDlgButtonChecked(hwndDlg,IDC_NOBORDERWND)); - { + { TCHAR title[256]; GetDlgItemText(hwndDlg,IDC_TITLETEXT,title,SIZEOF(title)); ModernWriteSettingTString(NULL,"CList","TitleText",title); @@ -1446,21 +1446,21 @@ static INT_PTR CALLBACK DlgProcClistWindowOpts(HWND hwndDlg, UINT msg, WPARAM wP } ModernWriteSettingByte(NULL,"CList","Min2Tray",(BYTE)IsDlgButtonChecked(hwndDlg,IDC_MIN2TRAY)); ModernWriteSettingByte(NULL,"CList","WindowShadow",(BYTE)IsDlgButtonChecked(hwndDlg,IDC_DROPSHADOW)); - ModernWriteSettingByte(NULL,"CLC","RoundCorners",(BYTE)IsDlgButtonChecked(hwndDlg,IDC_ROUNDCORNERS)); + ModernWriteSettingByte(NULL,"CLC","RoundCorners",(BYTE)IsDlgButtonChecked(hwndDlg,IDC_ROUNDCORNERS)); } //====== End of Non-Layered Mode ====== g_mutex_bChangingMode=TRUE; - if (IsDlgButtonChecked(hwndDlg,IDC_ONDESKTOP)) + if (IsDlgButtonChecked(hwndDlg,IDC_ONDESKTOP)) { HWND hProgMan=FindWindow(TEXT("Progman"),NULL); - if (IsWindow(hProgMan)) + if (IsWindow(hProgMan)) { SetParent(pcli->hwndContactList,hProgMan); Sync( CLUIFrames_SetParentForContainers, (HWND)hProgMan ); g_CluiData.fOnDesktop=1; } - } - else + } + else { if (GetParent(pcli->hwndContactList)) { @@ -1476,7 +1476,7 @@ static INT_PTR CALLBACK DlgProcClistWindowOpts(HWND hwndDlg, UINT msg, WPARAM wP int i1; int i2; i1=SendDlgItemMessage(hwndDlg,IDC_FRAMESSPIN,UDM_GETPOS,0,0); - i2=SendDlgItemMessage(hwndDlg,IDC_CAPTIONSSPIN,UDM_GETPOS,0,0); + i2=SendDlgItemMessage(hwndDlg,IDC_CAPTIONSSPIN,UDM_GETPOS,0,0); ModernWriteSettingDword(NULL,"CLUIFrames","GapBetweenFrames",(DWORD)i1); ModernWriteSettingDword(NULL,"CLUIFrames","GapBetweenTitleBar",(DWORD)i2); @@ -1488,11 +1488,11 @@ static INT_PTR CALLBACK DlgProcClistWindowOpts(HWND hwndDlg, UINT msg, WPARAM wP ModernWriteSettingByte(NULL,"CList","OnDesktop",(BYTE)IsDlgButtonChecked(hwndDlg,IDC_ONDESKTOP)); ske_LoadSkinFromDB(); - CLUI_UpdateLayeredMode(); - CLUI_ChangeWindowMode(); + CLUI_UpdateLayeredMode(); + CLUI_ChangeWindowMode(); SendMessage(pcli->hwndContactTree,WM_SIZE,0,0); //forces it to send a cln_listsizechanged CLUI_ReloadCLUIOptions(); - cliShowHide(0,1); + cliShowHide(0,1); g_mutex_bChangingMode=FALSE; return TRUE; } @@ -1575,8 +1575,8 @@ static INT_PTR CALLBACK DlgProcClcBkgOpts(HWND hwndDlg, UINT msg, WPARAM wParam, dat->item[indx].useBitmap = ModernGetSettingByte(NULL,module, "UseBitmap", DEFAULT_USEBITMAP); dat->item[indx].bkColor = ModernGetSettingDword(NULL,module, "BkColour", DEFAULT_BKCOLOUR); dat->item[indx].selColor = ModernGetSettingDword(NULL,module, "SelBkColour", DEFAULT_SELBKCOLOUR); - dat->item[indx].useWinColours = ModernGetSettingByte(NULL,module, "UseWinColours", CLCDEFAULT_USEWINDOWSCOLOURS); - { + dat->item[indx].useWinColours = ModernGetSettingByte(NULL,module, "UseWinColours", CLCDEFAULT_USEWINDOWSCOLOURS); + { DBVARIANT dbv; if (!ModernGetSettingString(NULL,module,"BkBitmap",&dbv)) { @@ -1607,7 +1607,7 @@ static INT_PTR CALLBACK DlgProcClcBkgOpts(HWND hwndDlg, UINT msg, WPARAM wParam, if(dat->item) mir_free(dat->item); mir_free(dat); } - + return TRUE; case M_BKGR_GETSTATE: @@ -1620,7 +1620,7 @@ static INT_PTR CALLBACK DlgProcClcBkgOpts(HWND hwndDlg, UINT msg, WPARAM wParam, dat->item[indx].useWinColours = IsDlgButtonChecked(hwndDlg,IDC_USEWINCOL); dat->item[indx].bkColor = SendDlgItemMessage(hwndDlg, IDC_BKGCOLOUR, CPM_GETCOLOUR,0,0); dat->item[indx].selColor = SendDlgItemMessage(hwndDlg, IDC_SELCOLOUR, CPM_GETCOLOUR,0,0); - + GetDlgItemTextA(hwndDlg, IDC_FILENAME, dat->item[indx].filename, SIZEOF(dat->item[indx].filename)); { WORD flags = 0; @@ -1632,7 +1632,7 @@ static INT_PTR CALLBACK DlgProcClcBkgOpts(HWND hwndDlg, UINT msg, WPARAM wParam, if(IsDlgButtonChecked(hwndDlg,IDC_PROPORTIONAL)) flags |= CLBF_PROPORTIONAL; if(IsDlgButtonChecked(hwndDlg,IDC_TILEVROWH)) flags |= CLBF_TILEVTOROWHEIGHT; dat->item[indx].flags = flags; - } + } break; } case M_BKGR_SETSTATE: @@ -1654,7 +1654,7 @@ static INT_PTR CALLBACK DlgProcClcBkgOpts(HWND hwndDlg, UINT msg, WPARAM wParam, SendDlgItemMessage(hwndDlg, IDC_BKGCOLOUR, CPM_SETCOLOUR, 0, dat->item[indx].bkColor); SendDlgItemMessage(hwndDlg, IDC_SELCOLOUR, CPM_SETDEFAULTCOLOUR, 0, DEFAULT_SELBKCOLOUR); SendDlgItemMessage(hwndDlg, IDC_SELCOLOUR, CPM_SETCOLOUR, 0, dat->item[indx].selColor); - SetDlgItemTextA(hwndDlg, IDC_FILENAME, dat->item[indx].filename); + SetDlgItemTextA(hwndDlg, IDC_FILENAME, dat->item[indx].filename); CheckDlgButton(hwndDlg,IDC_STRETCHH, flags&CLB_STRETCHH?BST_CHECKED:BST_UNCHECKED); CheckDlgButton(hwndDlg,IDC_STRETCHV,flags&CLB_STRETCHV?BST_CHECKED:BST_UNCHECKED); @@ -1681,7 +1681,7 @@ static INT_PTR CALLBACK DlgProcClcBkgOpts(HWND hwndDlg, UINT msg, WPARAM wParam, 130, cy, 0, 0, SWP_NOACTIVATE|SWP_NOZORDER|SWP_NOSIZE); - cy += 25; + cy += 25; } if(visibility & M_BKGR_SELECTCOLOR) { @@ -1693,7 +1693,7 @@ static INT_PTR CALLBACK DlgProcClcBkgOpts(HWND hwndDlg, UINT msg, WPARAM wParam, 130, cy, 0, 0, SWP_NOACTIVATE|SWP_NOZORDER|SWP_NOSIZE); - cy += 25; + cy += 25; } ShowWindow(GetDlgItem(hwndDlg,IDC_STRETCHH), visibility&CLB_STRETCHH?SW_SHOW:SW_HIDE); ShowWindow(GetDlgItem(hwndDlg,IDC_STRETCHV), visibility&CLB_STRETCHV?SW_SHOW:SW_HIDE); @@ -1756,10 +1756,10 @@ static INT_PTR CALLBACK DlgProcClcBkgOpts(HWND hwndDlg, UINT msg, WPARAM wParam, int indx = SendDlgItemMessage(hwndDlg, IDC_BKGRLIST, CB_GETCURSEL, 0,0); if(indx != CB_ERR && indx < dat->count) { - indx = SendDlgItemMessage(hwndDlg, IDC_BKGRLIST, CB_GETITEMDATA, indx, 0); + indx = SendDlgItemMessage(hwndDlg, IDC_BKGRLIST, CB_GETITEMDATA, indx, 0); dat->item[indx].changed = TRUE; - - } + + } { BOOL EnableColours=!IsDlgButtonChecked(hwndDlg,IDC_USEWINCOL); EnableWindow(GetDlgItem(hwndDlg,IDC_BKGCOLOUR), EnableColours); @@ -1783,10 +1783,10 @@ static INT_PTR CALLBACK DlgProcClcBkgOpts(HWND hwndDlg, UINT msg, WPARAM wParam, { char *module = bkgrList[indx] + strlen(bkgrList[indx]) + 1; ModernWriteSettingByte(NULL, module, "UseBitmap", (BYTE)dat->item[indx].useBitmap); - { + { COLORREF col; - if ((col = dat->item[indx].bkColor) == DEFAULT_BKCOLOUR) + if ((col = dat->item[indx].bkColor) == DEFAULT_BKCOLOUR) ModernDeleteSetting(NULL, module, "BkColour"); else ModernWriteSettingDword(NULL, module, "BkColour", col); @@ -1797,7 +1797,7 @@ static INT_PTR CALLBACK DlgProcClcBkgOpts(HWND hwndDlg, UINT msg, WPARAM wParam, ModernWriteSettingDword(NULL, module, "SelBkColour", col); } ModernWriteSettingByte(NULL, module, "UseWinColours", (BYTE)dat->item[indx].useWinColours); - + { char str[MAX_PATH]; int retval = CallService(MS_UTILS_PATHTOABSOLUTE, @@ -1842,14 +1842,14 @@ static INT_PTR BkgrCfg_Register(WPARAM wParam,LPARAM lParam) bkgrList = (char **)mir_realloc(bkgrList, sizeof(char*)*(bkgrCount+1)); bkgrList[bkgrCount] = value; bkgrCount++; - + return 0; } HRESULT BackgroundsLoadModule() -{ - CreateServiceFunction(MS_BACKGROUNDCONFIG_REGISTER, BkgrCfg_Register); +{ + CreateServiceFunction(MS_BACKGROUNDCONFIG_REGISTER, BkgrCfg_Register); return S_OK; } @@ -2051,7 +2051,7 @@ static INT_PTR CALLBACK DlgProcModernOptions(HWND hwndDlg, UINT msg, WPARAM wPar SendMessage(hwndDlg,WM_HSCROLL,0x12345678,0); - for (i=0; ihwndContactTree,WM_SIZE,0,0); //forces it to send a cln_listsizechanged CLUI_ReloadCLUIOptions(); - cliShowHide(0,1); + cliShowHide(0,1); g_mutex_bChangingMode=FALSE; return TRUE; } diff --git a/plugins/Clist_mw/CLUIFrames/cluiframes.cpp b/plugins/Clist_mw/CLUIFrames/cluiframes.cpp index 3d5eb1d676..df70ff4d02 100644 --- a/plugins/Clist_mw/CLUIFrames/cluiframes.cpp +++ b/plugins/Clist_mw/CLUIFrames/cluiframes.cpp @@ -2853,18 +2853,18 @@ static int CLUIFrameOnFontChange(WPARAM wParam,LPARAM lParam) static void CLUIRegisterFonts() { - if (ServiceExists(MS_FONT_REGISTER)) { - FontID fid = {0}; - fid.cbSize = sizeof(fid); - strcpy(fid.group,LPGEN("Frames")); - strcpy(fid.name,LPGEN("TitleBarFont")); - strcpy(fid.dbSettingsGroup,"CLUIFrames"); - strcpy(fid.prefix,"FramesTitleBarFont"); - - CallService(MS_FONT_REGISTER,(WPARAM)&fid,0); - CLUIFrameOnFontChange(0,0); - HookEvent(ME_FONT_RELOAD,CLUIFrameOnFontChange); -} } + FontID fid = {0}; + fid.cbSize = sizeof(fid); + strcpy(fid.group, LPGEN("Frames")); + strcpy(fid.name, LPGEN("TitleBarFont")); + strcpy(fid.dbSettingsGroup, "CLUIFrames"); + strcpy(fid.prefix, "FramesTitleBarFont"); + FontRegister(&fid); + + CLUIFrameOnFontChange(0,0); + + HookEvent(ME_FONT_RELOAD,CLUIFrameOnFontChange); +} static int CLUIFrameOnModulesLoad(WPARAM wParam,LPARAM lParam) { diff --git a/plugins/Clist_mw/clcfonts.cpp b/plugins/Clist_mw/clcfonts.cpp index 346c53c9f3..1ad20dc2b0 100644 --- a/plugins/Clist_mw/clcfonts.cpp +++ b/plugins/Clist_mw/clcfonts.cpp @@ -99,8 +99,7 @@ void RegisterCListFonts() sprintf(idstr, "Font%d", fontListOrder[i]); strncpy(fontid.prefix, idstr, SIZEOF(fontid.prefix)); fontid.order = fontListOrder[i]; - - CallService(MS_FONT_REGISTERT, (WPARAM)&fontid, 0); + FontRegisterT(&fontid); } } @@ -113,25 +112,25 @@ void RegisterCListFonts() _tcsncpy(colourid.name, LPGENT("Background"), SIZEOF(colourid.name)); _tcsncpy(colourid.group, LPGENT("Contact List"), SIZEOF(colourid.group)); colourid.defcolour = CLCDEFAULT_BKCOLOUR; - CallService(MS_COLOUR_REGISTERT, (WPARAM)&colourid, 0); + ColourRegisterT(&colourid); strncpy(colourid.setting, "SelTextColour", sizeof(colourid.setting)); _tcsncpy(colourid.name, LPGENT("Selected Text"), SIZEOF(colourid.name)); colourid.order = 1; colourid.defcolour = CLCDEFAULT_SELTEXTCOLOUR; - CallService(MS_COLOUR_REGISTERT, (WPARAM)&colourid, 0); + ColourRegisterT(&colourid); strncpy(colourid.setting, "HotTextColour", sizeof(colourid.setting)); _tcsncpy(colourid.name, LPGENT("Hottrack Text"), SIZEOF(colourid.name)); colourid.order = 1; colourid.defcolour = CLCDEFAULT_HOTTEXTCOLOUR; - CallService(MS_COLOUR_REGISTERT, (WPARAM)&colourid, 0); + ColourRegisterT(&colourid); strncpy(colourid.setting, "QuickSearchColour", sizeof(colourid.setting)); _tcsncpy(colourid.name, LPGENT("Quicksearch Text"), SIZEOF(colourid.name)); colourid.order = 1; colourid.defcolour = CLCDEFAULT_QUICKSEARCHCOLOUR; - CallService(MS_COLOUR_REGISTERT, (WPARAM)&colourid, 0); + ColourRegisterT(&colourid); HookEvent(ME_FONT_RELOAD, FS_FontsChanged); } diff --git a/plugins/Clist_nicer/SRC/clui.cpp b/plugins/Clist_nicer/SRC/clui.cpp index 106ade9372..e4009d6feb 100644 --- a/plugins/Clist_nicer/SRC/clui.cpp +++ b/plugins/Clist_nicer/SRC/clui.cpp @@ -2148,7 +2148,7 @@ void FS_RegisterFonts() lstrcpynA(fid.deffontsettings.szFace, dbv.pszVal, LF_FACESIZE); mir_free(dbv.pszVal); } - CallService(MS_FONT_REGISTER, (WPARAM)&fid, 0); + FontRegister(&fid); j++; } // and colours @@ -2160,24 +2160,23 @@ void FS_RegisterFonts() strncpy(colourid.name, LPGEN("Background"), SIZEOF(colourid.name)); strncpy(colourid.group, LPGEN("Contact List"), SIZEOF(colourid.group)); colourid.defcolour = CLCDEFAULT_BKCOLOUR; - CallService(MS_COLOUR_REGISTER, (WPARAM)&colourid, 0); + ColourRegister(&colourid); strncpy(colourid.setting, "SelTextColour", sizeof(colourid.setting)); strncpy(colourid.name, LPGEN("Selected Text"), SIZEOF(colourid.name)); colourid.order = 1; colourid.defcolour = CLCDEFAULT_SELTEXTCOLOUR; - CallService(MS_COLOUR_REGISTER, (WPARAM)&colourid, 0); + ColourRegister(&colourid); strncpy(colourid.setting, "HotTextColour", sizeof(colourid.setting)); strncpy(colourid.name, LPGEN("Hottrack Text"), SIZEOF(colourid.name)); colourid.order = 1; colourid.defcolour = CLCDEFAULT_HOTTEXTCOLOUR; - CallService(MS_COLOUR_REGISTER, (WPARAM)&colourid, 0); + ColourRegister(&colourid); strncpy(colourid.setting, "QuickSearchColour", sizeof(colourid.setting)); strncpy(colourid.name, LPGEN("Quicksearch Text"), SIZEOF(colourid.name)); colourid.order = 1; colourid.defcolour = CLCDEFAULT_QUICKSEARCHCOLOUR; - CallService(MS_COLOUR_REGISTER, (WPARAM)&colourid, 0); - + ColourRegister(&colourid); } diff --git a/plugins/Console/Console.cpp b/plugins/Console/Console.cpp index 24f187cee1..3a5db7f64c 100644 --- a/plugins/Console/Console.cpp +++ b/plugins/Console/Console.cpp @@ -1259,56 +1259,43 @@ static int OnSystemModulesLoaded(WPARAM wParam,LPARAM lParam) CreateServiceFunction(MS_CONSOLE_SHOW_HIDE, ShowHideConsole); - { - FontIDT fid={0}; - fid.cbSize = sizeof(fid); - _tcscpy(fid.group,_T("Console")); - _tcscpy(fid.name,TranslateT("Text")); - strcpy(fid.dbSettingsGroup,"Console"); - strcpy(fid.prefix,"ConsoleFont"); - - _tcscpy(fid.backgroundGroup,_T("Console")); - _tcscpy(fid.backgroundName,_T("Background")); - - fid.flags = FIDF_DEFAULTVALID; - - fid.deffontsettings.charset = DEFAULT_CHARSET; - fid.deffontsettings.colour = RGB(0, 0, 0); - fid.deffontsettings.size = 10; - fid.deffontsettings.style = 0; - _tcsncpy(fid.deffontsettings.szFace, _T("Courier"), LF_FACESIZE); - - CallService(MS_FONT_REGISTERT,(WPARAM)&fid,0); - - hHooks[i++] = HookEvent(ME_FONT_RELOAD,OnFontChange); - } - - { - ColourIDT cid = {0}; - - cid.cbSize=sizeof(cid); - _tcscpy(cid.group,_T("Console")); - _tcscpy(cid.name,_T("Background")); - strcpy(cid.dbSettingsGroup,"Console"); - strcpy(cid.setting,"BgColor"); - - cid.defcolour = RGB(255,255,255); - - CallService(MS_COLOUR_REGISTERT,(WPARAM)&cid,0); - - hHooks[i++] = HookEvent(ME_COLOUR_RELOAD, OnColourChange); - } - - { - HOTKEYDESC hkd = {0}; - hkd.cbSize = sizeof(hkd); - hkd.pszName = "Console_Show_Hide"; - hkd.pszDescription = LPGEN("Show/Hide Console"); - hkd.pszSection = "Main"; - hkd.pszService = MS_CONSOLE_SHOW_HIDE; - hkd.DefHotKey = HOTKEYCODE(HOTKEYF_EXT, 'C'); - Hotkey_Register(&hkd); - } + FontIDT fid = {0}; + fid.cbSize = sizeof(fid); + _tcscpy(fid.group,_T("Console")); + _tcscpy(fid.name,TranslateT("Text")); + strcpy(fid.dbSettingsGroup,"Console"); + strcpy(fid.prefix,"ConsoleFont"); + _tcscpy(fid.backgroundGroup,_T("Console")); + _tcscpy(fid.backgroundName,_T("Background")); + fid.flags = FIDF_DEFAULTVALID; + fid.deffontsettings.charset = DEFAULT_CHARSET; + fid.deffontsettings.colour = RGB(0, 0, 0); + fid.deffontsettings.size = 10; + fid.deffontsettings.style = 0; + _tcsncpy(fid.deffontsettings.szFace, _T("Courier"), LF_FACESIZE); + FontRegisterT(&fid); + + hHooks[i++] = HookEvent(ME_FONT_RELOAD,OnFontChange); + + ColourIDT cid = {0}; + cid.cbSize=sizeof(cid); + _tcscpy(cid.group,_T("Console")); + _tcscpy(cid.name,_T("Background")); + strcpy(cid.dbSettingsGroup,"Console"); + strcpy(cid.setting,"BgColor"); + cid.defcolour = RGB(255,255,255); + ColourRegisterT(&cid); + + hHooks[i++] = HookEvent(ME_COLOUR_RELOAD, OnColourChange); + + HOTKEYDESC hkd = {0}; + hkd.cbSize = sizeof(hkd); + hkd.pszName = "Console_Show_Hide"; + hkd.pszDescription = LPGEN("Show/Hide Console"); + hkd.pszSection = "Main"; + hkd.pszService = MS_CONSOLE_SHOW_HIDE; + hkd.DefHotKey = HOTKEYCODE(HOTKEYF_EXT, 'C'); + Hotkey_Register(&hkd); if (ServiceExists(MS_TB_ADDBUTTON)) { TBButton tbb = {0}; diff --git a/plugins/ExternalAPI/m_toptoolbar.h b/plugins/ExternalAPI/m_toptoolbar.h index dba10dea61..576daf944b 100644 --- a/plugins/ExternalAPI/m_toptoolbar.h +++ b/plugins/ExternalAPI/m_toptoolbar.h @@ -91,12 +91,11 @@ toptoolbar/getoptions service lparam = 0,or lparam=lpTTBButton if flag=TTBO_ALLDATA returns: value on success, -1 on failure. */ -#define TTBO_FLAGS 0 //get/set all flags -#define TTBO_POS 1 //position -#define TTBO_WIDTH 2 //not impemented -#define TTBO_HEIGHT 3 //not impemented -#define TTBO_TIPNAME 4 //tool tip name -#define TTBO_ALLDATA 5 //change all data via lparam=lpTTBButton +#define TTBO_FLAGS 0 //get/set all flags +#define TTBO_WIDTH 2 //not impemented +#define TTBO_HEIGHT 3 //not impemented +#define TTBO_TIPNAME 4 //tool tip name +#define TTBO_ALLDATA 5 //change all data via lparam=lpTTBButton #define MS_TTB_GETBUTTONOPTIONS "TopToolBar/GetOptions" diff --git a/plugins/FavContacts/src/main.cpp b/plugins/FavContacts/src/main.cpp index d2c4db9f6f..5aba9e88fb 100644 --- a/plugins/FavContacts/src/main.cpp +++ b/plugins/FavContacts/src/main.cpp @@ -214,13 +214,13 @@ int ProcessModulesLoaded(WPARAM wParam, LPARAM lParam) lstrcpyA(fontid.prefix, "fntName"); fontid.deffontsettings.colour = GetSysColor(COLOR_MENUTEXT); fontid.deffontsettings.style = DBFONTF_BOLD; - CallService(MS_FONT_REGISTERT, (WPARAM)&fontid, 0); + FontRegisterT(&fontid); lstrcpy(fontid.name, _T("Second line")); lstrcpyA(fontid.prefix, "fntSecond"); fontid.deffontsettings.colour = sttShadeColor(GetSysColor(COLOR_MENUTEXT), GetSysColor(COLOR_MENU)); fontid.deffontsettings.style = 0; - CallService(MS_FONT_REGISTERT, (WPARAM)&fontid, 0); + FontRegisterT(&fontid); lstrcpy(fontid.backgroundName, _T("Selected background")); @@ -228,13 +228,13 @@ int ProcessModulesLoaded(WPARAM wParam, LPARAM lParam) lstrcpyA(fontid.prefix, "fntNameSel"); fontid.deffontsettings.colour = GetSysColor(COLOR_HIGHLIGHTTEXT); fontid.deffontsettings.style = DBFONTF_BOLD; - CallService(MS_FONT_REGISTERT, (WPARAM)&fontid, 0); + FontRegisterT(&fontid); lstrcpy(fontid.name, _T("Selected second line (color)")); lstrcpyA(fontid.prefix, "fntSecondSel"); fontid.deffontsettings.colour = sttShadeColor(GetSysColor(COLOR_HIGHLIGHTTEXT), GetSysColor(COLOR_HIGHLIGHT)); fontid.deffontsettings.style = 0; - CallService(MS_FONT_REGISTERT, (WPARAM)&fontid, 0); + FontRegisterT(&fontid); ///////////////////////////////////////////////////////////////////////////////////// @@ -246,12 +246,12 @@ int ProcessModulesLoaded(WPARAM wParam, LPARAM lParam) lstrcpy(colourid.name, _T("Background")); lstrcpyA(colourid.setting, "BackColour"); colourid.defcolour = GetSysColor(COLOR_MENU); - CallService(MS_COLOUR_REGISTERT, (WPARAM)&colourid, 0); + ColourRegisterT(&colourid); lstrcpy(colourid.name, _T("Selected background")); lstrcpyA(colourid.setting, "SelectedColour"); colourid.defcolour = GetSysColor(COLOR_HIGHLIGHT); - CallService(MS_COLOUR_REGISTERT, (WPARAM)&colourid, 0); + ColourRegisterT(&colourid); HookEvent(ME_FONT_RELOAD, ProcessReloadFonts); HookEvent(ME_COLOUR_RELOAD, ProcessReloadFonts); diff --git a/plugins/Popup/src/font.cpp b/plugins/Popup/src/font.cpp index d9502eadac..77aca7b94a 100644 --- a/plugins/Popup/src/font.cpp +++ b/plugins/Popup/src/font.cpp @@ -85,12 +85,12 @@ void InitFonts() { lstrcpy(cid.name, _T(PU_COL_BACK_NAME)); strcpy(cid.setting, PU_COL_BACK_SETTING); cid.defcolour = SETTING_BACKCOLOUR_DEFAULT; - CallService(MS_COLOUR_REGISTERT, (WPARAM)&cid, 0); + ColourRegisterT(&cid); lstrcpy(cid.name, _T(PU_COL_AVAT_NAME)); strcpy(cid.setting, PU_COL_AVAT_SETTING); cid.defcolour = SETTING_TEXTCOLOUR_DEFAULT; - CallService(MS_COLOUR_REGISTERT, (WPARAM)&cid, 0); + ColourRegisterT(&cid); ReloadFonts(); } diff --git a/plugins/Popup/src/notifications.cpp b/plugins/Popup/src/notifications.cpp index 3a8beb8f15..bed6cdc116 100644 --- a/plugins/Popup/src/notifications.cpp +++ b/plugins/Popup/src/notifications.cpp @@ -213,7 +213,7 @@ HANDLE RegisterNotification(POPUPNOTIFICATION *notification) mir_snprintf(fontid.name, SIZEOF(fontid.name), "%s (colors only)", notification->lpzName); mir_snprintf(fontid.prefix, SIZEOF(fontid.prefix), "{%s/%s}text", notification->lpzGroup, notification->lpzName); fontid.deffontsettings.style = 0; - CallService(MS_FONT_REGISTER, (WPARAM)&fontid, 0); + FontRegister(&fontid); ColourID colourid = {0}; colourid.cbSize = sizeof(colourid); @@ -222,7 +222,7 @@ HANDLE RegisterNotification(POPUPNOTIFICATION *notification) mir_snprintf(colourid.name, SIZEOF(colourid.name), "%s (colors only)", notification->lpzName); mir_snprintf(colourid.setting, SIZEOF(colourid.setting), "{%s/%s}backColor", notification->lpzGroup, notification->lpzName); colourid.defcolour = ptd->notification.colorBack; - CallService(MS_COLOUR_REGISTER, (WPARAM)&colourid, 0); + ColourRegister(&colourid); char section[MAXMODULELABELLENGTH], setting[MAXMODULELABELLENGTH]; mir_snprintf(section, sizeof(section), "PopUps/%s", notification->lpzGroup); diff --git a/plugins/Popup/src/services.cpp b/plugins/Popup/src/services.cpp index ca1c700781..3246a2fbcd 100644 --- a/plugins/Popup/src/services.cpp +++ b/plugins/Popup/src/services.cpp @@ -612,7 +612,7 @@ INT_PTR PopUp_RegisterPopupClass(WPARAM wParam, LPARAM lParam) { mir_snprintf(fid.prefix, sizeof(fid.prefix), "%s/Text", ptd->pupClass.pszName); // result is "%s/TextCol" fid.deffontsettings.style = 0; fid.deffontsettings.colour = fonts.clText; - CallService(MS_FONT_REGISTER, (WPARAM)&fid, 0); + FontRegister(&fid); //we ignore pc->colorBack and use fonts.clBack as default (if no setting found in DB) mir_snprintf(setting, 256, "%s/BgCol", ptd->pupClass.pszName); @@ -624,7 +624,7 @@ INT_PTR PopUp_RegisterPopupClass(WPARAM wParam, LPARAM lParam) { strcpy(cid.name, PU_COL_BACK_NAME); mir_snprintf(cid.setting, sizeof(cid.setting), "%s/BgCol", ptd->pupClass.pszName); cid.defcolour = fonts.clBack; - CallService(MS_COLOUR_REGISTER, (WPARAM)&cid, 0); + ColourRegister(&cid); gTreeData.insert(ptd); num_classes++; diff --git a/plugins/SRMM/msgoptions.cpp b/plugins/SRMM/msgoptions.cpp index 4524966d56..6eb91e910f 100644 --- a/plugins/SRMM/msgoptions.cpp +++ b/plugins/SRMM/msgoptions.cpp @@ -115,7 +115,7 @@ void RegisterSRMMFonts( void ) fontid.deffontsettings.style = fontOptionsList[i].defStyle; _tcscpy(fontid.deffontsettings.szFace, fontOptionsList[i].szDefFace); fontid.deffontsettings.charset = MsgDlgGetFontDefaultCharset(fontOptionsList[i].szDefFace); - CallService(MS_FONT_REGISTERT, (WPARAM)&fontid, 0); + FontRegisterT(&fontid); } colourid.cbSize = sizeof(ColourID); @@ -124,7 +124,7 @@ void RegisterSRMMFonts( void ) colourid.defcolour = SRMSGDEFSET_BKGCOLOUR; _tcscpy(colourid.name, LPGENT("Background")); _tcscpy(colourid.group, LPGENT("Message Log")); - CallService(MS_COLOUR_REGISTERT, (WPARAM)&colourid, 0); + ColourRegisterT(&colourid); } ///////////////////////////////////////////////////////////////////////////////////////// diff --git a/plugins/Scriver/msgoptions.cpp b/plugins/Scriver/msgoptions.cpp index cfbde8c141..f688efc50a 100644 --- a/plugins/Scriver/msgoptions.cpp +++ b/plugins/Scriver/msgoptions.cpp @@ -160,7 +160,7 @@ void RegisterFontServiceFonts() { fid.deffontsettings.charset = MsgDlgGetFontDefaultCharset(fontOptionsList[i].szDefFace); _tcsncpy(fid.deffontsettings.szFace, fontOptionsList[i].szDefFace, SIZEOF(fid.deffontsettings.szFace)); _tcsncpy(fid.backgroundName, fontOptionsList[i].szBkgName, SIZEOF(fid.backgroundName)); - CallService(MS_FONT_REGISTERT, (WPARAM)&fid, 0); + FontRegisterT(&fid); } cid.cbSize = sizeof(ColourIDT); mir_sntprintf(cid.group, SIZEOF(cid.group), _T("%s"), LPGENT("Messaging")); @@ -175,7 +175,7 @@ void RegisterFontServiceFonts() { cid.defcolour = colourOptionsList[i].defColour; } strncpy(cid.setting, colourOptionsList[i].szSettingName, SIZEOF(cid.setting)); - CallService(MS_COLOUR_REGISTERT, (WPARAM)&cid, 0); + ColourRegisterT(&cid); } } @@ -202,7 +202,7 @@ void RegisterChatFonts( void ) fid.deffontsettings.charset = MsgDlgGetFontDefaultCharset(fontOptionsList[i].szDefFace); _tcsncpy(fid.deffontsettings.szFace, chatFontOptionsList[i].szDefFace, SIZEOF(fid.deffontsettings.szFace)); _tcsncpy(fid.backgroundName, chatFontOptionsList[i].szBkgName, SIZEOF(fid.backgroundName)); - CallService(MS_FONT_REGISTERT, (WPARAM)&fid, 0); + FontRegisterT(&fid); } colourid.cbSize = sizeof(ColourIDT); @@ -213,22 +213,22 @@ void RegisterChatFonts( void ) _tcsncpy(colourid.name, LPGENT("Background"), SIZEOF(colourid.name)); mir_sntprintf(colourid.group, SIZEOF(colourid.group), _T("%s/%s"), LPGENT("Messaging"), LPGENT("Group Chats")); colourid.defcolour = GetSysColor(COLOR_WINDOW); - CallService(MS_COLOUR_REGISTERT, (WPARAM)&colourid, 0); + ColourRegisterT(&colourid); strncpy(colourid.setting, "ColorNicklistBG", SIZEOF(colourid.setting)); _tcsncpy(colourid.name, LPGENT("User list background"), SIZEOF(colourid.name)); colourid.defcolour = GetSysColor(COLOR_WINDOW); - CallService(MS_COLOUR_REGISTERT, (WPARAM)&colourid, 0); + ColourRegisterT(&colourid); strncpy(colourid.setting, "ColorNicklistLines", SIZEOF(colourid.setting)); _tcsncpy(colourid.name, LPGENT("User list lines"), SIZEOF(colourid.name)); colourid.defcolour = GetSysColor(COLOR_INACTIVEBORDER); - CallService(MS_COLOUR_REGISTERT, (WPARAM)&colourid, 0); + ColourRegisterT(&colourid); strncpy(colourid.setting, "ColorNicklistSelectedBG", SIZEOF(colourid.setting)); _tcsncpy(colourid.name, LPGENT("User list background (selected)"), SIZEOF(colourid.name)); colourid.defcolour = GetSysColor(COLOR_HIGHLIGHT); - CallService(MS_COLOUR_REGISTERT, (WPARAM)&colourid, 0); + ColourRegisterT(&colourid); } int IconsChanged(WPARAM wParam, LPARAM lParam) diff --git a/plugins/TabSRMM/chat/options.cpp b/plugins/TabSRMM/chat/options.cpp index 6a3da75c8d..77f6cb0f82 100644 --- a/plugins/TabSRMM/chat/options.cpp +++ b/plugins/TabSRMM/chat/options.cpp @@ -759,7 +759,7 @@ void RegisterFontServiceFonts() { _tcsncpy(fid.backgroundName, _T("Incoming background"), SIZEOF(fid.backgroundName)); break; } - CallService(MS_FONT_REGISTERT, (WPARAM)&fid, 0); + FontRegisterT(&fid); } fontOptionsList = IP_fontOptionsList; @@ -785,9 +785,9 @@ void RegisterFontServiceFonts() { _tcsncpy(fid.backgroundGroup, _T(""), SIZEOF(fid.backgroundGroup)); _tcsncpy(fid.backgroundName, _T(""), SIZEOF(fid.backgroundName)); _tcsncpy(fid.group, _T("TabSRMM"), SIZEOF(fid.group)); - } - CallService(MS_FONT_REGISTERT, (WPARAM)&fid, 0); } + FontRegisterT(&fid); + } fontOptionsList = CHAT_fontOptionsList; fid.flags = FIDF_DEFAULTVALID|FIDF_ALLOWEFFECTS; @@ -810,7 +810,7 @@ void RegisterFontServiceFonts() { _tcsncpy(fid.backgroundName, _T("Group chat log background"), SIZEOF(fid.backgroundName)); if(i == 18 || i == 19) _tcsncpy(fid.backgroundName, _T("Userlist background"), SIZEOF(fid.backgroundName)); - CallService(MS_FONT_REGISTERT, (WPARAM)&fid, 0); + FontRegisterT(&fid); } _tcsncpy(cid.group, _T("TabSRMM/Group Chats"), SIZEOF(cid.group)); @@ -821,23 +821,23 @@ void RegisterFontServiceFonts() { cid.order=i+1; strncpy(cid.setting, szTemp, SIZEOF(cid.setting)); switch (i) { - case 5: - cid.defcolour = GetSysColor(COLOR_HIGHLIGHT); - break; - case 6: - cid.defcolour = GetSysColor(COLOR_HIGHLIGHTTEXT); - break; - default: - cid.defcolour =RGB(0, 0, 0); - break; - } - CallService(MS_COLOUR_REGISTERT, (WPARAM)&cid, 0); + case 5: + cid.defcolour = GetSysColor(COLOR_HIGHLIGHT); + break; + case 6: + cid.defcolour = GetSysColor(COLOR_HIGHLIGHTTEXT); + break; + default: + cid.defcolour =RGB(0, 0, 0); + break; } + ColourRegisterT(&cid); + } cid.order=8; _tcsncpy(cid.name, _T("Userlist background"), SIZEOF(cid.name)); strncpy(cid.setting, "ColorNicklistBG", SIZEOF(cid.setting)); cid.defcolour = SRMSGDEFSET_BKGCOLOUR; - CallService(MS_COLOUR_REGISTERT, (WPARAM)&cid, 0); + ColourRegisterT(&cid); /* * static colors (info panel, tool bar background etc...) @@ -854,7 +854,7 @@ void RegisterFontServiceFonts() { cid.defcolour = GetSysColor(_clrs[i].def & 0x000000ff); else cid.defcolour = _clrs[i].def; - CallService(MS_COLOUR_REGISTERT, (WPARAM)&cid, 0); + ColourRegisterT(&cid); } strncpy(cid.dbSettingsGroup, SRMSGMOD_T, SIZEOF(fid.dbSettingsGroup)); @@ -872,7 +872,7 @@ void RegisterFontServiceFonts() { else cid.defcolour = _tabclrs[i].def; - CallService(MS_COLOUR_REGISTERT, (WPARAM)&cid, 0); + ColourRegisterT(&cid); } } diff --git a/plugins/TipperYM/tipper.cpp b/plugins/TipperYM/tipper.cpp index fde1fd7a39..09903c4302 100644 --- a/plugins/TipperYM/tipper.cpp +++ b/plugins/TipperYM/tipper.cpp @@ -151,6 +151,7 @@ void InitFonts() strcpy(colourBg.setting, "ColourBg"); colourBg.defcolour = RGB(219, 219, 219); colourBg.order = 0; + ColourRegisterT(&colourBg); colourBorder.cbSize = sizeof(ColourIDT); _tcscpy(colourBorder.group, LPGENT("Tooltips")); @@ -159,6 +160,7 @@ void InitFonts() strcpy(colourBorder.setting, "BorderCol"); colourBorder.defcolour = 0; colourBorder.order = 0; + ColourRegisterT(&colourBorder); colourAvatarBorder.cbSize = sizeof(ColourIDT); _tcscpy(colourAvatarBorder.group, LPGENT("Tooltips")); @@ -167,6 +169,7 @@ void InitFonts() strcpy(colourAvatarBorder.setting, "AvBorderCol"); colourAvatarBorder.defcolour = 0; colourAvatarBorder.order = 0; + ColourRegisterT(&colourAvatarBorder); colourDivider.cbSize = sizeof(ColourIDT); _tcscpy(colourDivider.group, LPGENT("Tooltips")); @@ -175,6 +178,7 @@ void InitFonts() strcpy(colourDivider.setting, "DividerCol"); colourDivider.defcolour = 0; colourDivider.order = 0; + ColourRegisterT(&colourDivider); colourSidebar.cbSize = sizeof(ColourIDT); _tcscpy(colourSidebar.group, LPGENT("Tooltips")); @@ -183,12 +187,7 @@ void InitFonts() strcpy(colourSidebar.setting, "SidebarCol"); colourSidebar.defcolour = RGB(192, 192, 192); colourSidebar.order = 0; - - CallService(MS_COLOUR_REGISTERT, (WPARAM)&colourBg, 0); - CallService(MS_COLOUR_REGISTERT, (WPARAM)&colourBorder, 0); - CallService(MS_COLOUR_REGISTERT, (WPARAM)&colourAvatarBorder, 0); - CallService(MS_COLOUR_REGISTERT, (WPARAM)&colourDivider, 0); - CallService(MS_COLOUR_REGISTERT, (WPARAM)&colourSidebar, 0); + ColourRegisterT(&colourSidebar); fontTitle.cbSize = sizeof(FontIDT); fontTitle.flags = FIDF_ALLOWEFFECTS; diff --git a/plugins/TooltipNotify/src/TooltipNotify.cpp b/plugins/TooltipNotify/src/TooltipNotify.cpp index 1bac84a5c6..969d714b8b 100644 --- a/plugins/TooltipNotify/src/TooltipNotify.cpp +++ b/plugins/TooltipNotify/src/TooltipNotify.cpp @@ -116,11 +116,11 @@ void CTooltipNotify::RegisterFonts() _tcscpy(fontId.name, s_fontTable[i].name); strcpy(fontId.prefix, s_fontTable[i].fontPrefix); _tcscpy(fontId.backgroundName, s_fontTable[i].name); - ::CallService(MS_FONT_REGISTERT, (WPARAM)&fontId, 0); + ::FontRegisterT(&fontId); _tcscpy(colorId.name, s_fontTable[i].name); strcpy(colorId.setting, s_fontTable[i].clrPrefix); - ::CallService(MS_COLOUR_REGISTERT, (WPARAM)&colorId, 0); + ::ColourRegisterT(&colorId); } } diff --git a/plugins/YAPP/popups2.cpp b/plugins/YAPP/popups2.cpp index c90196336f..c464ea02f9 100644 --- a/plugins/YAPP/popups2.cpp +++ b/plugins/YAPP/popups2.cpp @@ -111,13 +111,12 @@ int ReloadFont(WPARAM wParam, LPARAM lParam) HANDLE hEventReloadFont = 0; -int ModulesLoaded(WPARAM wParam, LPARAM lParam) { +int ModulesLoaded(WPARAM wParam, LPARAM lParam) +{ MNotifyGetLink(); if (ServiceExists(MS_HPP_EG_WINDOW)) - { lstPopupHistory.SetRenderer(RENDER_HISTORYPP); - } if(ServiceExists(MS_UPDATE_REGISTER)) { // register with updater @@ -148,172 +147,77 @@ int ModulesLoaded(WPARAM wParam, LPARAM lParam) { CallService(MS_UPDATE_REGISTER, 0, (WPARAM)&update); } - - if(ServiceExists(MS_FONT_REGISTERW)) - { - font_id_firstlinew.cbSize = sizeof(FontIDW); - font_id_firstlinew.flags = FIDF_ALLOWEFFECTS; - _tcscpy(font_id_firstlinew.group, _T("Popups")); - _tcscpy(font_id_firstlinew.name, _T("First line")); - strcpy(font_id_firstlinew.dbSettingsGroup, MODULE); - strcpy(font_id_firstlinew.prefix, "FontFirst"); - font_id_firstlinew.order = 0; - - font_id_secondlinew.cbSize = sizeof(FontIDW); - font_id_secondlinew.flags = FIDF_ALLOWEFFECTS; - _tcscpy(font_id_secondlinew.group, _T("Popups")); - _tcscpy(font_id_secondlinew.name, _T("Second line")); - strcpy(font_id_secondlinew.dbSettingsGroup, MODULE); - strcpy(font_id_secondlinew.prefix, "FontSecond"); - font_id_secondlinew.order = 1; - - font_id_timew.cbSize = sizeof(FontIDW); - font_id_timew.flags = FIDF_ALLOWEFFECTS; - _tcscpy(font_id_timew.group, _T("Popups")); - _tcscpy(font_id_timew.name, _T("Time")); - strcpy(font_id_timew.dbSettingsGroup, MODULE); - strcpy(font_id_timew.prefix, "FontTime"); - font_id_timew.order = 2; - - CallService(MS_FONT_REGISTERW, (WPARAM)&font_id_firstlinew, 0); - CallService(MS_FONT_REGISTERW, (WPARAM)&font_id_secondlinew, 0); - CallService(MS_FONT_REGISTERW, (WPARAM)&font_id_timew, 0); + font_id_firstlinew.cbSize = sizeof(FontIDW); + font_id_firstlinew.flags = FIDF_ALLOWEFFECTS; + _tcscpy(font_id_firstlinew.group, _T("Popups")); + _tcscpy(font_id_firstlinew.name, _T("First line")); + strcpy(font_id_firstlinew.dbSettingsGroup, MODULE); + strcpy(font_id_firstlinew.prefix, "FontFirst"); + font_id_firstlinew.order = 0; + FontRegisterT(&font_id_firstlinew); + + font_id_secondlinew.cbSize = sizeof(FontIDW); + font_id_secondlinew.flags = FIDF_ALLOWEFFECTS; + _tcscpy(font_id_secondlinew.group, _T("Popups")); + _tcscpy(font_id_secondlinew.name, _T("Second line")); + strcpy(font_id_secondlinew.dbSettingsGroup, MODULE); + strcpy(font_id_secondlinew.prefix, "FontSecond"); + font_id_secondlinew.order = 1; + FontRegisterT(&font_id_secondlinew); + + font_id_timew.cbSize = sizeof(FontIDW); + font_id_timew.flags = FIDF_ALLOWEFFECTS; + _tcscpy(font_id_timew.group, _T("Popups")); + _tcscpy(font_id_timew.name, _T("Time")); + strcpy(font_id_timew.dbSettingsGroup, MODULE); + strcpy(font_id_timew.prefix, "FontTime"); + font_id_timew.order = 2; + FontRegisterT(&font_id_timew); - colour_id_bgw.cbSize = sizeof(ColourIDW); - _tcscpy(colour_id_bgw.group, _T("Popups")); - _tcscpy(colour_id_bgw.name, _T("Background")); - strcpy(colour_id_bgw.dbSettingsGroup, MODULE); - strcpy(colour_id_bgw.setting, "ColourBg"); - colour_id_bgw.defcolour = GetSysColor(COLOR_3DSHADOW); - colour_id_bgw.order = 0; - - colour_id_borderw.cbSize = sizeof(ColourIDW); - _tcscpy(colour_id_borderw.group, _T("Popups")); - _tcscpy(colour_id_borderw.name, _T("Border")); - strcpy(colour_id_borderw.dbSettingsGroup, MODULE); - strcpy(colour_id_borderw.setting, "ColourBorder"); - colour_id_borderw.defcolour = RGB(0, 0, 0); - colour_id_borderw.order = 1; - - colour_id_sidebarw.cbSize = sizeof(ColourIDW); - _tcscpy(colour_id_sidebarw.group, _T("Popups")); - _tcscpy(colour_id_sidebarw.name, _T("Sidebar")); - strcpy(colour_id_sidebarw.dbSettingsGroup, MODULE); - strcpy(colour_id_sidebarw.setting, "ColourSidebar"); - colour_id_sidebarw.defcolour = RGB(128, 128, 128); - colour_id_sidebarw.order = 2; - - colour_id_titleunderlinew.cbSize = sizeof(ColourIDW); - _tcscpy(colour_id_titleunderlinew.group, _T("Popups")); - _tcscpy(colour_id_titleunderlinew.name, _T("Title underline")); - strcpy(colour_id_titleunderlinew.dbSettingsGroup, MODULE); - strcpy(colour_id_titleunderlinew.setting, "ColourTitleUnderline"); - colour_id_titleunderlinew.defcolour = GetSysColor(COLOR_3DSHADOW); - colour_id_titleunderlinew.order = 3; - - CallService(MS_COLOUR_REGISTERW, (WPARAM)&colour_id_bgw, 0); - CallService(MS_COLOUR_REGISTERW, (WPARAM)&colour_id_borderw, 0); - CallService(MS_COLOUR_REGISTERW, (WPARAM)&colour_id_sidebarw, 0); - CallService(MS_COLOUR_REGISTERW, (WPARAM)&colour_id_titleunderlinew, 0); + colour_id_bgw.cbSize = sizeof(ColourIDW); + _tcscpy(colour_id_bgw.group, _T("Popups")); + _tcscpy(colour_id_bgw.name, _T("Background")); + strcpy(colour_id_bgw.dbSettingsGroup, MODULE); + strcpy(colour_id_bgw.setting, "ColourBg"); + colour_id_bgw.defcolour = GetSysColor(COLOR_3DSHADOW); + colour_id_bgw.order = 0; + ColourRegisterT(&colour_id_bgw); + + colour_id_borderw.cbSize = sizeof(ColourIDW); + _tcscpy(colour_id_borderw.group, _T("Popups")); + _tcscpy(colour_id_borderw.name, _T("Border")); + strcpy(colour_id_borderw.dbSettingsGroup, MODULE); + strcpy(colour_id_borderw.setting, "ColourBorder"); + colour_id_borderw.defcolour = RGB(0, 0, 0); + colour_id_borderw.order = 1; + ColourRegisterT(&colour_id_borderw); + + colour_id_sidebarw.cbSize = sizeof(ColourIDW); + _tcscpy(colour_id_sidebarw.group, _T("Popups")); + _tcscpy(colour_id_sidebarw.name, _T("Sidebar")); + strcpy(colour_id_sidebarw.dbSettingsGroup, MODULE); + strcpy(colour_id_sidebarw.setting, "ColourSidebar"); + colour_id_sidebarw.defcolour = RGB(128, 128, 128); + colour_id_sidebarw.order = 2; + ColourRegisterT(&colour_id_sidebarw); + + colour_id_titleunderlinew.cbSize = sizeof(ColourIDW); + _tcscpy(colour_id_titleunderlinew.group, _T("Popups")); + _tcscpy(colour_id_titleunderlinew.name, _T("Title underline")); + strcpy(colour_id_titleunderlinew.dbSettingsGroup, MODULE); + strcpy(colour_id_titleunderlinew.setting, "ColourTitleUnderline"); + colour_id_titleunderlinew.defcolour = GetSysColor(COLOR_3DSHADOW); + colour_id_titleunderlinew.order = 3; + ColourRegisterT(&colour_id_titleunderlinew); - ReloadFont(0, 0); - - hEventReloadFont = HookEvent(ME_FONT_RELOAD, ReloadFont); - } - else + ReloadFont(0, 0); - if(ServiceExists(MS_FONT_REGISTER)) - { - font_id_firstline.cbSize = sizeof(FontID); - font_id_firstline.flags = FIDF_ALLOWEFFECTS; - strcpy(font_id_firstline.group, "Popups"); - strcpy(font_id_firstline.name, "First line"); - strcpy(font_id_firstline.dbSettingsGroup, MODULE); - strcpy(font_id_firstline.prefix, "FontFirst"); - font_id_firstline.order = 0; - - font_id_secondline.cbSize = sizeof(FontID); - font_id_secondline.flags = FIDF_ALLOWEFFECTS; - strcpy(font_id_secondline.group, "Popups"); - strcpy(font_id_secondline.name, "Second line"); - strcpy(font_id_secondline.dbSettingsGroup, MODULE); - strcpy(font_id_secondline.prefix, "FontSecond"); - font_id_secondline.order = 1; - - font_id_time.cbSize = sizeof(FontID); - font_id_time.flags = FIDF_ALLOWEFFECTS; - strcpy(font_id_time.group, "Popups"); - strcpy(font_id_time.name, "Time"); - strcpy(font_id_time.dbSettingsGroup, MODULE); - strcpy(font_id_time.prefix, "FontTime"); - font_id_time.order = 2; - - CallService(MS_FONT_REGISTER, (WPARAM)&font_id_firstline, 0); - CallService(MS_FONT_REGISTER, (WPARAM)&font_id_secondline, 0); - CallService(MS_FONT_REGISTER, (WPARAM)&font_id_time, 0); - - colour_id_bg.cbSize = sizeof(ColourID); - strcpy(colour_id_bg.group, "Popups"); - strcpy(colour_id_bg.name, "Background"); - strcpy(colour_id_bg.dbSettingsGroup, MODULE); - strcpy(colour_id_bg.setting, "ColourBg"); - colour_id_bg.defcolour = GetSysColor(COLOR_3DSHADOW); - colour_id_bg.order = 0; - - colour_id_border.cbSize = sizeof(ColourID); - strcpy(colour_id_border.group, "Popups"); - strcpy(colour_id_border.name, "Border"); - strcpy(colour_id_border.dbSettingsGroup, MODULE); - strcpy(colour_id_border.setting, "ColourBorder"); - colour_id_border.defcolour = RGB(0, 0, 0); - colour_id_border.order = 1; - - colour_id_sidebar.cbSize = sizeof(ColourID); - strcpy(colour_id_sidebar.group, "Popups"); - strcpy(colour_id_sidebar.name, "Sidebar"); - strcpy(colour_id_sidebar.dbSettingsGroup, MODULE); - strcpy(colour_id_sidebar.setting, "ColourSidebar"); - colour_id_sidebar.defcolour = RGB(128, 128, 128); - colour_id_sidebar.order = 2; - - colour_id_titleunderline.cbSize = sizeof(ColourID); - strcpy(colour_id_titleunderline.group, "Popups"); - strcpy(colour_id_titleunderline.name, "Title underline"); - strcpy(colour_id_titleunderline.dbSettingsGroup, MODULE); - strcpy(colour_id_titleunderline.setting, "ColourTitleUnderline"); - colour_id_titleunderline.defcolour = GetSysColor(COLOR_3DSHADOW); - colour_id_titleunderline.order = 3; - - CallService(MS_COLOUR_REGISTER, (WPARAM)&colour_id_bg, 0); - CallService(MS_COLOUR_REGISTER, (WPARAM)&colour_id_border, 0); - CallService(MS_COLOUR_REGISTER, (WPARAM)&colour_id_sidebar, 0); - CallService(MS_COLOUR_REGISTER, (WPARAM)&colour_id_titleunderline, 0); - - ReloadFont(0, 0); - - hEventReloadFont = HookEvent(ME_FONT_RELOAD, ReloadFont); - } else { - LOGFONT lf = {0}; - lf.lfCharSet = DEFAULT_CHARSET; - lf.lfHeight = -14; - lf.lfWeight = FW_BOLD; - hFontFirstLine = CreateFontIndirect(&lf); - - lf.lfHeight = -12; - lf.lfWeight = 0; - hFontSecondLine = CreateFontIndirect(&lf); - - lf.lfHeight = -8; - lf.lfWeight = 0; - hFontTime = CreateFontIndirect(&lf); - } + hEventReloadFont = HookEvent(ME_FONT_RELOAD, ReloadFont); LoadModuleDependentOptions(); if(GetModuleHandle(_T("neweventnotify"))) - { ignore_gpd_passed_addy = true; - } return 0; } @@ -357,16 +261,15 @@ extern "C" int POPUPS2_API Load(PLUGINLINK *link) { return 0; } -extern "C" int POPUPS2_API Unload() { - if(hEventReloadFont) UnhookEvent(hEventReloadFont); +extern "C" int POPUPS2_API Unload() +{ + if(hEventReloadFont) + UnhookEvent(hEventReloadFont); UnhookEvent(hEventPreShutdown); UnhookEvent(hEventModulesLoaded); DeinitNotify(); - if(ServiceExists(MS_FONT_REGISTERW)) { - DeleteObject(hFontFirstLine); - DeleteObject(hFontSecondLine); - DeleteObject(hFontTime); - } // otherwise, no need to delete the handle - + DeleteObject(hFontFirstLine); + DeleteObject(hFontSecondLine); + DeleteObject(hFontTime); return 0; } -- cgit v1.2.3