当前位置: 首页>>代码示例>>C#>>正文


C# TreeView.RemoveColumn方法代码示例

本文整理汇总了C#中Gtk.TreeView.RemoveColumn方法的典型用法代码示例。如果您正苦于以下问题:C# TreeView.RemoveColumn方法的具体用法?C# TreeView.RemoveColumn怎么用?C# TreeView.RemoveColumn使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Gtk.TreeView的用法示例。


在下文中一共展示了TreeView.RemoveColumn方法的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: ClearColumns

 public static void ClearColumns(TreeView treeView)
 {
     treeView.Model=null;//Antes de llamar a RemoveColumn para evitar los Gtk.Critical
     TreeViewColumn[] treeViewColumns = treeView.Columns;
     foreach (TreeViewColumn treeViewColumn in treeViewColumns)
         treeView.RemoveColumn (treeViewColumn);
 }
开发者ID:rubenGan,项目名称:AD,代码行数:7,代码来源:TreeViewExtensions.cs

示例2: removeAllColumns

 private static void removeAllColumns(TreeView treeView)
 {
     //vaciar el array
     TreeViewColumn[] treeViewColumns = treeView.Columns;
     foreach (TreeViewColumn treeViewColumn in treeViewColumns)
         treeView.RemoveColumn (treeViewColumn);
 }
开发者ID:alvarorovira5,项目名称:ad,代码行数:7,代码来源:TreeViewHelper.cs

示例3: removeAllColumns

 private static void removeAllColumns(TreeView treeView)
 {
     TreeViewColumn[] treeViewColumns = treeView.Columns;
     foreach(TreeViewColumn treeViewColumn in treeViewColumns){
         treeView.RemoveColumn (treeViewColumn);
     }
 }
开发者ID:lcornag,项目名称:AD,代码行数:7,代码来源:TreeViewHelper.cs

示例4: ClearColumns

        public static void ClearColumns(TreeView treeView)
        {
            treeView.Model = null;

            TreeViewColumn[] treeViewColumns = treeView.Columns;
            foreach (TreeViewColumn treeViewColumn in treeViewColumns)
                treeView.RemoveColumn (treeViewColumn);
        }
开发者ID:esterdam,项目名称:ad,代码行数:8,代码来源:TreeViewExtensions.cs

示例5: Clear

 /**
  * Removes all columns from a GTK treeview. I didn't find a better way
  * to completely clear a treeview :-/.
  * @param treeview The pointer to the treeview widget we'd like to clear.
  **/
 public static void Clear(TreeView treeview)
 {
     #if DEBUG
     Console.WriteLine("TreeViewHelper.Clear");
     #endif
     if (treeview != null) {
         for (int i = treeview.Columns.Length - 1; i >= 0; i--) {
             treeview.RemoveColumn(treeview.Columns[i]);
         }
         treeview.Model = null;
     }
 }
开发者ID:kashifsoofi,项目名称:bygfoot,代码行数:17,代码来源:TreeViewHelper.cs

示例6: foreach

        /////////////////////////////////////////////////////////////////////////////////
        ///<summary>
        ///Build a tree with xml nodes
        ///</summary>
        ///<param name="node">xml node</param>
        ///<param name="parent">row parent</param>
        /*public void BuildTree (XmlNode node, TreeIter parent)
        {
            if (!node.HasChildNodes)
                return;
            else
            {
                XmlNodeList childNodeList = node.ChildNodes;
                foreach (XmlNode childNode in childNodeList)
                {
                    if (childNode.Name == "node")
                    {
                        // Creamos el diccionario con los valores de las columnas.
                        IDictionary colValues = new Hashtable();

                        XmlNodeList childs = childNode.ChildNodes;
                        int i = 0;
                        foreach (XmlNode child in childs)
                            if (child.Name == "column")
                                colValues[i++] = child.Attributes["value"].Value;

                        TreeIter newParent = InsertRow (parent, colValues);
                        BuildTree (childNode, newParent);
                    }
                }
            }
        } // build_tree
        */
        public static void RemoveColumns(TreeView tv)
        {
            TreeViewColumn[] columns = tv.Columns;
            foreach (TreeViewColumn column in columns)
                tv.RemoveColumn (column);
        }
开发者ID:BackupTheBerlios,项目名称:sharptranslator-svn,代码行数:39,代码来源:GuiTreeview.cs

示例7: removeColmns

 private static void removeColmns(TreeView treeView)
 {
     foreach (TreeViewColumn col in treeView.Columns) {
         treeView.RemoveColumn (col);
     }
 }
开发者ID:orgimeno,项目名称:ad,代码行数:6,代码来源:TreeViewHelper.cs

示例8: getRunsTreeView

        /// <summary>
        /// Gets the tree view.
        /// </summary>
        /// <returns>The tree view.</returns>
        private Gtk.TreeView getRunsTreeView(List<RunSession> sessions)
        {
            var treeView = new Gtk.TreeView ();

            // Create liststore
            var types = new System.Type[3];
            for (int typeNumber = 0; typeNumber < types.Length; ++typeNumber) {
                types [typeNumber] = typeof(string);
            }
            Gtk.ListStore listStore = new Gtk.ListStore (types);
            treeView.Model = listStore;

            // Delete existing columns
            while (treeView.Columns.Length > 0) {
                treeView.RemoveColumn (treeView.Columns [0]);
            }

            // Create started column
            var columnStarted = new Gtk.TreeViewColumn ();
            var cellStarted = new Gtk.CellRendererText ();
            columnStarted.Title = "Started (hh:mm:ss)";
            columnStarted.PackStart (cellStarted, true);
            cellStarted.Editable = false;
            cellStarted.Foreground = "black";
            cellStarted.Background = "light gray";
            columnStarted.AddAttribute (cellStarted, "text", 0);
            treeView.AppendColumn (columnStarted);

            // Create runned column
            var columnRunned = new Gtk.TreeViewColumn ();
            var cellRunned = new Gtk.CellRendererText ();
            columnRunned.Title = "Distance (m)";
            columnRunned.PackStart (cellRunned, true);
            cellRunned.Editable = false;
            cellRunned.Foreground = "black";
            cellRunned.Background = "light gray";
            columnRunned.AddAttribute (cellRunned, "text", 1);
            treeView.AppendColumn (columnRunned);

            // Create distance column
            var columnDistance = new Gtk.TreeViewColumn ();
            var cellDistance = new Gtk.CellRendererText ();
            columnDistance.Title = "Runned (hh:mm:ss)";
            columnDistance.PackStart (cellDistance, true);
            cellDistance.Editable = false;
            cellDistance.Foreground = "black";
            cellDistance.Background = "light gray";
            columnDistance.AddAttribute (cellDistance, "text", 2);
            treeView.AppendColumn (columnDistance);

            var row = new List<string> ();
            foreach (RunSession s in sessions) {
                // Insert data
                row.Clear ();
                ////////////////////////AKIIIIIIIIIII
                ///
                var date = this.runFilter.FromUnixTime (s.Start);
                Console.Write ("date "+date.ToString ());
                var hour = date.Hour + ":" + date.Minute + ":" + date.Second;
                var distance = s.Distance;
                var duration = TimeSpan.FromSeconds (s.Duration).ToString (@"hh\:mm\:ss");

                row.Insert (0, Convert.ToString (hour));
                row.Insert (1, Convert.ToString (distance));
                row.Insert (2, Convert.ToString (duration));

                listStore.AppendValues (row.ToArray ());
            }

            treeView.EnableGridLines = Gtk.TreeViewGridLines.Both;
            treeView.HeadersClickable = true;
            return treeView;
        }
开发者ID:diag1,项目名称:integration,代码行数:77,代码来源:MainWindowCore.cs

示例9: getStatsTreeView

        /// <summary>
        /// Gets the tree view.
        /// </summary>
        /// <returns>The tree view.</returns>
        private Gtk.TreeView getStatsTreeView(bool flag)
        {
            var treeView = new Gtk.TreeView ();

            try {
                // Create liststore
                var types = new System.Type[4];
                for(int typeNumber = 0; typeNumber < types.Length; ++typeNumber) {
                    types[ typeNumber ] = typeof( string );
                }
                Gtk.ListStore listStore = new Gtk.ListStore( types );
                treeView.Model = listStore;

                // Delete existing columns
                while(treeView.Columns.Length > 0) {
                    treeView.RemoveColumn( treeView.Columns[ 0 ] );
                }

                // Create index column
                var column = new Gtk.TreeViewColumn();
                var cell = new Gtk.CellRendererText();
                column.Title = "Stats";
                column.PackStart( cell, true );
                cell.Editable = false;
                cell.Foreground = "black";
                cell.Background = "light gray";
                column.AddAttribute( cell, "text", 0 );
                treeView.AppendColumn( column );

                // Create columns belonging to the document
                for(int colNum = 0; colNum < 1; ++colNum) {
                    column = new Gtk.TreeViewColumn();
                    column.Expand = true;
                    cell = new Gtk.CellRendererText();
                    column.PackStart( cell, true );
                    cell.Editable = false;
                    column.AddAttribute( cell, "text", colNum + 1 );

                    treeView.AppendColumn( column );
                }
                if(flag==true){
                    // Insert data
                    var row = new List<string>();
                    row.Clear();
                    row.Insert( 0, "Distance" );
                    row.Insert(1,fa.getDistTot());
                    listStore.AppendValues( row.ToArray() );

                    row = new List<string>();
                    row.Clear();
                    row.Insert( 0, "Steps" );
                    row.Insert(1,fa.getNumStpsTot());
                    listStore.AppendValues( row.ToArray() );

                    row = new List<string>();
                    row.Clear();
                    row.Insert( 0, "Hours" );
                    row.Insert(1,fa.getNumHourTot());
                    listStore.AppendValues( row.ToArray() );

                    row = new List<string>();
                    row.Clear();
                    row.Insert( 0, "Average speed" );
                    row.Insert(1,fa.getVelMedTot());
                    listStore.AppendValues( row.ToArray() );
                }
                else{
                    // Insert data
                    var row = new List<string>();
                    row.Clear();
                    row.Insert( 0, "Distance" );
                    row.Insert(1,fa.getDistDay(dia));
                    listStore.AppendValues( row.ToArray() );

                    row = new List<string>();
                    row.Clear();
                    row.Insert( 0, "Steps" );
                    row.Insert(1,fa.getNumStpsDay(dia));
                    listStore.AppendValues( row.ToArray() );

                    row = new List<string>();
                    row.Clear();
                    row.Insert( 0, "Hours" );
                    row.Insert(1,fa.getNumHourDay(dia));
                    listStore.AppendValues( row.ToArray() );

                    row = new List<string>();
                    row.Clear();
                    row.Insert( 0, "Average speed" );
                    row.Insert(1,fa.getVelMedDay(dia));
                    listStore.AppendValues( row.ToArray() );
                }

            } catch(Exception e) {
                Console.Write (e);
            }
//.........这里部分代码省略.........
开发者ID:diag1,项目名称:integration,代码行数:101,代码来源:MainWindowCore.cs

示例10: SetColumns

        private static void SetColumns(TreeView tv, bool waiting)
        {
            foreach (TreeViewColumn c in tv.Columns)
                tv.RemoveColumn(c);

            TreeViewColumn col;
            CellRendererText leftAlignedTR = new CellRendererText();
            leftAlignedTR.Xalign = 0.0f;
            leftAlignedTR.Ellipsize = Pango.EllipsizeMode.End;

            if (waiting) {
                col = new TreeViewColumn(string.Empty, leftAlignedTR, "text", 0);
                col.Resizable = true;
                col.Alignment = 0.0f;
                tv.AppendColumn(col);

            } else {
                col = new TreeViewColumn(string.Empty, new CellRendererPixbuf(), "pixbuf", 0);
                col.Resizable = false;
                col.Expand = false;
                tv.AppendColumn(col);

                col = new TreeViewColumn(S._("Drive"), leftAlignedTR, "text", 1);
                col.Resizable = true;
                col.Expand = true;
                col.Alignment = 0.0f;
                tv.AppendColumn(col);

                col = new TreeViewColumn(S._("Label"), leftAlignedTR, "text", 2);
                col.Resizable = true;
                col.Expand = true;
                col.Alignment = 0.0f;
                tv.AppendColumn(col);

                CellRendererText rightAlignedTR = new CellRendererText();
                rightAlignedTR.Xalign = 1.0f;

                col = new TreeViewColumn(S._("Size"), rightAlignedTR, "text", 3);
                col.Resizable = true;
                col.Expand = false;
                col.Alignment = 1.0f;
                tv.AppendColumn(col);
             }
        }
开发者ID:pulb,项目名称:basenji,代码行数:44,代码来源:DriveSelection.cs

示例11: removeAllColumns

 private static void removeAllColumns(TreeView treeView)
 {
     TreeViewColumn[] columnas = treeView.Columns;
     for (int i = 0; i < columnas.Length;i++)
         treeView.RemoveColumn (columnas[i]);
 }
开发者ID:Dorowk,项目名称:AD,代码行数:6,代码来源:TreeViewHelper.cs

示例12: ClearColumns

		public static void ClearColumns(TreeView treeView)
		{
			TreeViewColumn[] treeViewColumns = treeView.Columns;//para cada una: foreach
			foreach (TreeViewColumn treeViewColumn in treeViewColumns)
				treeView.RemoveColumn (treeViewColumn);
		}
开发者ID:sai1080,项目名称:AD,代码行数:6,代码来源:TreeViewExtensions.cs

示例13: refresh

 private void refresh(TreeView treeView,TreeViewHelper helper)
 {
     ListStore listStore=helper.ListStore;
     int fieldCountArticulo=helper.getFieldCount();
     for (int i=0;i<fieldCountArticulo;i++){//elimina columnas
         treeView.RemoveColumn(treeView.GetColumn(0));
     }
     listStore.Clear();
     listStore=helper.ListStore;
     helper.actualizar(helper.IDbCommand,listStore);
 }
开发者ID:nerea123,项目名称:ad,代码行数:11,代码来源:MainWindow.cs

示例14: Init

        /// <summary>
        /// Creates the number of columns needed.
        /// </summary>
        /// <param name="tv">
        /// A <see cref="Gtk.TreeView"/> that will be the base.
        /// </param>
        /// <param name="numCols">
        /// A <see cref="System.Int32"/> holding the number of columns.
        /// </param>
        /// <param name="mutability">
        /// A <see cref="System.Array"/> holding the mutability of columns.
        /// </param>
        protected void Init(Gtk.TreeView tv, int numCols, bool[] mutability)
        {
            this.numCols = numCols;
            this.tvTable = tv;
            this.headers = new string[ this.NumCols ];

            // Chk
            if ( this.NumCols < 1 ) {
                throw new ArgumentException( "number of cols must be > 0" );
            }

            // Create
            var types = new System.Type[ this.NumCols ];
            for(int i = 0; i < this.NumCols; ++i)
            {
                types[ i ] = typeof( string );
            }

            Gtk.ListStore listStore = new Gtk.ListStore( types );
            tvTable.Model = listStore;

            // Delete existing columns
            while(tvTable.Columns.Length > 0) {
                tvTable.RemoveColumn( tvTable.Columns[ 0 ] );
            }

            // Create index column
            var column = new Gtk.TreeViewColumn();
            var cell = new Gtk.CellRendererText();
            column.Title = "#";
            column.PackStart( cell, true );

            if ( !mutability[ 0 ] ) {
                cell.Editable = false;
                cell.Foreground = "black";
                cell.Background = "light gray";
            } else {
                cell.Editable = true;
            }

            column.AddAttribute( cell, "text", 0 );
            tvTable.AppendColumn( column );

            // Add columns
            for(int colNum = 0; colNum < this.NumCols -1; ++colNum)
            {
                column = new Gtk.TreeViewColumn();
                cell = new Gtk.CellRendererText();
                column.Title = this.Headers[ colNum ];
                column.PackStart( cell, true );

                cell.Editable = mutability[ colNum +1 ];
                if ( !mutability[ colNum +1 ] ) {
                    cell.Foreground = "black";
                    cell.Background = "light gray";
                }

                column.AddAttribute( cell, "text", colNum + 1 );
                cell.Edited += OnCellEdited;
                tvTable.AppendColumn( column );
            }
        }
开发者ID:Baltasarq,项目名称:GtkUtil,代码行数:74,代码来源:GtkTableTextView.cs


注:本文中的Gtk.TreeView.RemoveColumn方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。