Option for variable line heights (MSW and GTK+ sofar)

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@53604 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Robert Roebling
2008-05-16 12:37:32 +00:00
parent 2a23042680
commit 344ed1f386
6 changed files with 227 additions and 88 deletions

View File

@@ -3620,7 +3620,10 @@ bool wxDataViewCtrl::Create(wxWindow *parent, wxWindowID id,
#ifdef __WXGTK26__
if (!gtk_check_version(2,6,0))
gtk_tree_view_set_fixed_height_mode( GTK_TREE_VIEW(m_treeview), TRUE );
{
bool fixed = (style & wxDV_VARIABLE_LINE_HEIGHT) == 0;
gtk_tree_view_set_fixed_height_mode( GTK_TREE_VIEW(m_treeview), fixed );
}
#endif
if (style & wxDV_MULTIPLE)
@@ -3712,6 +3715,14 @@ bool wxDataViewCtrl::AssociateModel( wxDataViewModel *model )
if (!wxDataViewCtrlBase::AssociateModel( model ))
return false;
#ifdef __WXGTK26__
if (!gtk_check_version(2,6,0))
{
bool fixed = (((GetWindowStyle() & wxDV_VARIABLE_LINE_HEIGHT) == 0) || (model->IsVirtualListModel()));
gtk_tree_view_set_fixed_height_mode( GTK_TREE_VIEW(m_treeview), fixed );
}
#endif
GtkWxTreeModel *gtk_model = wxgtk_tree_model_new();
m_internal = new wxDataViewCtrlInternal( this, model, gtk_model );
gtk_model->internal = m_internal;