本文整理汇总了C#中Gtk.TreePath.Prev方法的典型用法代码示例。如果您正苦于以下问题:C# TreePath.Prev方法的具体用法?C# TreePath.Prev怎么用?C# TreePath.Prev使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Gtk.TreePath
的用法示例。
在下文中一共展示了TreePath.Prev方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: 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;
}
示例2: DragDataReceived
public bool DragDataReceived(TreePath path, SelectionData data)
{
Console.WriteLine("DragDataReceived dstPath={0}", path);
TreeModel srcModel;
TreePath srcPath;
if(Tree.GetRowDragData(data, out srcModel, out srcPath))
{
Console.WriteLine("DragDataReceived srcPath={0}", srcPath);
object row = NodeAtPath (srcPath);
SourceList.RemoveAt (srcPath.Indices[0]);
if (srcPath.Indices [0] < path.Indices [0])
path.Prev ();
if (path.Indices [0] == SourceList.Count)
SourceList.Add (row);
else
SourceList.Insert (path.Indices [0], row);
return true;
}
return false;
}
示例3: 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;
}
示例4: 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();
}
}