AnglePopup.cs 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. using System;
  2. using System.Drawing;
  3. using System.Windows.Forms;
  4. using FastReport.Utils;
  5. namespace FastReport.Controls
  6. {
  7. internal class AnglePopup : PopupWindow
  8. {
  9. private AngleControl control;
  10. public event EventHandler AngleChanged;
  11. public int Angle
  12. {
  13. get { return control.Angle; }
  14. set { control.Angle = value; }
  15. }
  16. private void FControl_AngleChanged(object sender, EventArgs e)
  17. {
  18. if (AngleChanged != null)
  19. AngleChanged(this, EventArgs.Empty);
  20. }
  21. public AnglePopup(Form ownerForm) : base(ownerForm)
  22. {
  23. control = new AngleControl();
  24. control.ShowBorder = false;
  25. control.AngleChanged += new EventHandler(FControl_AngleChanged);
  26. Controls.Add(control);
  27. float scale = ownerForm.Dpi() / 96f;
  28. control.Scale(new SizeF(scale, scale));
  29. Font = ownerForm.Font;
  30. ClientSize = control.Size;
  31. }
  32. }
  33. }