From e58823d961a630eb62e60d2ccb443761ba5f1704 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Thu, 14 Jun 2012 15:51:34 +0000 Subject: - all MS_CLIST_ADD*ITEM services replaced with Menu_Add*Item stubs. - massive cleanup of the menu-related code git-svn-id: http://svn.miranda-ng.org/main/trunk@410 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- src/modules/fonts/FontOptions.cpp | 66 +++++++++++++++++++-------------------- src/modules/fonts/FontService.cpp | 4 +-- src/modules/fonts/FontService.h | 4 +-- src/modules/fonts/services.cpp | 16 +++++----- 4 files changed, 45 insertions(+), 45 deletions(-) (limited to 'src/modules/fonts') diff --git a/src/modules/fonts/FontOptions.cpp b/src/modules/fonts/FontOptions.cpp index 961c598c3b..12291fb933 100644 --- a/src/modules/fonts/FontOptions.cpp +++ b/src/modules/fonts/FontOptions.cpp @@ -2,7 +2,7 @@ Miranda IM: the free IM client for Microsoft* Windows* -Copyright 2000-2009 Miranda ICQ/IM project, +Copyright 2000-2009 Miranda ICQ/IM project, all portions of this codebase are copyrighted to the people listed in contributors.txt. @@ -11,7 +11,7 @@ modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. -This program is distributed in the hope that it will be useful, +This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. @@ -486,47 +486,47 @@ static INT_PTR CALLBACK ChooseEffectDlgProc( HWND hwndDlg, UINT uMsg, WPARAM wPa int i; TCHAR * ModernEffectNames[]= { - _T(""), - _T("Shadow at left"), - _T("Shadow at right"), - _T("Outline"), - _T("Outline smooth"), - _T("Smooth bump"), - _T("Contour thin"), - _T("Contour heavy"), + _T(""), + _T("Shadow at left"), + _T("Shadow at right"), + _T("Outline"), + _T("Outline smooth"), + _T("Smooth bump"), + _T("Contour thin"), + _T("Contour heavy"), }; for ( i=0; ieffectIndex ) { - SendDlgItemMessage(hwndDlg,IDC_EFFECT_COMBO,CB_SETCURSEL, i, 0 ); + if (SendDlgItemMessage(hwndDlg, IDC_EFFECT_COMBO, CB_GETITEMDATA, i, 0) == pEffect->effectIndex ) { + SendDlgItemMessage(hwndDlg, IDC_EFFECT_COMBO, CB_SETCURSEL, i, 0 ); break; } } } - SendDlgItemMessage(hwndDlg,IDC_EFFECT_COLOUR1,CPM_SETCOLOUR,0,pEffect->baseColour&0x00FFFFFF); - SendDlgItemMessage(hwndDlg,IDC_EFFECT_COLOUR2,CPM_SETCOLOUR,0,pEffect->secondaryColour&0x00FFFFFF); + SendDlgItemMessage(hwndDlg, IDC_EFFECT_COLOUR1, CPM_SETCOLOUR, 0, pEffect->baseColour&0x00FFFFFF); + SendDlgItemMessage(hwndDlg, IDC_EFFECT_COLOUR2, CPM_SETCOLOUR, 0, pEffect->secondaryColour&0x00FFFFFF); - SendDlgItemMessage(hwndDlg,IDC_EFFECT_COLOUR_SPIN1,UDM_SETRANGE,0,MAKELONG(255,0)); - SendDlgItemMessage(hwndDlg,IDC_EFFECT_COLOUR_SPIN2,UDM_SETRANGE,0,MAKELONG(255,0)); - SendDlgItemMessage(hwndDlg,IDC_EFFECT_COLOUR_SPIN1,UDM_SETPOS,0,MAKELONG((BYTE)~((BYTE)((pEffect->baseColour&0xFF000000)>>24)),0)); - SendDlgItemMessage(hwndDlg,IDC_EFFECT_COLOUR_SPIN2,UDM_SETPOS,0,MAKELONG((BYTE)~((BYTE)((pEffect->secondaryColour&0xFF000000)>>24)),0)); + SendDlgItemMessage(hwndDlg, IDC_EFFECT_COLOUR_SPIN1, UDM_SETRANGE, 0, MAKELONG(255, 0)); + SendDlgItemMessage(hwndDlg, IDC_EFFECT_COLOUR_SPIN2, UDM_SETRANGE, 0, MAKELONG(255, 0)); + SendDlgItemMessage(hwndDlg, IDC_EFFECT_COLOUR_SPIN1, UDM_SETPOS, 0, MAKELONG((BYTE)~((BYTE)((pEffect->baseColour&0xFF000000)>>24)), 0)); + SendDlgItemMessage(hwndDlg, IDC_EFFECT_COLOUR_SPIN2, UDM_SETPOS, 0, MAKELONG((BYTE)~((BYTE)((pEffect->secondaryColour&0xFF000000)>>24)), 0)); return TRUE; case WM_COMMAND: switch (LOWORD(wParam)) { case IDOK: { - int i = SendDlgItemMessage(hwndDlg,IDC_EFFECT_COMBO,CB_GETCURSEL, 0, 0 ); - pEffect->effectIndex=(BYTE)SendDlgItemMessage(hwndDlg,IDC_EFFECT_COMBO,CB_GETITEMDATA,i,0); - pEffect->baseColour=SendDlgItemMessage(hwndDlg,IDC_EFFECT_COLOUR1,CPM_GETCOLOUR,0,0)|((~(BYTE)SendDlgItemMessage(hwndDlg,IDC_EFFECT_COLOUR_SPIN1,UDM_GETPOS,0,0))<<24); - pEffect->secondaryColour=SendDlgItemMessage(hwndDlg,IDC_EFFECT_COLOUR2,CPM_GETCOLOUR,0,0)|((~(BYTE)SendDlgItemMessage(hwndDlg,IDC_EFFECT_COLOUR_SPIN2,UDM_GETPOS,0,0))<<24);; + int i = SendDlgItemMessage(hwndDlg, IDC_EFFECT_COMBO, CB_GETCURSEL, 0, 0 ); + pEffect->effectIndex=(BYTE)SendDlgItemMessage(hwndDlg, IDC_EFFECT_COMBO, CB_GETITEMDATA, i, 0); + pEffect->baseColour=SendDlgItemMessage(hwndDlg, IDC_EFFECT_COLOUR1, CPM_GETCOLOUR, 0, 0)|((~(BYTE)SendDlgItemMessage(hwndDlg, IDC_EFFECT_COLOUR_SPIN1, UDM_GETPOS, 0, 0))<<24); + pEffect->secondaryColour=SendDlgItemMessage(hwndDlg, IDC_EFFECT_COLOUR2, CPM_GETCOLOUR, 0, 0)|((~(BYTE)SendDlgItemMessage(hwndDlg, IDC_EFFECT_COLOUR_SPIN2, UDM_GETPOS, 0, 0))<<24);; } EndDialog( hwndDlg, IDOK ); return TRUE; @@ -879,10 +879,10 @@ static INT_PTR CALLBACK DlgProcLogOptions(HWND hwndDlg, UINT msg, WPARAM wParam, hbrBack = CreateBrushIndirect(&lb); } - SetRect(&rc, - dis->rcItem.left+FSUI_COLORBOXLEFT, - dis->rcItem.top+FSUI_FONTFRAMEVERT, - dis->rcItem.left+FSUI_COLORBOXLEFT+FSUI_COLORBOXWIDTH, + SetRect(&rc, + dis->rcItem.left+FSUI_COLORBOXLEFT, + dis->rcItem.top+FSUI_FONTFRAMEVERT, + dis->rcItem.left+FSUI_COLORBOXLEFT+FSUI_COLORBOXWIDTH, dis->rcItem.bottom-FSUI_FONTFRAMEVERT); FillRect(dis->hDC, &rc, hbrBack); @@ -910,10 +910,10 @@ static INT_PTR CALLBACK DlgProcLogOptions(HWND hwndDlg, UINT msg, WPARAM wParam, { RECT rc; HBRUSH hbrTmp; - SetRect(&rc, - dis->rcItem.left+FSUI_COLORBOXLEFT, - dis->rcItem.top+FSUI_FONTFRAMEVERT, - dis->rcItem.left+FSUI_COLORBOXLEFT+FSUI_COLORBOXWIDTH, + SetRect(&rc, + dis->rcItem.left+FSUI_COLORBOXLEFT, + dis->rcItem.top+FSUI_FONTFRAMEVERT, + dis->rcItem.left+FSUI_COLORBOXLEFT+FSUI_COLORBOXWIDTH, dis->rcItem.bottom-FSUI_FONTFRAMEVERT); hbrTmp = CreateSolidBrush(clText); @@ -1311,7 +1311,7 @@ int OptInit(WPARAM wParam, LPARAM) odp.flags = ODPF_BOLDGROUPS; odp.nIDBottomSimpleControl = 0; odp.pfnDlgProc = DlgProcLogOptions; - CallService( MS_OPT_ADDPAGE, wParam,( LPARAM )&odp ); + CallService( MS_OPT_ADDPAGE, wParam, ( LPARAM )&odp ); return 0; } @@ -1479,7 +1479,7 @@ int FontsModernOptInit(WPARAM wParam, LPARAM lParam) { static int iBoldControls[] = { - IDC_TXT_TITLE1, IDC_TXT_TITLE2, IDC_TXT_TITLE3, + IDC_TXT_TITLE1, IDC_TXT_TITLE2, IDC_TXT_TITLE3, MODERNOPT_CTRL_LAST }; diff --git a/src/modules/fonts/FontService.cpp b/src/modules/fonts/FontService.cpp index f8e977f9b3..7b19e962f4 100644 --- a/src/modules/fonts/FontService.cpp +++ b/src/modules/fonts/FontService.cpp @@ -2,7 +2,7 @@ Miranda IM: the free IM client for Microsoft* Windows* -Copyright 2000-2009 Miranda ICQ/IM project, +Copyright 2000-2009 Miranda ICQ/IM project, all portions of this codebase are copyrighted to the people listed in contributors.txt. @@ -11,7 +11,7 @@ modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. -This program is distributed in the hope that it will be useful, +This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. diff --git a/src/modules/fonts/FontService.h b/src/modules/fonts/FontService.h index 4f665ae6d3..5d9a3f10a2 100644 --- a/src/modules/fonts/FontService.h +++ b/src/modules/fonts/FontService.h @@ -11,7 +11,7 @@ modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. -This program is distributed in the hope that it will be useful, +This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. @@ -46,7 +46,7 @@ struct TFontID char prefix[32]; // this is prepended to the settings used to store this font's data in the db DWORD flags; // bitwise OR of the FIDF_* flags above TFontSettings deffontsettings; // defaults, valid if flags & FIDF_DEFAULTVALID - int order; // controls the order in the font group in which the fonts are listed in the UI (if order fields are equal, + int order; // controls the order in the font group in which the fonts are listed in the UI (if order fields are equal, // they will be ordered alphabetically by name) TCHAR backgroundGroup[64]; TCHAR backgroundName[64]; diff --git a/src/modules/fonts/services.cpp b/src/modules/fonts/services.cpp index 09e465c59a..0a00198d66 100644 --- a/src/modules/fonts/services.cpp +++ b/src/modules/fonts/services.cpp @@ -2,7 +2,7 @@ Miranda IM: the free IM client for Microsoft* Windows* -Copyright 2000-2009 Miranda ICQ/IM project, +Copyright 2000-2009 Miranda ICQ/IM project, all portions of this codebase are copyrighted to the people listed in contributors.txt. @@ -11,7 +11,7 @@ modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. -This program is distributed in the hope that it will be useful, +This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. @@ -115,7 +115,7 @@ static void GetDefaultFontSetting(LOGFONT* lf, COLORREF* colour) lf->lfHeight = 10; HDC hdc = GetDC(0); - lf->lfHeight = -MulDiv(lf->lfHeight,GetDeviceCaps(hdc, LOGPIXELSY), 72); + lf->lfHeight = -MulDiv(lf->lfHeight, GetDeviceCaps(hdc, LOGPIXELSY), 72); ReleaseDC(0, hdc); } @@ -174,7 +174,7 @@ int GetFontSettingFromDB(char *settings_group, char *prefix, LOGFONT* lf, COLORR if (lf->lfHeight > 0) { HDC hdc = GetDC(0); if (flags & FIDF_SAVEPOINTSIZE) { - lf->lfHeight = -MulDiv(lf->lfHeight,GetDeviceCaps(hdc, LOGPIXELSY), 72); + lf->lfHeight = -MulDiv(lf->lfHeight, GetDeviceCaps(hdc, LOGPIXELSY), 72); } else { // assume SAVEACTUALHEIGHT TEXTMETRIC tm; HFONT hFont = CreateFontIndirect(lf); @@ -236,8 +236,8 @@ void UpdateFontSettings(TFontID* font_id, TFontSettings* fontsettings) static COLORREF sttMixColor(COLORREF cl1, COLORREF cl2, int q) { return RGB( - (GetRValue(cl1) * q + GetRValue(cl2) * (255 - q)) / 255, - (GetGValue(cl1) * q + GetGValue(cl2) * (255 - q)) / 255, + (GetRValue(cl1) * q + GetRValue(cl2) * (255 - q)) / 255, + (GetGValue(cl1) * q + GetGValue(cl2) * (255 - q)) / 255, (GetBValue(cl1) * q + GetBValue(cl2) * (255 - q)) / 255 ); } @@ -255,10 +255,10 @@ COLORREF GetColorFromDefault(COLORREF cl) case MIRCOLOR_BTNHALF: return sttMixColor(GetSysColor(COLOR_BTNFACE), GetSysColor(COLOR_BTNTEXT), 128); case MIRCOLOR_WNDHALF: return sttMixColor(GetSysColor(COLOR_WINDOW), GetSysColor(COLOR_WINDOWTEXT), 128); case MIRCOLOR_SELHALF: return sttMixColor(GetSysColor(COLOR_HIGHLIGHT), GetSysColor(COLOR_HIGHLIGHTTEXT), 128); - case MIRCOLOR_INBACK: return sttMixColor(GetSysColor(COLOR_WINDOW), RGB(0,0,255), 245); + case MIRCOLOR_INBACK: return sttMixColor(GetSysColor(COLOR_WINDOW), RGB(0, 0, 255), 245); case MIRCOLOR_INTEXT: return GetSysColor(COLOR_WINDOWTEXT); case MIRCOLOR_INHALF: return sttMixColor(GetColorFromDefault(MIRCOLOR_INBACK), GetColorFromDefault(MIRCOLOR_INTEXT), 128); - case MIRCOLOR_OUTBACK: return sttMixColor(GetSysColor(COLOR_WINDOW), RGB(0,255,0), 245); + case MIRCOLOR_OUTBACK: return sttMixColor(GetSysColor(COLOR_WINDOW), RGB(0, 255, 0), 245); case MIRCOLOR_OUTTEXT: return GetSysColor(COLOR_WINDOWTEXT); case MIRCOLOR_OUTHALF: return sttMixColor(GetColorFromDefault(MIRCOLOR_OUTBACK), GetColorFromDefault(MIRCOLOR_OUTTEXT), 128); } -- cgit v1.2.3