{
public:
wxGtkTreeModelNode( wxGtkTreeModelNode* parent, const wxDataViewItem &item,
- wxDataViewCtrlInternal *internal )
+ wxDataViewCtrlInternal *internal )
{
m_parent = parent;
m_item = item;
break;
}
}
-
}
wxGtkTreeModelNode* GetParent()
wxGtkTreeModelChildren &GetChildren()
{ return m_children; }
- unsigned int GetChildCount() { return m_children.GetCount(); }
- unsigned int GetNodesCount() { return m_nodes.GetCount(); }
+ unsigned int GetChildCount() const { return m_children.GetCount(); }
+ unsigned int GetNodesCount() const { return m_nodes.GetCount(); }
wxDataViewItem &GetItem() { return m_item; }
wxDataViewCtrlInternal *GetInternal() { return m_internal; }
/* sortable */
static gboolean wxgtk_tree_model_get_sort_column_id (GtkTreeSortable *sortable,
gint *sort_column_id,
- GtkSortType *order);
+ GtkSortType *order);
static void wxgtk_tree_model_set_sort_column_id (GtkTreeSortable *sortable,
gint sort_column_id,
GtkSortType order);
GtkSelectionData *selection_data);
static gboolean wxgtk_tree_model_row_drop_possible (GtkTreeDragDest *drag_dest,
GtkTreePath *dest_path,
- GtkSelectionData *selection_data);
+ GtkSelectionData *selection_data);
static GObjectClass *list_parent_class = NULL;
wxString wxtype = wxtree_model->internal->GetDataViewModel()->GetColumnType( (unsigned int) index );
- wxPrintf( "get_column_type %s\n", wxtype );
-
if (wxtype == wxT("string"))
gtype = G_TYPE_STRING;
else
{
GtkWxTreeModel *wxtree_model = (GtkWxTreeModel *) tree_model;
- if (wxtree_model->stamp != iter->stamp)
- wxPrintf( "crash\n" );
+ //if (wxtree_model->stamp != iter->stamp)
+ // wxPrintf( "crash\n" );
+ // TODO: remove this code
g_return_val_if_fail (GTK_IS_WX_TREE_MODEL (wxtree_model), FALSE);
g_return_val_if_fail (wxtree_model->stamp == iter->stamp, FALSE);
{
GtkWxTreeModel *wxtree_model = (GtkWxTreeModel *) tree_model;
g_return_val_if_fail (GTK_IS_WX_TREE_MODEL (wxtree_model), FALSE);
-
+
if (iter != NULL)
g_return_val_if_fail (wxtree_model->stamp == iter->stamp, 0);
-
+
return wxtree_model->internal->iter_n_children( iter );
}
static gboolean
wxgtk_tree_model_row_drop_possible (GtkTreeDragDest *drag_dest,
GtkTreePath *dest_path,
- GtkSelectionData *selection_data)
+ GtkSelectionData *selection_data)
{
GtkWxTreeModel *wxtree_model = (GtkWxTreeModel *) drag_dest;
g_return_val_if_fail (GTK_IS_WX_TREE_MODEL (wxtree_model), FALSE);
gint WXUNUSED(sort_column_id),
GtkTreeIterCompareFunc func,
gpointer WXUNUSED(data),
- GtkDestroyNotify WXUNUSED(destroy) )
+ GtkDestroyNotify WXUNUSED(destroy))
{
g_return_if_fail (GTK_IS_WX_TREE_MODEL (sortable) );
g_return_if_fail (func != NULL);
}
-void wxgtk_tree_model_set_default_sort_func (GtkTreeSortable *sortable,
- GtkTreeIterCompareFunc func,
- gpointer WXUNUSED(data),
- GtkDestroyNotify WXUNUSED(destroy) )
+static void
+wxgtk_tree_model_set_default_sort_func (GtkTreeSortable *sortable,
+ GtkTreeIterCompareFunc func,
+ gpointer WXUNUSED(data),
+ GtkDestroyNotify WXUNUSED(destroy))
{
g_return_if_fail (GTK_IS_WX_TREE_MODEL (sortable) );
g_return_if_fail (func != NULL);
- wxPrintf( "wxgtk_tree_model_set_default_sort_func\n" );
+ //wxPrintf( "wxgtk_tree_model_set_default_sort_func\n" );
+ // TODO: remove this code
}
-gboolean wxgtk_tree_model_has_default_sort_func (GtkTreeSortable *sortable)
+static gboolean
+wxgtk_tree_model_has_default_sort_func (GtkTreeSortable *sortable)
{
g_return_val_if_fail (GTK_IS_WX_TREE_MODEL (sortable), FALSE );
wxRect renderrect( rect.x, rect.y, rect.width, rect.height );
wxWindowDC* dc = (wxWindowDC*) cell->GetDC();
wxWindowDCImpl *impl = (wxWindowDCImpl *) dc->GetImpl();
-
- // Reinitilise DC if drawing occurs into a different
+
+ // Reinitialize wxWindowDC's GDK window if drawing occurs into a different
// window such as a DnD drop window.
if (window != impl->m_gdkwindow)
{
const_cast<wxDataViewChoiceRenderer*>(this)->GetOwner()->GetOwner()->GetFont() );
g_value_unset( &gvalue );
value = temp;
- wxPrintf( "temp %s\n", temp );
+
+ //wxPrintf( "temp %s\n", temp );
+ // TODO: remove this code
}
else
#endif
if (!m_wx_model->IsVirtualListModel())
{
wxGtkTreeModelNode *parent_node = FindNode( parent );
+ wxASSERT_MSG(parent_node,
+ "Did you forget a call to ItemAdded()? The parent node is unknown to the wxGtkTreeModel");
+
if (m_wx_model->IsContainer( item ))
parent_node->AddNode( new wxGtkTreeModelNode( parent_node, item, this ) );
else
if (!m_wx_model->IsVirtualListModel())
{
wxGtkTreeModelNode *parent_node = FindNode( parent );
+ wxASSERT_MSG(parent_node,
+ "Did you forget a call to ItemAdded()? The parent node is unknown to the wxGtkTreeModel");
+
parent_node->DeleteChild( item.GetID() );
}
return FALSE;
wxGtkTreeModelNode *parent_node = FindNode( parent );
+ wxASSERT_MSG(parent_node,
+ "Did you forget a call to ItemAdded()? The parent node is unknown to the wxGtkTreeModel");
+
BuildBranch( parent_node );
if (parent_node->GetChildCount() == 0)
return FALSE;
wxGtkTreeModelNode *node = FindNode( iter );
+ wxASSERT_MSG(node,
+ "Did you forget a call to ItemAdded()? The iterator is unknown to the wxGtkTreeModel");
+
BuildBranch( node );
return (node->GetChildCount() > 0);
{
if (iter == NULL)
return m_root->GetChildCount();
-
+
wxDataViewItem item( (void*) iter->user_data );
if (!m_wx_model->IsContainer( item ))
return 0;
wxGtkTreeModelNode *parent_node = FindNode( iter );
+ wxASSERT_MSG(parent_node,
+ "Did you forget a call to ItemAdded()? The parent node is unknown to the wxGtkTreeModel");
+
BuildBranch( parent_node );
// wxPrintf( "iter_n_children %d\n", parent_node->GetChildCount() );
return FALSE;
wxGtkTreeModelNode *parent_node = FindNode( parent );
+ wxASSERT_MSG(parent_node,
+ "Did you forget a call to ItemAdded()? The parent node is unknown to the wxGtkTreeModel");
+
BuildBranch( parent_node );
// wxPrintf( "iter_nth_child %d\n", n );
wxGtkTreeModelNode *result = wxDataViewCtrlInternal_FindNode( m_wx_model, m_root, item );
+/*
if (!result)
{
wxLogDebug( "Not found %p", iter->user_data );
char *crash = NULL;
*crash = 0;
}
+ // TODO: remove this code
+*/
return result;
}
wxGtkTreeModelNode *result = wxDataViewCtrlInternal_FindNode( m_wx_model, m_root, item );
+/*
if (!result)
{
wxLogDebug( "Not found %p", item.GetID() );
char *crash = NULL;
*crash = 0;
}
+ // TODO: remove this code
+*/
return result;
}