UltimateZoneBuilder/Source/Core/Controls/ToolStripNumericUpDown.cs
MaxED 3e132f1cf2 Changed, Curve Linedefs mode: re-designed the mode UI. Alternative control options are now available (check Help tab while the mode is active).
Changed, Curve Linedefs mode: changed curve generation logic. Setting Distance to 0 will now divide selected linedefs into equal parts.
Changed, Curve Linedefs mode: curve vertices are now drawn.
Updated ZDoom_DECORATE.cfg.
2016-10-26 22:33:36 +00:00

39 lines
1.3 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; } }
public decimal Increment { get { return nud.Increment; } set { nud.Increment = 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);
}
}
}