public LeaderTextGraphicState(DataFragment fragment)
     : base(fragment)
 {
     m_AttachPoint = new GePoint();
     m_InternalPoints = new FRList<GePoint>();
     m_Text = new RichString(PtApp.ActiveDocument.GetFontManager());
 }
Exemplo n.º 2
0
        // N/A maybe we should clone the str here.
        public void SetText(RichString str)
        {
            m_String = str;

            //if (m_Position != null)
            //GraphicChangeNotify();
        }
Exemplo n.º 3
0
        public override void DoubClick()
        {
            TextDialogData DlgData = new TextDialogData();
            DlgData.m_Text = m_Instance.GetText().TextString;

            if (TextDialogUtil.ShowDialog(DlgData))
            {
                RichString str = new RichString(PtApp.ActiveDocument.GetFontManager());
                str.TextString = DlgData.m_Text;
                str.FontID = DlgData.GetFontID();
                m_Instance.SetText(str);
            }
        }
Exemplo n.º 4
0
        // It was called by target class when d-click
        public override void ShowDialog()
        {
            TextDialogData DlgData = new TextDialogData();

            if (TextDialogUtil.ShowDialog(DlgData))
            {
                RichString str = new RichString(PtApp.ActiveDocument.GetFontManager());
                str.TextString = DlgData.m_Text;
                str.FontID = DlgData.GetFontID();
                m_Instance.SetText(str);

                // commit the command
                PtApp.Get().CmdResolver.OnDone();
            }
            else
            {
                PtApp.Get().CmdResolver.OnCancel();
            }
        }
Exemplo n.º 5
0
 public TextGraphicState(DataFragment fragment)
     : base(fragment)
 {
     m_String = new RichString(PtApp.ActiveDocument.GetFontManager());
 }
Exemplo n.º 6
0
        public GeRectangle GetRichStringRange(RichString str)
        {
            Graphics gp = GetGDIGraphics();

            // Measure string.
            SizeF stringSize = new SizeF();

            FontManager manager = PtApp.ActiveDocument.GetFontManager();

            Font StrFont = null;
            if (str.FontID != -1)
                StrFont = manager.GetFont(str.FontID);
            else
                StrFont = manager.GetApplicationDefaultFont();

            // Device coordinates
            stringSize = gp.MeasureString(
                   str.GetString(), StrFont);

            // Defect - We should convert to World coordinates here.
            GeRectangle rec = new GeRectangle(new GePoint(0, 0)
                , new GePoint(stringSize.Width, stringSize.Height));
            return rec;
        }
Exemplo n.º 7
0
        public static DisplayItemText GenDisplayItemText(DisplayItemList list, RichString str, GePoint position, GeRectangle rec)
        {
            //GeRectangle rec = PtApp.ActiveView.GetRichStringRange(str);

            DisplayItemText DLText = new DisplayItemText(str.GetString(), position,
                str.GetFont());
            DLText.Range = rec;

            if (list != null)
                list.AddItem(DLText);

            return DLText;
        }
Exemplo n.º 8
0
 // N/A maybe we should clone the str here.
 public void SetText(RichString str)
 {
     m_Text = str;
 }