SimpleProgressGauge.cs 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. using FastReport.Utils;
  2. using System.ComponentModel;
  3. using System.Drawing;
  4. namespace FastReport.Gauge.Simple.Progress
  5. {
  6. /// <summary>
  7. /// Represents a simple progress gauge.
  8. /// </summary>
  9. public partial class SimpleProgressGauge : SimpleGauge
  10. {
  11. /// <summary>
  12. /// Gets or sets gauge label.
  13. /// </summary>
  14. [Category("Appearance")]
  15. [Browsable(true)]
  16. public override GaugeLabel Label
  17. {
  18. get { return base.Label; }
  19. set { base.Label = value; }
  20. }
  21. /// <summary>
  22. /// Gets scale. Should be disabled for SimpleProgressGauge
  23. /// </summary>
  24. [Browsable(false)]
  25. public new GaugeScale Scale
  26. {
  27. get { return base.Scale; }
  28. }
  29. #region Constructors
  30. /// <summary>
  31. /// Initializes a new instance of the <see cref="SimpleGauge"/> class.
  32. /// </summary>
  33. public SimpleProgressGauge() : base()
  34. {
  35. Pointer = new SimpleProgressPointer(this);
  36. (Scale as SimpleScale).FirstSubScale.Enabled = false;
  37. (Scale as SimpleScale).SecondSubScale.Enabled = false;
  38. (Pointer as SimplePointer).PointerRatio = 1f;
  39. (Pointer as SimplePointer).HorizontalOffset = 0;
  40. Label = new SimpleProgressLabel(this);
  41. Pointer.BorderColor = Color.Transparent;
  42. Border.Lines = BorderLines.All;
  43. }
  44. #endregion // Constructors
  45. #region Public Methods
  46. /// <inheritdoc/>
  47. public override void Draw(FRPaintEventArgs e)
  48. {
  49. base.Draw(e);
  50. Label.Draw(e);
  51. }
  52. #endregion // Public Methods
  53. }
  54. }