diff options
| author | Jonas Kümmerlin <jonas@kuemmerlin.eu> | 2020-05-31 20:40:31 +0200 |
|---|---|---|
| committer | Jonas Kümmerlin <jonas@kuemmerlin.eu> | 2020-05-31 20:40:31 +0200 |
| commit | 07d18635095fa13a7be974db2d9d990bd12d2cc1 (patch) | |
| tree | 20bde93e208aef5b7f126521785e8b1c19eafa27 | |
| parent | a304be5509e4b7970fa18dcc3316a49269517c07 (diff) | |
combo: implement WM_PAINT, WM_ERASEBKGND, fix WM_CTLCOLORLISTBOX and styles
| -rw-r--r-- | alf/alfcombobox.cpp | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/alf/alfcombobox.cpp b/alf/alfcombobox.cpp index ca0924d..86ba4ea 100644 --- a/alf/alfcombobox.cpp +++ b/alf/alfcombobox.cpp @@ -31,7 +31,7 @@ ALF_Combo_InitializePriv(HWND hwnd, ALFComboCreateParams *params) priv->hwndChild = CreateWindowEx(0, TEXT("COMBOBOX"), TEXT(""), - WS_CHILD | WS_VISIBLE | WS_VSCROLL | WS_TABSTOP | comboStyle, + WS_CHILD | WS_VISIBLE | WS_TABSTOP | comboStyle, 0, 0, 100, 200 /* FIXME needed for commctl32 v5, what is the best value here? */, hwnd, (HMENU) GetWindowLongPtrW(hwnd, GWLP_ID), @@ -269,9 +269,26 @@ ALF__ComboWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) return TRUE; } + if (uMsg == WM_PAINT) { + PAINTSTRUCT ps; + HDC dc = BeginPaint(hwnd, &ps); + + FillRect(dc, &ps.rcPaint, GetSysColorBrush(COLOR_BTNFACE)); + + EndPaint(hwnd, &ps); + + return 0; + } + + if (uMsg == WM_ERASEBKGND) { + return TRUE; + } + if (!ALF_Compat_IsMinWindowsVersion(4, 0)) { // HACK to draw the space between edit control and button as COLOR_BTNFACE if (uMsg == WM_CTLCOLORLISTBOX && priv && !(GetWindowLong(priv->hwndChild, GWL_STYLE) & 1)) { + SetTextColor((HDC)wParam, GetSysColor(COLOR_BTNTEXT)); + SetBkColor((HDC)wParam, GetSysColor(COLOR_BTNFACE)); return (LRESULT)GetSysColorBrush(COLOR_BTNFACE); } } |
