UltimateZoneBuilder/Source/Plugins/BuilderModes/Interface/DrawCurveOptionsPanel.cs
MaxED 7d4ac20b0f Fixed button states for "Draw [stuff]" modes in the modes toolbar.
Moved settings for "Draw [stuff]" modes to the top toolbar.
Added hints for Draw Grid mode.
Fixed a status message update bug introduced in previous commit.
2014-02-28 14:32:20 +00:00

36 lines
1,014 B
C#

using System;
using System.Windows.Forms;
namespace CodeImp.DoomBuilder.BuilderModes
{
internal partial class DrawCurveOptionsPanel : UserControl
{
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(); }
public void Register() {
General.Interface.AddButton(seglabel);
General.Interface.AddButton(seglen);
}
public void Unregister() {
General.Interface.RemoveButton(seglabel);
General.Interface.RemoveButton(seglen);
}
private void seglen_ValueChanged(object sender, EventArgs e) {
if(!blockEvents && OnValueChanged != null) OnValueChanged(this, EventArgs.Empty);
}
}
}