2013-03-18 13:52:27 +00:00
|
|
|
|
using System;
|
|
|
|
|
using System.Windows.Forms;
|
2014-02-26 14:11:06 +00:00
|
|
|
|
using CodeImp.DoomBuilder.Windows;
|
2013-03-18 13:52:27 +00:00
|
|
|
|
|
|
|
|
|
namespace CodeImp.DoomBuilder.BuilderEffects
|
|
|
|
|
{
|
|
|
|
|
public partial class MenusForm : Form
|
|
|
|
|
{
|
2014-12-03 23:15:26 +00:00
|
|
|
|
public MenusForm()
|
|
|
|
|
{
|
2013-03-18 13:52:27 +00:00
|
|
|
|
InitializeComponent();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// This invokes an action from control event
|
2014-12-03 23:15:26 +00:00
|
|
|
|
private void InvokeTaggedAction(object sender, EventArgs e)
|
|
|
|
|
{
|
2013-03-18 13:52:27 +00:00
|
|
|
|
General.Interface.InvokeTaggedAction(sender, e);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// This registers with the core
|
2014-12-03 23:15:26 +00:00
|
|
|
|
public void Register()
|
|
|
|
|
{
|
2013-03-18 13:52:27 +00:00
|
|
|
|
// Add the menus to the core
|
2016-11-26 00:02:56 +00:00
|
|
|
|
General.Interface.BeginToolbarUpdate();
|
2016-11-16 20:31:04 +00:00
|
|
|
|
General.Interface.AddModesMenu(menujitter, "002_modify");
|
|
|
|
|
General.Interface.AddModesButton(buttonjitter, "002_modify");
|
|
|
|
|
General.Interface.AddModesMenu(menusectorflatshading, "002_modify");
|
|
|
|
|
General.Interface.AddModesButton(buttonsectorflatshading, "002_modify");
|
2016-11-26 00:02:56 +00:00
|
|
|
|
General.Interface.EndToolbarUpdate();
|
2014-03-19 13:03:47 +00:00
|
|
|
|
|
2016-11-16 20:31:04 +00:00
|
|
|
|
for(int i = 0; i < stripimport.DropDownItems.Count; i++)
|
|
|
|
|
General.Interface.AddMenu(stripimport.DropDownItems[i] as ToolStripMenuItem, MenuSection.FileImport);
|
2013-03-18 13:52:27 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// This unregisters from the core
|
2014-12-03 23:15:26 +00:00
|
|
|
|
public void Unregister()
|
|
|
|
|
{
|
2013-03-18 13:52:27 +00:00
|
|
|
|
// Remove the menus from the core
|
2016-11-26 00:02:56 +00:00
|
|
|
|
General.Interface.BeginToolbarUpdate();
|
2016-11-16 20:31:04 +00:00
|
|
|
|
General.Interface.RemoveMenu(menujitter);
|
|
|
|
|
General.Interface.RemoveButton(buttonjitter);
|
|
|
|
|
General.Interface.RemoveMenu(menusectorflatshading);
|
|
|
|
|
General.Interface.RemoveButton(buttonsectorflatshading);
|
2016-11-26 00:02:56 +00:00
|
|
|
|
General.Interface.EndToolbarUpdate();
|
2014-03-19 13:03:47 +00:00
|
|
|
|
|
2016-11-16 20:31:04 +00:00
|
|
|
|
for(int i = 0; i < stripimport.DropDownItems.Count; i++)
|
|
|
|
|
General.Interface.RemoveMenu(stripimport.DropDownItems[i] as ToolStripMenuItem);
|
2013-03-18 13:52:27 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|