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


C# TreePath.Down方法代码示例

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


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

示例1: DeleteLocations

		private void DeleteLocations(TreePath path){
			path.Down();
			
			TreeModel model = ((TreeModelFilter)locationsView.Model).Model;
			TreeIter iter;
			while(model.GetIter(out iter,path) == true){
				// we also need delete the children of the location
				DeleteLocations(path.Copy());				
				Location loc = (Location)model.GetValue(iter,0);
				// this won't delete the children
				Locations.Remove(loc);
				
				// do move to next, since the location is not removed from the positions yet
				path.Next();
			}
		}
开发者ID:konne88,项目名称:MyInventory,代码行数:16,代码来源:LocationsBox.cs

示例2: Dialog

        public Dialog(Image image, Drawable drawable, VariableSet variables)
            : base("Photoshop Actions", variables)
        {
            _image = image;
              _drawable = drawable;

              var vbox = new VBox(false, 12) {BorderWidth = 12};
              VBox.PackStart(vbox, true, true, 0);

              var store = CreateActionTree();

              var sw = new ScrolledWindow() {HeightRequest = 400};
              vbox.PackStart(sw, true, true, 0);

              var view = new TreeView(store);
              sw.Add(view);

              var activeRenderer = new CellRendererToggle() {Activatable = true};
              var columnOne = view.AppendColumn("Enabled", activeRenderer,
                    new TreeCellDataFunc(RenderActive));
              activeRenderer.Toggled += delegate(object o, ToggledArgs args)
            {
              TreeIter iter;
              var path = new TreePath(args.Path);
              if (store.GetIter(out iter, path))
              {
            var executable = store.GetValue(iter, 1) as IExecutable;
            executable.IsEnabled = !executable.IsEnabled;

            path.Down();
            while (store.GetIter(out iter, path))
              {
            store.EmitRowChanged(path, iter);
            path.Next();
              }
              }
            };

              var textRenderer = new CellRendererText();
              var column = view.AppendColumn("Set Name", textRenderer,
                     new TreeCellDataFunc(RenderText));

              var hbox = new HBox();
              vbox.PackStart(hbox, false, true, 0);

              var play = new Button(Stock.Execute);
              play.Clicked += delegate
            {
              RenameToBackground();

              var paths = view.Selection.GetSelectedRows();
              var path = paths[0];	// Assume only 1 is selected

              var indices = path.Indices;

              var actions = _set[indices[0]];

              if (indices.Length > 2)
            {
              actions.Execute(indices[1], indices[2]);
              path.Next();
              view.Selection.SelectPath(path);
            }
              else
            {
              actions.Execute(indices[1]);
            }
              Gimp.DisplaysFlush();
            };
              hbox.PackStart(play, false, true, 0);

              view.Selection.Changed += delegate
            {
              var paths = view.Selection.GetSelectedRows();
              var indices = paths[0].Indices;

              play.Sensitive = (indices.Length > 1);
            };

              view.Selection.SetSelectFunction(delegate(TreeSelection selection,
                        TreeModel model,
                        TreePath path,
                        bool path_currently_selected)
              {
            return path.Indices.Length <= 3;
              },
                       IntPtr.Zero, null);

              ActionEvent.ActionSetCollection = _set;
        }
开发者ID:unhammer,项目名称:gimp-sharp,代码行数:90,代码来源:Dialog.cs


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