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/options/descbutton.cpp | 22 +++++++++--------- src/modules/options/filter.cpp | 10 ++++----- src/modules/options/filter.h | 4 ++-- src/modules/options/headerbar.cpp | 26 ++++++++++----------- src/modules/options/iconheader.cpp | 46 +++++++++++++++++++------------------- src/modules/options/options.cpp | 2 +- 6 files changed, 55 insertions(+), 55 deletions(-) (limited to 'src/modules/options') diff --git a/src/modules/options/descbutton.cpp b/src/modules/options/descbutton.cpp index 2b5a270271..08538fc41c 100644 --- a/src/modules/options/descbutton.cpp +++ b/src/modules/options/descbutton.cpp @@ -3,7 +3,7 @@ Miranda IM: the free IM client for Microsoft* Windows* Copyright 2007 Artem Shpynov -Copyright 2000-2007 Miranda ICQ/IM project, +Copyright 2000-2007 Miranda ICQ/IM project, all portions of this codebase are copyrighted to the people listed in contributors.txt. @@ -13,7 +13,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. @@ -130,8 +130,8 @@ static void MDescButton_DrawGradient(HDC hdc, int x, int y, int width, int heigh RECT rc; SetRect(&rc, x, 0, x+width, 0); for (int i=y+height; --i >= y; ) { COLORREF color = RGB( - ((height-i-1)*rgb0->rgbRed + i*rgb1->rgbRed) / height, - ((height-i-1)*rgb0->rgbGreen + i*rgb1->rgbGreen) / height, + ((height-i-1)*rgb0->rgbRed + i*rgb1->rgbRed) / height, + ((height-i-1)*rgb0->rgbGreen + i*rgb1->rgbGreen) / height, ((height-i-1)*rgb0->rgbBlue + i*rgb1->rgbBlue) / height); rc.top = rc.bottom = i; ++rc.bottom; @@ -150,13 +150,13 @@ static LRESULT MDescButton_OnPaint(HWND hwndDlg, MDescButtonCtrl *dat, UINT msg RECT temprc; HFONT hfntSave; - HDC hdc=BeginPaint(hwndDlg,&ps); + HDC hdc=BeginPaint(hwndDlg, &ps); HDC tempDC=CreateCompatibleDC(hdc); SIZE titleSize = {0}; - hBmp=CreateCompatibleBitmap(hdc,dat->width, dat->height); - hOldBmp=(HBITMAP)SelectObject(tempDC,hBmp); + hBmp=CreateCompatibleBitmap(hdc, dat->width, dat->height); + hOldBmp=(HBITMAP)SelectObject(tempDC, hBmp); temprc.left=0; temprc.right=dat->width; @@ -212,11 +212,11 @@ static LRESULT MDescButton_OnPaint(HWND hwndDlg, MDescButtonCtrl *dat, UINT msg SelectObject(tempDC, hfntSave); //Copy to output - BitBlt(hdc,dat->rc.left,dat->rc.top,dat->width,dat->height,tempDC,0,0,SRCCOPY); - SelectObject(tempDC,hOldBmp); + BitBlt(hdc, dat->rc.left, dat->rc.top, dat->width, dat->height, tempDC, 0, 0, SRCCOPY); + SelectObject(tempDC, hOldBmp); DeleteObject(hBmp); DeleteDC(tempDC); - EndPaint(hwndDlg,&ps); + EndPaint(hwndDlg, &ps); return TRUE; } @@ -240,7 +240,7 @@ static LRESULT CALLBACK MDescButtonWndProc(HWND hwndDlg, UINT msg, WPARAM wPara break; case WM_SIZE: - GetClientRect(hwndDlg,&dat->rc); + GetClientRect(hwndDlg, &dat->rc); dat->width=dat->rc.right-dat->rc.left; dat->height=dat->rc.bottom-dat->rc.top; return TRUE; diff --git a/src/modules/options/filter.cpp b/src/modules/options/filter.cpp index 0088220266..3e003d720e 100644 --- a/src/modules/options/filter.cpp +++ b/src/modules/options/filter.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. @@ -50,7 +50,7 @@ INT_PTR CALLBACK DlgProcOptSearch(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lPa case WM_COMMAND: switch (LOWORD(wParam)) { case IDC_ENABLE_KEYWORDFILTERING: - SendMessage(GetParent(hWnd), PSM_CHANGED,0,0); + SendMessage(GetParent(hWnd), PSM_CHANGED, 0, 0); break; } break; @@ -151,7 +151,7 @@ void AddDialogString(HWND hWndDlg, const PageHash key) AddFilterString(key, title); TCHAR szClass[64]; - GetClassName(hWndDlg,szClass, SIZEOF(szClass)); + GetClassName(hWndDlg, szClass, SIZEOF(szClass)); if (lstrcmpi(szClass, _T("SysTreeView32")) == 0) { HTREEITEM hItem = TreeView_GetRoot(hWndDlg); @@ -194,7 +194,7 @@ void AddDialogString(HWND hWndDlg, const PageHash key) AddFilterString(key, title); } } } } } } } -static BOOL CALLBACK GetDialogStringsCallback(HWND hWnd,LPARAM lParam) +static BOOL CALLBACK GetDialogStringsCallback(HWND hWnd, LPARAM lParam) { AddDialogString(hWnd, lParam); diff --git a/src/modules/options/filter.h b/src/modules/options/filter.h index 3db823fcdf..fc15074502 100644 --- a/src/modules/options/filter.h +++ b/src/modules/options/filter.h @@ -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/options/headerbar.cpp b/src/modules/options/headerbar.cpp index 4a6f11cba5..f47047ad19 100644 --- a/src/modules/options/headerbar.cpp +++ b/src/modules/options/headerbar.cpp @@ -3,7 +3,7 @@ Miranda IM: the free IM client for Microsoft* Windows* Copyright 2007 Artem Shpynov -Copyright 2000-2007 Miranda ICQ/IM project, +Copyright 2000-2007 Miranda ICQ/IM project, all portions of this codebase are copyrighted to the people listed in contributors.txt. @@ -13,7 +13,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. @@ -129,8 +129,8 @@ static void MHeaderbar_DrawGradient(HDC hdc, int x, int y, int width, int height for (i=y+height; --i >= y; ) { COLORREF color = RGB( - ((height-i-1)*rgb0->rgbRed + i*rgb1->rgbRed) / height, - ((height-i-1)*rgb0->rgbGreen + i*rgb1->rgbGreen) / height, + ((height-i-1)*rgb0->rgbRed + i*rgb1->rgbRed) / height, + ((height-i-1)*rgb0->rgbGreen + i*rgb1->rgbGreen) / height, ((height-i-1)*rgb0->rgbBlue + i*rgb1->rgbBlue) / height); rc.top = rc.bottom = i; ++rc.bottom; @@ -155,7 +155,7 @@ static LRESULT MHeaderbar_OnPaint(HWND hwndDlg, MHeaderbarCtrl *mit, UINT msg, TCHAR *szSubTitle = _tcschr(szTitle, _T('\n')); if (szSubTitle) *szSubTitle++ = 0; - HDC hdc=BeginPaint(hwndDlg,&ps); + HDC hdc=BeginPaint(hwndDlg, &ps); HDC tempDC=CreateCompatibleDC(hdc); BITMAPINFO bmi; @@ -167,7 +167,7 @@ static LRESULT MHeaderbar_OnPaint(HWND hwndDlg, MHeaderbarCtrl *mit, UINT msg, bmi.bmiHeader.biCompression = BI_RGB; hBmp = CreateDIBSection(tempDC, &bmi, DIB_RGB_COLORS, NULL, NULL, 0); - hOldBmp=(HBITMAP)SelectObject(tempDC,hBmp); + hOldBmp=(HBITMAP)SelectObject(tempDC, hBmp); if (IsAeroMode()) { RECT temprc; @@ -177,7 +177,7 @@ static LRESULT MHeaderbar_OnPaint(HWND hwndDlg, MHeaderbarCtrl *mit, UINT msg, temprc.bottom=mit->width; FillRect(tempDC, &temprc, (HBRUSH)GetStockObject(BLACK_BRUSH)); - MARGINS margins = {0,0,mit->height,0}; + MARGINS margins = {0, 0, mit->height, 0}; dwmExtendFrameIntoClientArea(GetParent(hwndDlg), &margins); WTA_OPTIONS opts; @@ -275,19 +275,19 @@ static LRESULT MHeaderbar_OnPaint(HWND hwndDlg, MHeaderbarCtrl *mit, UINT msg, CombineRgn(hRgn, hRgn, hRgnTmp, RGN_DIFF); DeleteObject(hRgnTmp); } - SelectClipRgn(hdc,hRgn); + SelectClipRgn(hdc, hRgn); DeleteObject(hRgn); } - BitBlt(hdc,mit->rc.left,mit->rc.top,mit->width,mit->height,tempDC,0,0,SRCCOPY); + BitBlt(hdc, mit->rc.left, mit->rc.top, mit->width, mit->height, tempDC, 0, 0, SRCCOPY); - SelectClipRgn(hdc,NULL); + SelectClipRgn(hdc, NULL); - SelectObject(tempDC,hOldBmp); + SelectObject(tempDC, hOldBmp); DeleteObject(hBmp); DeleteDC(tempDC); - EndPaint(hwndDlg,&ps); + EndPaint(hwndDlg, &ps); return TRUE; } @@ -332,7 +332,7 @@ static LRESULT CALLBACK MHeaderbarWndProc(HWND hwndDlg, UINT msg, WPARAM wParam break; case WM_SIZE: - GetClientRect(hwndDlg,&itc->rc); + GetClientRect(hwndDlg, &itc->rc); itc->width=itc->rc.right-itc->rc.left; itc->height=itc->rc.bottom-itc->rc.top; return TRUE; diff --git a/src/modules/options/iconheader.cpp b/src/modules/options/iconheader.cpp index b31ba45bba..8499f3d470 100644 --- a/src/modules/options/iconheader.cpp +++ b/src/modules/options/iconheader.cpp @@ -3,7 +3,7 @@ Miranda IM: the free IM client for Microsoft* Windows* Copyright 2007 Artem Shpynov -Copyright 2000-2007 Miranda ICQ/IM project, +Copyright 2000-2007 Miranda ICQ/IM project, all portions of this codebase are copyrighted to the people listed in contributors.txt. @@ -13,7 +13,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. @@ -171,8 +171,8 @@ static void MIcoTab_DrawGradient(HDC hdc, int x, int y, int width, int height, R RECT rc; SetRect(&rc, x, 0, x+width, 0); for ( int i=y+height; --i >= y; ) { COLORREF color = RGB( - ((height-i-1)*rgb0->rgbRed + i*rgb1->rgbRed) / height, - ((height-i-1)*rgb0->rgbGreen + i*rgb1->rgbGreen) / height, + ((height-i-1)*rgb0->rgbRed + i*rgb1->rgbRed) / height, + ((height-i-1)*rgb0->rgbGreen + i*rgb1->rgbGreen) / height, ((height-i-1)*rgb0->rgbBlue + i*rgb1->rgbBlue) / height); rc.top = rc.bottom = i; ++rc.bottom; @@ -244,7 +244,7 @@ static void MIcoTab_DrawItem(HWND hwnd, HDC hdc, MIcoTabCtrl *dat, MIcoTab *tab, textRect.right=itemX+dat->itemWidth; textRect.top=textTop; textRect.bottom=iconTop+dat->itemHeight; - DrawIcon(hdc,itemX+dat->itemWidth/2-16, iconTop, tab->hIcon); + DrawIcon(hdc, itemX+dat->itemWidth/2-16, iconTop, tab->hIcon); if (IsVSMode()) { DTTOPTS dto = {0}; @@ -257,7 +257,7 @@ static void MIcoTab_DrawItem(HWND hwnd, HDC hdc, MIcoTabCtrl *dat, MIcoTab *tab, mir_free(tcsNameW); closeThemeData(hTheme); } - else DrawText(hdc,tab->tcsName,-1,&textRect, DT_VCENTER|DT_CENTER|DT_END_ELLIPSIS); + else DrawText(hdc, tab->tcsName, -1, &textRect, DT_VCENTER|DT_CENTER|DT_END_ELLIPSIS); if (hFntSave) DeleteObject(SelectObject(hdc, hFntSave)); @@ -270,7 +270,7 @@ static LRESULT MIcoTab_OnPaint(HWND hwndDlg, MIcoTabCtrl *mit, UINT msg, WPARAM RECT temprc; int i; - HDC hdc=BeginPaint(hwndDlg,&ps); + HDC hdc=BeginPaint(hwndDlg, &ps); HDC tempDC=CreateCompatibleDC(hdc); HFONT hFont = 0; @@ -284,7 +284,7 @@ static LRESULT MIcoTab_OnPaint(HWND hwndDlg, MIcoTabCtrl *mit, UINT msg, WPARAM bmi.bmiHeader.biCompression = BI_RGB; hBmp = CreateDIBSection(tempDC, &bmi, DIB_RGB_COLORS, NULL, NULL, 0); - hOldBmp=(HBITMAP)SelectObject(tempDC,hBmp); + hOldBmp=(HBITMAP)SelectObject(tempDC, hBmp); if (IsAeroMode()) { temprc.left=0; @@ -295,7 +295,7 @@ static LRESULT MIcoTab_OnPaint(HWND hwndDlg, MIcoTabCtrl *mit, UINT msg, WPARAM } else { if (mit->hBkgBmp) - StretchBlt(tempDC,0,0,mit->width,mit->height,mit->hBkgDC,0,0,mit->BkgSize.cx,mit->BkgSize.cy,SRCCOPY); + StretchBlt(tempDC, 0, 0, mit->width, mit->height, mit->hBkgDC, 0, 0, mit->BkgSize.cx, mit->BkgSize.cy, SRCCOPY); else { if (IsVSMode()) MIcoTab_FillRect(tempDC, 0, 0, mit->width, mit->height, GetSysColor(COLOR_WINDOW)); @@ -308,8 +308,8 @@ static LRESULT MIcoTab_OnPaint(HWND hwndDlg, MIcoTabCtrl *mit, UINT msg, WPARAM //Draw Items hFont = mit->hFont; - SelectObject(tempDC,hFont); - SetBkMode(tempDC,TRANSPARENT); + SelectObject(tempDC, hFont); + SetBkMode(tempDC, TRANSPARENT); for (i=0; ipList.getCount(); i++) { MIcoTab *tab = (MIcoTab *)mit->pList[i]; @@ -317,12 +317,12 @@ static LRESULT MIcoTab_OnPaint(HWND hwndDlg, MIcoTabCtrl *mit, UINT msg, WPARAM } //Copy to output - BitBlt(hdc,mit->rc.left,mit->rc.top,mit->width,mit->height,tempDC,0,0,SRCCOPY); - SelectObject(tempDC,hOldBmp); + BitBlt(hdc, mit->rc.left, mit->rc.top, mit->width, mit->height, tempDC, 0, 0, SRCCOPY); + SelectObject(tempDC, hOldBmp); DeleteObject(hBmp); DeleteDC(tempDC); - EndPaint(hwndDlg,&ps); + EndPaint(hwndDlg, &ps); return TRUE; } @@ -342,7 +342,7 @@ static LRESULT CALLBACK MIcoTabWndProc(HWND hwndDlg, UINT msg, WPARAM wParam, L if (IsAeroMode()) { RECT rc; GetWindowRect(hwndDlg, &rc); - MARGINS margins = {0,0,rc.bottom-rc.top,0}; + MARGINS margins = {0, 0, rc.bottom-rc.top, 0}; dwmExtendFrameIntoClientArea(GetParent(hwndDlg), &margins); } @@ -353,7 +353,7 @@ static LRESULT CALLBACK MIcoTabWndProc(HWND hwndDlg, UINT msg, WPARAM wParam, L break; case WM_SIZE: - GetClientRect(hwndDlg,&itc->rc); + GetClientRect(hwndDlg, &itc->rc); itc->width=itc->rc.right-itc->rc.left; itc->height=itc->rc.bottom-itc->rc.top; @@ -397,8 +397,8 @@ static LRESULT CALLBACK MIcoTabWndProc(HWND hwndDlg, UINT msg, WPARAM wParam, L itc->nSelectedIdx = itc->nHotIdx; SetWindowText(hwndDlg, itc->pList[itc->nSelectedIdx]->tcsName); RedrawWindow(hwndDlg, NULL, NULL, RDW_INVALIDATE); - SendMessage(GetParent(hwndDlg), WM_COMMAND, - MAKEWPARAM(GetWindowLongPtr(hwndDlg, GWL_ID), ITCN_SELCHANGED), + SendMessage(GetParent(hwndDlg), WM_COMMAND, + MAKEWPARAM(GetWindowLongPtr(hwndDlg, GWL_ID), ITCN_SELCHANGED), itc->nSelectedIdx); } return 0; @@ -454,8 +454,8 @@ static LRESULT CALLBACK MIcoTabWndProc(HWND hwndDlg, UINT msg, WPARAM wParam, L itc->nSelectedIdx = newIdx; SetWindowText(hwndDlg, itc->pList[itc->nSelectedIdx]->tcsName); RedrawWindow(hwndDlg, NULL, NULL, RDW_INVALIDATE); - SendMessage(GetParent(hwndDlg), WM_COMMAND, - MAKEWPARAM(GetWindowLongPtr(hwndDlg, GWL_ID), ITCN_SELCHANGEDKBD), + SendMessage(GetParent(hwndDlg), WM_COMMAND, + MAKEWPARAM(GetWindowLongPtr(hwndDlg, GWL_ID), ITCN_SELCHANGEDKBD), itc->nSelectedIdx); } return 0; @@ -518,8 +518,8 @@ static LRESULT CALLBACK MIcoTabWndProc(HWND hwndDlg, UINT msg, WPARAM wParam, L itc->nSelectedIdx = wParam; SetWindowText(hwndDlg, itc->pList[itc->nSelectedIdx]->tcsName); RedrawWindow(hwndDlg, NULL, NULL, RDW_INVALIDATE); - SendMessage(GetParent(hwndDlg), WM_COMMAND, - MAKEWPARAM(GetWindowLongPtr(hwndDlg, GWL_ID), ITCN_SELCHANGED), + SendMessage(GetParent(hwndDlg), WM_COMMAND, + MAKEWPARAM(GetWindowLongPtr(hwndDlg, GWL_ID), ITCN_SELCHANGED), itc->nSelectedIdx); } return TRUE; @@ -537,7 +537,7 @@ static LRESULT CALLBACK MIcoTabWndProc(HWND hwndDlg, UINT msg, WPARAM wParam, L SelectObject(itc->hBkgDC, itc->hBkgOldBmp); DeleteDC(itc->hBkgDC); } - li_ListDestruct(itc->pList,MITListDestructor); + li_ListDestruct(itc->pList, MITListDestructor); delete itc; return TRUE; } diff --git a/src/modules/options/options.cpp b/src/modules/options/options.cpp index 0b6c2d583d..c417b4b6e4 100644 --- a/src/modules/options/options.cpp +++ b/src/modules/options/options.cpp @@ -1483,7 +1483,7 @@ static int OptModulesLoaded(WPARAM, LPARAM) mi.position = 1900000000; mi.pszName = LPGEN("&Options..."); mi.pszService = "Options/OptionsCommand"; - CallService( MS_CLIST_ADDMAINMENUITEM, 0, ( LPARAM )&mi ); + Menu_AddMainMenuItem(&mi); return 0; } -- cgit v1.2.3