public override Shape Spawn() { var obj = m_Spawn; m_Spawn = null; return(obj); }
public override void CopyFrom(Datum other, CopyDepth depth, Mapping mapID) { base.CopyFrom(other, depth, mapID); FreeText freeText = (FreeText)other; m_StartPoint = freeText.m_StartPoint; m_Bounds = freeText.m_Bounds; }
/// <summary>Creates one of these which matches (give or take) the given freetext</summary> public static TextLine FromFreeText(FreeText free) { TextLine create = new TextLine() { m_BaseLineFixed = true, TextStyle = new TextStyleC() }; create.Vertices[0] = free.Bounds.Location; create.Vertices[1] = free.Bounds.TopRight(); create.TextStyle.CopyFrom(free.StyleObjectForParameter(Parameters.FontSize)); create.LabelText = free.LabelText; // must be set after font size return(create); }
public override VerbResult Choose(EditableView.ClickPosition position) { // can be moved if no text yet. However if the focus was not in the drawing area, we just ignore it // the click will have just moved the focus back into the drawing area //Debug.WriteLine("f: " + objPosition.WasFocused.ToString) if (!position.WasFocused) { return(VerbResult.Continuing); } if (string.IsNullOrEmpty(m_Label)) { m_StartPoint = position.Snapped; m_Bounds = CalculateBounds(); return(VerbResult.Continuing); } else { m_Spawn = new FreeText(); m_Spawn.Start(position); m_Spawn.TextStyle.CopyFrom(this.TextStyle); m_Spawn.CaretGain(); return(VerbResult.Spawn); } }