diff options
Diffstat (limited to 'alf/alfbutton.cpp')
| -rw-r--r-- | alf/alfbutton.cpp | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/alf/alfbutton.cpp b/alf/alfbutton.cpp index f809410..f41b0b5 100644 --- a/alf/alfbutton.cpp +++ b/alf/alfbutton.cpp @@ -780,6 +780,11 @@ ALF_NtButton_WndProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) ALF_NtButton_Paint(hwnd, priv, (HDC)wParam, &rc); } else if (uMsg == WM_GETDLGCODE) { if (priv->drawFlags & ALF_NTBTN_FLAG_DRAW_CHECKBOX || priv->drawFlags & ALF_NTBTN_FLAG_DRAW_TRISTATE) { + if (lParam && ((MSG *)lParam)->message == WM_CHAR && ( + ((MSG *)lParam)->wParam == '+' || ((MSG *)lParam)->wParam == '-' || ((MSG *)lParam)->wParam == '=')) { + return DLGC_WANTCHARS | DLGC_BUTTON; + } + return DLGC_BUTTON; } else if (priv->drawFlags & ALF_NTBTN_FLAG_DRAW_RADIOBTN) { return DLGC_RADIOBUTTON; @@ -900,6 +905,20 @@ ALF_NtButton_WndProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) } } } + } else if (uMsg == WM_CHAR) { + if (priv->drawFlags & ALF_NTBTN_FLAG_DRAW_CHECKBOX) { + if (wParam == '+' || wParam == '=') { + // check + if (!(priv->drawFlags & ALF_NTBTN_FLAG_IS_CHECKED)) { + ALF_NtButton_Clicked(hwnd, priv); + } + } else if (wParam == '-') { + // uncheck + if (priv->drawFlags & ALF_NTBTN_FLAG_IS_CHECKED) { + ALF_NtButton_Clicked(hwnd, priv); + } + } + } } else if (uMsg == WM_ERASEBKGND) { return TRUE; } else if (uMsg == WM_SETTEXT) { |
