Merge branch 'dvc-markup'

Add support for using markup in wxDataViewCtrl items.
This commit is contained in:
Vadim Zeitlin
2016-06-16 17:49:54 +02:00
14 changed files with 322 additions and 46 deletions

View File

@@ -702,9 +702,14 @@ void MyFrame::BuildDataViewCtrl(wxPanel* parent, unsigned int nPanel, unsigned l
m_ctrl[1]->AppendDateColumn("date",
MyListModel::Col_Date);
wxDataViewTextRenderer* const markupRenderer = new wxDataViewTextRenderer();
#if wxUSE_MARKUP
markupRenderer->EnableMarkup();
#endif // wxUSE_MARKUP
m_attributes =
new wxDataViewColumn("attributes",
new wxDataViewTextRenderer,
markupRenderer,
MyListModel::Col_TextWithAttr,
wxCOL_WIDTH_AUTOSIZE,
wxALIGN_RIGHT,

View File

@@ -436,7 +436,14 @@ void MyListModel::GetValueByRow( wxVariant &variant,
{
static const char *labels[5] =
{
"blue", "green", "red", "bold cyan", "default",
// These strings will look wrong without wxUSE_MARKUP, but
// it's just a sample, so we don't care.
"<span color=\"#87ceeb\">light</span> and "
"<span color=\"#000080\">dark</span> blue",
"<big>growing green</big>",
"<i>emphatic red</i>",
"<b>bold cyan</b>",
"<small><tt>dull default</tt></small>",
};
variant = labels[row % 5];