CheckBoxObject.DesignExt.cs 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. using System.Windows.Forms;
  2. using System.Drawing;
  3. using FastReport.Utils;
  4. namespace FastReport
  5. {
  6. partial class CheckBoxObject
  7. {
  8. #region Public Methods
  9. /// <inheritdoc/>
  10. public override SizeF GetPreferredSize()
  11. {
  12. if ((Page as ReportPage).IsImperialUnitsUsed)
  13. return new SizeF(Units.Inches * 0.2f, Units.Inches * 0.2f);
  14. return new SizeF(Units.Millimeters * 5, Units.Millimeters * 5);
  15. }
  16. /// <inheritdoc/>
  17. public override SmartTagBase GetSmartTag()
  18. {
  19. return new CheckBoxSmartTag(this);
  20. }
  21. /// <inheritdoc/>
  22. public override void OnMouseDown(MouseEventArgs e)
  23. {
  24. if (Editable && !Config.WebMode)
  25. {
  26. Checked = !Checked;
  27. if (Page != null)
  28. {
  29. Page.NeedModify = true;
  30. Page.NeedRefresh = true;
  31. }
  32. }
  33. else base.OnMouseDown(e);
  34. }
  35. #endregion
  36. }
  37. }