private void WriteToItemCanvasLog(IVisualItemMore visualItem) { var rowCol = visualItem.ShowRowCol( ); SpecialLogFile.AppendTextLine( "write to canvas. " + rowCol.ToString() + " " + visualItem.ToString()); }
public static string TypeCode(this IVisualItemMore item) { if (item.ClassCode == "Spanner") { return(item.ClassCode); } else if (item.ShowItem == null) { return("Literal"); } else { return("Field"); } }
/// <summary> /// important function. Places the actual frameworkElement of the VisualItem on /// the canvas. /// </summary> /// <param name="visualItem"></param> /// <param name="Elem"></param> public Point AddItemToCanvas(IVisualItemMore visualItem, FrameworkElement Elem) { // start column is beyond screen size. Advance to column 0 of the next row. var rowCol = visualItem.ShowRowCol(); // calc the x,y dot position of the visual item. var pos = rowCol.ToCanvasPos(this.CanvasDefn.CharBoxDim); this.Canvas.Children.Add(Elem); System.Windows.Controls.Canvas.SetLeft(Elem, pos.X); System.Windows.Controls.Canvas.SetTop(Elem, pos.Y); visualItem.IsOnCanvas = true; return(pos); }