git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@53609
c3d73ce0-8a6f-49c7-b76d-
6d57e0e08775
int wxDataViewMainWindow::GetLineStart( unsigned int row ) const
{
int wxDataViewMainWindow::GetLineStart( unsigned int row ) const
{
+ const wxDataViewModel *model = GetOwner()->GetModel();
+
if (GetOwner()->GetWindowStyle() & wxDV_VARIABLE_LINE_HEIGHT)
{
// TODO make more efficient
if (GetOwner()->GetWindowStyle() & wxDV_VARIABLE_LINE_HEIGHT)
{
// TODO make more efficient
const wxDataViewTreeNode* node = GetTreeNodeByRow(r);
if (!node) return start;
const wxDataViewTreeNode* node = GetTreeNodeByRow(r);
if (!node) return start;
+ wxDataViewItem item = node->GetItem();
+
unsigned int cols = GetOwner()->GetColumnCount();
unsigned int col;
int height = 0;
unsigned int cols = GetOwner()->GetColumnCount();
unsigned int col;
int height = 0;
if (column->IsHidden())
continue; // skip it!
if (column->IsHidden())
continue; // skip it!
+ if ((col != 0) && model->IsContainer(item) && !model->HasContainerColumns(item))
+ continue; // skip it!
+
const wxDataViewRenderer *renderer = column->GetRenderer();
const wxDataViewRenderer *renderer = column->GetRenderer();
+ wxVariant value;
+ model->GetValue( value, item, column->GetModelColumn() );
+ wxDataViewRenderer *renderer2 = const_cast<wxDataViewRenderer*>(renderer);
+ renderer2->SetValue( value );
height = wxMax( height, renderer->GetSize().y );
}
height = wxMax( height, renderer->GetSize().y );
}
int wxDataViewMainWindow::GetLineAt( unsigned int y ) const
{
int wxDataViewMainWindow::GetLineAt( unsigned int y ) const
{
+ const wxDataViewModel *model = GetOwner()->GetModel();
+
if (GetOwner()->GetWindowStyle() & wxDV_VARIABLE_LINE_HEIGHT)
{
// TODO make more efficient
if (GetOwner()->GetWindowStyle() & wxDV_VARIABLE_LINE_HEIGHT)
{
// TODO make more efficient
return row + ((y-yy) / m_lineHeight);
}
return row + ((y-yy) / m_lineHeight);
}
+ wxDataViewItem item = node->GetItem();
+
unsigned int cols = GetOwner()->GetColumnCount();
unsigned int col;
int height = 0;
unsigned int cols = GetOwner()->GetColumnCount();
unsigned int col;
int height = 0;
const wxDataViewColumn *column = GetOwner()->GetColumn(col);
if (column->IsHidden())
continue; // skip it!
const wxDataViewColumn *column = GetOwner()->GetColumn(col);
if (column->IsHidden())
continue; // skip it!
+
+ if ((col != 0) && model->IsContainer(item) && !model->HasContainerColumns(item))
+ continue; // skip it!
const wxDataViewRenderer *renderer = column->GetRenderer();
const wxDataViewRenderer *renderer = column->GetRenderer();
+ wxVariant value;
+ model->GetValue( value, item, column->GetModelColumn() );
+ wxDataViewRenderer *renderer2 = const_cast<wxDataViewRenderer*>(renderer);
+ renderer2->SetValue( value );
height = wxMax( height, renderer->GetSize().y );
}
height = wxMax( height, renderer->GetSize().y );
}
int wxDataViewMainWindow::GetLineHeight( unsigned int row ) const
{
int wxDataViewMainWindow::GetLineHeight( unsigned int row ) const
{
+ const wxDataViewModel *model = GetOwner()->GetModel();
+
if (GetOwner()->GetWindowStyle() & wxDV_VARIABLE_LINE_HEIGHT)
{
wxASSERT( !IsVirtualList() );
if (GetOwner()->GetWindowStyle() & wxDV_VARIABLE_LINE_HEIGHT)
{
wxASSERT( !IsVirtualList() );
// wxASSERT( node );
if (!node) return m_lineHeight;
// wxASSERT( node );
if (!node) return m_lineHeight;
- wxDataViewItem item( node->GetItem() );
+ wxDataViewItem item = node->GetItem();
const wxDataViewColumn *column = GetOwner()->GetColumn(col);
if (column->IsHidden())
continue; // skip it!
const wxDataViewColumn *column = GetOwner()->GetColumn(col);
if (column->IsHidden())
continue; // skip it!
+
+ if ((col != 0) && model->IsContainer(item) && !model->HasContainerColumns(item))
+ continue; // skip it!
const wxDataViewRenderer *renderer = column->GetRenderer();
const wxDataViewRenderer *renderer = column->GetRenderer();
+ wxVariant value;
+ model->GetValue( value, item, column->GetModelColumn() );
+ wxDataViewRenderer *renderer2 = const_cast<wxDataViewRenderer*>(renderer);
+ renderer2->SetValue( value );
height = wxMax( height, renderer->GetSize().y );
}
height = wxMax( height, renderer->GetSize().y );
}