Add wxDataViewValueAdjuster

Add wxDataViewRenderer:: SetValueAdjuster() and a
wxDataViewValueAdjuster class. This can be used to customize rendering
of values depending on whether they are highlighted (selection) or not,
without having to implement an entire new custom renderer.
This commit is contained in:
Václav Slavík
2016-11-21 18:07:32 +01:00
committed by Václav Slavík
parent 13862ad8e6
commit ff1dba498e
9 changed files with 152 additions and 6 deletions

View File

@@ -2128,6 +2128,12 @@ wxEllipsizeMode wxDataViewRenderer::GetEllipsizeMode() const
return mode;
}
bool wxDataViewRenderer::IsHighlighted() const
{
return m_itemBeingRendered.IsOk() &&
GetOwner()->GetOwner()->IsSelected(m_itemBeingRendered);
}
void
wxDataViewRenderer::GtkOnTextEdited(const char *itempath, const wxString& str)
{
@@ -3078,6 +3084,7 @@ static void wxGtkTreeCellDataFunc( GtkTreeViewColumn *WXUNUSED(column),
return;
}
cell->GtkSetCurrentItem(item);
cell->PrepareForItem(wx_model, item, column);
}