From 470caaf9df1fe6796e6efc7ec17b627bb0180aff Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Tue, 7 Dec 1999 14:15:23 +0000 Subject: [PATCH] small cosmetic fix for wxListCtrl git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@4855 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- include/wx/generic/listctrl.h | 3 ++- samples/dialogs/dialogs.cpp | 3 ++- src/generic/listctrl.cpp | 15 ++++++++++----- 3 files changed, 14 insertions(+), 7 deletions(-) diff --git a/include/wx/generic/listctrl.h b/include/wx/generic/listctrl.h index 98b332888d..91f74cd9c9 100644 --- a/include/wx/generic/listctrl.h +++ b/include/wx/generic/listctrl.h @@ -180,7 +180,8 @@ public: private: void SetAttributes(wxDC *dc, const wxListItemAttr *attr, - const wxColour& colText, const wxFont& font); + const wxColour& colText, const wxFont& font, + bool hilight); DECLARE_DYNAMIC_CLASS(wxListLineData); }; diff --git a/samples/dialogs/dialogs.cpp b/samples/dialogs/dialogs.cpp index 552de089ff..9edfbed05e 100644 --- a/samples/dialogs/dialogs.cpp +++ b/samples/dialogs/dialogs.cpp @@ -273,7 +273,8 @@ void MyFrame::FileOpen(wxCommandEvent& WXUNUSED(event) ) void MyFrame::FilesOpen(wxCommandEvent& WXUNUSED(event) ) { wxFileDialog dialog(this, "Testing open multiple file dialog", - "", "", "*.*", wxMULTIPLE); + "", "", wxFileSelectorDefaultWildcardStr, + wxMULTIPLE); if (dialog.ShowModal() == wxID_OK) { diff --git a/src/generic/listctrl.cpp b/src/generic/listctrl.cpp index 816c94f3da..032bb8344b 100644 --- a/src/generic/listctrl.cpp +++ b/src/generic/listctrl.cpp @@ -586,9 +586,13 @@ int wxListLineData::GetImage( int index ) void wxListLineData::SetAttributes(wxDC *dc, const wxListItemAttr *attr, const wxColour& colText, - const wxFont& font) + const wxFont& font, + bool hilight) { - if ( attr && attr->HasTextColour() ) + // don't use foregroud colour for drawing highlighted items - this might + // make them completely invisible (and there is no way to do bit + // arithmetics on wxColour, unfortunately) + if ( !hilight && attr && attr->HasTextColour() ) { dc->SetTextForeground(attr->GetTextColour()); } @@ -640,7 +644,7 @@ void wxListLineData::DoDraw( wxDC *dc, bool hilight, bool paintBG ) // customize the subitems (in report mode) too. wxListItemData *item = (wxListItemData*)m_items.First()->Data(); wxListItemAttr *attr = item->GetAttributes(); - SetAttributes(dc, attr, colText, font); + SetAttributes(dc, attr, colText, font, hilight); bool hasBgCol = attr && attr->HasBackgroundColour(); if ( paintBG || hasBgCol ) @@ -867,9 +871,10 @@ void wxListHeaderWindow::OnPaint( wxPaintEvent &WXUNUSED(event) ) int cw = item.m_width-2; #if wxUSE_GENERIC_LIST_EXTENSIONS if ((i+1 == numColumns) || ( dc.LogicalToDeviceX(x+item.m_width) > w-5)) - cw = dc.DeviceToLogicalX(w)-x-1; + cw = dc.DeviceToLogicalX(w)-x-1; #else - if ((i+1 == numColumns) || (x+item.m_width > w-5)) cw = w-x-1; + if ((i+1 == numColumns) || (x+item.m_width > w-5)) + cw = w-x-1; #endif dc.SetPen( *wxWHITE_PEN ); -- 2.45.2