ZoneBuilder/Source/Plugins/BuilderModes/Interface/DrawLineOptionsPanel.cs

51 lines
1.7 KiB
C#
Raw Normal View History

2022-11-25 17:14:35 +00:00
using System;
using System.Windows.Forms;
namespace CodeImp.DoomBuilder.BuilderModes
{
internal partial class DrawLineOptionsPanel : UserControl
{
public event EventHandler OnContinuousDrawingChanged;
public event EventHandler OnAutoCloseDrawingChanged;
public event EventHandler OnShowGuidelinesChanged;
2022-11-25 17:14:35 +00:00
public bool ContinuousDrawing { get { return continuousdrawing.Checked; } set { continuousdrawing.Checked = value; } }
public bool AutoCloseDrawing { get { return autoclosedrawing.Checked; } set { autoclosedrawing.Checked = value; } }
public bool ShowGuidelines { get { return showguidelines.Checked; } set { showguidelines.Checked = value; } }
2022-11-25 17:14:35 +00:00
public DrawLineOptionsPanel()
{
InitializeComponent();
}
public void Register()
{
General.Interface.AddButton(continuousdrawing);
General.Interface.AddButton(autoclosedrawing);
General.Interface.AddButton(showguidelines);
2022-11-25 17:14:35 +00:00
}
public void Unregister()
{
General.Interface.RemoveButton(showguidelines);
General.Interface.RemoveButton(autoclosedrawing);
2022-11-25 17:14:35 +00:00
General.Interface.RemoveButton(continuousdrawing);
}
private void continuousdrawing_CheckedChanged(object sender, EventArgs e)
{
if(OnContinuousDrawingChanged != null) OnContinuousDrawingChanged(continuousdrawing.Checked, EventArgs.Empty);
}
private void autoclosedrawing_CheckedChanged(object sender, EventArgs e)
{
if(OnAutoCloseDrawingChanged != null) OnAutoCloseDrawingChanged(autoclosedrawing.Checked, EventArgs.Empty);
}
private void showguidelines_CheckedChanged(object sender, EventArgs e)
{
if(OnShowGuidelinesChanged != null) OnShowGuidelinesChanged(showguidelines.Checked, EventArgs.Empty);
}
2022-11-25 17:14:35 +00:00
}
}