diff options
author | George Hazan <george.hazan@gmail.com> | 2013-07-15 11:44:40 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2013-07-15 11:44:40 +0000 |
commit | f92563fa59cd21d339f98288c60b81a51109fa01 (patch) | |
tree | 3f5831465380a967f0c79d9819a41422b7b2c59c /src | |
parent | 8e10b13b38995be8e810342d21040a4324cbfeef (diff) |
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
Diffstat (limited to 'src')
-rw-r--r-- | src/modules/button/button.cpp | 20 |
1 files changed, 6 insertions, 14 deletions
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
|