]> git.saurik.com Git - wxWidgets.git/blobdiff - src/msw/listctrl.cpp
corrected code to really skip stack frames in the beginning and to number the remaini...
[wxWidgets.git] / src / msw / listctrl.cpp
index b24b99daf0d2f39f6821dda51546d2811b8043e3..b23125349fb1591bded738bc53b65ef4cd4bc62a 100644 (file)
@@ -362,6 +362,10 @@ bool wxListCtrl::Create(wxWindow *parent,
     // versions of _some_ messages (notably LVN_GETDISPINFOA) in MSLU build
     wxSetCCUnicodeFormat(GetHwnd());
 
+    // We must set the default text colour to the system/theme color, otherwise
+    // GetTextColour will always return black
+    SetTextColour(GetDefaultAttributes().colFg);
+
     // for comctl32.dll v 4.70+ we want to have some non default extended
     // styles because it's prettier (and also because wxGTK does it like this)
     if ( InReportView() && wxApp::GetComCtl32Version() >= 470 )
@@ -1115,9 +1119,9 @@ int wxListCtrl::GetSelectedItemCount() const
 // Gets the text colour of the listview
 wxColour wxListCtrl::GetTextColour() const
 {
-    // Use GetDefaultAttributes instead of ListView_GetTextColor because
-    // the latter seems to return black all the time (instead of the theme color)
-    return GetDefaultAttributes().colFg;
+    COLORREF ref = ListView_GetTextColor(GetHwnd());
+    wxColour col(GetRValue(ref), GetGValue(ref), GetBValue(ref));
+    return col;
 }
 
 // Sets the text colour of the listview