]> git.saurik.com Git - wxWidgets.git/blobdiff - src/generic/listctrl.cpp
Compile fix for Universal
[wxWidgets.git] / src / generic / listctrl.cpp
index 42db9247e595a0283559b53bdfc66085873c7cfe..d83f686fbfc7125044117896efe0dfbd79fd0c55 100644 (file)
@@ -121,7 +121,7 @@ WX_DEFINE_ARRAY_PTR(wxColWidthInfo *, ColWidthArray);
 //  wxListItemData (internal)
 //-----------------------------------------------------------------------------
 
-class WXDLLEXPORT wxListItemData
+class wxListItemData
 {
 public:
     wxListItemData(wxListMainWindow *owner);
@@ -191,7 +191,7 @@ protected:
 //  wxListHeaderData (internal)
 //-----------------------------------------------------------------------------
 
-class WXDLLEXPORT wxListHeaderData : public wxObject
+class wxListHeaderData : public wxObject
 {
 public:
     wxListHeaderData();
@@ -372,7 +372,7 @@ WX_DEFINE_OBJARRAY(wxListLineDataArray)
 //  wxListHeaderWindow (internal)
 //-----------------------------------------------------------------------------
 
-class WXDLLEXPORT wxListHeaderWindow : public wxWindow
+class wxListHeaderWindow : public wxWindow
 {
 protected:
     wxListMainWindow  *m_owner;
@@ -429,7 +429,7 @@ private:
 // wxListRenameTimer (internal)
 //-----------------------------------------------------------------------------
 
-class WXDLLEXPORT wxListRenameTimer: public wxTimer
+class wxListRenameTimer: public wxTimer
 {
 private:
     wxListMainWindow *m_owner;
@@ -443,7 +443,7 @@ public:
 // wxListTextCtrlWrapper: wraps a wxTextCtrl to make it work for inline editing
 //-----------------------------------------------------------------------------
 
-class WXDLLEXPORT wxListTextCtrlWrapper : public wxEvtHandler
+class wxListTextCtrlWrapper : public wxEvtHandler
 {
 public:
     // NB: text must be a valid object but not Create()d yet
@@ -1380,7 +1380,11 @@ bool wxListLineData::SetAttributes(wxDC *dc,
     // arithmetics on wxColour, unfortunately)
     wxColour colText;
     if ( highlighted )
+#ifdef __WXMAC__
+        colText = *wxWHITE;
+#else
         colText = wxSystemSettings::GetColour(wxSYS_COLOUR_HIGHLIGHTTEXT);
+#endif
     else if ( attr && attr->HasTextColour() )
         colText = attr->GetTextColour();
     else
@@ -2182,23 +2186,39 @@ wxListMainWindow::wxListMainWindow( wxWindow *parent,
 {
     Init();
 
+
+#ifdef __WXMAC__
+    // OS X sel item highlight color differs from text highlight color, which is
+    // what wxSYS_COLOUR_HIGHLIGHT returns. 
+    RGBColor hilight;
+    GetThemeBrushAsColor(kThemeBrushAlternatePrimaryHighlightColor, 32, true, &hilight);
+    m_highlightBrush = new wxBrush( wxColour(hilight.red, hilight.green, hilight.blue ), wxSOLID );
+#else
     m_highlightBrush = new wxBrush
-                           (
+                         (
                             wxSystemSettings::GetColour
                             (
                                 wxSYS_COLOUR_HIGHLIGHT
                             ),
                             wxSOLID
-                           );
+                         );
+#endif
 
+#ifdef __WXMAC__
+    // on Mac, this color also differs from the wxSYS_COLOUR_BTNSHADOW, enough to be noticable.
+    // I don't know if BTNSHADOW is appropriate in other contexts, so I'm just changing it here.
+    GetThemeBrushAsColor(kThemeBrushSecondaryHighlightColor, 32, true, &hilight);
+    m_highlightUnfocusedBrush = new wxBrush( wxColour(hilight.red, hilight.green, hilight.blue ), wxSOLID );
+#else
     m_highlightUnfocusedBrush = new wxBrush
-                                    (
-                                       wxSystemSettings::GetColour
-                                       (
-                                           wxSYS_COLOUR_BTNSHADOW
-                                       ),
-                                       wxSOLID
-                                    );
+                              (
+                                 wxSystemSettings::GetColour
+                                 (
+                                     wxSYS_COLOUR_BTNSHADOW
+                                 ),
+                                 wxSOLID
+                              );
+#endif
 
     SetScrollbars( 0, 0, 0, 0, 0, 0 );