From 65ca73880e72b507af6c8366d7a560aba02191a3 Mon Sep 17 00:00:00 2001 From: Adam Johnson Date: Sun, 25 Feb 2024 15:56:35 -0500 Subject: [PATCH] Fix #1508. As it turns out, the responder state combo box has the owner draw style applied. So, `ifdef`ing the draw method out causes the box to be blank. Who would have thought it? While I was here, I cleaned up the colors to not look out of place on Max 2022. --- .../MaxComponent/plResponderComponent.cpp | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/Sources/Tools/MaxComponent/plResponderComponent.cpp b/Sources/Tools/MaxComponent/plResponderComponent.cpp index 1a891fa857..e048c6b782 100644 --- a/Sources/Tools/MaxComponent/plResponderComponent.cpp +++ b/Sources/Tools/MaxComponent/plResponderComponent.cpp @@ -877,11 +877,18 @@ void plResponderProc::IDrawComboItem(DRAWITEMSTRUCT *dis) return; // The colors depend on whether the item is selected. - COLORREF clrForeground = SetTextColor(dis->hDC, - GetSysColor(dis->itemState & ODS_SELECTED ? COLOR_HIGHLIGHTTEXT : COLOR_WINDOWTEXT)); - - COLORREF clrBackground = SetBkColor(dis->hDC, - GetSysColor(dis->itemState & ODS_SELECTED ? COLOR_HIGHLIGHT : COLOR_WINDOW)); + bool selected = hsCheckBits(dis->itemState, ODS_SELECTED); + COLORREF maxForeground = selected ? kHilightText : kWindowText; + COLORREF maxBackground = selected ? kItemHilight : kWindow; + + COLORREF clrForeground = SetTextColor( + dis->hDC, + GetColorManager()->GetColor(maxForeground) + ); + COLORREF clrBackground = SetBkColor( + dis->hDC, + GetColorManager()->GetColor(maxBackground) + ); // Calculate the vertical and horizontal position. TEXTMETRIC tm; @@ -1072,7 +1079,6 @@ INT_PTR plResponderProc::DlgProc(TimeValue t, IParamMap2 *pm, HWND hWnd, UINT ms } return TRUE; -#ifdef CUSTOM_DRAW case WM_DRAWITEM: if (wParam == IDC_STATE_COMBO) { @@ -1080,7 +1086,6 @@ INT_PTR plResponderProc::DlgProc(TimeValue t, IParamMap2 *pm, HWND hWnd, UINT ms return TRUE; } break; -#endif case WM_SETCURSOR: {