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


C# Gtk.TreeViewColumn类代码示例

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


TreeViewColumn类属于Gtk命名空间,在下文中一共展示了TreeViewColumn类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: SetupTreeView

    private void SetupTreeView()
    {
        {
            var cell = new CellRendererText();
            var column = new TreeViewColumn("Customer ID", cell, "text", (int)Column.CustomerID);
            column.SortColumnId = (int)Column.CustomerID;
            this.treeview1.AppendColumn(column);
        }

        {
            var cell = new CellRendererText();
            var column = new TreeViewColumn("First Name", cell, "text", (int)Column.FirstName);
            column.SortColumnId = (int)Column.FirstName;
            this.treeview1.AppendColumn(column);
        }

        {
            var cell = new CellRendererText();
            var column = new TreeViewColumn("Last Name", cell, "text", (int)Column.LastName);
            column.SortColumnId = (int)Column.LastName;
            this.treeview1.AppendColumn(column);
        }

        this.store = this.SetupTreeViewModel();
        this.treeview1.Model = this.store;
        this.treeview1.RulesHint = true;
    }
开发者ID:jholland918,项目名称:gtk-sharp-samples,代码行数:27,代码来源:MainWindow.cs

示例2: CombineEntryConfigurationsPanelWidget

		public CombineEntryConfigurationsPanelWidget (MultiConfigItemOptionsDialog dlg)
		{
			Build ();
			
			configData = dlg.ConfigurationData;
			
			store = new TreeStore (typeof(object), typeof(string));
			configsList.Model = store;
			configsList.HeadersVisible = true;
			store.SetSortColumnId (1, SortType.Ascending);
			
			TreeViewColumn col = new TreeViewColumn ();
			CellRendererText sr = new CellRendererText ();
			col.PackStart (sr, true);
			col.AddAttribute (sr, "text", 1);
			col.Title = GettextCatalog.GetString ("Configuration");
			col.SortColumnId = 1;
			configsList.AppendColumn (col);

			foreach (ItemConfiguration cc in configData.Configurations)
				store.AppendValues (cc, cc.Id);

			addButton.Clicked += new EventHandler (OnAddConfiguration);
			removeButton.Clicked += new EventHandler (OnRemoveConfiguration);
			renameButton.Clicked += new EventHandler (OnRenameConfiguration);
			copyButton.Clicked += new EventHandler (OnCopyConfiguration);
		}
开发者ID:pabloescribanoloza,项目名称:monodevelop,代码行数:27,代码来源:SolutionItemConfigurationsPanel.cs

示例3: CollectionsTreeView

	public CollectionsTreeView ()
		: base ()
	{
		Gtk.TreeViewColumn NameCol = new Gtk.TreeViewColumn ();
		Gtk.CellRendererText NameRenderer = new Gtk.CellRendererText ();
		NameRenderer.Editable = true;
		NameRenderer.Edited += new Gtk.EditedHandler (CollectionNameEditedHandler);
		NameCol.Title = "Name";
		NameCol.PackStart (NameRenderer, true);
		NameCol.AddAttribute (NameRenderer, "markup", 0);
		NameCol.SortColumnId = 0;
		NameCol.Resizable = true;
		NameCol.FixedWidth = 150;
		NameCol.Sizing = Gtk.TreeViewColumnSizing.Autosize;
		this.AppendColumn (NameCol);

		Gtk.TreeViewColumn CountCol = new Gtk.TreeViewColumn ();
		Gtk.CellRendererText CountRenderer = new Gtk.CellRendererText ();
		CountCol.Title = "Images";
		CountCol.PackStart (CountRenderer, true);
		CountCol.AddAttribute (CountRenderer, "text", 1);
		CountCol.SortColumnId = 1;
		CountCol.Resizable = true;
		CountCol.Sizing = Gtk.TreeViewColumnSizing.Autosize;
		this.AppendColumn (CountCol);

		store = new CollectionsTreeStore ();
		this.Model = store;
	}
开发者ID:emtees,项目名称:old-code,代码行数:29,代码来源:CollectionsTreeView.cs

示例4: ContentDirectoryInfo

        public ContentDirectoryInfo (RemoteContentDirectory contentDirectory)
        {
            if (contentDirectory == null) {
                throw new ArgumentNullException ("contentDirectory");
            }

            this.content_directry = contentDirectory;
            this.store = new TreeStore (typeof (ObjectRow));
            var objects = new TreeView ();
            var column = new TreeViewColumn ();
            var cell = new CellRendererText ();
            column.PackStart (cell, true);
            column.SetCellDataFunc (cell, RenderObject);
            column.Title = "Objects";
            objects.AppendColumn (column);
            objects.Selection.Changed += HandleObjectsSelectionChanged;
            objects.RowExpanded += HandleObjectsRowExpanded;
            objects.Model = store;

            var root = contentDirectory.GetRootObject ();
            store.AppendValues (new ObjectRow (root));
            TreeIter iter;
            store.GetIterFirst (out iter);
            store.AppendValues (iter, loading);

            Add (objects);
        }
开发者ID:pacificIT,项目名称:mono-upnp,代码行数:27,代码来源:ContentDirectoryInfo.cs

示例5: Initialize

		public void Initialize (TreeView treeView)
		{
			var column = new TreeViewColumn ();

			var toggleRenderer = new CellRendererToggle ();
			toggleRenderer.Toggled += ToggleRendererToggled;
			column.PackStart (toggleRenderer, false);
			column.AddAttribute (toggleRenderer, "active", 0);

			var pixbufRenderer = new CellRendererImage ();
			column.PackStart (pixbufRenderer, false);
			column.AddAttribute (pixbufRenderer, "image", 1);

			var textRenderer = new CellRendererText ();
			column.PackStart (textRenderer, true);
			column.AddAttribute (textRenderer, "text", 2);
			column.Expand = true;

			treeView.AppendColumn (column);
			foreach (object obj in GetValidMembers ()) {
				var member = obj as ISymbol;
				if (member != null) {
					Store.AppendValues (false, ImageService.GetIcon (member.GetStockIcon (), IconSize.Menu), member.ToDisplayString (Ambience.LabelFormat), member);
					continue;
				}

				var tuple = obj as Tuple<ISymbol, bool>;
				if (tuple != null) {
					Store.AppendValues (false, ImageService.GetIcon (tuple.Item1.GetStockIcon (), IconSize.Menu), tuple.Item1.ToDisplayString (Ambience.LabelFormat), tuple);
					continue;
				}
			}
			
			treeView.Model = store;
		}
开发者ID:pabloescribanoloza,项目名称:monodevelop,代码行数:35,代码来源:AbstractGenerateAction.cs

示例6: ImportSymbolSelectionDlg

        public ImportSymbolSelectionDlg(INode[] nodes)
        {
            this.Build ();

            SetResponseSensitive(ResponseType.Ok, true);
            SetResponseSensitive(ResponseType.Cancel, true);

            buttonOk.GrabFocus();
            Modal = true;
            WindowPosition = Gtk.WindowPosition.CenterOnParent;

            // Init name column
            var nameCol = new TreeViewColumn();
            var textRenderer = new CellRendererText();
            nameCol.PackStart(textRenderer, true);
            nameCol.AddAttribute(textRenderer, "text", 0);
            list.AppendColumn(nameCol);

            // Init list model
            var nodeStore = new ListStore(typeof(string),typeof(INode));
            list.Model = nodeStore;

            // Fill list
            foreach (var n in nodes)
                if(n!=null)
                    nodeStore.AppendValues(n.ToString(), n);

            // Select first result
            TreeIter iter;
            if(nodeStore.GetIterFirst(out iter))
                list.Selection.SelectIter(iter);
        }
开发者ID:robik,项目名称:Mono-D,代码行数:32,代码来源:ImportSymbolSelectionDlg.cs

示例7: MergeDialog

		public MergeDialog (GitRepository repo, bool rebasing)
		{
			this.Build ();

			this.UseNativeContextMenus ();

			this.repo = repo;
			this.rebasing = rebasing;

			store = new TreeStore (typeof(string), typeof(Xwt.Drawing.Image), typeof (string), typeof(string));
			tree.Model = store;

			var crp = new CellRendererImage ();
			var col = new TreeViewColumn ();
			col.PackStart (crp, false);
			col.AddAttribute (crp, "image", 1);
			var crt = new CellRendererText ();
			col.PackStart (crt, true);
			col.AddAttribute (crt, "text", 2);
			tree.AppendColumn (col);

			tree.Selection.Changed += HandleTreeSelectionChanged;

			if (rebasing) {
				labelHeader.Text = GettextCatalog.GetString ("Select the branch to which to rebase:");
				checkStage.Label = GettextCatalog.GetString ("Stash/unstash local changes before/after rebasing");
				buttonOk.Label = GettextCatalog.GetString ("Rebase");
			}

			checkStage.Active = true;

			Fill ();
		}
开发者ID:pabloescribanoloza,项目名称:monodevelop,代码行数:33,代码来源:MergeDialog.cs

示例8: WebDeployLaunchDialog

		public WebDeployLaunchDialog (AspNetAppProject project)
		{
			this.Build();
			
			this.project = project;
			
			//set up the sort order 
			targetStore.SetSortFunc (LISTCOL_Text, delegate (TreeModel m, TreeIter a, TreeIter b) {
				return string.Compare ((string) m.GetValue (a, LISTCOL_Text), (string) m.GetValue (b, LISTCOL_Text));
			});
			targetStore.SetSortColumnId (LISTCOL_Text, SortType.Ascending);
			
			//set up the view
			targetView.Model = targetStore;
			targetView.HeadersVisible = false;
			
			CellRendererToggle toggleRenderer = new CellRendererToggle ();
			toggleRenderer.Activatable = true;
			toggleRenderer.Xpad = 6;
			TreeViewColumn checkCol = new TreeViewColumn ("", toggleRenderer, "active", LISTCOL_Checked);
			checkCol.Expand = false;
			targetView.AppendColumn (checkCol);
			toggleRenderer.Toggled += HandleToggle;
			
			CellRendererText textRenderer = new CellRendererText ();
			textRenderer.WrapMode = Pango.WrapMode.WordChar;
			targetView.AppendColumn ("", textRenderer, "markup", LISTCOL_Text);
			
			fillStore ();
		}
开发者ID:Kalnor,项目名称:monodevelop,代码行数:30,代码来源:WebDeployLaunchDialog.cs

示例9: ProjectFileSelectorDialog

		public ProjectFileSelectorDialog (Project project, string defaultFilterName, string defaultFilterPattern, string [] buildActions)
		{
			this.project = project;
			this.defaultFilter = new SelectFileDialogFilter (defaultFilterName, defaultFilterPattern ?? "*");
			this.buildActions = buildActions;
			
			this.Build();
			
			projBuf = ImageService.GetIcon (project.StockIcon, IconSize.Menu);
			dirClosedBuf = ImageService.GetIcon (MonoDevelop.Ide.Gui.Stock.ClosedFolder, IconSize.Menu);
			dirOpenBuf = ImageService.GetIcon (MonoDevelop.Ide.Gui.Stock.OpenFolder, IconSize.Menu);
			
			TreeViewColumn projectCol = new TreeViewColumn ();
			projectCol.Title = GettextCatalog.GetString ("Project Folders");
			var pixRenderer = new CellRendererImage ();
			CellRendererText txtRenderer = new CellRendererText ();
			projectCol.PackStart (pixRenderer, false);
			projectCol.PackStart (txtRenderer, true);
			projectCol.SetCellDataFunc (pixRenderer, new TreeCellDataFunc (PixDataFunc));
			projectCol.SetCellDataFunc (txtRenderer, new TreeCellDataFunc (TxtDataFunc));
			projectTree.Model = dirStore;
			projectTree.AppendColumn (projectCol);
			TreeIter projectIter = dirStore.AppendValues ("", FilePath.Empty);
			InitDirs (projectIter);
			projectTree.ExpandAll ();
			projectTree.RowActivated += delegate {
				fileList.GrabFocus ();
			};
			projectTree.KeyPressEvent += ProjectListKeyPressEvent;
			
			TreeViewColumn fileCol = new TreeViewColumn ();
			var filePixRenderer = new CellRendererImage ();
			fileCol.Title = GettextCatalog.GetString ("Files");
			fileCol.PackStart (filePixRenderer, false);
			fileCol.PackStart (txtRenderer, true);
			fileCol.AddAttribute (filePixRenderer, "image", 1);
			fileCol.SetCellDataFunc (txtRenderer, new TreeCellDataFunc (TxtFileDataFunc));
			fileList.Model = fileStore;
			fileList.AppendColumn (fileCol);
			fileList.RowActivated += delegate {
				TreeIter iter;
				if (fileList.Selection.GetSelected (out iter))
					Respond (ResponseType.Ok);
			};
			fileList.KeyPressEvent += FileListKeyPressEvent;
			fileList.KeyReleaseEvent += FileListKeyReleaseEvent;
			
			TreeIter root;
			if (dirStore.GetIterFirst (out root))
				projectTree.Selection.SelectIter (root);
			
			UpdateFileList (null, null);
			
			projectTree.Selection.Changed += UpdateFileList;
			fileList.Selection.Changed += UpdateSensitivity;
			
			
			this.DefaultResponse = ResponseType.Cancel;
			this.Modal = true;
		}
开发者ID:pabloescribanoloza,项目名称:monodevelop,代码行数:60,代码来源:ProjectFileSelectorDialog.cs

示例10: Initialize

		public void Initialize (Gtk.TreeView treeView)
		{
			TreeViewColumn column = new TreeViewColumn ();

			CellRendererToggle toggleRenderer = new CellRendererToggle ();
			toggleRenderer.Toggled += ToggleRendererToggled;
			column.PackStart (toggleRenderer, false);
			column.AddAttribute (toggleRenderer, "active", 0);

			var pixbufRenderer = new CellRendererPixbuf ();
			column.PackStart (pixbufRenderer, false);
			column.AddAttribute (pixbufRenderer, "pixbuf", 1);

			CellRendererText textRenderer = new CellRendererText ();
			column.PackStart (textRenderer, true);
			column.AddAttribute (textRenderer, "text", 2);
			column.Expand = true;

			treeView.AppendColumn (column);
			Ambience ambience = AmbienceService.GetAmbienceForFile (options.Document.FileName);
			foreach (IBaseMember member in GetValidMembers ()) {
				Store.AppendValues (false, ImageService.GetPixbuf (member.StockIcon, IconSize.Menu), ambience.GetString (member, member.MemberType == MonoDevelop.Projects.Dom.MemberType.Parameter ? OutputFlags.IncludeParameterName : OutputFlags.ClassBrowserEntries), member);
			}
			
			treeView.Model = store;
		}
开发者ID:yayanyang,项目名称:monodevelop,代码行数:26,代码来源:AbstractGenerateAction.cs

示例11: PythonOptionsWidget

		public PythonOptionsWidget ()
		{
			this.Build();
			
			// Python paths
			m_PathsListStore = new ListStore (typeof (string));
			m_PathsTreeView.Model = this.m_PathsListStore;
			m_PathsTreeView.HeadersVisible = false;
			TreeViewColumn column = new TreeViewColumn ();
			CellRendererText ctext = new CellRendererText ();
			column.PackStart (ctext, true);
			column.AddAttribute (ctext, "text", 0);
			m_PathsTreeView.AppendColumn (column);
			m_PathsTreeView.Selection.Changed += delegate {
				this.m_RemovePathButton.Sensitive = m_PathsTreeView.Selection.CountSelectedRows () == 1;
			};
			
			// Setup Python Runtime Version
			m_RuntimeListStore = new ListStore (typeof (string), typeof (Type));
			m_RuntimeCombo.Model = this.m_RuntimeListStore;
			m_RuntimeListStore.AppendValues ("Python 2.5", typeof (Python25Runtime));
			m_RuntimeListStore.AppendValues ("Python 2.6", typeof (Python26Runtime));
			m_RuntimeListStore.AppendValues ("Python 2.7", typeof (Python27Runtime));
			m_RuntimeListStore.AppendValues ("IronPython", typeof (IronPythonRuntime));
			
			m_RuntimeCombo.Changed += delegate {
				m_RuntimeFileEntry.Path = String.Empty;
			};
		}
开发者ID:Kalnor,项目名称:monodevelop,代码行数:29,代码来源:PythonOptionsWidget.cs

示例12: Initialize

		public void Initialize (Gtk.TreeView treeView)
		{
			TreeViewColumn column = new TreeViewColumn ();

			CellRendererToggle toggleRenderer = new CellRendererToggle ();
			toggleRenderer.Toggled += ToggleRendererToggled;
			column.PackStart (toggleRenderer, false);
			column.AddAttribute (toggleRenderer, "active", 0);

			var pixbufRenderer = new CellRendererPixbuf ();
			column.PackStart (pixbufRenderer, false);
			column.AddAttribute (pixbufRenderer, "pixbuf", 1);

			CellRendererText textRenderer = new CellRendererText ();
			column.PackStart (textRenderer, true);
			column.AddAttribute (textRenderer, "text", 2);
			column.Expand = true;

			treeView.AppendColumn (column);
			Ambience ambience = AmbienceService.GetAmbienceForFile (options.Document.FileName);
			foreach (object obj in GetValidMembers ()) {
				var member = obj as IEntity;
				if (member != null) {
					Store.AppendValues (false, ImageService.GetPixbuf (member.GetStockIcon (), IconSize.Menu), ambience.GetString (member, OutputFlags.ClassBrowserEntries), member);
					continue;
				}
				
				var variable = obj as IVariable;
				if (variable != null)
					Store.AppendValues (false, ImageService.GetPixbuf (variable.GetStockIcon (), IconSize.Menu), variable.Name, variable);
				
			}
			
			treeView.Model = store;
		}
开发者ID:gary-b,项目名称:monodevelop,代码行数:35,代码来源:AbstractGenerateAction.cs

示例13: CombineConfigurationPanelWidget

		public CombineConfigurationPanelWidget (MultiConfigItemOptionsDialog parentDialog)
		{
			Build ();
			
			this.parentDialog = parentDialog;
			store = new ListStore (typeof(object), typeof(string), typeof(bool));
			configsList.Model = store;
			configsList.HeadersVisible = true;
			
			TreeViewColumn col = new TreeViewColumn ();
			CellRendererText sr = new CellRendererText ();
			col.PackStart (sr, true);
			col.Expand = true;
			col.AddAttribute (sr, "text", 1);
			col.Title = GettextCatalog.GetString ("Solution Item");
			configsList.AppendColumn (col);
			col.SortColumnId = 1;
			
			CellRendererToggle tt = new CellRendererToggle ();
			tt.Activatable = true;
			tt.Toggled += new ToggledHandler (OnBuildToggled);
			configsList.AppendColumn (GettextCatalog.GetString ("Build"), tt, "active", 2);
			
			CellRendererComboBox comboCell = new CellRendererComboBox ();
			comboCell.Changed += new ComboSelectionChangedHandler (OnConfigSelectionChanged);
			configsList.AppendColumn (GettextCatalog.GetString ("Configuration"), comboCell, new TreeCellDataFunc (OnSetConfigurationsData));
			store.SetSortColumnId (1, SortType.Ascending);
		}
开发者ID:Kalnor,项目名称:monodevelop,代码行数:28,代码来源:CombineConfigurationPanel.cs

示例14: ContextActionPanelWidget

		public ContextActionPanelWidget (string mimeType)
		{
			this.mimeType = mimeType;
			this.Build ();
			
			var col = new TreeViewColumn ();
			
			var togRender = new CellRendererToggle ();
			togRender.Toggled += delegate(object o, ToggledArgs args) {
				TreeIter iter;
				if (!treeStore.GetIterFromString (out iter, args.Path)) 
					return;
				bool enabled = (bool)treeStore.GetValue (iter, 1);
				treeStore.SetValue (iter, 1, !enabled);
			};
			col.PackStart (togRender, false);
			col.AddAttribute (togRender, "active", 1);
			
			var textRender = new CellRendererText ();
			col.PackStart (textRender, true);
			col.AddAttribute (textRender, "text", 0);
			
			treeviewContextActions.AppendColumn (col);
			treeviewContextActions.HeadersVisible = false;
			treeviewContextActions.Model = treeStore;
			
			FillTreeStore ();
			treeviewContextActions.Selection.Changed += HandleTreeviewContextActionsSelectionChanged;
		}
开发者ID:yayanyang,项目名称:monodevelop,代码行数:29,代码来源:ContextActionPanelWidget.cs

示例15: TUploads

 public TUploads(Gtk.TreeView tvUploads, CInterfaceGateway in_krnGateway)
 {
     krnGateway = in_krnGateway;
     Gtk.TreeViewColumn tvc = new TreeViewColumn ("Name",new CellRendererText(),"text",0);
     tvUploads.AppendColumn (tvc);
     tvc.SortColumnId = 0;
     tvc = new TreeViewColumn ("File name",new CellRendererText(),"text",1);
     tvUploads.AppendColumn (tvc);
     tvc.SortColumnId = 1;
     tvc = new TreeViewColumn ("Speed",new CellRendererText(),"text",2);
     tvUploads.AppendColumn (tvc);
     tvc.SortColumnId = 2;
     tvc = new TreeViewColumn ("Position",new CellRendererText(),"text",3);
     tvUploads.AppendColumn (tvc);
     tvc.SortColumnId = 3;
     tvc = new TreeViewColumn ("Downloaded",new CellRendererText(),"text",4);
     tvUploads.AppendColumn (tvc);
     tvc.SortColumnId = 4;
     tvc = new TreeViewColumn ("Uploaded",new CellRendererText(),"text",5);
     tvUploads.AppendColumn (tvc);
     tvc.SortColumnId = 5;
     tvc = new TreeViewColumn ("Progress",new CellRendererText(),"text",6);
     tvUploads.AppendColumn (tvc);
     tvc.SortColumnId = 6;
     tvc = new TreeViewColumn ("Software",new CellRendererText(),"text",7);
     tvUploads.AppendColumn (tvc);
     tvc.SortColumnId = 7;
     tvc = new TreeViewColumn ("Version",new CellRendererText(),"text",8);
     tvUploads.AppendColumn (tvc);
     tvc.SortColumnId = 8;
 }
开发者ID:elnomade,项目名称:hathi,代码行数:31,代码来源:Uploads.cs


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