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 --- src/modules/button/button.cpp | 20 ++++++-------------- 1 file changed, 6 insertions(+), 14 deletions(-) (limited to 'src') diff --git a/src/modules/button/button.cpp b/src/modules/button/button.cpp index b619eacceb..d1b06896ea 100644 --- a/src/modules/button/button.cpp +++ b/src/modules/button/button.cpp @@ -247,9 +247,6 @@ static void PaintWorker(MButtonCtrl *ctl, HDC hdcPaint) static LRESULT CALLBACK MButtonWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) { MButtonCtrl* bct = (MButtonCtrl *)GetWindowLongPtr(hwnd, 0); - if (bct && bct->fnWindowProc) - if ( bct->fnWindowProc(hwnd, msg, wParam, lParam)) - return bct->lResult; switch(msg) { case WM_NCCREATE: @@ -506,19 +503,14 @@ static LRESULT CALLBACK MButtonWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPAR } break; - case BUTTONSETCUSTOM: - { - MButtonCustomize *pCustom = (MButtonCustomize*)lParam; - if (pCustom == NULL || bct->fnWindowProc) - break; - - bct = (MButtonCtrl*)mir_realloc(bct, pCustom->cbLen); - if (pCustom->cbLen > sizeof(MButtonCtrl)) - memset(bct+1, 0, pCustom->cbLen - sizeof(MButtonCtrl)); - bct->fnPainter = pCustom->fnPainter; - bct->fnWindowProc = pCustom->fnWindowProc; + case BUTTONSETCUSTOMPAINT: + if (wParam > sizeof(MButtonCtrl)) { + bct = (MButtonCtrl*)mir_realloc(bct, wParam); + memset(bct+1, 0, wParam - sizeof(MButtonCtrl)); SetWindowLongPtr(hwnd, 0, (LONG_PTR)bct); } + if (lParam) + bct->fnPainter = pfnPainterFunc(lParam); break; case WM_SETFOCUS: // set keybord focus and redraw -- cgit v1.2.3