virtual bool HasDefaultCompare() const { return false; }
// internal
+ virtual bool IsListModel() const { return false; }
virtual bool IsVirtualListModel() const { return false; }
protected:
{
return GetAttrByRow( GetRow(item), col, attr );
}
+
+ virtual bool IsListModel() const { return true; }
};
// ---------------------------------------------------------
const wxString &name = wxT("wxdataviewctrlmainwindow") );
virtual ~wxDataViewMainWindow();
+ bool IsList() const { return GetOwner()->GetModel()->IsListModel(); }
bool IsVirtualList() const { return m_root == NULL; }
// notifications from wxDataViewModel
}
indent = 0;
- if (!IsVirtualList())
+ if (!IsList())
{
wxDataViewTreeNode *node = GetTreeNodeByRow(row);
indent = GetOwner()->GetIndent() * node->GetIndentLevel();
// deal with the expander
int indent = 0;
- if ((!IsVirtualList()) && (col == expander))
+ if ((!IsList()) && (col == expander))
{
// Calculate the indent first
indent = GetOwner()->GetIndent() * node->GetIndentLevel();
bool wxDataViewMainWindow::IsExpanded( unsigned int row ) const
{
- if (IsVirtualList())
+ if (IsList())
return false;
wxDataViewTreeNode * node = GetTreeNodeByRow(row);
bool wxDataViewMainWindow::HasChildren( unsigned int row ) const
{
- if (IsVirtualList())
+ if (IsList())
return false;
wxDataViewTreeNode * node = GetTreeNodeByRow(row);
void wxDataViewMainWindow::Expand( unsigned int row )
{
- if (IsVirtualList())
+ if (IsList())
return;
wxDataViewTreeNode * node = GetTreeNodeByRow(row);
void wxDataViewMainWindow::Collapse(unsigned int row)
{
- if (IsVirtualList())
+ if (IsList())
return;
wxDataViewTreeNode *node = GetTreeNodeByRow(row);
// to get the correct x position where the actual text is
int indent = 0;
int row = GetRowByItem(item);
- if (!IsVirtualList() && (column == 0 || GetOwner()->GetExpanderColumn() == column) )
+ if (!IsList() && (column == 0 || GetOwner()->GetExpanderColumn() == column) )
{
wxDataViewTreeNode* node = GetTreeNodeByRow(row);
indent = GetOwner()->GetIndent() * node->GetIndentLevel();
// Add the process for tree expanding/collapsing
case WXK_LEFT:
{
- if (IsVirtualList())
+ if (IsList())
break;
wxDataViewTreeNode* node = GetTreeNodeByRow(m_currentRow);
// Test whether the mouse is hovered on the tree item button
bool hoverOverExpander = false;
- if ((!IsVirtualList()) && (GetOwner()->GetExpanderColumn() == col))
+ if ((!IsList()) && (GetOwner()->GetExpanderColumn() == col))
{
wxDataViewTreeNode * node = GetTreeNodeByRow(current);
if( node!=NULL && node->HasChildren() )
GtkTreeModelFlags wxDataViewCtrlInternal::get_flags()
{
- if (m_wx_model->IsVirtualListModel())
- return GTK_TREE_MODEL_LIST_ONLY;
- else
- return GTK_TREE_MODEL_ITERS_PERSIST;
+ int flags = 0;
+
+ if ( m_wx_model->IsListModel() )
+ flags |= GTK_TREE_MODEL_LIST_ONLY;
+
+ if ( !m_wx_model->IsVirtualListModel() )
+ flags |= GTK_TREE_MODEL_ITERS_PERSIST;
+
+ return GtkTreeModelFlags(flags);
}
gboolean wxDataViewCtrlInternal::get_iter( GtkTreeIter *iter, GtkTreePath *path )