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
This commit is contained in:
Vadim Zeitlin
2002-09-04 14:30:25 +00:00
parent 8705ab68e2
commit 2076893b53

View File

@@ -2392,17 +2392,16 @@ bool wxTreeCtrl::MSWOnNotify(int idCtrl, WXLPARAM lParam, WXLPARAM *result)
} }
HFONT hFont; HFONT hFont;
wxColour colText, colBack;
if ( attr->HasFont() ) if ( attr->HasFont() )
{ {
wxFont font = attr->GetFont(); hFont = GetHfontOf(attr->GetFont());
hFont = (HFONT)font.GetResourceHandle();
} }
else else
{ {
hFont = 0; hFont = 0;
} }
wxColour colText;
if ( attr->HasTextColour() ) if ( attr->HasTextColour() )
{ {
colText = attr->GetTextColour(); colText = attr->GetTextColour();
@@ -2415,16 +2414,14 @@ bool wxTreeCtrl::MSWOnNotify(int idCtrl, WXLPARAM lParam, WXLPARAM *result)
// selection colours should override ours // selection colours should override ours
if ( nmcd.uItemState & CDIS_SELECTED ) if ( nmcd.uItemState & CDIS_SELECTED )
{ {
DWORD clrBk = ::GetSysColor(COLOR_HIGHLIGHT); lptvcd->clrTextBk =
lptvcd->clrTextBk = clrBk; ::GetSysColor(COLOR_HIGHLIGHT);
lptvcd->clrText =
// try to make the text visible ::GetSysColor(COLOR_HIGHLIGHTTEXT);
lptvcd->clrText = wxColourToRGB(colText);
lptvcd->clrText |= ~clrBk;
lptvcd->clrText &= 0x00ffffff;
} }
else else // !selected
{ {
wxColour colBack;
if ( attr->HasBackgroundColour() ) if ( attr->HasBackgroundColour() )
{ {
colBack = attr->GetBackgroundColour(); colBack = attr->GetBackgroundColour();