Esempio n. 1
0
        internal virtual void RenderListItem(Gtk.TreeViewColumn column, Gtk.CellRenderer cell, Gtk.TreeModel model, Gtk.TreeIter iter)
        {
            CellRendererCustom mycell = (CellRendererCustom)cell;

            mycell.ItemIndex = int.Parse(model.GetPath(iter).ToString());
            mycell.Iter      = iter;
            mycell.Text      = this.Items[mycell.ItemIndex].ToString();
        }
Esempio n. 2
0
        //text cell function
        private void OnTextDataFunc(
            Gtk.TreeViewColumn col, Gtk.CellRenderer cell,
            Gtk.TreeModel model, Gtk.TreeIter iter
            )
        {
            //renderer node text
            HTreeNode          nod = getNodeFromIter(iter);
            CellRendererCustom c   = cell as CellRendererCustom;

            c.Text = nod.Text;
            c.Iter = iter;
        }
        public HSimpleList()
        {
            this.HeadersVisible         = false;
            TreeViewColumn firstColumn  = new Gtk.TreeViewColumn ();
            CellRendererCustom cell     = new CellRendererCustom( this );
            this.Reorderable            = true;
            firstColumn.PackStart (cell, true);

            firstColumn.SetCellDataFunc (cell, new Gtk.TreeCellDataFunc (RenderListItem));

            this.Model                  = store;
            this.AppendColumn( firstColumn );

            this.Items.OnItemAdded   += new ListAddEventHandler( this.on_item_added   );
            this.items.OnItemRemoved += new ListRemoveEventHandler( this.on_item_removed );
            this.items.OnItemUpdated += new ListUpdateEventHandler( this.on_item_updated );
        }
Esempio n. 4
0
        public HSimpleList()
        {
            this.HeadersVisible = false;
            TreeViewColumn     firstColumn = new Gtk.TreeViewColumn();
            CellRendererCustom cell        = new CellRendererCustom(this);

            this.Reorderable = true;
            firstColumn.PackStart(cell, true);

            firstColumn.SetCellDataFunc(cell, new Gtk.TreeCellDataFunc(RenderListItem));

            this.Model = store;
            this.AppendColumn(firstColumn);

            this.Items.OnItemAdded   += new ListAddEventHandler(this.on_item_added);
            this.items.OnItemRemoved += new ListRemoveEventHandler(this.on_item_removed);
            this.items.OnItemUpdated += new ListUpdateEventHandler(this.on_item_updated);
        }
 public HTreeView()
 {
     //create the text cell
     cell_text = new CellRendererCustom( this );
     //create model
     this.Model          = store;
     //default settings
     this.HeadersVisible = false;
     this.EnableSearch   = true;
     //
     AddBaseColumn();
     this.RowExpanded      += OnExpandRow;
     this.RowCollapsed     += OnCollapseRow;
     this.TestExpandRow    += OnTestExpandRow;
     this.TestCollapseRow  += OnTestCollapseRow;
     //add cell edited change listener
     cell_text.Edited      += OnTextEdited;
     //key listener
     this.KeyReleaseEvent  +=OnKeyReleased;
 }
Esempio n. 6
0
 public HTreeView()
 {
     //create the text cell
     cell_text = new CellRendererCustom(this);
     //create model
     this.Model = store;
     //default settings
     this.HeadersVisible = false;
     this.EnableSearch   = true;
     //
     AddBaseColumn();
     this.RowExpanded     += OnExpandRow;
     this.RowCollapsed    += OnCollapseRow;
     this.TestExpandRow   += OnTestExpandRow;
     this.TestCollapseRow += OnTestCollapseRow;
     //add cell edited change listener
     cell_text.Edited += OnTextEdited;
     //key listener
     this.KeyReleaseEvent += OnKeyReleased;
 }
Esempio n. 7
0
        public void constructColumns()
        {
            TreeViewColumn column = new Gtk.TreeViewColumn();

            column.Clickable = true;


            //create the text_cell
            text_cell         = new CellRendererCustom(this);
            text_cell.Edited += OnCellEdited;
            //
            chk_cell.Visible  = false;
            chk_cell.Toggled += OnCelltoggled;
            //add cells to column
            column.PackStart(chk_cell, false);
            column.PackStart(text_cell, true);
            //set data functions
            column.SetCellDataFunc(text_cell, new Gtk.TreeCellDataFunc(RenderListItem));
            column.SetCellDataFunc(chk_cell, new TreeCellDataFunc(OnChkDataFunc));
            //add the column
            AppendColumn(column);
        }
        public void constructColumns()
        {
            TreeViewColumn column        = new Gtk.TreeViewColumn ();
            column.Clickable             = true;

            //create the text_cell
            text_cell          = new CellRendererCustom( this );
            text_cell.Edited  += OnCellEdited;
            //
            chk_cell.Visible             = false;
            chk_cell.Toggled            += OnCelltoggled;
            //add cells to column
            column.PackStart( chk_cell , false );
            column.PackStart( text_cell, true  );
            //set data functions
            column.SetCellDataFunc( text_cell, new Gtk.TreeCellDataFunc ( RenderListItem ) );
            column.SetCellDataFunc( chk_cell , new TreeCellDataFunc     ( OnChkDataFunc  ) );
            //add the column
            AppendColumn( column );
        }
Esempio n. 9
0
        private void RenderListItem(Gtk.TreeViewColumn column, Gtk.CellRenderer cell, Gtk.TreeModel model, Gtk.TreeIter iter)
        {
            CellRendererCustom mycell = (CellRendererCustom)cell;

            mycell.ItemIndex = int.Parse(model.GetPath(iter).ToString());
        }