]> git.saurik.com Git - wxWidgets.git/blobdiff - src/mac/carbon/dataview.cpp
applied patch 1908782 wxAuiMDIChildFrame not removed from wxAuiMDIClientWindow
[wxWidgets.git] / src / mac / carbon / dataview.cpp
index 0d334b6d7361c8bd530311d54548ae145842a958..99b593cdb93b90c9857e622f0e8d1fcad327ebb8 100644 (file)
@@ -174,13 +174,23 @@ static bool InitializeColumnDescription(DataBrowserListViewColumnDesc& columnDes
   } /* switch */
   columnDescription.headerBtnDesc.btnFontStyle.font  = kControlFontViewSystemFont;
   columnDescription.headerBtnDesc.btnFontStyle.style = normal;
-  columnDescription.headerBtnDesc.btnContentInfo.contentType = kControlContentIconRef;
-  if (columnPtr->GetBitmap().Ok())
+  if (columnPtr->GetBitmap().IsOk())
+  {
+    columnDescription.headerBtnDesc.btnContentInfo.contentType = kControlContentIconRef;
 #if wxCHECK_VERSION(2,9,0)
     columnDescription.headerBtnDesc.btnContentInfo.u.iconRef = columnPtr->GetBitmap().GetIconRef();
 #else
     columnDescription.headerBtnDesc.btnContentInfo.u.iconRef = columnPtr->GetBitmap().GetBitmapData()->GetIconRef();
 #endif
+  }
+  else
+  {
+    // not text only as we otherwise could not add a bitmap later
+    // columnDescription.headerBtnDesc.btnContentInfo.contentType = kControlContentTextOnly;
+    columnDescription.headerBtnDesc.btnContentInfo.contentType = kControlContentIconRef;
+    columnDescription.headerBtnDesc.btnContentInfo.u.iconRef = NULL;
+  }
+    
  // done:
   return true;
 } /* InitializeColumnDescription(DataBrowserListViewColumnDesc&, wxDataViewColumn const*, DataBrowserPropertyID, wxMacCFStringHolder const&) */
@@ -997,6 +1007,18 @@ bool wxDataViewCtrl::Create(wxWindow *parent, wxWindowID id, const wxPoint& pos,
   return true;
 } /* wxDataViewCtrl::Create(wxWindow *parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long style, const wxValidator& validator) */
 
+/*static*/
+wxVisualAttributes wxDataViewCtrl::GetClassDefaultAttributes(wxWindowVariant variant)
+{
+    wxVisualAttributes attr;
+
+    attr.colFg = wxSystemSettings::GetColour( wxSYS_COLOUR_WINDOWTEXT );
+    attr.colBg = wxSystemSettings::GetColour( wxSYS_COLOUR_LISTBOX );
+    attr.font.MacCreateFromThemeFont(kThemeViewsFont);
+
+    return attr;
+}
+
 bool wxDataViewCtrl::AssociateModel(wxDataViewModel* model)
 {
   if (!wxDataViewCtrlBase::AssociateModel(model))
@@ -1016,9 +1038,9 @@ bool wxDataViewCtrl::AppendColumn(wxDataViewColumn* columnPtr)
   wxMacDataViewDataBrowserListViewControlPointer MacDataViewListCtrlPtr(dynamic_cast<wxMacDataViewDataBrowserListViewControlPointer>(this->m_peer));
 
 #if wxCHECK_VERSION(2,9,0)
-  wxCFStringRef title(columnPtr->GetTitle(),this->m_font.Ok() ? this->m_font.GetEncoding() : wxLocale::GetSystemEncoding());
+  wxCFStringRef title(columnPtr->GetTitle(),this->m_font.Ok() ? this->GetFont().GetEncoding() : wxLocale::GetSystemEncoding());
 #else
-  wxMacCFStringHolder title(columnPtr->GetTitle(),this->m_font.Ok() ? this->m_font.GetEncoding() : wxLocale::GetSystemEncoding());
+  wxMacCFStringHolder title(columnPtr->GetTitle(),this->m_font.Ok() ? this->GetFont().GetEncoding() : wxLocale::GetSystemEncoding());
 #endif
 
 
@@ -1136,9 +1158,9 @@ bool wxDataViewCtrl::PrependColumn(wxDataViewColumn* columnPtr)
   wxMacDataViewDataBrowserListViewControlPointer MacDataViewListCtrlPtr(dynamic_cast<wxMacDataViewDataBrowserListViewControlPointer>(this->m_peer));
 
 #if wxCHECK_VERSION(2,9,0)
-  wxCFStringRef title(columnPtr->GetTitle(),this->m_font.Ok() ? this->m_font.GetEncoding() : wxLocale::GetSystemEncoding());
+  wxCFStringRef title(columnPtr->GetTitle(),this->m_font.Ok() ? this->GetFont().GetEncoding() : wxLocale::GetSystemEncoding());
 #else
-  wxMacCFStringHolder title(columnPtr->GetTitle(),this->m_font.Ok() ? this->m_font.GetEncoding() : wxLocale::GetSystemEncoding());
+  wxMacCFStringHolder title(columnPtr->GetTitle(),this->m_font.Ok() ? this->GetFont().GetEncoding() : wxLocale::GetSystemEncoding());
 #endif