2014-02-26 14:11:06 +00:00
|
|
|
|
using System;
|
|
|
|
|
using System.Windows.Forms;
|
|
|
|
|
|
|
|
|
|
namespace CodeImp.DoomBuilder.BuilderModes
|
|
|
|
|
{
|
2014-02-28 14:32:20 +00:00
|
|
|
|
internal partial class DrawCurveOptionsPanel : UserControl
|
2014-02-26 14:11:06 +00:00
|
|
|
|
{
|
|
|
|
|
public event EventHandler OnValueChanged;
|
|
|
|
|
private bool blockEvents;
|
|
|
|
|
|
|
|
|
|
public int SegmentLength { get { return (int)seglen.Value; } set { blockEvents = true; seglen.Value = value; blockEvents = false; } }
|
|
|
|
|
|
|
|
|
|
public DrawCurveOptionsPanel(int minLength, int maxLength) {
|
|
|
|
|
InitializeComponent();
|
|
|
|
|
|
|
|
|
|
seglen.Minimum = minLength;
|
|
|
|
|
seglen.Maximum = maxLength;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private DrawCurveOptionsPanel() { InitializeComponent(); }
|
|
|
|
|
|
2014-02-28 14:32:20 +00:00
|
|
|
|
public void Register() {
|
|
|
|
|
General.Interface.AddButton(seglabel);
|
|
|
|
|
General.Interface.AddButton(seglen);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void Unregister() {
|
|
|
|
|
General.Interface.RemoveButton(seglen);
|
2014-03-04 09:04:43 +00:00
|
|
|
|
General.Interface.RemoveButton(seglabel);
|
2014-02-28 14:32:20 +00:00
|
|
|
|
}
|
|
|
|
|
|
2014-02-26 14:11:06 +00:00
|
|
|
|
private void seglen_ValueChanged(object sender, EventArgs e) {
|
|
|
|
|
if(!blockEvents && OnValueChanged != null) OnValueChanged(this, EventArgs.Empty);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|