From f92563fa59cd21d339f98288c60b81a51109fa01 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Mon, 15 Jul 2013 11:44:40 +0000 Subject: same clutch removed for MButtonCtrl, mir_subclassWindow won again git-svn-id: http://svn.miranda-ng.org/main/trunk@5360 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/Clist_modern/src/modern_cluiframes.cpp | 2 +- plugins/Clist_modern/src/modern_contact.cpp | 2 +- plugins/Clist_modern/src/modern_docking.cpp | 2 +- plugins/Clist_modern/src/modern_gdiplus.cpp | 2 +- .../Clist_modern/src/modern_rowheight_funcs.cpp | 8 ++-- plugins/Clist_modern/src/modern_skinengine.cpp | 4 +- plugins/Clist_modern/src/modern_statusbar.cpp | 2 +- plugins/Clist_modern/src/modern_tbbutton.cpp | 52 +++++++++------------- plugins/Clist_nicer/src/CLCButton.cpp | 22 ++++----- 9 files changed, 40 insertions(+), 56 deletions(-) (limited to 'plugins') diff --git a/plugins/Clist_modern/src/modern_cluiframes.cpp b/plugins/Clist_modern/src/modern_cluiframes.cpp index bbf1f7af69..b0e47e2d3e 100644 --- a/plugins/Clist_modern/src/modern_cluiframes.cpp +++ b/plugins/Clist_modern/src/modern_cluiframes.cpp @@ -985,7 +985,7 @@ static HMENU CLUIFramesCreateMenuForFrame(int frameid,int root,int popuppos,HGEN static int ModifyMItem(WPARAM wParam,LPARAM lParam) { - if ((int) wParam == -1 ) return 0; // FIXME + if ((int)wParam == -1 ) return 0; // FIXME return ModifyMenuItemProxy(wParam,lParam); }; diff --git a/plugins/Clist_modern/src/modern_contact.cpp b/plugins/Clist_modern/src/modern_contact.cpp index 2fe6c81265..52eeef32fc 100644 --- a/plugins/Clist_modern/src/modern_contact.cpp +++ b/plugins/Clist_modern/src/modern_contact.cpp @@ -48,7 +48,7 @@ static int GetContactStatus(HANDLE hContact) void cli_ChangeContactIcon(HANDLE hContact,int iIcon,int add) { - corecli.pfnChangeContactIcon((HANDLE) hContact,(int) iIcon,(int) add); + corecli.pfnChangeContactIcon((HANDLE) hContact,(int)iIcon,(int)add); } static int GetStatusModeOrdering(int statusMode) diff --git a/plugins/Clist_modern/src/modern_docking.cpp b/plugins/Clist_modern/src/modern_docking.cpp index 8f4ddbff8c..08036e2669 100644 --- a/plugins/Clist_modern/src/modern_docking.cpp +++ b/plugins/Clist_modern/src/modern_docking.cpp @@ -271,7 +271,7 @@ int Docking_ProcessWindowMessage(WPARAM wParam,LPARAM lParam) case WM_SHOWWINDOW: { if (msg->lParam) return 0; - BOOL toBeDocked = (BOOL) db_get_b(NULL,"CLUI","DockToSides",SETTING_DOCKTOSIDES_DEFAULT); + BOOL toBeDocked = (BOOL)db_get_b(NULL,"CLUI","DockToSides",SETTING_DOCKTOSIDES_DEFAULT); if ((msg->wParam && g_CluiData.fDocked < 0) || (!msg->wParam && g_CluiData.fDocked>0)) g_CluiData.fDocked = -g_CluiData.fDocked; ZeroMemory(&abd,sizeof(abd)); abd.cbSize = sizeof(abd); diff --git a/plugins/Clist_modern/src/modern_gdiplus.cpp b/plugins/Clist_modern/src/modern_gdiplus.cpp index 733709183a..972105cfb1 100644 --- a/plugins/Clist_modern/src/modern_gdiplus.cpp +++ b/plugins/Clist_modern/src/modern_gdiplus.cpp @@ -181,7 +181,7 @@ BOOL GDIPlus_IsAnimatedGif (TCHAR * szName) delete[] pDimensionIDs; - return (BOOL) (nFrameCount > 1); + return (BOOL)(nFrameCount > 1); } void GDIPlus_ExtractAnimatedGIF (TCHAR * szName, int width, int height, HBITMAP * pBitmap, int ** pframesDelay, int * pframesCount, SIZE * pSizeAvatar) diff --git a/plugins/Clist_modern/src/modern_rowheight_funcs.cpp b/plugins/Clist_modern/src/modern_rowheight_funcs.cpp index 02e786571d..b8d4940024 100644 --- a/plugins/Clist_modern/src/modern_rowheight_funcs.cpp +++ b/plugins/Clist_modern/src/modern_rowheight_funcs.cpp @@ -367,7 +367,7 @@ BOOL RowHeights_Alloc(ClcData *dat, int size) size_grow += 100 - (size_grow % 100); if (dat->row_heights != NULL) { - int *tmp = (int *) realloc((void *)dat->row_heights, sizeof(int) * size_grow); + int *tmp = (int *) realloc((void *)dat->row_heights, sizeof(int)* size_grow); if (tmp == NULL) { TRACE("Out of memory: realloc returned NULL (RowHeights_Alloc)"); RowHeights_Free(dat); @@ -375,16 +375,16 @@ BOOL RowHeights_Alloc(ClcData *dat, int size) } dat->row_heights = tmp; - memset(dat->row_heights+(dat->row_heights_allocated), 0, sizeof(int) * (size_grow-dat->row_heights_allocated)); + memset(dat->row_heights+(dat->row_heights_allocated), 0, sizeof(int)* (size_grow-dat->row_heights_allocated)); } else { - dat->row_heights = (int *) malloc(sizeof(int) * size_grow); + dat->row_heights = (int *) malloc(sizeof(int)* size_grow); if (dat->row_heights == NULL) { TRACE("Out of memory: alloc returned NULL (RowHeights_Alloc)"); RowHeights_Free(dat); return FALSE; } - memset(dat->row_heights, 0, sizeof(int) * size_grow); + memset(dat->row_heights, 0, sizeof(int)* size_grow); } dat->row_heights_allocated = size_grow; } diff --git a/plugins/Clist_modern/src/modern_skinengine.cpp b/plugins/Clist_modern/src/modern_skinengine.cpp index 74b39ef932..6385e65344 100644 --- a/plugins/Clist_modern/src/modern_skinengine.cpp +++ b/plugins/Clist_modern/src/modern_skinengine.cpp @@ -563,8 +563,8 @@ struct DCBUFFER static int SortBufferList(const DCBUFFER *buf1, const DCBUFFER *buf2) { if (buf1->hdcOwnedBy != buf2->hdcOwnedBy) return (int)(buf1->hdcOwnedBy < buf2->hdcOwnedBy); - else if (buf1->nUsageID != buf2->nUsageID) return (int) (buf1->nUsageID < buf2->nUsageID); - else return (int) (buf1->hDC < buf2->hDC); + else if (buf1->nUsageID != buf2->nUsageID) return (int)(buf1->nUsageID < buf2->nUsageID); + else return (int)(buf1->hDC < buf2->hDC); } LIST BufferList(2, SortBufferList); diff --git a/plugins/Clist_modern/src/modern_statusbar.cpp b/plugins/Clist_modern/src/modern_statusbar.cpp index a1bf2e2b43..556f8bad1e 100644 --- a/plugins/Clist_modern/src/modern_statusbar.cpp +++ b/plugins/Clist_modern/src/modern_statusbar.cpp @@ -265,7 +265,7 @@ int ModernDrawStatusBarWorker(HWND hWnd, HDC hDC) // create service name mir_snprintf(servName, SIZEOF(servName), "%s/GetUnreadEmailCount", accs[i]->szModuleName); if (p->showProtoEmails == 1 && ServiceExists(servName)) { - mir_snprintf(protoNameExt, SIZEOF(protoNameExt),"[%d]", (int) CallService(servName, 0, 0)); + mir_snprintf(protoNameExt, SIZEOF(protoNameExt),"[%d]", (int)CallService(servName, 0, 0)); p->ProtoEMailCount = mir_strdup(protoNameExt); } } diff --git a/plugins/Clist_modern/src/modern_tbbutton.cpp b/plugins/Clist_modern/src/modern_tbbutton.cpp index d4b23904bc..a82696884e 100644 --- a/plugins/Clist_modern/src/modern_tbbutton.cpp +++ b/plugins/Clist_modern/src/modern_tbbutton.cpp @@ -249,11 +249,11 @@ static LRESULT CALLBACK ToolbarButtonProc(HWND hwndDlg, UINT msg, WPARAM wParam case WM_SETFONT: // remember the font so we can use it later bct->hFont = (HFONT) wParam; // maybe we should redraw? - bct->nFontID = (int) lParam - 1; + bct->nFontID = (int)lParam - 1; break; case BUTTONSETSENDONDOWN: - bct->fSendOnDown = (BOOL) lParam; + bct->fSendOnDown = (BOOL)lParam; break; case BUTTONSETMARGINS: @@ -283,9 +283,8 @@ static LRESULT CALLBACK ToolbarButtonProc(HWND hwndDlg, UINT msg, WPARAM wParam EndPaint(hwndDlg, &ps); } } - ValidateRect(hwndDlg,NULL); - bct->lResult = 0; - return 1; + ValidateRect(hwndDlg, NULL); + return 0; case WM_CAPTURECHANGED: if ((HWND)lParam != bct->hwnd && bct->stateId != PBS_DISABLED) { @@ -316,20 +315,19 @@ static LRESULT CALLBACK ToolbarButtonProc(HWND hwndDlg, UINT msg, WPARAM wParam InvalidateParentRect(bct->hwnd, NULL, TRUE); } } - SetCapture( bct->hwnd ); + SetCapture(bct->hwnd); } } - bct->lResult = 0; - return 1; + return 0; case WM_LBUTTONUP: if ( GetCapture() == bct->hwnd ) { POINT ptMouse = UNPACK_POINT(lParam); RECT rcClient; - GetClientRect( bct->hwnd, &rcClient ); + GetClientRect(bct->hwnd, &rcClient); - if ( !PtInRect( &rcClient, ptMouse )) { + if ( !PtInRect(&rcClient, ptMouse)) { bct->fHotMark = FALSE; ReleaseCapture(); break; @@ -343,12 +341,13 @@ static LRESULT CALLBACK ToolbarButtonProc(HWND hwndDlg, UINT msg, WPARAM wParam bct->stateId = PBS_HOT; InvalidateParentRect(bct->hwnd, NULL, TRUE); } - if ( !bct->fSendOnDown) - SendMessage(GetParent(hwndDlg), WM_COMMAND, MAKELONG(GetDlgCtrlID(hwndDlg), BN_CLICKED), (LPARAM) hwndDlg); + if ( !bct->fSendOnDown) { + bct->fHotMark = FALSE; + SendMessage(GetParent(hwndDlg), WM_COMMAND, MAKELONG(GetDlgCtrlID(hwndDlg), BN_CLICKED), (LPARAM)hwndDlg); + } } - bct->fHotMark = FALSE; - bct->lResult = 0; - return 1; + else bct->fHotMark = FALSE; + return 0; case WM_MOUSEMOVE: { @@ -383,17 +382,13 @@ static LRESULT CALLBACK ToolbarButtonProc(HWND hwndDlg, UINT msg, WPARAM wParam ReleaseCapture(); } } - bct->lResult = 0; - return 1; + return 0; case WM_NCHITTEST: { LRESULT lr = SendMessage(GetParent(hwndDlg), WM_NCHITTEST, wParam, lParam); - if (lr == HTLEFT || lr == HTRIGHT || lr == HTBOTTOM || lr == HTTOP || lr == HTTOPLEFT || lr == HTTOPRIGHT - || lr == HTBOTTOMLEFT || lr == HTBOTTOMRIGHT) { - bct->lResult = HTTRANSPARENT; - return 1; - } + if (lr == HTLEFT || lr == HTRIGHT || lr == HTBOTTOM || lr == HTTOP || lr == HTTOPLEFT || lr == HTTOPRIGHT || lr == HTBOTTOMLEFT || lr == HTBOTTOMRIGHT) + return HTTRANSPARENT; } break; @@ -404,11 +399,9 @@ static LRESULT CALLBACK ToolbarButtonProc(HWND hwndDlg, UINT msg, WPARAM wParam else if (wParam == BST_UNCHECKED) bct->bIsPushed = 0; InvalidateRect(bct->hwnd, NULL, TRUE); - bct->lResult = 0; - return 1; + return 0; case WM_ERASEBKGND: - bct->lResult = 1; return 1; case MBM_SETICOLIBHANDLE: @@ -440,16 +433,13 @@ static LRESULT CALLBACK ToolbarButtonProc(HWND hwndDlg, UINT msg, WPARAM wParam } return 1; } - return 0; + return mir_callNextSubclass(hwndDlg, ToolbarButtonProc, msg, wParam, lParam); } void MakeButtonSkinned(HWND hWnd) { - MButtonCustomize Custom; - Custom.cbLen = sizeof(TBBUTTONDATA); - Custom.fnPainter = (pfnPainterFunc)PaintWorker; - Custom.fnWindowProc = ToolbarButtonProc; - SendMessage(hWnd, BUTTONSETCUSTOM, 0, (LPARAM)&Custom); + SendMessage(hWnd, BUTTONSETCUSTOMPAINT, sizeof(TBBUTTONDATA), (LPARAM)PaintWorker); + mir_subclassWindow(hWnd, ToolbarButtonProc); TBBUTTONDATA* p = (TBBUTTONDATA*)GetWindowLongPtr(hWnd, 0); p->nFontID = -1; diff --git a/plugins/Clist_nicer/src/CLCButton.cpp b/plugins/Clist_nicer/src/CLCButton.cpp index 01a0b6281d..dc18a6d6b2 100644 --- a/plugins/Clist_nicer/src/CLCButton.cpp +++ b/plugins/Clist_nicer/src/CLCButton.cpp @@ -379,16 +379,14 @@ static LRESULT CALLBACK TSButtonWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPAR if (bct->stateId != PBS_DISABLED && bct->cHot && bct->cHot == tolower((int) wParam)) { if ( !bct->bSendOnDown) SendMessage(pcli->hwndContactList, WM_COMMAND, MAKELONG(bct->iCtrlID, BN_CLICKED), (LPARAM) hwnd); - bct->lResult = 0; - return 1; + return 0; } break; case BM_GETIMAGE: - if (wParam == IMAGE_ICON) { - bct->lResult = (LRESULT)(bct->hIconPrivate ? bct->hIconPrivate : bct->hIcon); - return 1; - } + if (wParam == IMAGE_ICON) + return (LRESULT)(bct->hIconPrivate ? bct->hIconPrivate : bct->hIcon); + break; case BM_SETIMAGE: @@ -489,20 +487,16 @@ static LRESULT CALLBACK TSButtonWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPAR switch( SendMessage(pcli->hwndContactList, WM_NCHITTEST, wParam, lParam)) { case HTLEFT: case HTRIGHT: case HTBOTTOM: case HTTOP: case HTTOPLEFT: case HTTOPRIGHT: case HTBOTTOMLEFT: case HTBOTTOMRIGHT: - bct->lResult = HTTRANSPARENT; - return 1; + return HTTRANSPARENT; } } - return 0; + return mir_callNextSubclass(hwnd, TSButtonWndProc, msg, wParam, lParam); } static void SetButtonAsCustom(HWND hWnd) { - MButtonCustomize Custom; - Custom.cbLen = sizeof(MButtonExtension); - Custom.fnPainter = (pfnPainterFunc)PaintWorker; - Custom.fnWindowProc = TSButtonWndProc; - SendMessage(hWnd, BUTTONSETCUSTOM, 0, (LPARAM)&Custom); + SendMessage(hWnd, BUTTONSETCUSTOMPAINT, sizeof(MButtonExtension), (LPARAM)PaintWorker); + mir_subclassWindow(hWnd, TSButtonWndProc); } static LRESULT CALLBACK ToolbarWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) -- cgit v1.2.3