+// ---------------------------------------------------------
+// wxDataViewIconTextRenderer
+// ---------------------------------------------------------
+
+IMPLEMENT_CLASS(wxDataViewIconTextRenderer, wxDataViewCustomRenderer)
+
+wxDataViewIconTextRenderer::wxDataViewIconTextRenderer(
+ const wxString &varianttype, wxDataViewCellMode mode, int align ) :
+ wxDataViewCustomRenderer( varianttype, mode, align )
+{
+ SetMode(mode);
+ SetAlignment(align);
+}
+
+wxDataViewIconTextRenderer::~wxDataViewIconTextRenderer()
+{
+}
+
+bool wxDataViewIconTextRenderer::SetValue( const wxVariant &value )
+{
+ m_value << value;
+ return true;
+}
+
+bool wxDataViewIconTextRenderer::GetValue( wxVariant& WXUNUSED(value) ) const
+{
+ return false;
+}
+
+bool wxDataViewIconTextRenderer::Render( wxRect cell, wxDC *dc, int state )
+{
+ int xoffset = 0;
+ const wxIcon &icon = m_value.GetIcon();
+ if (icon.IsOk())
+ {
+ dc->DrawIcon( icon, cell.x, cell.y + ((cell.height - icon.GetHeight()) / 2));
+ xoffset = icon.GetWidth()+4;
+ }
+
+ RenderText( m_value.GetText(), xoffset, cell, dc, state );
+
+ return true;
+}
+
+wxSize wxDataViewIconTextRenderer::GetSize() const
+{
+ const wxDataViewCtrl *view = GetView();
+ if (!m_value.GetText().empty())
+ {
+ int x,y;
+ view->GetTextExtent( m_value.GetText(), &x, &y );
+
+ if (m_value.GetIcon().IsOk())
+ x += m_value.GetIcon().GetWidth() + 4;
+ return wxSize( x, y );
+ }
+ return wxSize(80,20);
+}
+
+wxControl *
+wxDataViewIconTextRenderer::CreateEditorCtrl(wxWindow * WXUNUSED(parent),
+ wxRect WXUNUSED(labelRect),
+ const wxVariant& WXUNUSED(value))
+{
+ return NULL;
+}
+
+bool
+wxDataViewIconTextRenderer::GetValueFromEditorCtrl(wxControl* WXUNUSED(editor),
+ wxVariant& WXUNUSED(value))
+{
+ return false;
+}
+