RichObject.DesignExt.cs 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. using FastReport.Forms;
  2. using FastReport.Utils;
  3. using System.Drawing;
  4. using System.Windows.Forms;
  5. namespace FastReport
  6. {
  7. partial class RichObject : IHasEditor
  8. {
  9. #region Public Methods
  10. internal void DrawDesign(FRPaintEventArgs e)
  11. {
  12. if (IsDesigning)
  13. {
  14. e.Graphics.DrawString(Res.Get("Forms,RichTextEditor,Invoke"), DrawUtils.DefaultReportFont, Brushes.Gray,
  15. new RectangleF(AbsLeft * e.ScaleX, AbsTop * e.ScaleY, Width * e.ScaleX, Height * e.ScaleY));
  16. DrawMarkers(e);
  17. }
  18. }
  19. /// <inheritdoc/>
  20. public bool InvokeEditor()
  21. {
  22. using (RichSelectorForm form = new RichSelectorForm(this))
  23. {
  24. if (form.ShowDialog() == DialogResult.OK)
  25. {
  26. actualTextStart = 0;
  27. actualTextLength = 0;
  28. return true;
  29. }
  30. }
  31. return false;
  32. }
  33. /// <inheritdoc/>
  34. public override SmartTagBase GetSmartTag()
  35. {
  36. return new RichObjectSmartTag(this);
  37. }
  38. /// <inheritdoc/>
  39. public override ContextMenuBase GetContextMenu()
  40. {
  41. return new TextObjectBaseMenu(Report.Designer);
  42. }
  43. #endregion
  44. }
  45. }