#ifndef WX_PRECOMP
#include "wx/timer.h"
+ #include "wx/settings.h"
+ #include "wx/dcclient.h"
#endif
#include "wx/icon.h"
delete this->m_DCPtr;
} /* wxDataViewCustomRenderer::~wxDataViewCustomRenderer(void) */
+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();
+ dc->SetTextForeground(col);
+ dc->DrawText( text, cell.x + xoffset, cell.y + ((cell.height - dc->GetCharHeight()) / 2));
+}
+
wxDC* wxDataViewCustomRenderer::GetDC(void)
{
if (this->m_DCPtr == NULL)
this->m_DCPtr = newDCPtr;
} /* wxDataViewCustomRenderer::SetDC(wxDC*) */
+WXDataBrowserPropertyType wxDataViewCustomRenderer::GetPropertyType() const
+{
+ return kDataBrowserCustomType;
+}
IMPLEMENT_ABSTRACT_CLASS(wxDataViewCustomRenderer, wxDataViewRenderer)
return false;
} /* wxDataViewTextRenderer::Render(void) */
+WXDataBrowserPropertyType wxDataViewTextRenderer::GetPropertyType() const
+{
+ return kDataBrowserTextType;
+}
+
IMPLEMENT_CLASS(wxDataViewTextRenderer,wxDataViewRenderer)
// ---------------------------------------------------------
return false;
} /* wxDataViewBitmapRenderer::Render(void) */
+WXDataBrowserPropertyType wxDataViewBitmapRenderer::GetPropertyType() const
+{
+ return kDataBrowserIconType;
+}
+
IMPLEMENT_CLASS(wxDataViewBitmapRenderer,wxDataViewRenderer)
// ---------------------------------------------------------
return false;
} /* wxDataViewIconTextRenderer::Render(void) */
+WXDataBrowserPropertyType wxDataViewIconTextRenderer::GetPropertyType() const
+{
+ return kDataBrowserIconAndTextType;
+}
+
IMPLEMENT_ABSTRACT_CLASS(wxDataViewIconTextRenderer,wxDataViewRenderer)
return false;
} /* wxDataViewToggleRenderer::Render(void) */
+WXDataBrowserPropertyType wxDataViewToggleRenderer::GetPropertyType() const
+{
+ return kDataBrowserCheckboxType;
+}
+
IMPLEMENT_ABSTRACT_CLASS(wxDataViewToggleRenderer,wxDataViewRenderer)
// ---------------------------------------------------------
return false;
} /* wxDataViewProgressRenderer::Render(void) */
+WXDataBrowserPropertyType wxDataViewProgressRenderer::GetPropertyType() const
+{
+ return kDataBrowserProgressBarType;
+}
+
IMPLEMENT_ABSTRACT_CLASS(wxDataViewProgressRenderer,wxDataViewRenderer)
// ---------------------------------------------------------
return false;
} /* wxDataViewDateRenderer::Render(void) */
+WXDataBrowserPropertyType wxDataViewDateRenderer::GetPropertyType() const
+{
+ return kDataBrowserDateTimeType;
+}
+
IMPLEMENT_ABSTRACT_CLASS(wxDataViewDateRenderer,wxDataViewRenderer)
// ---------------------------------------------------------
// initialize column description:
dataViewColumnPtr->SetPropertyID(NewPropertyID);
columnDescription.propertyDesc.propertyID = NewPropertyID;
- columnDescription.propertyDesc.propertyType = dataViewColumnPtr->GetRenderer()->GetPropertyType();
+ columnDescription.propertyDesc.propertyType = DataBrowserPropertyType(dataViewColumnPtr->GetRenderer()->GetPropertyType());
columnDescription.propertyDesc.propertyFlags = kDataBrowserListViewSelectionColumn; // make the column selectable
if (dataViewColumnPtr->IsSortable())
columnDescription.propertyDesc.propertyFlags |= kDataBrowserListViewSortableColumn;
#endif
if (dataViewColumnPtr->GetRenderer()->GetMode() == wxDATAVIEW_CELL_EDITABLE)
columnDescription.propertyDesc.propertyFlags |= kDataBrowserPropertyIsEditable;
-#if MAC_OS_X_VERSION_MAX_ALLOWED > MAC_OS_X_VERSION_10_2
+
if ((columnDescription.propertyDesc.propertyType == kDataBrowserTextType) ||
(columnDescription.propertyDesc.propertyType == kDataBrowserIconAndTextType) ||
(columnDescription.propertyDesc.propertyType == kDataBrowserDateTimeType))
columnDescription.propertyDesc.propertyFlags |= kDataBrowserListViewTypeSelectColumn;
-#endif
+
#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_4
columnDescription.propertyDesc.propertyFlags |= kDataBrowserListViewNoGapForIconInHeaderButton;
#endif
#endif
} /* wxDataViewCtrl::AddChildrenLevel(wxDataViewItem const&) */
-wxDataViewColumn* wxDataViewCtrl::GetColumnPtr(DataBrowserPropertyID propertyID) const
+wxDataViewColumn* wxDataViewCtrl::GetColumnPtr(WXDataBrowserPropertyID propertyID) const
{
// variable definition:
ColumnPointerHashMapType::const_iterator Result(this->m_ColumnPointers.find(propertyID));