using FastReport.Utils; using System; using System.Drawing; using System.Windows.Forms; namespace FastReport.Controls { internal class ToolStripTextAngleButton : ToolStripDropDownButton { private AngleControl control; public event EventHandler AngleChanged; public int Angle { get => control.Angle; set => control.Angle = value; } private void control_AngleChanged(object sender, EventArgs e) { AngleChanged?.Invoke(this, EventArgs.Empty); } public ToolStripTextAngleButton(Control owner) { DisplayStyle = ToolStripItemDisplayStyle.Image; control = new AngleControl(); control.AngleChanged += control_AngleChanged; control.Scale(new SizeF(owner.DpiMultiplier(), owner.DpiMultiplier())); DropDown = new FRToolStripDropDown(control); DropDown.Opening += (s, e) => control.UpdateDpiDependencies(owner); } } }