if (m_classicalMusicIsKnownToControl)
{
// notify control
- wxDataViewItem child( child_node->GetID() );
- wxDataViewItem parent( m_classical->GetID() );
+ wxDataViewItem child( (void*) child_node->GetID() );
+ wxDataViewItem parent( (void*) m_classical->GetID() );
ItemAdded( parent, child );
}
}
virtual wxDataViewItem GetFirstChild( const wxDataViewItem &parent ) const
{
if (parent.GetID() == 0)
- return wxDataViewItem( m_root->GetID() );
+ return wxDataViewItem( (void*) m_root->GetID() );
MyMusicModelNode *node = FindNode( parent );
}
MyMusicModelNode *first_child = node->GetChildren().Item( 0 );
- return wxDataViewItem( first_child->GetID() );
+ return wxDataViewItem( (void*) first_child->GetID() );
}
virtual wxDataViewItem GetNextSibling( const wxDataViewItem &item ) const
return wxDataViewItem(0);
node = parent->GetChildren().Item( pos+1 );
- return wxDataViewItem( node->GetID() );
+ return wxDataViewItem( (void*) node->GetID() );
}
private:
MyMusicModelNode *FindNodeRec( MyMusicModelNode *node, const wxDataViewItem &item ) const
{
- if (node->GetID() == item.GetID())
+ if (node->GetID() == (wxUint32) item.GetID())
return node;
size_t count = node->GetChildCount();
{
wxVariant variant;
g_value_init( value, G_TYPE_STRING );
- wxDataViewItem item( (wxUint32) iter->user_data );
+ wxDataViewItem item( (void*) iter->user_data );
model->GetValue( variant, item, (unsigned int) column );
g_value_set_string( value, variant.GetString().utf8_str() );
gboolean wxGtkTreeModel::iter_next( GtkTreeIter *iter )
{
- wxDataViewItem item( (wxUint32) iter->user_data );
+ wxDataViewItem item( (void*) iter->user_data );
item = m_wx_model->GetNextSibling( item );
if (!item.IsOk())
return FALSE;
gboolean wxGtkTreeModel::iter_children( GtkTreeIter *iter, GtkTreeIter *parent )
{
- wxDataViewItem item( (wxUint32) parent->user_data );
+ wxDataViewItem item( (void*) parent->user_data );
if (!m_wx_model->HasChildren( item ))
return FALSE;
gboolean wxGtkTreeModel::iter_has_child( GtkTreeIter *iter )
{
- wxDataViewItem item( (wxUint32) iter->user_data );
+ wxDataViewItem item( (void*) iter->user_data );
return m_wx_model->HasChildren( item );
}
gint wxGtkTreeModel::iter_n_children( GtkTreeIter *iter )
{
- wxDataViewItem item( (wxUint32) iter->user_data );
+ wxDataViewItem item( (void*) iter->user_data );
if (!m_wx_model->HasChildren( item ))
return 0;
gboolean wxGtkTreeModel::iter_nth_child( GtkTreeIter *iter, GtkTreeIter *parent, gint n )
{
- wxUint32 id = 0;
- if (parent) id = (wxUint32) parent->user_data;
+ void* id = NULL;
+ if (parent) id = (void*) parent->user_data;
wxDataViewItem item( id );
if (!m_wx_model->HasChildren( item ))
gboolean wxGtkTreeModel::iter_parent( GtkTreeIter *iter, GtkTreeIter *child )
{
- wxDataViewItem item( (wxUint32) child->user_data );
+ wxDataViewItem item( (void*) child->user_data );
wxGtkTreeModelNode *node = FindNode( child );
node = node->GetParent();
if (!iter)
return m_root;
- wxDataViewItem item( (wxUint32) iter->user_data );
+ wxDataViewItem item( (void*) iter->user_data );
wxGtkTreeModelNode *result = wxGtkTreeModel_FindNode( m_root, item );
// wxDataViewListModel *model = cell->GetOwner()->GetOwner()->GetModel();
GtkTreePath *treepath = gtk_tree_path_new_from_string( path );
- unsigned int model_row = (unsigned int)gtk_tree_path_get_indices (treepath)[0];
+ // TODO
+ wxDataViewItem item;
gtk_tree_path_free( treepath );
- cell->StartEditing( model_row, renderrect );
+ cell->StartEditing( item, renderrect );
return NULL;
}
wxDataViewModel *model = cell->GetOwner()->GetOwner()->GetModel();
GtkTreePath *treepath = gtk_tree_path_new_from_string( path );
- unsigned int model_row = (unsigned int)gtk_tree_path_get_indices (treepath)[0];
+ // TODO
+ wxDataViewItem item;
gtk_tree_path_free( treepath );
unsigned int model_col = cell->GetOwner()->GetModelColumn();
bool ret = false;
// activated by <ENTER>
- if (cell->Activate( renderrect, model, model_col, model_row ))
+ if (cell->Activate( renderrect, model, item, model_col ))
ret = true;
return ret;
bool ret = false;
if (button_event->button == 1)
{
- if (cell->LeftClick( pt, renderrect, model, model_col, model_row ))
+ if (cell->LeftClick( pt, renderrect, model, item, model_col ))
ret = true;
// TODO: query system double-click time
if (button_event->time - wxrenderer->last_click < 400)
- if (cell->Activate( renderrect, model, model_col, model_row ))
+ if (cell->Activate( renderrect, model, item, model_col ))
ret = true;
}
if (button_event->button == 3)
{
- if (cell->RightClick( pt, renderrect, model, model_col, model_row ))
+ if (cell->RightClick( pt, renderrect, model, item, model_col ))
ret = true;
}
wxDataViewModel *model = cell->GetOwner()->GetOwner()->GetModel();
GtkTreePath *path = gtk_tree_path_new_from_string( arg1 );
- unsigned int model_row = (unsigned int)gtk_tree_path_get_indices (path)[0];
+ GtkTreeIter iter;
+ // TODO
+ wxDataViewItem item;
gtk_tree_path_free( path );
unsigned int model_col = cell->GetOwner()->GetModelColumn();
- model->SetValue( value, model_col, model_row );
- model->ValueChanged( model_col, model_row );
+ model->SetValue( value, item, model_col );
+ model->ValueChanged( item, model_col );
}
IMPLEMENT_CLASS(wxDataViewTextRenderer, wxDataViewRenderer)
wxDataViewModel *model = cell->GetOwner()->GetOwner()->GetModel();
GtkTreePath *gtk_path = gtk_tree_path_new_from_string( path );
- unsigned int model_row = (unsigned int)gtk_tree_path_get_indices (gtk_path)[0];
+ // TODO
+ wxDataViewItem item;
gtk_tree_path_free( gtk_path );
unsigned int model_col = cell->GetOwner()->GetModelColumn();
- model->SetValue( value, model_col, model_row );
- model->ValueChanged( model_col, model_row );
+ model->SetValue( value, item, model_col );
+ model->ValueChanged( item, model_col );
}
IMPLEMENT_CLASS(wxDataViewToggleRenderer, wxDataViewRenderer)
wxDataViewRenderer *cell = (wxDataViewRenderer*) data;
- wxDataViewItem item( (wxUint32) iter->user_data );
+ wxDataViewItem item( (void*) iter->user_data );
wxVariant value;
tree_model->model->GetDataViewModel()->GetValue( value, item, cell->GetOwner()->GetModelColumn() );
GtkTreeIter iter;
if (gtk_tree_selection_get_selected( selection, NULL, &iter ))
{
- wxDataViewItem item( (wxUint32) iter.user_data );
+ wxDataViewItem item( (void*) iter.user_data );
return item;
}
}