UltimateZoneBuilder/Source/Core/Controls/ToolStripNumericUpDown.cs
MaxED 3a35b7603a Fixed, Map Analysis mode, "Check stuck things" check: rewritten parts of the flags checking logic to allow more accurate flag checks.
Fixed, Map Analysis mode: fixed a crash when trying to dissolve an invalid sector when one of it's linedefs referenced it on the both sides.
Fixed, Sectors mode: fixed incorrect undo description when deleting sectors.
Internal: joined declaration and assignment of some more variables.
2015-12-28 15:01:53 +00:00

38 lines
1.2 KiB
C#

using System;
using System.Windows.Forms;
using System.Windows.Forms.Design;
namespace CodeImp.DoomBuilder.Controls
{
[ToolStripItemDesignerAvailability(ToolStripItemDesignerAvailability.ToolStrip)]
public class ToolStripNumericUpDown : ToolStripControlHost
{
public event EventHandler ValueChanged;
public decimal Value { get { return nud.Value; } set { nud.Value = value; } }
public decimal Minimum { get { return nud.Minimum; } set { nud.Minimum = value; } }
public decimal Maximum { get { return nud.Maximum; } set { nud.Maximum = value; } }
private NumericUpDown nud;
public ToolStripNumericUpDown() : base(new NumericUpDown()) { }
protected override void OnSubscribeControlEvents(Control control)
{
base.OnSubscribeControlEvents(control);
nud = control as NumericUpDown;
nud.ValueChanged += OnValueChanged;
}
protected override void OnUnsubscribeControlEvents(Control control)
{
base.OnUnsubscribeControlEvents(control);
nud.ValueChanged -= OnValueChanged;
}
public void OnValueChanged(object sender, EventArgs e)
{
if(ValueChanged != null) ValueChanged(this, e);
}
}
}