]> git.saurik.com Git - wxWidgets.git/commitdiff
small cosmetic fix for wxListCtrl
authorVadim Zeitlin <vadim@wxwidgets.org>
Tue, 7 Dec 1999 14:15:23 +0000 (14:15 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Tue, 7 Dec 1999 14:15:23 +0000 (14:15 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@4855 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

include/wx/generic/listctrl.h
samples/dialogs/dialogs.cpp
src/generic/listctrl.cpp

index 98b332888d476eb04771688081f1174d7c38d122..91f74cd9c9bd36801b10f4eff2e649df17cf24d4 100644 (file)
@@ -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);
 };
index 552de089ffedb49ce3a740b794070b5832720761..9edfbed05e7d63dc19fd531cac88bc7d5c89a4b8 100644 (file)
@@ -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)
     {
index 816c94f3da97b492c3a8f275a901bd6f2457bb0b..032bb8344b28a71d3d53be5b562269cd3e82c357 100644 (file)
@@ -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 );