X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/99c75ebc5e447e1bb25439e22f07130583dc5783..3e1924dd5f5744c3e2a8973de9b3e4f372b7fd85:/src/mac/carbon/dataview.cpp diff --git a/src/mac/carbon/dataview.cpp b/src/mac/carbon/dataview.cpp index e54cc745f7..c3ee3ab5c7 100644 --- a/src/mac/carbon/dataview.cpp +++ b/src/mac/carbon/dataview.cpp @@ -992,9 +992,23 @@ bool wxDataViewCtrl::Create(wxWindow *parent, wxWindowID id, const wxPoint& pos, ::SetDataBrowserTableViewHiliteStyle( this->m_peer->GetControlRef(), kDataBrowserTableViewFillHilite ); + ::SetDataBrowserTableViewGeometry( this->m_peer->GetControlRef(), true, false ); + 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)) @@ -1014,9 +1028,9 @@ bool wxDataViewCtrl::AppendColumn(wxDataViewColumn* columnPtr) wxMacDataViewDataBrowserListViewControlPointer MacDataViewListCtrlPtr(dynamic_cast(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 @@ -1134,9 +1148,9 @@ bool wxDataViewCtrl::PrependColumn(wxDataViewColumn* columnPtr) wxMacDataViewDataBrowserListViewControlPointer MacDataViewListCtrlPtr(dynamic_cast(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 @@ -1456,6 +1470,19 @@ void wxDataViewCtrl::OnSize(wxSizeEvent& event) dataViewCustomRendererPtr->SetDC(NULL); // reset DC because DC has changed } /* if */ } /* for */ + + wxMacDataViewDataBrowserListViewControlPointer MacDataViewListCtrlPtr(dynamic_cast(this->m_peer)); + ControlRef ref = MacDataViewListCtrlPtr->GetControlRef(); + if (NoOfColumns == 1) + { + ::SetDataBrowserHasScrollBars( ref, false, true ); + ::AutoSizeDataBrowserListViewColumns( ref ); + } + if (NoOfColumns > 1) + { + ::SetDataBrowserHasScrollBars( ref, true, true ); + } + event.Skip(); } /* wxDataViewCtrl::OnSize(wxSizeEvent&) */