From 2076893b534cccf9542d63197af24afe09c4eb36 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Wed, 4 Sep 2002 14:30:25 +0000 Subject: [PATCH] use standard colour for the selected tree item text as well as background git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@16971 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/msw/treectrl.cpp | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/src/msw/treectrl.cpp b/src/msw/treectrl.cpp index cda27e0311..187d568c38 100644 --- a/src/msw/treectrl.cpp +++ b/src/msw/treectrl.cpp @@ -2392,17 +2392,16 @@ bool wxTreeCtrl::MSWOnNotify(int idCtrl, WXLPARAM lParam, WXLPARAM *result) } HFONT hFont; - wxColour colText, colBack; if ( attr->HasFont() ) { - wxFont font = attr->GetFont(); - hFont = (HFONT)font.GetResourceHandle(); + hFont = GetHfontOf(attr->GetFont()); } else { hFont = 0; } + wxColour colText; if ( attr->HasTextColour() ) { colText = attr->GetTextColour(); @@ -2415,16 +2414,14 @@ bool wxTreeCtrl::MSWOnNotify(int idCtrl, WXLPARAM lParam, WXLPARAM *result) // selection colours should override ours if ( nmcd.uItemState & CDIS_SELECTED ) { - DWORD clrBk = ::GetSysColor(COLOR_HIGHLIGHT); - lptvcd->clrTextBk = clrBk; - - // try to make the text visible - lptvcd->clrText = wxColourToRGB(colText); - lptvcd->clrText |= ~clrBk; - lptvcd->clrText &= 0x00ffffff; + lptvcd->clrTextBk = + ::GetSysColor(COLOR_HIGHLIGHT); + lptvcd->clrText = + ::GetSysColor(COLOR_HIGHLIGHTTEXT); } - else + else // !selected { + wxColour colBack; if ( attr->HasBackgroundColour() ) { colBack = attr->GetBackgroundColour();