X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/de40d7364730fd9556620ea5411689dad1c9e28a..948c6134e7cd57a0b776b9440975a73ce30d7d03:/src/osx/dataview_osx.cpp?ds=inline diff --git a/src/osx/dataview_osx.cpp b/src/osx/dataview_osx.cpp index 9ffcb8af46..f2d16e61a0 100644 --- a/src/osx/dataview_osx.cpp +++ b/src/osx/dataview_osx.cpp @@ -2,7 +2,7 @@ // Name: src/osx/dataview_osx.cpp // Purpose: wxDataViewCtrl native mac implementation // Author: -// Id: $Id: dataview_osx.cpp 58317 2009-01-27 +// Id: $Id$ // Copyright: (c) 2009 // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// @@ -303,15 +303,6 @@ wxDataViewCustomRenderer::~wxDataViewCustomRenderer() delete m_DCPtr; } -void wxDataViewCustomRenderer::RenderText( const wxString &text, int xoffset, wxRect cell, wxDC *dc, int state ) -{ - wxDataViewCtrl *view = GetOwner()->GetOwner(); - - wxColour col = (state & wxDATAVIEW_CELL_SELECTED) ? *wxWHITE : view->GetForegroundColour(); - dc->SetTextForeground(col); - dc->DrawText( text, cell.x + xoffset, cell.y + ((cell.height - dc->GetCharHeight()) / 2)); -} - wxDC* wxDataViewCustomRenderer::GetDC() { if ((m_DCPtr == NULL) && (GetOwner() != NULL) && (GetOwner()->GetOwner() != NULL)) @@ -342,9 +333,15 @@ void wxDataViewCtrl::Init() m_cgContext = NULL; } -bool wxDataViewCtrl::Create(wxWindow *parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long style, const wxValidator& validator ) +bool wxDataViewCtrl::Create(wxWindow *parent, + wxWindowID id, + const wxPoint& pos, + const wxSize& size, + long style, + const wxValidator& validator, + const wxString& name) { - if (!(wxControl::Create(parent,id,pos,size,style & ~(wxHSCROLL | wxVSCROLL),validator))) + if (!(wxControl::Create(parent,id,pos,size,style,validator,name))) return false; m_peer = ::CreateDataView(this,parent,id,pos,size,style,GetExtraStyle()); @@ -499,6 +496,16 @@ unsigned int wxDataViewCtrl::GetCount() const return GetDataViewPeer()->GetCount(); } +wxDataViewItem wxDataViewCtrl::DoGetCurrentItem() const +{ + return GetDataViewPeer()->GetCurrentItem(); +} + +void wxDataViewCtrl::DoSetCurrentItem(const wxDataViewItem& item) +{ + GetDataViewPeer()->SetCurrentItem(item); +} + wxRect wxDataViewCtrl::GetItemRect(wxDataViewItem const& item, wxDataViewColumn const* columnPtr) const { if (item.IsOk() && (columnPtr != NULL)) @@ -623,7 +630,8 @@ wxDataViewCtrl::GetClassDefaultAttributes(wxWindowVariant WXUNUSED(variant)) attr.colFg = wxSystemSettings::GetColour( wxSYS_COLOUR_WINDOWTEXT ); attr.colBg = wxSystemSettings::GetColour( wxSYS_COLOUR_LISTBOX ); - attr.font.CreateSystemFont(wxOSX_SYSTEM_FONT_VIEWS); + static wxFont font = wxFont(wxOSX_SYSTEM_FONT_VIEWS); + attr.font = font; return attr; }