#include "wx/mac/carbon/databrow.h"
#ifndef WX_PRECOMP
- #include "wx/timer.h"
+ #include "wx/timer.h"
+ #include "wx/settings.h"
+ #include "wx/dcclient.h"
+ #include "wx/icon.h"
#endif
-#include "wx/icon.h"
#include "wx/renderer.h"
//-----------------------------------------------------------------------------
DataViewEvent.SetColumn(columnIndex);
DataViewEvent.SetDataViewColumn(DataViewCtrlPtr->GetColumn(columnIndex));
// finally sent the equivalent wxWidget event:
- DataViewCtrlPtr->GetEventHandler()->ProcessEvent(DataViewEvent);
+ DataViewCtrlPtr->HandleWindowEvent(DataViewEvent);
return ::CallNextEventHandler(handler,EventReference);
} /* if */
else
columnDescription.headerBtnDesc.btnFontStyle.style = normal;
columnDescription.headerBtnDesc.btnContentInfo.contentType = kControlContentIconRef;
if (columnPtr->GetBitmap().Ok())
- columnDescription.headerBtnDesc.btnContentInfo.u.iconRef = columnPtr->GetBitmap().GetBitmapData()->GetIconRef();
+ columnDescription.headerBtnDesc.btnContentInfo.u.iconRef = columnPtr->GetBitmap().GetIconRef();
// done:
return true;
} /* InitializeColumnDescription(DataBrowserListViewColumnDesc&, wxDataViewColumn const*, DataBrowserPropertyID, wxMacCFStringHolder const&) */
dataViewEvent.SetEventObject(dataViewCtrlPtr);
dataViewEvent.SetItem(item);
// sent the equivalent wxWidget event:
- dataViewCtrlPtr->GetEventHandler()->ProcessEvent(dataViewEvent);
+ dataViewCtrlPtr->HandleWindowEvent(dataViewEvent);
// done
return true;
} /* if */
for (size_t i=0; i<noOfEntries; ++i)
{
dataViewEvent.SetItem(reinterpret_cast<void*>(itemIDs[i]));
- dataViewCtrlPtr->GetEventHandler()->ProcessEvent(dataViewEvent);
+ dataViewCtrlPtr->HandleWindowEvent(dataViewEvent);
} /* for */
} /* if */
// release allocated array space:
dataViewEvent.SetColumn(col);
dataViewEvent.SetItem(item);
// send the equivalent wxWidget event:
- dataViewCtrlPtr->GetEventHandler()->ProcessEvent(dataViewEvent);
+ dataViewCtrlPtr->HandleWindowEvent(dataViewEvent);
// done
return true;
} /* if */
void wxDataViewCustomRenderer::RenderText( const wxString &text, int xoffset, wxRect cell, wxDC *dc, int state )
{
wxDataViewCtrl *view = GetOwner()->GetOwner();
- wxColour col = (state & wxDATAVIEW_CELL_SELECTED) ? wxSystemSettings::GetColour(wxSYS_COLOUR_HIGHLIGHTTEXT) : view->GetForegroundColour();
+ 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));
}
{
if ((GetOwner() == NULL) || (GetOwner()->GetOwner() == NULL))
return NULL;
- this->m_DCPtr = new wxClientDC(this->GetOwner()->GetOwner());
+ this->m_DCPtr = new wxWindowDC(this->GetOwner()->GetOwner());
} /* if */
return this->m_DCPtr;
} /* wxDataViewCustomRenderer::GetDC(void) */
IMPLEMENT_CLASS(wxDataViewTextRendererAttr,wxDataViewTextRenderer)
-// ---------------------------------------------------------
-// wxDataViewTextRendererAttr
-// ---------------------------------------------------------
-
-wxDataViewTextRendererAttr::wxDataViewTextRendererAttr(wxString const& varianttype, wxDataViewCellMode mode, int align)
- :wxDataViewTextRenderer(varianttype,mode,align)
-{
-}
-
-IMPLEMENT_CLASS(wxDataViewTextRendererAttr,wxDataViewTextRenderer)
-
// ---------------------------------------------------------
// wxDataViewBitmapRenderer
// ---------------------------------------------------------
bitmap << this->GetValue();
if (bitmap.Ok())
- return (::SetDataBrowserItemDataIcon(this->GetDataReference(),bitmap.GetBitmapData()->GetIconRef()) == noErr);
+ return (::SetDataBrowserItemDataIcon(this->GetDataReference(),bitmap.GetIconRef()) == noErr);
else
return true;
} /* if */
// variable definition:
wxMacCFStringHolder cfString(iconText.GetText(),(this->GetView()->GetFont().Ok() ? this->GetView()->GetFont().GetEncoding() : wxLocale::GetSystemEncoding()));
+
+ if (iconText.GetIcon().IsOk())
+ {
+ if (::SetDataBrowserItemDataIcon(this->GetDataReference(),MAC_WXHICON(iconText.GetIcon().GetHICON())) != noErr)
+ return false;
+ }
- return ((::SetDataBrowserItemDataIcon(this->GetDataReference(),MAC_WXHICON(iconText.GetIcon().GetHICON())) == noErr) &&
- (::SetDataBrowserItemDataText(this->GetDataReference(),cfString) == noErr));
+ return (::SetDataBrowserItemDataText(this->GetDataReference(),cfString) == noErr);
} /* if */
else
return false;
wxCHECK_RET(macDataViewListCtrlPtr->GetHeaderDesc(this->GetPropertyID(),&headerDescription) == noErr,_("Could not get header description."));
if (this->GetBitmap().Ok())
- headerDescription.btnContentInfo.u.iconRef = this->GetBitmap().GetBitmapData()->GetIconRef();
+ headerDescription.btnContentInfo.u.iconRef = this->GetBitmap().GetIconRef();
else
headerDescription.btnContentInfo.u.iconRef = NULL;
wxCHECK_RET(macDataViewListCtrlPtr->SetHeaderDesc(this->GetPropertyID(),&headerDescription) == noErr,_("Could not set icon."));
InstallControlEventHandler(this->m_peer->GetControlRef(),GetwxMacDataViewCtrlEventHandlerUPP(),GetEventTypeCount(eventList),eventList,this,NULL);
+ ::SetDataBrowserTableViewHiliteStyle( this->m_peer->GetControlRef(), kDataBrowserTableViewFillHilite );
+
return true;
} /* wxDataViewCtrl::Create(wxWindow *parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long style, const wxValidator& validator) */