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


C# TreePath.Next方法代码示例

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


在下文中一共展示了TreePath.Next方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: EnsureState

        private void EnsureState()
        {
            if (store.Categorised) {
                //LAMESPEC: why can't we just get a TreePath or a count from the NodeStore?
                TreePath tp = new Gtk.TreePath ("0");
                CategoryToolboxNode node = (CategoryToolboxNode) store.GetNode (tp);
                while (node != null) {
                    if (expandedCategories [node.Label] != null)
                        nodeView.ExpandRow (tp, false);
                    tp.Next ();
                    node = (CategoryToolboxNode) store.GetNode (tp);
                }
            }

            if (selectedNode != null) {
                //LAMESPEC: why oh why is there no easy way to find if a node is in the store?
                //FIXME: This doesn't survive all store rebuilds, for some reason
                foreach (BaseToolboxNode b in store)
                    if (b == selectedNode) {
                        nodeView.NodeSelection.SelectNode (selectedNode);
                        break;
                    }
            }
        }
开发者ID:mono,项目名称:aspeditor,代码行数:24,代码来源:Toolbox.cs

示例3: 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

示例4: IncrementPathForKeyPress

        private bool IncrementPathForKeyPress (Gdk.EventKey press, TreePath path)
        {
            switch (press.Key) {
            case Gdk.Key.Up:
            case Gdk.Key.KP_Up:
                return path.Prev ();

            case Gdk.Key.Down:
            case Gdk.Key.KP_Down:
                path.Next ();
                return true;
            }

            return false;
        }
开发者ID:dineshkummarc,项目名称:banshee,代码行数:15,代码来源:SourceView.cs

示例5: ItemToggled

    void ItemToggled(object o, ToggledArgs args)
    {
        //cannot toggle item while capturing or recalculating
        if(capturingCsharp == encoderCaptureProcess.CAPTURING ||
                encoderRProcAnalyze.status == EncoderRProc.Status.RUNNING)
            return;

        TreeIter iter;
        int column = 0;
        if (encoderCaptureListStore.GetIterFromString (out iter, args.Path))
        {
            int rowNum = Convert.ToInt32(args.Path); //starts at zero

            //on "ecS" don't pass the 2nd row, pass always the first
            //then need to move the iter to previous row
            TreePath path = new TreePath(args.Path);
            if(ecconLast != "c" && ! Util.IsEven(rowNum)) {
                rowNum --;
                path.Prev();
                //there's no "IterPre", for this reason we use this path method:
                encoderCaptureListStore.GetIter (out iter, path);

                /*
                 * caution, note args.Path has not changed; but path, iter and rowNum have decreased
                 * do not use args.Path from now
                 */
            }

            EncoderCurve curve = (EncoderCurve) encoderCaptureListStore.GetValue (iter, column);
            //get previous value
            bool val = curve.Record;

            //change value
            //this changes value, but checkbox will be changed on RenderRecord. Was impossible to do here.
            ((EncoderCurve) encoderCaptureListStore.GetValue (iter, column)).Record = ! val;

            //this makes RenderRecord work on changed row without having to put mouse there
            encoderCaptureListStore.EmitRowChanged(path,iter);

            saveOrDeleteCurveFromCaptureTreeView(false, rowNum, curve, ! val);

            /* temporarily removed message
             *
            string message = "";
            if(! val)
                message = Catalog.GetString("Saved");
            else
                message = Catalog.GetString("Removed");
            if(ecconLast ==	"c")
                label_encoder_curve_action.Text = message + " " + (rowNum +1).ToString();
            else
                label_encoder_curve_action.Text = message + " " + (decimal.Truncate((rowNum +1) /2) +1).ToString();
                */

            //on ec, ecS need to [un]select second row
            if (ecconLast=="ec" || ecconLast =="ecS") {
                path.Next();
                encoderCaptureListStore.IterNext (ref iter);

                //change value
                ((EncoderCurve) encoderCaptureListStore.GetValue (iter, column)).Record = ! val;

                //this makes RenderRecord work on changed row without having to put mouse there
                encoderCaptureListStore.EmitRowChanged(path,iter);
            }

            updateUserCurvesLabelsAndCombo(false);

            callPlotCurvesGraphDoPlot();
        }
    }
开发者ID:GNOME,项目名称:chronojump,代码行数:71,代码来源:encoderTreeviews.cs


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