diff options
author | George Hazan <george.hazan@gmail.com> | 2013-08-12 18:03:10 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2013-08-12 18:03:10 +0000 |
commit | d9013df6a880f0bd7459f952d654ff476e480a90 (patch) | |
tree | d6547c07cc04da79368c3a98003f365b83835c7a /src/modules | |
parent | 58ff50e5bf8dbb6b28d54370423232dc0221cd53 (diff) |
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
Diffstat (limited to 'src/modules')
-rw-r--r-- | src/modules/button/button.cpp | 19 |
1 files changed, 11 insertions, 8 deletions
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;
|