public LeaderTextGraphicState(DataFragment fragment) : base(fragment) { m_AttachPoint = new GePoint(); m_InternalPoints = new FRList<GePoint>(); m_Text = new RichString(PtApp.ActiveDocument.GetFontManager()); }
// N/A maybe we should clone the str here. public void SetText(RichString str) { m_String = str; //if (m_Position != null) //GraphicChangeNotify(); }
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); } }
// 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(); } }
public TextGraphicState(DataFragment fragment) : base(fragment) { m_String = new RichString(PtApp.ActiveDocument.GetFontManager()); }
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; }
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; }
// N/A maybe we should clone the str here. public void SetText(RichString str) { m_Text = str; }