Implement wxDataViewCtrl::SetRowHeight() for wxGTK.

Also document that this method can only be used to increase the row height
compared to the default, not to make it smaller.

See #12749.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@67920 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2011-06-11 23:56:44 +00:00
parent 16a7d8a5a5
commit 0f4a54a655
3 changed files with 36 additions and 4 deletions

View File

@@ -1333,6 +1333,17 @@ gtk_wx_cell_renderer_get_size (GtkCellRenderer *renderer,
wxSize size = cell->GetSize();
wxDataViewCtrl * const ctrl = cell->GetOwner()->GetOwner();
// Uniform row height, if specified, overrides the value returned by the
// renderer.
if ( !ctrl->HasFlag(wxDV_VARIABLE_LINE_HEIGHT) )
{
const int uniformHeight = ctrl->GTKGetUniformRowHeight();
if ( uniformHeight > 0 )
size.y = uniformHeight;
}
int xpad, ypad;
gtk_cell_renderer_get_padding(renderer, &xpad, &ypad);
int calc_width = xpad * 2 + size.x;
@@ -4473,6 +4484,8 @@ void wxDataViewCtrl::Init()
m_internal = NULL;
m_cols.DeleteContents( true );
m_uniformRowHeight = -1;
}
bool wxDataViewCtrl::Create(wxWindow *parent,
@@ -5103,6 +5116,12 @@ wxDataViewCtrl::GetItemRect(const wxDataViewItem& WXUNUSED(item),
return wxRect();
}
bool wxDataViewCtrl::SetRowHeight(int rowHeight)
{
m_uniformRowHeight = rowHeight;
return true;
}
void wxDataViewCtrl::DoSetExpanderColumn()
{
gtk_tree_view_set_expander_column( GTK_TREE_VIEW(m_treeview),