From d9013df6a880f0bd7459f952d654ff476e480a90 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Mon, 12 Aug 2013 18:03:10 +0000 Subject: custom buttons in TabSRMM removed and based on the standard MButtonClass git-svn-id: http://svn.miranda-ng.org/main/trunk@5661 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- src/modules/button/button.cpp | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) (limited to 'src/modules/button') diff --git a/src/modules/button/button.cpp b/src/modules/button/button.cpp index 7bbbd9ef8a..1a2ae3f695 100644 --- a/src/modules/button/button.cpp +++ b/src/modules/button/button.cpp @@ -246,7 +246,7 @@ 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); + MButtonCtrl *bct = (MButtonCtrl *)GetWindowLongPtr(hwnd, 0); switch(msg) { case WM_NCCREATE: @@ -259,13 +259,16 @@ static LRESULT CALLBACK MButtonWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPAR bct->fnPainter = PaintWorker; bct->hFont = (HFONT)GetStockObject(DEFAULT_GUI_FONT); LoadTheme(bct); - if (SUCCEEDED(CoCreateInstance(CLSID_AccPropServices, NULL, CLSCTX_SERVER, IID_IAccPropServices, (void**)&bct->pAccPropServices))) { - // Annotating the Role of this object to be PushButton + + // Annotating the Role of this object to be PushButton + if (SUCCEEDED(CoCreateInstance(CLSID_AccPropServices, NULL, CLSCTX_SERVER, IID_IAccPropServices, (void**)&bct->pAccPropServices))) SetHwndPropInt(bct, OBJID_CLIENT, CHILDID_SELF, PROPID_ACC_ROLE, ROLE_SYSTEM_PUSHBUTTON); - } - else bct->pAccPropServices = NULL; + else + bct->pAccPropServices = NULL; + SetWindowLongPtr(hwnd, 0, (LONG_PTR)bct); - if (((CREATESTRUCT *)lParam)->lpszName) SetWindowText(hwnd, ((CREATESTRUCT *)lParam)->lpszName); + if (((CREATESTRUCT *)lParam)->lpszName) + SetWindowText(hwnd, ((CREATESTRUCT*)lParam)->lpszName); return TRUE; case WM_DESTROY: @@ -300,7 +303,7 @@ static LRESULT CALLBACK MButtonWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPAR if (bct->arrow) IcoLib_ReleaseIcon(bct->arrow, 0); DestroyTheme(bct); } - break; // DONT! fall thru + break; case WM_NCDESTROY: SetWindowLongPtr(hwnd, GWLP_USERDATA, 0); @@ -323,7 +326,7 @@ static LRESULT CALLBACK MButtonWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPAR break; case WM_KEYUP: - if (bct->stateId != PBS_DISABLED && wParam == VK_SPACE) { + if (bct->stateId != PBS_DISABLED && wParam == VK_SPACE && !(GetKeyState(VK_CONTROL) & 0x8000) && !(GetKeyState(VK_SHIFT) & 0x8000)) { if (bct->bIsPushBtn) { if (bct->bIsPushed) { bct->bIsPushed = 0; -- cgit v1.2.3