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


C# TreeStore.SetSortColumnId方法代码示例

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


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

示例1: GacReferencePanel

        public GacReferencePanel(SelectReferenceDialog selectDialog)
        {
            this.selectDialog = selectDialog;

            store = new TreeStore (typeof (string), typeof (string), typeof(string), typeof(bool), typeof(string));
            treeView = new TreeView (store);

            TreeViewColumn firstColumn = new TreeViewColumn ();
            firstColumn.Title = GettextCatalog.GetString ("Reference Name");
            CellRendererToggle tog_render = new CellRendererToggle ();
            tog_render.Toggled += new Gtk.ToggledHandler (AddReference);
            firstColumn.PackStart (tog_render, false);
            firstColumn.AddAttribute (tog_render, "active", 3);

            CellRendererText text_render = new CellRendererText ();
            firstColumn.PackStart (text_render, true);
            firstColumn.AddAttribute (text_render, "text", 0);

            treeView.AppendColumn (firstColumn);
            treeView.AppendColumn (GettextCatalog.GetString ("Version"), new CellRendererText (), "text", 1);
            // FIXME: this seems useless
            //treeView.AppendColumn (GettextCatalog.GetString ("Path"), new CellRendererText (), "text", 2);

            store.SetSortColumnId (0, SortType.Ascending);
            store.SetSortFunc (0, new TreeIterCompareFunc (SortTree));

            PrintCache();
            ScrolledWindow sc = new ScrolledWindow ();
            sc.ShadowType = Gtk.ShadowType.In;
            sc.Add (treeView);
            this.PackStart (sc, true, true, 0);
            ShowAll ();
            BorderWidth = 6;
        }
开发者ID:slluis,项目名称:monodevelop-prehistoric,代码行数:34,代码来源:GacReferencePanel.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: MenuCategorySelectorDialog

		public MenuCategorySelectorDialog()
		{
			this.Build();
			
			store = new TreeStore (typeof(string), typeof(string), typeof(bool));
			tree.Model = store;
			tree.HeadersVisible = false;
			
			TreeViewColumn col = new TreeViewColumn ();
			Gtk.CellRendererToggle tog = new CellRendererToggle ();
			tog.Toggled += OnToggled;
			col.PackStart (tog, false);
			
			Gtk.CellRendererText crt = new CellRendererText ();
			col.PackStart (crt, true);
			
			col.AddAttribute (crt, "markup", 1);
			col.AddAttribute (tog, "active", 2);
			tree.AppendColumn (col);
			
			XmlDocument doc = DesktopEntry.GetDesktopInfo ();
			categories = doc.DocumentElement ["Categories"];
			
			store.DefaultSortFunc = new Gtk.TreeIterCompareFunc (CompareNodes);
			store.SetSortColumnId (/* GTK_TREE_SORTABLE_DEFAULT_SORT_COLUMN_ID */ -1, Gtk.SortType.Ascending);
			
			store.AppendValues ("__other", Mono.Unix.Catalog.GetString ("Additional categories"), false);
			
			insertedCats = new Hashtable ();
			insertedCats ["__other"] = null;
			
			foreach (XmlElement cat in categories.SelectNodes ("Category"))
				InsertCategory (cat);
			
			insertedCats = null;
			doc = null;
		}
开发者ID:Kalnor,项目名称:monodevelop,代码行数:37,代码来源:MenuCategorySelectorDialog.cs

示例4: ProjectReferencePanel

        public ProjectReferencePanel(SelectReferenceDialog selectDialog)
            : base(false, 6)
        {
            this.selectDialog = selectDialog;

            store = new TreeStore (typeof (string), typeof (string), typeof(Project), typeof(bool), typeof(Gdk.Pixbuf));
            store.SetSortColumnId (0, SortType.Ascending);
            treeView = new TreeView (store);

            TreeViewColumn firstColumn = new TreeViewColumn ();

            firstColumn.Title = GettextCatalog.GetString ("Project");
            CellRendererToggle tog_render = new CellRendererToggle ();
            tog_render.Xalign = 0;
            tog_render.Toggled += new Gtk.ToggledHandler (AddReference);
            firstColumn.PackStart (tog_render, false);
            firstColumn.AddAttribute (tog_render, "active", 3);

            Gtk.CellRendererPixbuf pix_render = new Gtk.CellRendererPixbuf ();
            firstColumn.PackStart (pix_render, false);
            firstColumn.AddAttribute (pix_render, "pixbuf", 4);

            CellRendererText text_render = new CellRendererText ();
            firstColumn.PackStart (text_render, true);
            firstColumn.AddAttribute (text_render, "text", 0);

            treeView.AppendColumn (firstColumn);
            treeView.AppendColumn (GettextCatalog.GetString ("Directory"), new CellRendererText (), "text", 1);

            ScrolledWindow sc = new ScrolledWindow ();
            sc.ShadowType = Gtk.ShadowType.In;
            sc.Add (treeView);
            PackStart (sc, true, true, 0);
            ShowAll ();
            BorderWidth = 6;
        }
开发者ID:slluis,项目名称:monodevelop-prehistoric,代码行数:36,代码来源:ProjectReferencePanel.cs

示例5: ChangeSetView

		public ChangeSetView ()
		{
			ShadowType = Gtk.ShadowType.In;
			filelist = new FileTreeView();
			filelist.Selection.Mode = SelectionMode.Multiple;
			
			Add (filelist);
			HscrollbarPolicy = PolicyType.Automatic;
			VscrollbarPolicy = PolicyType.Automatic;
			filelist.RowActivated += OnRowActivated;
			filelist.DiffLineActivated += OnDiffLineActivated;
			
			CellRendererToggle cellToggle = new CellRendererToggle();
//			cellToggle.Toggled += new ToggledHandler(OnCommitToggledHandler);
			var crc = new CellRendererIcon ();
			crc.StockId = "vc-comment";
			colCommit = new TreeViewColumn ();
			colCommit.Spacing = 2;
			colCommit.Widget = new Gtk.Image ("vc-commit", Gtk.IconSize.Menu);
			colCommit.Widget.Show ();
			colCommit.PackStart (cellToggle, false);
			colCommit.PackStart (crc, false);
			colCommit.AddAttribute (cellToggle, "active", ColCommit);
			colCommit.AddAttribute (cellToggle, "visible", ColShowToggle);
			colCommit.AddAttribute (crc, "visible", ColShowComment);
			colCommit.Visible = false;
			
			CellRendererText crt = new CellRendererText();
			var crp = new CellRendererPixbuf ();
			TreeViewColumn colStatus = new TreeViewColumn ();
			colStatus.Title = GettextCatalog.GetString ("Status");
			colStatus.PackStart (crp, false);
			colStatus.PackStart (crt, true);
			colStatus.AddAttribute (crp, "pixbuf", ColIcon);
			colStatus.AddAttribute (crp, "visible", ColShowStatus);
			colStatus.AddAttribute (crt, "text", ColStatus);
			colStatus.AddAttribute (crt, "foreground", ColStatusColor);
			
			TreeViewColumn colFile = new TreeViewColumn ();
			colFile.Title = GettextCatalog.GetString ("File");
			colFile.Spacing = 2;
			crp = new CellRendererPixbuf ();
			diffRenderer = new CellRendererDiff ();
			colFile.PackStart (crp, false);
			colFile.PackStart (diffRenderer, true);
			colFile.AddAttribute (crp, "pixbuf", ColIconFile);
			colFile.AddAttribute (crp, "visible", ColShowStatus);
			colFile.SetCellDataFunc (diffRenderer, new TreeCellDataFunc (SetDiffCellData));
			
			filelist.AppendColumn(colStatus);
			filelist.AppendColumn(colCommit);
			filelist.AppendColumn(colFile);
			
			filestore = new TreeStore (typeof (Gdk.Pixbuf), typeof (string), typeof (string[]), typeof(bool), typeof(bool), typeof(string), typeof(bool), typeof (bool), typeof(Gdk.Pixbuf), typeof(bool), typeof(string));
			filelist.Model = filestore;
			filelist.TestExpandRow += new Gtk.TestExpandRowHandler (OnTestExpandRow);
			
			ShowAll();
			
			filelist.Selection.Changed += new EventHandler(OnCursorChanged);
			
			filelist.HeadersClickable = true;
			filestore.SetSortFunc (0, CompareNodes);
			colStatus.SortColumnId = 0;
			filestore.SetSortFunc (1, CompareNodes);
			colCommit.SortColumnId = 1;
			filestore.SetSortFunc (2, CompareNodes);
			colFile.SortColumnId = 2;
			
			filestore.SetSortColumnId (2, Gtk.SortType.Ascending);
		}
开发者ID:LogosBible,项目名称:monodevelop,代码行数:71,代码来源:ChangeSetView.cs

示例6: InitializeComponents

		void InitializeComponents ()
		{
			iconView = new TemplateView ();
			iconView.ShowAll ();
			boxTemplates.PackStart (iconView, true, true, 0);
			
			catStore = new TreeStore (typeof(string), typeof(List<Category>), typeof(List<TemplateItem>));

			TreeViewColumn treeViewColumn = new TreeViewColumn ();
			treeViewColumn.Title = "categories";
			CellRenderer cellRenderer = new CellRendererText ();
			treeViewColumn.PackStart (cellRenderer, true);
			treeViewColumn.AddAttribute (cellRenderer, "text", 0);
			catView.AppendColumn (treeViewColumn);

			catStore.SetSortColumnId (0, SortType.Ascending);
			catView.Model = catStore;

			okButton.Clicked += new EventHandler (OpenEvent);
			cancelButton.Clicked += new EventHandler (cancelClicked);

			nameEntry.Changed += new EventHandler (NameChanged);
			nameEntry.Activated += new EventHandler (OpenEvent);

			infoLabel.Text = string.Empty;
			labelTemplateTitle.Text = string.Empty;
			
			Project[] projects = null;
			if (parentProject == null)
				projects = IdeApp.Workspace.GetAllProjects ().ToArray ();

			if (projects != null && projects.Length > 0) {
				Project curProject = IdeApp.ProjectOperations.CurrentSelectedProject;

				boxProject.Visible = true;
				projectAddCheckbox.Active = curProject != null;
				projectAddCheckbox.Toggled += new EventHandler (AddToProjectToggled);

				projectNames = new string[projects.Length];
				projectRefs = new Project[projects.Length];
				int i = 0;

				bool singleSolution = IdeApp.Workspace.Items.Count == 1 && IdeApp.Workspace.Items[0] is Solution;

				foreach (Project project in projects) {
					projectRefs[i] = project;
					if (singleSolution)
						projectNames[i++] = project.Name; else
						projectNames[i++] = project.ParentSolution.Name + "/" + project.Name;
				}

				Array.Sort (projectNames, projectRefs);
				i = Array.IndexOf (projectRefs, curProject);

				foreach (string pn in projectNames)
					projectAddCombo.AppendText (pn);

				projectAddCombo.Active = i != -1 ? i : 0;
				projectAddCombo.Sensitive = projectAddCheckbox.Active;
				projectAddCombo.Changed += new EventHandler (AddToProjectComboChanged);

				projectPathLabel.Sensitive = projectAddCheckbox.Active;
				projectFolderEntry.Sensitive = projectAddCheckbox.Active;
				if (curProject != null)
					projectFolderEntry.Path = curProject.BaseDirectory;
				projectFolderEntry.PathChanged += new EventHandler (AddToProjectPathChanged);

				if (curProject != null) {
					basePath = curProject.BaseDirectory;
					parentProject = curProject;
				}
			} else {
				boxProject.Visible = false;
			}

			catView.Selection.Changed += new EventHandler (CategoryChange);
			catView.RowActivated += new RowActivatedHandler (CategoryActivated);
			iconView.SelectionChanged += new EventHandler (SelectedTemplateChanged);
			iconView.DoubleClicked += new EventHandler (OpenEvent);
			InitializeDialog (false);
			InitializeView ();
			UpdateOkStatus ();
		}
开发者ID:pabloescribanoloza,项目名称:monodevelop,代码行数:83,代码来源:NewFileDialog.cs

示例7: ConfirmProjectDeleteDialog

		public ConfirmProjectDeleteDialog (IWorkspaceFileObject item)
		{
			this.Build ();
			this.item = item;
			
			store = new TreeStore (typeof(bool), typeof(Gdk.Pixbuf), typeof(string), typeof(string), typeof(string));
			fileList.Model = store;
			
			TreeViewColumn col = new TreeViewColumn ();
			
			CellRendererToggle crt = new CellRendererToggle ();
			crt.Toggled += CrtToggled;
			col.PackStart (crt, false);
			col.AddAttribute (crt, "active", 0);
			
			CellRendererPixbuf crp = new CellRendererPixbuf ();
			col.PackStart (crp, false);
			col.AddAttribute (crp, "pixbuf", 1);
			
			CellRendererText cre = new CellRendererText ();
			col.PackStart (cre, true);
			col.AddAttribute (cre, "text", 2);
			col.AddAttribute (cre, "foreground", 4);
			
			fileList.AppendColumn (col);
			store.SetSortColumnId (2, SortType.Ascending);
			
			labelProjectDir.Text = item.BaseDirectory.FullPath;
			
			HashSet<string> itemFiles = new HashSet<string> ();
			HashSet<string> knownPaths = new HashSet<string> ();
			
			foreach (FilePath file in item.GetItemFiles (true)) {
				itemFiles.Add (file.FullPath);
				knownPaths.Add (file.FullPath + "~");
			}
			
			foreach (string ext in knownExtensions)
				knownPaths.Add (item.FileName.ChangeExtension (ext));

			FillDirRec (TreeIter.Zero, item, itemFiles, knownPaths, item.BaseDirectory, false);
			
			if (item.BaseDirectory != item.ItemDirectory) {
				// If the project has a custom base directory, make sure the project files
				// from the item directory are shown in the list
				foreach (FilePath f in item.GetItemFiles (false)) {
					if (!f.IsChildPathOf (item.BaseDirectory)) {
						Gdk.Pixbuf pix = DesktopService.GetPixbufForFile (f, IconSize.Menu);
						paths [f] = store.AppendValues (true, pix, f.FileName, f.ToString ());
					}
				}
			}

			if (item is SolutionItem) {
				var sol = ((SolutionItem)item).ParentSolution;
				var bdir = item.BaseDirectory;
				if (sol.GetItemFiles (false).Any (f => f.IsChildPathOf (bdir)) || sol.GetAllSolutionItems<SolutionEntityItem> ().Any (it => it != item && it.GetItemFiles (true).Any (f => f.IsChildPathOf (bdir)))) {
					radioDeleteAll.Sensitive = false;
					labelProjectDir.Text = GettextCatalog.GetString ("Project directory can't be deleted since it contains files from other projects or solutions");
				}
			}
			
			if (item.BaseDirectory.FileName == item.Name && radioDeleteAll.Sensitive) {
				radioDeleteAll.Active = true;
				fileList.Sensitive = false;
			}
			else {
				radioDeleteSel.Active = true;
				Focus = radioDeleteSel;
			}
		}
开发者ID:telebovich,项目名称:monodevelop,代码行数:71,代码来源:ConfirmProjectDeleteDialog.cs

示例8: InitializeComponents

        void InitializeComponents()
        {
            catStore = new Gtk.TreeStore (typeof(string), typeof(ArrayList), typeof(ArrayList), typeof(Gdk.Pixbuf));
            catStore.SetSortColumnId (0, SortType.Ascending);

            templateStore = new Gtk.TreeStore (typeof(string), typeof(FileTemplate));

            ScrolledWindow swindow1 = new ScrolledWindow();
            swindow1.VscrollbarPolicy = PolicyType.Automatic;
            swindow1.HscrollbarPolicy = PolicyType.Automatic;
            swindow1.ShadowType = ShadowType.In;
            catView = new Gtk.TreeView (catStore);
            catView.WidthRequest = 160;
            catView.HeadersVisible = false;
            templateView = new Gtk.TreeView (templateStore);
            TemplateView = new IconView();

            TreeViewColumn catColumn = new TreeViewColumn ();
            catColumn.Title = "categories";

            CellRendererText cat_text_render = new CellRendererText ();
            catColumn.PackStart (cat_text_render, true);
            catColumn.AddAttribute (cat_text_render, "text", 0);

            catView.AppendColumn (catColumn);

            TreeViewColumn templateColumn = new TreeViewColumn ();
            templateColumn.Title = "template";
            CellRendererText tmpl_text_render = new CellRendererText ();
            templateColumn.PackStart (tmpl_text_render, true);
            templateColumn.AddAttribute (tmpl_text_render, "text", 0);
            templateView.AppendColumn (templateColumn);

            okButton = new Button (Gtk.Stock.New);
            okButton.Clicked += new EventHandler (OpenEvent);

            cancelButton = new Button (Gtk.Stock.Close);
            cancelButton.Clicked += new EventHandler (cancelClicked);

            infoLabel = new Label ("");
            Frame infoLabelFrame = new Frame();
            infoLabelFrame.Add(infoLabel);

            HBox viewbox = new HBox (false, 6);
            swindow1.Add(catView);
            viewbox.PackStart (swindow1,false,true,0);
            viewbox.PackStart(TemplateView, true, true,0);

            this.AddActionWidget (cancelButton, (int)Gtk.ResponseType.Cancel);
            this.AddActionWidget (okButton, (int)Gtk.ResponseType.Ok);

            this.VBox.PackStart (viewbox);
            this.VBox.PackStart (infoLabelFrame, false, false, 6);

            cat_imglist = new PixbufList();
            cat_imglist.Add(Runtime.Gui.Resources.GetBitmap("md-open-folder"));
            cat_imglist.Add(Runtime.Gui.Resources.GetBitmap("md-closed-folder"));
            catView.Selection.Changed += new EventHandler (CategoryChange);
            TemplateView.IconSelected += new EventHandler(SelectedIndexChange);
            TemplateView.IconDoubleClicked += new EventHandler(OpenEvent);
            InitializeView ();
        }
开发者ID:slluis,项目名称:monodevelop-prehistoric,代码行数:62,代码来源:NewFileDialog.cs

示例9: fillTreeView

    private void fillTreeView(Gtk.TreeView tv, TreeStore store, int except, int inSession)
    {
        ArrayList myPersons = SqlitePerson.SelectAllPersonsRecuperable("name", except, inSession, ""); //"" is searchFilterName (not implemented on recuperate multiple)

        foreach (Person person in myPersons) {
            store.AppendValues (
                    true,
                    person.UniqueID.ToString(),
                    person.Name,
                    getCorrectSex(person.Sex),
                    person.DateBorn.ToShortDateString(),
                    person.Description);
        }

        //show sorted by column Name
        store.SetSortColumnId(2, Gtk.SortType.Ascending);
    }
开发者ID:GNOME,项目名称:chronojump,代码行数:17,代码来源:person.cs

示例10: MemberView

                public MemberView () : base ()
		{
			memberRecords = new Hashtable ();

			store = new TreeStore ((int) TypeFundamentals.TypeString, (int) TypeFundamentals.TypeString, Gdk.Pixbuf.GType);
			store.SetSortColumnId (0, SortType.Ascending);

			column = new TreeViewColumn ();
			CellRenderer image = new CellRendererPixbuf ();
			CellRenderer text = new CellRendererText ();
			column.Title = "Member";
			column.PackStart (image, false);
			column.AddAttribute (image, "pixbuf", 2);
			column.PackStart (text, true);
			column.AddAttribute (text, "markup", 1);

			AppendColumn (column);
			Selection.Changed += new EventHandler (MemberSelectionChanged);

			Model = store;
		}
开发者ID:emtees,项目名称:old-code,代码行数:21,代码来源:MemberView.cs

示例11: FillTree

		private TreeStore FillTree ()
		{
			// title, filename, italic
			store = new TreeStore (typeof (string), typeof (System.Type), typeof (bool));
			Hashtable parents = new Hashtable ();
			TreeIter parent;

			Type[] types = Assembly.GetExecutingAssembly ().GetTypes ();
			foreach (Type t in types) {
				object[] att = t.GetCustomAttributes (typeof (DemoAttribute), false);
				foreach (DemoAttribute demo in att) {
					if (demo.Parent != null) {
						if (!parents.Contains (demo.Parent))
							parents.Add (demo.Parent, store.AppendValues (demo.Parent));

						parent = (TreeIter) parents[demo.Parent];
						store.AppendValues (parent, demo.Label, t, false);
					} else {
						store.AppendValues (demo.Label, t, false);
					}
				}
			}
			store.SetSortColumnId (0, SortType.Ascending);
			return store;
		}
开发者ID:ystk,项目名称:debian-gtk-sharp2,代码行数:25,代码来源:DemoMain.cs

示例12: ReferenceTreeViewer

		public ReferenceTreeViewer()
		{
			Build ();
			store = new Gtk.TreeStore (typeof(object), typeof(string), typeof(string), typeof(bool), typeof(string), typeof(string), typeof(string), typeof(string), typeof(string), typeof(string));
			treeview.Model = store;
			treeview.HeadersClickable = true;
			
			Gtk.TreeViewColumn complete_column = new Gtk.TreeViewColumn ();
			complete_column.Title = "Type";
			complete_column.Resizable = true;

			Gtk.CellRendererPixbuf pix_render = new Gtk.CellRendererPixbuf ();
			complete_column.PackStart (pix_render, false);
			complete_column.AddAttribute (pix_render, "stock-id", ImageCol);

			Gtk.CellRendererText text_render = new Gtk.CellRendererText ();
			complete_column.PackStart (text_render, true);
			
			complete_column.AddAttribute (text_render, "text", TypeCol);
			complete_column.Clickable = true;
	
			treeview.AppendColumn (complete_column);
			
			AddColumn ("Instances", InstancesCol, "Number of instances of a type. Only instances that contain references are included.");
			TreeColRefs = treeview.Columns.Length;
			AddColumn ("References", RefsCol, "Number of references to the parent type.");
			AddColumn ("Root Refs", RootRefsCol, "Number of indirect references to instances of the tree root type.");
			AddColumn ("Root Mem", RootMemCol, "Amount of memory of the root instances indirectly referenced.");
			AddColumn ("Memory Size", SizeCol, "Memory allocated by instances of the type.");
			AddColumn ("Avg. Size", AvgSizeCol, "Average size of the instances.");
			
			treeview.TestExpandRow += new Gtk.TestExpandRowHandler (OnTestExpandRow);
			treeview.RowActivated += new Gtk.RowActivatedHandler (OnNodeActivated);
			treeview.AppendColumn (new Gtk.TreeViewColumn());
			
			int nc = 0;
			foreach (TreeViewColumn c in treeview.Columns) {
				store.SetSortFunc (nc, CompareNodes);
				c.SortColumnId = nc++;
			}
			store.SetSortColumnId (1, Gtk.SortType.Descending);
			treeview.RulesHint = true;
			tips.Enable ();
		}
开发者ID:Kalnor,项目名称:monodevelop,代码行数:44,代码来源:ReferenceTreeViewer.cs

示例13: BacktracesView

		public BacktracesView ()
		{
			window = new ScrolledWindow ();
			tree = new TreeView ();
			tree.RulesHint = true;
			
			//                               icon            type            count            #bytes         avg size         avg age
			store = new TreeStore (typeof (string), typeof (string), typeof (string), typeof (string), typeof (string), typeof (string), typeof (object));
			tree.Model = store;

			CellRendererPixbuf pixbufRenderer = new CellRendererPixbuf ();
			CellRendererText typeRenderer = new CellRendererText ();
			CellRendererText countRenderer = new CellRendererText ();
			CellRendererText totalSizeRenderer = new CellRendererText ();
			CellRendererText avgSizeRenderer = new CellRendererText ();
			CellRendererText avgAgeRenderer = new CellRendererText ();
			
			TreeViewColumn columnType = new TreeViewColumn ();
			TreeViewColumn columnCount = new TreeViewColumn ();
			TreeViewColumn columnTotalSize = new TreeViewColumn ();
			TreeViewColumn columnAvgSize = new TreeViewColumn ();
			TreeViewColumn columnAvgAge = new TreeViewColumn ();
			
			columnType.Title = GettextCatalog.GetString ("Type");
			columnCount.Title = GettextCatalog.GetString ("Count");
			columnTotalSize.Title = GettextCatalog.GetString ("Total Size");
			columnAvgSize.Title = GettextCatalog.GetString ("Avg Size");
			columnAvgAge.Title = GettextCatalog.GetString ("Avg Age");
			
			columnType.PackStart (pixbufRenderer, false);
			columnType.PackStart (typeRenderer, true);
			columnCount.PackStart (countRenderer, true);
			columnTotalSize.PackStart (totalSizeRenderer, true);
			columnAvgSize.PackStart (avgSizeRenderer, true);
			columnAvgAge.PackStart (avgAgeRenderer, true);
			
			columnType.AddAttribute (pixbufRenderer, "stock-id", 0);
			columnType.AddAttribute (typeRenderer, "text", 1);
			columnCount.AddAttribute (countRenderer, "text", 2);
			columnTotalSize.AddAttribute (totalSizeRenderer, "text", 3);
			columnAvgSize.AddAttribute (avgSizeRenderer, "text", 4);
			columnAvgAge.AddAttribute (avgAgeRenderer, "text", 5);
			
			tree.AppendColumn (columnType);
			tree.AppendColumn (columnCount);
			tree.AppendColumn (columnTotalSize);
			tree.AppendColumn (columnAvgSize);
			tree.AppendColumn (columnAvgAge);
			
			int nc = 0;
			foreach (TreeViewColumn c in tree.Columns) {
				store.SetSortFunc (nc, CompareNodes);
				c.SortColumnId = nc++;
			}
			store.SetSortColumnId (1, SortType.Descending);
			
			window.Add (tree);
			window.ShowAll ();
		}
开发者ID:Kalnor,项目名称:monodevelop,代码行数:59,代码来源:BacktracesView.cs

示例14: MessageView

        public MessageView(String messagebox)
        {
            this.messagebox = messagebox;

            messagesWindow = new ScrolledWindow();
            messagesWindow.ShadowType = ShadowType.EtchedIn;
            messagesWindow.SetPolicy(PolicyType.Automatic, PolicyType.Automatic);

            treeviewMessages = new TreeView();
            treeviewMessages.BorderWidth = 0;
            treeviewMessages.AppendColumn ("Site", new CellRendererText(), "text", 2).Resizable = true;;
            treeviewMessages.AppendColumn ("User", new CellRendererText(), "text", 3).Resizable = true;;
            treeviewMessages.AppendColumn ("Subject", new CellRendererText(), "text", 4).Resizable = true;;
            treeviewMessages.AppendColumn ("Date", new CellRendererText(), "text", 5).Resizable = true;;
            treeviewMessages.RowActivated += treeviewMessages_RowActivated;
            messagesWindow.Add(treeviewMessages);
            this.Add1 (messagesWindow);

            contentBox = new VBox(false, 0);
            Toolbar toolbar = new Toolbar();
            toolbar.HeightRequest = 38;
            toolbar.ToolbarStyle = ToolbarStyle.Icons;
            toolbar.BorderWidth = 0;
            Image tmpimage = new Image();
            tmpimage.Pixbuf = new Gdk.Pixbuf(".images/icon_up.png");
            upbtn = new ToolButton(tmpimage, "");
            upbtn.TooltipText = "Expand view to top";
            upbtn.Clicked += upbtn_Clicked;
            Image tmpimage2 = new Image();
            tmpimage2.Pixbuf = new Gdk.Pixbuf(".images/icon_down.png");
            downbtn = new ToolButton(tmpimage2, "");
            downbtn.TooltipText = "Split view";
            downbtn.Clicked += downbtn_Clicked;
            Image tmpimage3 = new Image();
            tmpimage3.Pixbuf = new Gdk.Pixbuf(".images/reply.png");
            replybtn = new ToolButton(tmpimage3, "");
            replybtn.TooltipText = "Reply to sender";
            SeparatorToolItem sepSpacer = new SeparatorToolItem();
            sepSpacer.Expand = true;
            sepSpacer.Draw = false;

            messageWindow = new ScrolledWindow();
            messagebrowser = new WebView();
            messagebrowser.Editable = false;
            messageWindow.Add(messagebrowser);
            contentBox.PackStart(toolbar, false, false, 0);
            contentBox.PackStart(messageWindow);
            toolbar.Add(replybtn);
            toolbar.Add(sepSpacer);
            toolbar.Add(upbtn);
            toolbar.Add(downbtn);
            this.Add2(contentBox);
            this.ShowAll();
            downbtn.Hide ();
            replybtn.Sensitive = false;

            treestoreMessages = new TreeStore (typeof(string),typeof(string), typeof(string), typeof(string), typeof(string), typeof(string));
            forums = new List<Forum> ();
            getBoxMessages(messagebox);
            treestoreMessages.AppendValues("000", "000", "SharpTalk", "Admin", "Welcome to SharpTalk", "");
            treestoreMessages.SetSortColumnId(5, SortType.Descending);
            treeviewMessages.Model = treestoreMessages;
        }
开发者ID:jiceland,项目名称:sharptalk,代码行数:63,代码来源:MessageView.cs

示例15: GtkGladeCodeGenerator

    public GtkGladeCodeGenerator()
    {
        Gtk.Application.Init();

        Glade.XML glade = new Glade.XML(null, "gladecodegenerator.glade", "MainWindow", null);
        glade.Autoconnect(this);
        window = (Gtk.Window)glade.GetWidget("MainWindow");

        //mainEventBox.ModifyBg(Gtk.StateType.Normal, new Gdk.Color(0xff,0xff,0xff));
        mainEventBox.ModifyBg(Gtk.StateType.Normal, mainEventBox.Style.White);

        widgetTreeStore =  new Gtk.TreeStore(typeof(Gdk.Pixbuf), typeof(string), typeof(bool), typeof(Widget));

        Gtk.TreeViewColumn completeColumn = new Gtk.TreeViewColumn();

        Gtk.CellRendererToggle toggleRenderer = new Gtk.CellRendererToggle();
        toggleRenderer.Toggled += new Gtk.ToggledHandler (on_toggleRenderer_Toggled);
        completeColumn.PackStart(toggleRenderer, false);
        completeColumn.SetCellDataFunc(toggleRenderer, new Gtk.TreeCellDataFunc(toggleRendererFunc));

        Gtk.CellRendererPixbuf imageRenderer = new Gtk.CellRendererPixbuf();
        completeColumn.PackStart(imageRenderer, false);
        completeColumn.AddAttribute(imageRenderer, "pixbuf", 0);
        completeColumn.AddAttribute(imageRenderer, "visible", 2);

        Gtk.CellRendererText textRenderer = new Gtk.CellRendererText();
        completeColumn.PackStart(textRenderer, false);
        completeColumn.AddAttribute(textRenderer, "text", 1);

        widgetTree.AppendColumn(completeColumn);

        widgetTree.Model = widgetTreeStore;

        widgetTreeStore.SetSortColumnId(2,Gtk.SortType.Ascending);

        languageComboBox.Active = 0;

        window.Show();

        Gtk.Application.Run();
    }
开发者ID:codebutler,项目名称:glade-sharp-code-generator,代码行数:41,代码来源:GtkGladeCodeGenerator.cs


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