Exemple #1
0
        public override Shape Spawn()
        {
            var obj = m_Spawn;

            m_Spawn = null;
            return(obj);
        }
Exemple #2
0
        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;
        }
Exemple #3
0
        /// <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);
        }
Exemple #4
0
 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);
     }
 }