]> 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 e8b8a9374adec435c856f74cf9835f65e71b92a0..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&) */
@@ -1028,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
 
 
@@ -1148,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