X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/c9c13e704341ab94ea4484329b7883ef99ad6812..66ddd8d2f2e58f51a0ddecf2581766b6f932254a:/src/gtk/dataview.cpp diff --git a/src/gtk/dataview.cpp b/src/gtk/dataview.cpp index ef2990497a..f7d910d2de 100644 --- a/src/gtk/dataview.cpp +++ b/src/gtk/dataview.cpp @@ -20,25 +20,18 @@ #include "wx/log.h" #include "wx/dcclient.h" #include "wx/sizer.h" + #include "wx/icon.h" + #include "wx/list.h" + #include "wx/settings.h" + #include "wx/crt.h" #endif #include "wx/stockitem.h" #include "wx/calctrl.h" #include "wx/popupwin.h" -#include "wx/icon.h" -#include "wx/list.h" #include "wx/listimpl.cpp" - #include "wx/gtk/private.h" -#include "wx/gtk/win_gtk.h" - -#include -#include -#include -#include - -#include //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- @@ -58,7 +51,7 @@ typedef struct _GtkWxTreeModel GtkWxTreeModel; //----------------------------------------------------------------------------- WX_DECLARE_LIST(wxDataViewItem, ItemList); -WX_DEFINE_LIST(ItemList); +WX_DEFINE_LIST(ItemList) class wxDataViewCtrlInternal { @@ -92,6 +85,9 @@ public: void SetSortColumn( int column ) { m_sort_column = column; } int GetSortColumn() { return m_sort_column; } + void SetDataViewSortColumn( wxDataViewColumn *column ) { m_dataview_sort_column = column; } + wxDataViewColumn *GetDataViewSortColumn() { return m_dataview_sort_column; } + bool IsSorted() { return (m_sort_column >= 0); } @@ -109,6 +105,7 @@ private: GtkWxTreeModel *m_gtk_model; wxDataViewCtrl *m_owner; GtkSortType m_sort_order; + wxDataViewColumn *m_dataview_sort_column; int m_sort_column; }; @@ -463,7 +460,8 @@ wxgtk_tree_model_get_column_type (GtkTreeModel *tree_model, gtype = G_TYPE_STRING; else { - wxFAIL_MSG( _T("non-string columns not supported yet") ); + gtype = G_TYPE_STRING; + // wxFAIL_MSG( _T("non-string columns not supported yet") ); } return gtype; @@ -614,6 +612,8 @@ gboolean wxgtk_tree_model_get_sort_column_id (GtkTreeSortable *sortabl return TRUE; } +wxDataViewColumn *gs_lastLeftClickHeader = NULL; + void wxgtk_tree_model_set_sort_column_id (GtkTreeSortable *sortable, gint sort_column_id, GtkSortType order) @@ -621,23 +621,29 @@ void wxgtk_tree_model_set_sort_column_id (GtkTreeSortable *sortable, GtkWxTreeModel *tree_model = (GtkWxTreeModel *) sortable; g_return_if_fail (GTK_IS_WX_TREE_MODEL (sortable) ); - if ((sort_column_id == (gint) tree_model->internal->GetSortColumn()) && - (order == tree_model->internal->GetSortOrder())) - return; + tree_model->internal->SetDataViewSortColumn( gs_lastLeftClickHeader ); - tree_model->internal->SetSortColumn( sort_column_id ); - - tree_model->internal->SetSortOrder( order ); + if ((sort_column_id != (gint) tree_model->internal->GetSortColumn()) || + (order != tree_model->internal->GetSortOrder())) + { + tree_model->internal->SetSortColumn( sort_column_id ); + tree_model->internal->SetSortOrder( order ); - gtk_tree_sortable_sort_column_changed (sortable); + gtk_tree_sortable_sort_column_changed (sortable); - tree_model->internal->GetDataViewModel()->Resort(); + tree_model->internal->GetDataViewModel()->Resort(); + } - wxDataViewCtrl *dv = tree_model->internal->GetOwner(); - wxDataViewEvent event( wxEVT_COMMAND_DATAVIEW_COLUMN_SORTED, dv->GetId() ); - // TODO event.SetDataViewColumn( column ); - event.SetModel( dv->GetModel() ); - dv->GetEventHandler()->ProcessEvent( event ); + if (gs_lastLeftClickHeader) + { + wxDataViewCtrl *dv = tree_model->internal->GetOwner(); + wxDataViewEvent event( wxEVT_COMMAND_DATAVIEW_COLUMN_SORTED, dv->GetId() ); + event.SetDataViewColumn( gs_lastLeftClickHeader ); + event.SetModel( dv->GetModel() ); + dv->GetEventHandler()->ProcessEvent( event ); + } + + gs_lastLeftClickHeader = NULL; } void wxgtk_tree_model_set_sort_func (GtkTreeSortable *sortable, @@ -907,6 +913,13 @@ gtk_wx_cell_renderer_render (GtkCellRenderer *renderer, GtkWxCellRenderer *wxrenderer = (GtkWxCellRenderer *) renderer; wxDataViewCustomRenderer *cell = wxrenderer->cell; + cell->window = window; + cell->widget = widget; + cell->background_area = (void*) background_area; + cell->cell_area = (void*) cell_area; + cell->expose_area = (void*) expose_area; + cell->flags = (int) flags; + GdkRectangle rect; gtk_wx_cell_renderer_get_size (renderer, widget, cell_area, &rect.x, @@ -975,8 +988,10 @@ gtk_wx_cell_renderer_activate( wxDataViewModel *model = cell->GetOwner()->GetOwner()->GetModel(); GtkTreePath *treepath = gtk_tree_path_new_from_string( path ); - // TODO - wxDataViewItem item; + + GtkTreeIter iter; + cell->GetOwner()->GetOwner()->GtkGetInternal()->get_iter( &iter, treepath ); + wxDataViewItem item( iter.user_data ); gtk_tree_path_free( treepath ); unsigned int model_col = cell->GetOwner()->GetModelColumn(); @@ -1256,6 +1271,7 @@ void wxDataViewRenderer::SetMode( wxDataViewCellMode mode ) break; } + // This value is most often ignored in GtkTreeView GValue gvalue = { 0, }; g_value_init( &gvalue, gtk_cell_renderer_mode_get_type() ); g_value_set_enum( &gvalue, gtkMode ); @@ -1418,7 +1434,7 @@ bool wxDataViewTextRenderer::SetValue( const wxVariant &value ) GValue gvalue = { 0, }; g_value_init( &gvalue, G_TYPE_STRING ); - g_value_set_string( &gvalue, wxGTK_CONV_FONT( tmp, GetOwner()->GetOwner()->GetFont() ) ); + g_value_set_string( &gvalue, wxGTK_CONV( tmp ) ); g_object_set_property( G_OBJECT(m_renderer), "text", &gvalue ); g_value_unset( &gvalue ); @@ -1430,8 +1446,7 @@ bool wxDataViewTextRenderer::GetValue( wxVariant &value ) const GValue gvalue = { 0, }; g_value_init( &gvalue, G_TYPE_STRING ); g_object_get_property( G_OBJECT(m_renderer), "text", &gvalue ); - wxString tmp = wxGTK_CONV_BACK_FONT( g_value_get_string( &gvalue ), - wx_const_cast(wxDataViewTextRenderer*, this)->GetOwner()->GetOwner()->GetFont() ); + wxString tmp = wxGTK_CONV_BACK( g_value_get_string( &gvalue ) ); g_value_unset( &gvalue ); value = tmp; @@ -1652,6 +1667,7 @@ wxDataViewCustomRenderer::wxDataViewCustomRenderer( const wxString &varianttype, wxDataViewRenderer( varianttype, mode, align ) { m_dc = NULL; + m_text_renderer = NULL; if (no_init) m_renderer = NULL; @@ -1659,6 +1675,41 @@ wxDataViewCustomRenderer::wxDataViewCustomRenderer( const wxString &varianttype, Init(mode, align); } +void wxDataViewCustomRenderer::RenderText( const wxString &text, int xoffset, wxRect cell, wxDC *dc, int state ) +{ +#if 0 + wxDataViewCtrl *view = GetOwner()->GetOwner(); + wxColour col = (state & wxDATAVIEW_CELL_SELECTED) ? + wxSystemSettings::GetColour(wxSYS_COLOUR_HIGHLIGHTTEXT) : + view->GetForegroundColour(); + dc->SetTextForeground(col); + dc->DrawText( text, cell.x + xoffset, cell.y + ((cell.height - dc->GetCharHeight()) / 2)); +#else + if (!m_text_renderer) + m_text_renderer = gtk_cell_renderer_text_new(); + + GValue gvalue = { 0, }; + g_value_init( &gvalue, G_TYPE_STRING ); + g_value_set_string( &gvalue, wxGTK_CONV( text ) ); + g_object_set_property( G_OBJECT(m_text_renderer), "text", &gvalue ); + g_value_unset( &gvalue ); + + ((GdkRectangle*) cell_area)->x += xoffset; + ((GdkRectangle*) cell_area)->width -= xoffset; + + gtk_cell_renderer_render( m_text_renderer, + window, + widget, + (GdkRectangle*) background_area, + (GdkRectangle*) cell_area, + (GdkRectangle*) expose_area, + (GtkCellRendererState) flags ); + + ((GdkRectangle*) cell_area)->x -= xoffset; + ((GdkRectangle*) cell_area)->width += xoffset; +#endif +} + bool wxDataViewCustomRenderer::Init(wxDataViewCellMode mode, int align) { GtkWxCellRenderer *renderer = (GtkWxCellRenderer *) gtk_wx_cell_renderer_new(); @@ -1678,6 +1729,9 @@ wxDataViewCustomRenderer::~wxDataViewCustomRenderer() { if (m_dc) delete m_dc; + + if (m_text_renderer) + gtk_object_sink( GTK_OBJECT(m_text_renderer) ); } wxDC *wxDataViewCustomRenderer::GetDC() @@ -1715,8 +1769,7 @@ wxDataViewProgressRenderer::wxDataViewProgressRenderer( const wxString &label, GValue gvalue = { 0, }; g_value_init( &gvalue, G_TYPE_STRING ); - // FIXME: font encoding support - g_value_set_string( &gvalue, wxGTK_CONV_SYS(m_label) ); + g_value_set_string( &gvalue, wxGTK_CONV(m_label) ); g_object_set_property( G_OBJECT(m_renderer), "text", &gvalue ); g_value_unset( &gvalue ); @@ -1860,8 +1913,7 @@ bool wxDataViewDateRenderer::Render( wxRect cell, wxDC *dc, int state ) { dc->SetFont( GetOwner()->GetOwner()->GetFont() ); wxString tmp = m_date.FormatDate(); - dc->DrawText( tmp, cell.x, cell.y ); - + RenderText( tmp, 0, cell, dc, state ); return true; } @@ -1922,23 +1974,30 @@ bool wxDataViewIconTextRenderer::GetValue( wxVariant &value ) const bool wxDataViewIconTextRenderer::Render( wxRect cell, wxDC *dc, int state ) { - dc->SetFont( GetOwner()->GetOwner()->GetFont() ); - const wxIcon &icon = m_value.GetIcon(); + int offset = 0; if (icon.IsOk()) { - dc->DrawIcon( icon, cell.x, cell.y ); // TODO centre - cell.x += icon.GetWidth()+4; + int yoffset = wxMax( 0, (cell.height - icon.GetHeight()) / 2 ); + dc->DrawIcon( icon, cell.x, cell.y + yoffset ); + offset = icon.GetWidth() + 4; } - dc->DrawText( m_value.GetText(), cell.x, cell.y ); + RenderText( m_value.GetText(), offset, cell, dc, state ); return true; } wxSize wxDataViewIconTextRenderer::GetSize() const { - return wxSize(80,16); // TODO + wxSize size; + if (m_value.GetIcon().IsOk()) + size.x = 4 + m_value.GetIcon().GetWidth(); + wxCoord x,y,d; + GetView()->GetTextExtent( m_value.GetText(), &x, &y, &d ); + size.x += x; + size.y = y+d; + return size; } wxControl* wxDataViewIconTextRenderer::CreateEditorCtrl( wxWindow *parent, wxRect labelRect, const wxVariant &value ) @@ -1966,6 +2025,8 @@ gtk_dataview_header_button_press_callback( GtkWidget *widget, if (gdk_event->button == 1) { + gs_lastLeftClickHeader = column; + wxDataViewCtrl *dv = column->GetOwner(); wxDataViewEvent event( wxEVT_COMMAND_DATAVIEW_COLUMN_HEADER_CLICK, dv->GetId() ); event.SetDataViewColumn( column ); @@ -1974,6 +2035,16 @@ gtk_dataview_header_button_press_callback( GtkWidget *widget, return FALSE; } + if (gdk_event->button == 3) + { + wxDataViewCtrl *dv = column->GetOwner(); + wxDataViewEvent event( wxEVT_COMMAND_DATAVIEW_COLUMN_HEADER_RIGHT_CLICK, dv->GetId() ); + event.SetDataViewColumn( column ); + event.SetModel( dv->GetModel() ); + if (dv->GetEventHandler()->ProcessEvent( event )) + return FALSE; + } + return FALSE; } @@ -1999,8 +2070,40 @@ static void wxGtkTreeCellDataFunc( GtkTreeViewColumn *column, wxDataViewItem item( (void*) iter->user_data ); + wxDataViewModel *wx_model = tree_model->internal->GetDataViewModel(); + + if (wx_model->IsContainer( item )) + { + if (wx_model->HasContainerColumns( item ) || (cell->GetOwner()->GetModelColumn() == 0)) + { + GValue gvalue = { 0, }; + g_value_init( &gvalue, G_TYPE_BOOLEAN ); + g_value_set_boolean( &gvalue, TRUE ); + g_object_set_property( G_OBJECT(renderer), "visible", &gvalue ); + g_value_unset( &gvalue ); + } + else + { + GValue gvalue = { 0, }; + g_value_init( &gvalue, G_TYPE_BOOLEAN ); + g_value_set_boolean( &gvalue, FALSE ); + g_object_set_property( G_OBJECT(renderer), "visible", &gvalue ); + g_value_unset( &gvalue ); + + return; + } + } + else + { + GValue gvalue = { 0, }; + g_value_init( &gvalue, G_TYPE_BOOLEAN ); + g_value_set_boolean( &gvalue, TRUE ); + g_object_set_property( G_OBJECT(renderer), "visible", &gvalue ); + g_value_unset( &gvalue ); + } + wxVariant value; - tree_model->internal->GetDataViewModel()->GetValue( value, item, cell->GetOwner()->GetModelColumn() ); + wx_model->GetValue( value, item, cell->GetOwner()->GetModelColumn() ); if (value.GetType() != cell->GetVariantType()) wxLogError( wxT("Wrong type, required: %s but: %s"), @@ -2011,7 +2114,7 @@ static void wxGtkTreeCellDataFunc( GtkTreeViewColumn *column, #if 0 wxListItemAttr attr; - tree_model->model->GetAttr( attr, cell->GetOwner()->GetModelColumn(), model_row ); + wx_model->GetAttr( item, attr, cell->GetOwner()->GetModelColumn() ); if (attr.HasBackgroundColour()) { @@ -2039,7 +2142,7 @@ static void wxGtkTreeCellDataFunc( GtkTreeViewColumn *column, IMPLEMENT_CLASS(wxDataViewColumn, wxDataViewColumnBase) #include -WX_DEFINE_LIST(wxDataViewColumnList); +WX_DEFINE_LIST(wxDataViewColumnList) wxDataViewColumn::wxDataViewColumn( const wxString &title, wxDataViewRenderer *cell, unsigned int model_column, int width, @@ -2360,6 +2463,7 @@ wxDataViewCtrlInternal::wxDataViewCtrlInternal( wxDataViewCtrl *owner, m_root = NULL; m_sort_order = GTK_SORT_ASCENDING; m_sort_column = -1; + m_dataview_sort_column = NULL; InitTree(); } @@ -2380,17 +2484,19 @@ void wxDataViewCtrlInternal::BuildBranch( wxGtkTreeModelNode *node ) { if (node->GetChildCount() == 0) { - wxDataViewItem child = m_wx_model->GetFirstChild( node->GetItem() ); - while (child.IsOk()) + wxDataViewItemArray children; + unsigned int count = m_wx_model->GetChildren( node->GetItem(), children ); + unsigned int pos; + for (pos = 0; pos < count; pos++) { + wxDataViewItem child = children[pos]; + if (m_wx_model->IsContainer( child )) node->AddNode( new wxGtkTreeModelNode( node, child, this ) ); else node->AddLeave( child.GetID() ); // Don't send any events here - - child = m_wx_model->GetNextSibling( child ); } } } @@ -2407,13 +2513,7 @@ bool wxDataViewCtrlInternal::ItemAdded( const wxDataViewItem &parent, const wxDa parent_node->AddNode( new wxGtkTreeModelNode( parent_node, item, this ) ); else parent_node->AddLeave( item.GetID() ); - - wxDataViewEvent event( wxEVT_COMMAND_DATAVIEW_MODEL_ITEM_ADDED, m_owner->GetId() ); - event.SetEventObject( m_owner ); - event.SetModel( m_owner->GetModel() ); - event.SetItem( item ); - m_owner->GetEventHandler()->ProcessEvent( event ); - + return true; } @@ -2422,18 +2522,12 @@ bool wxDataViewCtrlInternal::ItemDeleted( const wxDataViewItem &parent, const wx wxGtkTreeModelNode *parent_node = FindNode( parent ); parent_node->DeleteChild( item.GetID() ); - wxDataViewEvent event( wxEVT_COMMAND_DATAVIEW_MODEL_ITEM_DELETED, m_owner->GetId() ); - event.SetEventObject( m_owner ); - event.SetModel( m_owner->GetModel() ); - event.SetItem( item ); - m_owner->GetEventHandler()->ProcessEvent( event ); - return true; } bool wxDataViewCtrlInternal::ItemChanged( const wxDataViewItem &item ) { - wxDataViewEvent event( wxEVT_COMMAND_DATAVIEW_MODEL_ITEM_CHANGED, m_owner->GetId() ); + wxDataViewEvent event( wxEVT_COMMAND_DATAVIEW_ITEM_VALUE_CHANGED, m_owner->GetId() ); event.SetEventObject( m_owner ); event.SetModel( m_owner->GetModel() ); event.SetItem( item ); @@ -2444,10 +2538,11 @@ bool wxDataViewCtrlInternal::ItemChanged( const wxDataViewItem &item ) bool wxDataViewCtrlInternal::ValueChanged( const wxDataViewItem &item, unsigned int col ) { - wxDataViewEvent event( wxEVT_COMMAND_DATAVIEW_MODEL_VALUE_CHANGED, m_owner->GetId() ); + wxDataViewEvent event( wxEVT_COMMAND_DATAVIEW_ITEM_VALUE_CHANGED, m_owner->GetId() ); event.SetEventObject( m_owner ); event.SetModel( m_owner->GetModel() ); event.SetColumn( col ); + event.SetDataViewColumn( GetOwner()->GetColumn(col) ); event.SetItem( item ); m_owner->GetEventHandler()->ProcessEvent( event ); @@ -2456,11 +2551,6 @@ bool wxDataViewCtrlInternal::ValueChanged( const wxDataViewItem &item, unsigned bool wxDataViewCtrlInternal::Cleared() { - wxDataViewEvent event( wxEVT_COMMAND_DATAVIEW_MODEL_CLEARED, m_owner->GetId() ); - event.SetEventObject( m_owner ); - event.SetModel( m_owner->GetModel() ); - m_owner->GetEventHandler()->ProcessEvent( event ); - return true; } @@ -2562,11 +2652,12 @@ gboolean wxDataViewCtrlInternal::iter_children( GtkTreeIter *iter, GtkTreeIter * gboolean wxDataViewCtrlInternal::iter_has_child( GtkTreeIter *iter ) { wxDataViewItem item( (void*) iter->user_data ); + bool is_container = m_wx_model->IsContainer( item ); if (!is_container) return FALSE; - + wxGtkTreeModelNode *node = FindNode( iter ); BuildBranch( node ); @@ -2629,6 +2720,7 @@ wxDataViewCtrlInternal_FindNode( wxDataViewModel * model, wxGtkTreeModelNode *tr ItemList list; list.DeleteContents( true ); wxDataViewItem it( item ); + while( it.IsOk() ) { wxDataViewItem * pItem = new wxDataViewItem( it ); @@ -2678,7 +2770,7 @@ wxGtkTreeModelNode *wxDataViewCtrlInternal::FindNode( GtkTreeIter *iter ) if (!result) { - wxPrintf( "Not found %d\n", (int) iter->user_data ); + wxLogDebug( "Not found %p", iter->user_data ); char *crash = NULL; *crash = 0; } @@ -2695,7 +2787,7 @@ wxGtkTreeModelNode *wxDataViewCtrlInternal::FindNode( const wxDataViewItem &item if (!result) { - wxPrintf( "Not found %d\n", (int) item.GetID() ); + wxLogDebug( "Not found %p", item.GetID() ); char *crash = NULL; *crash = 0; } @@ -2787,7 +2879,7 @@ wxdataview_selection_changed_callback( GtkTreeSelection* selection, wxDataViewCt if (!GTK_WIDGET_REALIZED(dv->m_widget)) return; - wxDataViewEvent event( wxEVT_COMMAND_DATAVIEW_ITEM_SELECTED, dv->GetId() ); + wxDataViewEvent event( wxEVT_COMMAND_DATAVIEW_SELECTION_CHANGED, dv->GetId() ); event.SetItem( dv->GetSelection() ); event.SetModel( dv->GetModel() ); dv->GetEventHandler()->ProcessEvent( event ); @@ -2904,6 +2996,52 @@ void gtk_dataviewctrl_size_callback( GtkWidget *WXUNUSED(widget), } +//----------------------------------------------------------------------------- +// "motion_notify_event" +//----------------------------------------------------------------------------- + +static gboolean +gtk_dataview_motion_notify_callback( GtkWidget *widget, + GdkEventMotion *gdk_event, + wxDataViewCtrl *dv ) +{ + if (gdk_event->is_hint) + { + int x = 0; + int y = 0; + GdkModifierType state; + gdk_window_get_pointer(gdk_event->window, &x, &y, &state); + gdk_event->x = x; + gdk_event->y = y; + } + + GtkTreePath *path = NULL; + GtkTreeViewColumn *column = NULL; + gint cell_x = 0; + gint cell_y = 0; + if (gtk_tree_view_get_path_at_pos( + GTK_TREE_VIEW(dv->GtkGetTreeView()), + (int) gdk_event->x, (int) gdk_event->y, + &path, + &column, + &cell_x, + &cell_y)) + { + if (path) + { + GtkTreeIter iter; + dv->GtkGetInternal()->get_iter( &iter, path ); + + // wxPrintf( "mouse %d %d\n", (int) gdk_event->x, (int) gdk_event->y ); + + gtk_tree_path_free( path ); + } + } + + + return FALSE; +} + IMPLEMENT_DYNAMIC_CLASS(wxDataViewCtrl, wxDataViewCtrlBase) @@ -3008,6 +3146,9 @@ bool wxDataViewCtrl::Create(wxWindow *parent, wxWindowID id, g_signal_connect_after (m_treeview, "row-expanded", G_CALLBACK (wxdataview_row_expanded_callback), this); + g_signal_connect (m_treeview, "motion_notify_event", + G_CALLBACK (gtk_dataview_motion_notify_callback), this); + return true; } @@ -3058,6 +3199,19 @@ bool wxDataViewCtrl::AppendColumn( wxDataViewColumn *col ) return true; } +bool wxDataViewCtrl::PrependColumn( wxDataViewColumn *col ) +{ + if (!wxDataViewCtrlBase::PrependColumn(col)) + return false; + + m_cols.Insert( col ); + + gtk_tree_view_insert_column( GTK_TREE_VIEW(m_treeview), + GTK_TREE_VIEW_COLUMN(col->GetGtkHandle()), 0 ); + + return true; +} + unsigned int wxDataViewCtrl::GetColumnCount() const { return m_cols.GetCount(); @@ -3109,6 +3263,24 @@ bool wxDataViewCtrl::ClearColumns() return true; } +int wxDataViewCtrl::GetColumnPosition( const wxDataViewColumn *column ) const +{ + GtkTreeViewColumn *gtk_column = GTK_TREE_VIEW_COLUMN(column->GetConstGtkHandle()); + + GList *list = gtk_tree_view_get_columns( GTK_TREE_VIEW(m_treeview) ); + + gint pos = g_list_index( list, (gconstpointer) gtk_column ); + + g_list_free( list ); + + return pos; +} + +wxDataViewColumn *wxDataViewCtrl::GetSortingColumn() const +{ + return m_internal->GetDataViewSortColumn(); +} + void wxDataViewCtrl::Expand( const wxDataViewItem & item ) { GtkTreeIter iter;