Skip to content

Commit

Permalink
Merge pull request #1569 from Hoikas/fix_1508
Browse files Browse the repository at this point in the history
Fix #1508.
  • Loading branch information
Hoikas authored Feb 27, 2024
2 parents 00a29eb + 65ca738 commit 35a45e3
Showing 1 changed file with 12 additions and 7 deletions.
19 changes: 12 additions & 7 deletions Sources/Tools/MaxComponent/plResponderComponent.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -1072,15 +1079,13 @@ 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)
{
IDrawComboItem((DRAWITEMSTRUCT*)lParam);
return TRUE;
}
break;
#endif

case WM_SETCURSOR:
{
Expand Down

0 comments on commit 35a45e3

Please sign in to comment.