• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# Gtk.TreePath类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: DragDataDelete

 public bool DragDataDelete(TreePath path)
 {
     TreeIter iter;
     this.GetIter(out iter, path);
     //this.Remove(ref iter);
     return true;
 }
开发者ID:QualitySolution,项目名称:GammaBinding,代码行数:7,代码来源:ObservableListReorderableTreeModel.cs


示例2: EventsListFromPaths

        /// <summary>
        /// Fill a list of events from a list of paths, if the first and unique path is an EventType the list
        /// is filled with al the child events in this EventType category.
        /// </summary>
        /// <param name = "model">Model.</param>
        /// <param name="events">Events.</param>
        /// <param name="paths">Paths.</param>
        public static List<TimelineEventLongoMatch> EventsListFromPaths(TreeModel model, TreePath[] paths)
        {
            List<TimelineEventLongoMatch> events = new List<TimelineEventLongoMatch> ();

            // If it's an EventType or a Player, traverse all children to fill the list
            if (paths.Length == 1 && !(model.GetValue (paths [0]) is TimelineEventLongoMatch)) {
                TreeIter parentIter;
                TreeIter child;
                bool hasChild;

                model.GetIter (out parentIter, paths [0]);
                hasChild = model.IterHasChild (parentIter);
                model.IterChildren (out child, parentIter);
                while (hasChild) {
                    TimelineEventLongoMatch evt = model.GetValue (child, 0) as TimelineEventLongoMatch;
                    if (evt != null) {
                        events.Add (evt);
                    }
                    hasChild = model.IterNext (ref child);
                }
            } else {
                foreach (var path in paths) {
                    TimelineEventLongoMatch evt = model.GetValue (path) as TimelineEventLongoMatch;
                    if (evt != null) {
                        events.Add (evt);
                    }
                }
            }
            return events;
        }
开发者ID:LongoMatch,项目名称:longomatch,代码行数:37,代码来源:TreeViewHelpers.cs


示例3: HandleRowsReordered

		void HandleRowsReordered (object sender, ListRowOrderEventArgs e)
		{
			var p = new Gtk.TreePath (new int[] { e.Row });
			var it = IterFromNode (e.Row);
			adapter.EmitRowsReordered (p, it, e.ChildrenOrder);
			parent.QueueResize ();
		}
开发者ID:m13253,项目名称:xwt,代码行数:7,代码来源:CustomListModel.cs


示例4: MultipleSelectionCommand

	/// <summary>Base constructor for classes that inherit <see cref="MultipleSelectionCommand" />.</summary>
	/// <param name="description">The description of the command.</param>
	/// <param name="canGroup">Whether to possibly group the command with the previous command.</param>
	/// <param name="selectionIntended">The intended selection.</param>
	/// <param name="paths">The paths to select, or null to use auto selection if setPaths is enabled.</param>
	/// <param name="setPaths">Whether to set the paths based on the current selection and the selectionType</param>
	public MultipleSelectionCommand (string description, bool canGroup, SelectionIntended selectionIntended, TreePath[] paths, bool setPaths) : base(description, canGroup) {
		if (setPaths) {
			switch (selectionIntended) {
				case SelectionIntended.Simple:
					this.paths = (paths != null ? paths : Base.Ui.View.Selection.Paths);
					this.focus = Base.Ui.View.Selection.Focus;
					break;
				case SelectionIntended.Range:
					this.paths = (paths != null ? paths : Base.Ui.View.Selection.Range);
					this.focus = Base.Ui.View.Selection.Focus;
					break;
				case SelectionIntended.SimpleToFirst:
					this.paths = (paths != null ? paths : Base.Ui.View.Selection.PathsToFirst);
					this.focus = Base.Ui.View.Selection.Focus;
					break;
				case SelectionIntended.SimpleToLast:
					this.paths = (paths != null ? paths : Base.Ui.View.Selection.PathsToLast);
					this.focus = Base.Ui.View.Selection.Focus;
					break;
				default:
					if (paths != null)
						this.paths = paths;

					break;
			}
		}

		this.selectionType = GetSelectionType(selectionIntended);
	}
开发者ID:GNOME,项目名称:gnome-subtitles,代码行数:35,代码来源:MultipleSelectionCommand.cs


示例5: HandleRowInserted

		void HandleRowInserted (object sender, ListRowEventArgs e)
		{
			var p = new Gtk.TreePath (new int[] { e.Row });
			var it = IterFromNode (e.Row);
			adapter.EmitRowInserted (p, it);
			parent.QueueResize ();
		}
开发者ID:m13253,项目名称:xwt,代码行数:7,代码来源:CustomListModel.cs


示例6: InitCell

		public void InitCell (Widget container, bool diffMode, string[] lines, TreePath path)
		{
			if (isDisposed)
				return;
			this.lines = lines;
			this.diffMode = diffMode;
			this.path = path;
			
			if (diffMode) {
				if (lines != null && lines.Length > 0) {
					int maxlen = -1;
					int maxlin = -1;
					for (int n=0; n<lines.Length; n++) {
						if (lines [n].Length > maxlen) {
							maxlen = lines [n].Length;
							maxlin = n;
						}
					}
					DisposeLayout ();
					layout = CreateLayout (container, lines [maxlin]);
					layout.GetPixelSize (out width, out lineHeight);
					height = lineHeight * lines.Length;
				}
				else
					width = height = 0;
			}
			else {
				DisposeLayout ();
				layout = CreateLayout (container, string.Join (Environment.NewLine, lines));
				layout.GetPixelSize (out width, out height);
			}
		}
开发者ID:transformersprimeabcxyz,项目名称:monodevelop-1,代码行数:32,代码来源:CellRendererDiff.cs


示例7: tree_select

        // the treeview is selected
        private bool tree_select(TreeSelection selection, TreeModel model, TreePath path, bool selected)
        {
            if (this != Global.Core.Library.DynamicTree)
                Global.Core.Library.DynamicTree.Selection.UnselectAll ();

            if (this != Global.Core.Library.FolderTree)
                Global.Core.Library.FolderTree.Selection.UnselectAll ();

            if (this != Global.Core.Library.PlaylistTree)
                Global.Core.Library.PlaylistTree.Selection.UnselectAll ();

            //if it isnt already selected
            if (!selected)
            {
                Global.Core.TopBar.SelectedTree = this;
                Global.Core.Library.MediaTree.SetFilter (FilterMedia);
                Global.Core.Library.MediaTree.Refilter ();

                //raise the event
                if (TreeSelected != null)
                {
                    TreeIter iter;
                    if (model.GetIter (out iter, path))
                        TreeSelected (model, iter);
                }
            }

            return true;
        }
开发者ID:gsterjov,项目名称:fusemc,代码行数:30,代码来源:OrganizerTree.cs


示例8: DragDataReceived

 public new bool DragDataReceived(TreePath path, SelectionData data)
 {
     logger.Debug("DragDataReceived dstPath={0}", path);
     TreeModel srcModel;
     TreePath srcPath;
     TreeIter srcIter, dstIter, newIter, ParentIter;
     if(Tree.GetRowDragData(data, out srcModel, out srcPath))
     {
         logger.Debug("DragDataReceived srcPath={0}", srcPath);
         bool Last = false;
         if(!this.GetIter(out dstIter, path))
         {
             path.Prev();
             Last = true;
             this.GetIter(out dstIter, path);
         }
         this.GetIter(out srcIter, srcPath);
         this.IterParent(out ParentIter, dstIter);
         if(Last)
             newIter = this.InsertNodeAfter(ParentIter, dstIter);
         else
             newIter = this.InsertNodeBefore(ParentIter, dstIter);
         CopyValues(srcIter, newIter);
         return true;
     }
     return false;
 }
开发者ID:QualitySolution,项目名称:earchive,代码行数:27,代码来源:ImageTreeStore.cs


示例9: GetIter

 public TreeIter GetIter(TreeView view, TreePath path)
 {
     TreeIter iter;
     if(!GetIter(out iter, path))
         throw new InvalidOperationException("Cesta ve stromu není platná");
     return iter;
 }
开发者ID:langpavel,项目名称:LPS-old,代码行数:7,代码来源:TreeStore.cs


示例10: removeImages

 public void removeImages(TreePath[] treePaths)
 {
     foreach(TreePath treePath in treePaths)
     {
         this.imagesModel.GetIter(out this.iter, treePath);
         this.imagesModel.Remove(ref this.iter);
     }
 }
开发者ID:kmnb,项目名称:ReduktuMi,代码行数:8,代码来源:Controler.cs


示例11: Remove

	public void Remove (TreePath[] paths) {
		foreach (TreePath path in paths) {
			TreeIter iter;
			model.GetIter(out iter, path);
			model.Remove(ref iter);

			collection.Remove(Util.PathToInt(path));
		}
	}
开发者ID:GNOME,项目名称:gnome-subtitles,代码行数:9,代码来源:SyncPoints.cs


示例12: TagByPath

	public Tag TagByPath (TreePath path) 
	{
		TreeIter iter;

		if (!Model.GetIter (out iter, path))
			return null;

		return TagByIter (iter);
	}
开发者ID:AminBonyadUni,项目名称:facedetect-f-spot,代码行数:9,代码来源:TagSelectionWidget.cs


示例13: GetRadioTrackInfo

        public RadioTrackInfo GetRadioTrackInfo(TreePath path)
        {
            TreeIter iter;

            if(GetIter(out iter, path)) {
                return GetRadioTrackInfo(iter);
            }

            return null;
        }
开发者ID:jrmuizel,项目名称:banshee-unofficial-plugins,代码行数:10,代码来源:StationModel.cs


示例14: TreePathReference

		public TreePathReference (TreeModel model, TreePath path)
		{
			model.RowsReordered += HandleRowsReordered;
			model.RowInserted += HandleRowInserted;
			model.RowDeleted += HandleRowDeleted;

			indices = path.Indices;
			this.path = path;
			Model = model;
		}
开发者ID:Kalnor,项目名称:monodevelop,代码行数:10,代码来源:TreePathReference.cs


示例15: GetDN

        public string GetDN(TreePath path)
        {
            TreeIter iter;

            if (this.dataStore.GetIter (out iter, path)) {
                string dn = (string) this.dataStore.GetValue (iter, dnColumn);
                return dn;
            }

            return null;
        }
开发者ID:MrJoe,项目名称:lat,代码行数:11,代码来源:ViewDataTreeView.cs


示例16: PathPodcastFeedInfo

        public PodcastFeedInfo PathPodcastFeedInfo(TreePath path)
        {
            TreeIter iter;

            if(!GetIter (out iter, path))
            {
                return null;
            }

            return IterPodcastFeedInfo (iter);
        }
开发者ID:jrmuizel,项目名称:banshee-unofficial-plugins,代码行数:11,代码来源:PodcastFeedModel.cs


示例17: log_syscall_modified_cb

        void log_syscall_modified_cb(int num)
        {
            TreePath path;
            TreeIter iter;

            path = new TreePath (new int[] { num });

            if (!GetIter (out iter, path))
                Debug.Assert (false, "Get an iter in the list model to modify it");

            SetValue (iter, 0, 0);
        }
开发者ID:GNOME,项目名称:mortadelo,代码行数:12,代码来源:syscall-list-model.cs


示例18: CopyCellMenuItem

        public CopyCellMenuItem(TreePath[] selectedRows, string label, Func<TreePath, string> getValue)
            : base(label)
        {
            if (selectedRows.Length == 0) {
                throw new IndexOutOfRangeException ("Missing selected resource rows");
            }

            SelectedRows = selectedRows;
            GetValueFromRow = getValue;

            ButtonReleaseEvent += (o, e) => OnCopy ();
        }
开发者ID:CalebMorris,项目名称:Xamarin-ResxEditor,代码行数:12,代码来源:ContextMenus.cs


示例19: HistoryItemSelected

 public bool HistoryItemSelected(TreeSelection selection, TreeModel model, TreePath path, bool path_currently_selected)
 {
     int current = path.Indices[0];
     if (!path_currently_selected) {
         while (PintaCore.History.Pointer < current) {
             PintaCore.History.Redo ();
         }
         while (PintaCore.History.Pointer > current) {
             PintaCore.History.Undo ();
         }
     }
     return true;
 }
开发者ID:joehillen,项目名称:Pinta,代码行数:13,代码来源:HistoryTreeView.cs


示例20: LoadProject

        public void LoadProject(Project project, ProjectStats stats)
        {
            TreePath path;

            store.Clear();
            pstats = stats;
            categoriesviewer.LoadStats (pstats, project);
            AddTeam (project.LocalTeamTemplate, project.Dashboard);
            AddTeam (project.VisitorTeamTemplate, project.Dashboard);
            path = new TreePath ("0:0");
            treeview1.ExpandAll ();
            treeview1.SetCursor (path, null, false);
        }
开发者ID:GNOME,项目名称:longomatch,代码行数:13,代码来源:PlayersViewer.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# Gtk.TreeStore类代码示例发布时间:2022-05-26
下一篇:
C# Gtk.TreeIter类代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap