added menu and toolbar separators for editing modes

This commit is contained in:
codeimp 2009-01-27 15:44:45 +00:00
parent 73e41e7f9e
commit 9ab807a8d9
14 changed files with 172 additions and 90 deletions

View file

@ -42,6 +42,7 @@ namespace CodeImp.DoomBuilder.BuilderModes
SwitchAction = "brightnessmode",
ButtonImage = "BrightnessMode.png",
ButtonOrder = int.MinValue + 201,
ButtonGroup = "000_editing",
AllowCopyPaste = false,
UseByDefault = true)]

View file

@ -40,6 +40,7 @@ namespace CodeImp.DoomBuilder.BuilderModes
SwitchAction = "errorcheckmode",
ButtonImage = "MapAnalysisMode.png",
ButtonOrder = 200,
ButtonGroup = "002_tools",
Volatile = true,
UseByDefault = true)]

View file

@ -40,6 +40,7 @@ namespace CodeImp.DoomBuilder.BuilderModes
SwitchAction = "findmode",
ButtonImage = "FindMode.png",
ButtonOrder = 100,
ButtonGroup = "002_tools",
Volatile = true,
UseByDefault = true)]

View file

@ -42,6 +42,7 @@ namespace CodeImp.DoomBuilder.BuilderModes
SwitchAction = "linedefsmode", // Action name used to switch to this mode
ButtonImage = "LinesMode.png", // Image resource name for the button
ButtonOrder = int.MinValue + 100, // Position of the button (lower is more to the left)
ButtonGroup = "000_editing",
UseByDefault = true)]
public class LinedefsMode : BaseClassicMode

View file

@ -41,6 +41,7 @@ namespace CodeImp.DoomBuilder.BuilderModes
SwitchAction = "makesectormode",
ButtonImage = "NewSector2.png", // Image resource name for the button
ButtonOrder = int.MinValue + 202, // Position of the button (lower is more to the left)
ButtonGroup = "000_editing",
UseByDefault = true)]
public class MakeSectorMode : BaseClassicMode

View file

@ -43,6 +43,7 @@ namespace CodeImp.DoomBuilder.BuilderModes
SwitchAction = "sectorsmode", // Action name used to switch to this mode
ButtonImage = "SectorsMode.png", // Image resource name for the button
ButtonOrder = int.MinValue + 200, // Position of the button (lower is more to the left)
ButtonGroup = "000_editing",
UseByDefault = true)]
public class SectorsMode : BaseClassicMode

View file

@ -42,6 +42,7 @@ namespace CodeImp.DoomBuilder.BuilderModes
SwitchAction = "thingsmode", // Action name used to switch to this mode
ButtonImage = "ThingsMode.png", // Image resource name for the button
ButtonOrder = int.MinValue + 300, // Position of the button (lower is more to the left)
ButtonGroup = "000_editing",
UseByDefault = true)]
public class ThingsMode : BaseClassicMode

View file

@ -40,6 +40,7 @@ namespace CodeImp.DoomBuilder.BuilderModes
SwitchAction = "verticesmode", // Action name used to switch to this mode
ButtonImage = "VerticesMode.png", // Image resource name for the button
ButtonOrder = int.MinValue + 0, // Position of the button (lower is more to the left)
ButtonGroup = "000_editing",
UseByDefault = true)]
public class VerticesMode : BaseClassicMode

View file

@ -41,6 +41,7 @@ namespace CodeImp.DoomBuilder.BuilderModes
SwitchAction = "visualmode", // Action name used to switch to this mode
ButtonImage = "VisualMode.png", // Image resource name for the button
ButtonOrder = 0, // Position of the button (lower is more to the left)
ButtonGroup = "001_visual",
UseByDefault = true)]
public class BaseVisualMode : VisualMode

View file

@ -40,6 +40,7 @@ namespace CodeImp.DoomBuilder.Editing
private string switchaction = null;
private string buttonimage = null;
private int buttonorder = 0;
private string buttongroup = "~none";
private bool optional = true;
private bool isvolatile = false;
private string displayname = "<unnamed mode>";
@ -69,6 +70,11 @@ namespace CodeImp.DoomBuilder.Editing
/// </summary>
public int ButtonOrder { get { return buttonorder; } set { buttonorder = value; } }
/// <summary>
/// Grouping name for buttons on the toolbar. Groups are sorted alphabetically.
/// </summary>
public string ButtonGroup { get { return buttongroup; } set { buttongroup = value; } }
/// <summary>
/// When set to false, this mode will always be available for use and the user cannot
/// change this in the game configuration.

View file

@ -46,6 +46,9 @@ namespace CodeImp.DoomBuilder.Editing
#region ================== Variables
// All editing mode groups, sorted alphabetically
private List<string> groups;
// All editing modes available
private List<EditModeInfo> allmodes;
@ -84,6 +87,7 @@ namespace CodeImp.DoomBuilder.Editing
// Initialize
allmodes = new List<EditModeInfo>();
usedmodes = new List<EditModeInfo>();
groups = new List<string>();
// Bind any methods
General.Actions.BindMethods(this);
@ -100,13 +104,19 @@ namespace CodeImp.DoomBuilder.Editing
foreach(EditModeAttribute a in emattrs)
{
// Make edit mode information
allmodes.Add(new EditModeInfo(p, t, a));
EditModeInfo modeinfo = new EditModeInfo(p, t, a);
allmodes.Add(modeinfo);
// Add group if not added yet
if(!groups.Contains(modeinfo.Attributes.ButtonGroup))
groups.Add(modeinfo.Attributes.ButtonGroup);
}
}
}
// Sort the modes in order for buttons
// Sort the lists
allmodes.Sort();
groups.Sort();
// Update modes
UpdateCurrentEditModes();
@ -226,11 +236,18 @@ namespace CodeImp.DoomBuilder.Editing
// Remove editing mode buttons from interface
General.MainWindow.RemoveEditModeButtons();
// Go for all used edit modes to add buttons
foreach(EditModeInfo emi in usedmodes)
// Go for all the editing mode groups
foreach(string grp in groups)
{
if((emi.ButtonImage != null) && (emi.ButtonDesc != null))
General.MainWindow.AddEditModeButton(emi);
General.MainWindow.AddEditModeSeperator();
// Go for all used edit modes to add buttons
foreach(EditModeInfo emi in usedmodes)
{
if((emi.ButtonImage != null) && (emi.ButtonDesc != null) &&
(emi.Attributes.ButtonGroup == grp))
General.MainWindow.AddEditModeButton(emi);
}
}
}

View file

@ -183,13 +183,13 @@ namespace CodeImp.DoomBuilder.Windows
//
toolStripMenuItem1.Margin = new System.Windows.Forms.Padding(0, 3, 0, 3);
toolStripMenuItem1.Name = "toolStripMenuItem1";
toolStripMenuItem1.Size = new System.Drawing.Size(198, 6);
toolStripMenuItem1.Size = new System.Drawing.Size(199, 6);
//
// toolStripMenuItem3
//
toolStripMenuItem3.Margin = new System.Windows.Forms.Padding(0, 3, 0, 3);
toolStripMenuItem3.Name = "toolStripMenuItem3";
toolStripMenuItem3.Size = new System.Drawing.Size(198, 6);
toolStripMenuItem3.Size = new System.Drawing.Size(199, 6);
//
// toolStripSeparator1
//
@ -219,7 +219,7 @@ namespace CodeImp.DoomBuilder.Windows
//
toolStripSeparator11.Margin = new System.Windows.Forms.Padding(0, 3, 0, 3);
toolStripSeparator11.Name = "toolStripSeparator11";
toolStripSeparator11.Size = new System.Drawing.Size(162, 6);
toolStripSeparator11.Size = new System.Drawing.Size(160, 6);
//
// toolstripSeperator1
//
@ -231,7 +231,7 @@ namespace CodeImp.DoomBuilder.Windows
//
toolstripSeperator6.Margin = new System.Windows.Forms.Padding(0, 3, 0, 3);
toolstripSeperator6.Name = "toolstripSeperator6";
toolstripSeperator6.Size = new System.Drawing.Size(162, 6);
toolstripSeperator6.Size = new System.Drawing.Size(160, 6);
//
// toolStripSeparator7
//
@ -248,12 +248,12 @@ namespace CodeImp.DoomBuilder.Windows
// toolStripMenuItem4
//
toolStripMenuItem4.Name = "toolStripMenuItem4";
toolStripMenuItem4.Size = new System.Drawing.Size(161, 6);
toolStripMenuItem4.Size = new System.Drawing.Size(150, 6);
//
// toolStripSeparator2
//
toolStripSeparator2.Name = "toolStripSeparator2";
toolStripSeparator2.Size = new System.Drawing.Size(164, 6);
toolStripSeparator2.Size = new System.Drawing.Size(153, 6);
//
// toolStripSeparator4
//
@ -305,7 +305,7 @@ namespace CodeImp.DoomBuilder.Windows
toolStripMenuItem3,
this.itemexit});
this.menufile.Name = "menufile";
this.menufile.Size = new System.Drawing.Size(35, 20);
this.menufile.Size = new System.Drawing.Size(37, 20);
this.menufile.Text = "File";
//
// itemnewmap
@ -313,7 +313,7 @@ namespace CodeImp.DoomBuilder.Windows
this.itemnewmap.Image = global::CodeImp.DoomBuilder.Properties.Resources.File;
this.itemnewmap.Name = "itemnewmap";
this.itemnewmap.ShortcutKeyDisplayString = "";
this.itemnewmap.Size = new System.Drawing.Size(201, 22);
this.itemnewmap.Size = new System.Drawing.Size(202, 22);
this.itemnewmap.Tag = "builder_newmap";
this.itemnewmap.Text = "New Map";
this.itemnewmap.Click += new System.EventHandler(this.InvokeTaggedAction);
@ -322,7 +322,7 @@ namespace CodeImp.DoomBuilder.Windows
//
this.itemopenmap.Image = global::CodeImp.DoomBuilder.Properties.Resources.OpenMap;
this.itemopenmap.Name = "itemopenmap";
this.itemopenmap.Size = new System.Drawing.Size(201, 22);
this.itemopenmap.Size = new System.Drawing.Size(202, 22);
this.itemopenmap.Tag = "builder_openmap";
this.itemopenmap.Text = "Open Map...";
this.itemopenmap.Click += new System.EventHandler(this.InvokeTaggedAction);
@ -330,7 +330,7 @@ namespace CodeImp.DoomBuilder.Windows
// itemclosemap
//
this.itemclosemap.Name = "itemclosemap";
this.itemclosemap.Size = new System.Drawing.Size(201, 22);
this.itemclosemap.Size = new System.Drawing.Size(202, 22);
this.itemclosemap.Tag = "builder_closemap";
this.itemclosemap.Text = "Close Map";
this.itemclosemap.Click += new System.EventHandler(this.InvokeTaggedAction);
@ -339,7 +339,7 @@ namespace CodeImp.DoomBuilder.Windows
//
this.itemsavemap.Image = global::CodeImp.DoomBuilder.Properties.Resources.SaveMap;
this.itemsavemap.Name = "itemsavemap";
this.itemsavemap.Size = new System.Drawing.Size(201, 22);
this.itemsavemap.Size = new System.Drawing.Size(202, 22);
this.itemsavemap.Tag = "builder_savemap";
this.itemsavemap.Text = "Save Map";
this.itemsavemap.Click += new System.EventHandler(this.InvokeTaggedAction);
@ -347,7 +347,7 @@ namespace CodeImp.DoomBuilder.Windows
// itemsavemapas
//
this.itemsavemapas.Name = "itemsavemapas";
this.itemsavemapas.Size = new System.Drawing.Size(201, 22);
this.itemsavemapas.Size = new System.Drawing.Size(202, 22);
this.itemsavemapas.Tag = "builder_savemapas";
this.itemsavemapas.Text = "Save Map As...";
this.itemsavemapas.Click += new System.EventHandler(this.InvokeTaggedAction);
@ -355,7 +355,7 @@ namespace CodeImp.DoomBuilder.Windows
// itemsavemapinto
//
this.itemsavemapinto.Name = "itemsavemapinto";
this.itemsavemapinto.Size = new System.Drawing.Size(201, 22);
this.itemsavemapinto.Size = new System.Drawing.Size(202, 22);
this.itemsavemapinto.Tag = "builder_savemapinto";
this.itemsavemapinto.Text = "Save Map Into...";
this.itemsavemapinto.Click += new System.EventHandler(this.InvokeTaggedAction);
@ -364,19 +364,19 @@ namespace CodeImp.DoomBuilder.Windows
//
this.toolStripMenuItem5.Margin = new System.Windows.Forms.Padding(0, 3, 0, 3);
this.toolStripMenuItem5.Name = "toolStripMenuItem5";
this.toolStripMenuItem5.Size = new System.Drawing.Size(198, 6);
this.toolStripMenuItem5.Size = new System.Drawing.Size(199, 6);
//
// itemnorecent
//
this.itemnorecent.Enabled = false;
this.itemnorecent.Name = "itemnorecent";
this.itemnorecent.Size = new System.Drawing.Size(201, 22);
this.itemnorecent.Size = new System.Drawing.Size(202, 22);
this.itemnorecent.Text = "No recently opened files";
//
// itemexit
//
this.itemexit.Name = "itemexit";
this.itemexit.Size = new System.Drawing.Size(201, 22);
this.itemexit.Size = new System.Drawing.Size(202, 22);
this.itemexit.Text = "Exit";
this.itemexit.Click += new System.EventHandler(this.itemexit_Click);
//
@ -399,14 +399,14 @@ namespace CodeImp.DoomBuilder.Windows
toolStripSeparator11,
this.itemmapoptions});
this.menuedit.Name = "menuedit";
this.menuedit.Size = new System.Drawing.Size(37, 20);
this.menuedit.Size = new System.Drawing.Size(39, 20);
this.menuedit.Text = "Edit";
//
// itemundo
//
this.itemundo.Image = global::CodeImp.DoomBuilder.Properties.Resources.Undo;
this.itemundo.Name = "itemundo";
this.itemundo.Size = new System.Drawing.Size(165, 22);
this.itemundo.Size = new System.Drawing.Size(163, 22);
this.itemundo.Tag = "builder_undo";
this.itemundo.Text = "Undo";
this.itemundo.Click += new System.EventHandler(this.InvokeTaggedAction);
@ -415,7 +415,7 @@ namespace CodeImp.DoomBuilder.Windows
//
this.itemredo.Image = global::CodeImp.DoomBuilder.Properties.Resources.Redo;
this.itemredo.Name = "itemredo";
this.itemredo.Size = new System.Drawing.Size(165, 22);
this.itemredo.Size = new System.Drawing.Size(163, 22);
this.itemredo.Tag = "builder_redo";
this.itemredo.Text = "Redo";
this.itemredo.Click += new System.EventHandler(this.InvokeTaggedAction);
@ -424,13 +424,13 @@ namespace CodeImp.DoomBuilder.Windows
//
this.toolStripMenuItem7.Margin = new System.Windows.Forms.Padding(0, 3, 0, 3);
this.toolStripMenuItem7.Name = "toolStripMenuItem7";
this.toolStripMenuItem7.Size = new System.Drawing.Size(162, 6);
this.toolStripMenuItem7.Size = new System.Drawing.Size(160, 6);
//
// itemcut
//
this.itemcut.Image = global::CodeImp.DoomBuilder.Properties.Resources.Cut;
this.itemcut.Name = "itemcut";
this.itemcut.Size = new System.Drawing.Size(165, 22);
this.itemcut.Size = new System.Drawing.Size(163, 22);
this.itemcut.Tag = "builder_cutselection";
this.itemcut.Text = "Cut";
this.itemcut.Click += new System.EventHandler(this.InvokeTaggedAction);
@ -439,7 +439,7 @@ namespace CodeImp.DoomBuilder.Windows
//
this.itemcopy.Image = global::CodeImp.DoomBuilder.Properties.Resources.Copy;
this.itemcopy.Name = "itemcopy";
this.itemcopy.Size = new System.Drawing.Size(165, 22);
this.itemcopy.Size = new System.Drawing.Size(163, 22);
this.itemcopy.Tag = "builder_copyselection";
this.itemcopy.Text = "Copy";
this.itemcopy.Click += new System.EventHandler(this.InvokeTaggedAction);
@ -448,7 +448,7 @@ namespace CodeImp.DoomBuilder.Windows
//
this.itempaste.Image = global::CodeImp.DoomBuilder.Properties.Resources.Paste;
this.itempaste.Name = "itempaste";
this.itempaste.Size = new System.Drawing.Size(165, 22);
this.itempaste.Size = new System.Drawing.Size(163, 22);
this.itempaste.Tag = "builder_pasteselection";
this.itempaste.Text = "Paste";
this.itempaste.Click += new System.EventHandler(this.InvokeTaggedAction);
@ -459,7 +459,7 @@ namespace CodeImp.DoomBuilder.Windows
this.itemsnaptogrid.CheckState = System.Windows.Forms.CheckState.Checked;
this.itemsnaptogrid.Image = global::CodeImp.DoomBuilder.Properties.Resources.Grid4;
this.itemsnaptogrid.Name = "itemsnaptogrid";
this.itemsnaptogrid.Size = new System.Drawing.Size(165, 22);
this.itemsnaptogrid.Size = new System.Drawing.Size(163, 22);
this.itemsnaptogrid.Tag = "builder_togglesnap";
this.itemsnaptogrid.Text = "Snap to Grid";
this.itemsnaptogrid.Click += new System.EventHandler(this.InvokeTaggedAction);
@ -470,7 +470,7 @@ namespace CodeImp.DoomBuilder.Windows
this.itemautomerge.CheckState = System.Windows.Forms.CheckState.Checked;
this.itemautomerge.Image = global::CodeImp.DoomBuilder.Properties.Resources.mergegeometry2;
this.itemautomerge.Name = "itemautomerge";
this.itemautomerge.Size = new System.Drawing.Size(165, 22);
this.itemautomerge.Size = new System.Drawing.Size(163, 22);
this.itemautomerge.Tag = "builder_toggleautomerge";
this.itemautomerge.Text = "Merge Geometry";
this.itemautomerge.Click += new System.EventHandler(this.InvokeTaggedAction);
@ -479,12 +479,12 @@ namespace CodeImp.DoomBuilder.Windows
//
this.toolStripMenuItem6.Margin = new System.Windows.Forms.Padding(0, 3, 0, 3);
this.toolStripMenuItem6.Name = "toolStripMenuItem6";
this.toolStripMenuItem6.Size = new System.Drawing.Size(162, 6);
this.toolStripMenuItem6.Size = new System.Drawing.Size(160, 6);
//
// itemgridinc
//
this.itemgridinc.Name = "itemgridinc";
this.itemgridinc.Size = new System.Drawing.Size(165, 22);
this.itemgridinc.Size = new System.Drawing.Size(163, 22);
this.itemgridinc.Tag = "builder_gridinc";
this.itemgridinc.Text = "Increase Grid";
this.itemgridinc.Click += new System.EventHandler(this.InvokeTaggedAction);
@ -492,7 +492,7 @@ namespace CodeImp.DoomBuilder.Windows
// itemgriddec
//
this.itemgriddec.Name = "itemgriddec";
this.itemgriddec.Size = new System.Drawing.Size(165, 22);
this.itemgriddec.Size = new System.Drawing.Size(163, 22);
this.itemgriddec.Tag = "builder_griddec";
this.itemgriddec.Text = "Decrease Grid";
this.itemgriddec.Click += new System.EventHandler(this.InvokeTaggedAction);
@ -501,7 +501,7 @@ namespace CodeImp.DoomBuilder.Windows
//
this.itemgridsetup.Image = global::CodeImp.DoomBuilder.Properties.Resources.Grid2;
this.itemgridsetup.Name = "itemgridsetup";
this.itemgridsetup.Size = new System.Drawing.Size(165, 22);
this.itemgridsetup.Size = new System.Drawing.Size(163, 22);
this.itemgridsetup.Tag = "builder_gridsetup";
this.itemgridsetup.Text = "Grid Setup...";
this.itemgridsetup.Click += new System.EventHandler(this.InvokeTaggedAction);
@ -510,7 +510,7 @@ namespace CodeImp.DoomBuilder.Windows
//
this.itemmapoptions.Image = global::CodeImp.DoomBuilder.Properties.Resources.Properties;
this.itemmapoptions.Name = "itemmapoptions";
this.itemmapoptions.Size = new System.Drawing.Size(165, 22);
this.itemmapoptions.Size = new System.Drawing.Size(163, 22);
this.itemmapoptions.Tag = "builder_mapoptions";
this.itemmapoptions.Text = "Map Options....";
this.itemmapoptions.Click += new System.EventHandler(this.InvokeTaggedAction);
@ -527,14 +527,14 @@ namespace CodeImp.DoomBuilder.Windows
this.toolStripMenuItem10,
this.itemscripteditor});
this.menuview.Name = "menuview";
this.menuview.Size = new System.Drawing.Size(41, 20);
this.menuview.Size = new System.Drawing.Size(44, 20);
this.menuview.Text = "View";
//
// itemthingsfilter
//
this.itemthingsfilter.Image = global::CodeImp.DoomBuilder.Properties.Resources.Filter;
this.itemthingsfilter.Name = "itemthingsfilter";
this.itemthingsfilter.Size = new System.Drawing.Size(210, 22);
this.itemthingsfilter.Size = new System.Drawing.Size(209, 22);
this.itemthingsfilter.Tag = "builder_thingsfilterssetup";
this.itemthingsfilter.Text = "Configure Things Filters...";
this.itemthingsfilter.Click += new System.EventHandler(this.InvokeTaggedAction);
@ -543,13 +543,13 @@ namespace CodeImp.DoomBuilder.Windows
//
this.toolStripMenuItem9.Margin = new System.Windows.Forms.Padding(0, 3, 0, 3);
this.toolStripMenuItem9.Name = "toolStripMenuItem9";
this.toolStripMenuItem9.Size = new System.Drawing.Size(207, 6);
this.toolStripMenuItem9.Size = new System.Drawing.Size(206, 6);
//
// itemviewnormal
//
this.itemviewnormal.Image = global::CodeImp.DoomBuilder.Properties.Resources.ViewNormal;
this.itemviewnormal.Name = "itemviewnormal";
this.itemviewnormal.Size = new System.Drawing.Size(210, 22);
this.itemviewnormal.Size = new System.Drawing.Size(209, 22);
this.itemviewnormal.Tag = "builder_viewmodenormal";
this.itemviewnormal.Text = "Wireframe";
this.itemviewnormal.Click += new System.EventHandler(this.InvokeTaggedAction);
@ -558,7 +558,7 @@ namespace CodeImp.DoomBuilder.Windows
//
this.itemviewbrightness.Image = global::CodeImp.DoomBuilder.Properties.Resources.ViewBrightness;
this.itemviewbrightness.Name = "itemviewbrightness";
this.itemviewbrightness.Size = new System.Drawing.Size(210, 22);
this.itemviewbrightness.Size = new System.Drawing.Size(209, 22);
this.itemviewbrightness.Tag = "builder_viewmodebrightness";
this.itemviewbrightness.Text = "Brightness Levels";
this.itemviewbrightness.Click += new System.EventHandler(this.InvokeTaggedAction);
@ -567,7 +567,7 @@ namespace CodeImp.DoomBuilder.Windows
//
this.itemviewfloors.Image = global::CodeImp.DoomBuilder.Properties.Resources.ViewTextureFloor;
this.itemviewfloors.Name = "itemviewfloors";
this.itemviewfloors.Size = new System.Drawing.Size(210, 22);
this.itemviewfloors.Size = new System.Drawing.Size(209, 22);
this.itemviewfloors.Tag = "builder_viewmodefloors";
this.itemviewfloors.Text = "Floor Textures";
this.itemviewfloors.Click += new System.EventHandler(this.InvokeTaggedAction);
@ -576,7 +576,7 @@ namespace CodeImp.DoomBuilder.Windows
//
this.itemviewceilings.Image = global::CodeImp.DoomBuilder.Properties.Resources.ViewTextureCeiling;
this.itemviewceilings.Name = "itemviewceilings";
this.itemviewceilings.Size = new System.Drawing.Size(210, 22);
this.itemviewceilings.Size = new System.Drawing.Size(209, 22);
this.itemviewceilings.Tag = "builder_viewmodeceilings";
this.itemviewceilings.Text = "Ceiling Textures";
this.itemviewceilings.Click += new System.EventHandler(this.InvokeTaggedAction);
@ -585,13 +585,13 @@ namespace CodeImp.DoomBuilder.Windows
//
this.toolStripMenuItem10.Margin = new System.Windows.Forms.Padding(0, 3, 0, 3);
this.toolStripMenuItem10.Name = "toolStripMenuItem10";
this.toolStripMenuItem10.Size = new System.Drawing.Size(207, 6);
this.toolStripMenuItem10.Size = new System.Drawing.Size(206, 6);
//
// itemscripteditor
//
this.itemscripteditor.Image = global::CodeImp.DoomBuilder.Properties.Resources.Script2;
this.itemscripteditor.Name = "itemscripteditor";
this.itemscripteditor.Size = new System.Drawing.Size(210, 22);
this.itemscripteditor.Size = new System.Drawing.Size(209, 22);
this.itemscripteditor.Tag = "builder_openscripteditor";
this.itemscripteditor.Text = "Script Editor...";
this.itemscripteditor.Click += new System.EventHandler(this.InvokeTaggedAction);
@ -599,7 +599,7 @@ namespace CodeImp.DoomBuilder.Windows
// menumode
//
this.menumode.Name = "menumode";
this.menumode.Size = new System.Drawing.Size(45, 20);
this.menumode.Size = new System.Drawing.Size(50, 20);
this.menumode.Text = "Mode";
//
// menuprefabs
@ -610,13 +610,13 @@ namespace CodeImp.DoomBuilder.Windows
this.toolStripMenuItem12,
this.itemcreateprefab});
this.menuprefabs.Name = "menuprefabs";
this.menuprefabs.Size = new System.Drawing.Size(56, 20);
this.menuprefabs.Size = new System.Drawing.Size(58, 20);
this.menuprefabs.Text = "Prefabs";
//
// iteminsertprefabfile
//
this.iteminsertprefabfile.Name = "iteminsertprefabfile";
this.iteminsertprefabfile.Size = new System.Drawing.Size(205, 22);
this.iteminsertprefabfile.Size = new System.Drawing.Size(199, 22);
this.iteminsertprefabfile.Tag = "builder_insertprefabfile";
this.iteminsertprefabfile.Text = "Insert Prefab from File...";
this.iteminsertprefabfile.Click += new System.EventHandler(this.InvokeTaggedAction);
@ -624,7 +624,7 @@ namespace CodeImp.DoomBuilder.Windows
// iteminsertpreviousprefab
//
this.iteminsertpreviousprefab.Name = "iteminsertpreviousprefab";
this.iteminsertpreviousprefab.Size = new System.Drawing.Size(205, 22);
this.iteminsertpreviousprefab.Size = new System.Drawing.Size(199, 22);
this.iteminsertpreviousprefab.Tag = "builder_insertpreviousprefab";
this.iteminsertpreviousprefab.Text = "Insert Previous Prefab";
this.iteminsertpreviousprefab.Click += new System.EventHandler(this.InvokeTaggedAction);
@ -633,12 +633,12 @@ namespace CodeImp.DoomBuilder.Windows
//
this.toolStripMenuItem12.Margin = new System.Windows.Forms.Padding(0, 3, 0, 3);
this.toolStripMenuItem12.Name = "toolStripMenuItem12";
this.toolStripMenuItem12.Size = new System.Drawing.Size(202, 6);
this.toolStripMenuItem12.Size = new System.Drawing.Size(196, 6);
//
// itemcreateprefab
//
this.itemcreateprefab.Name = "itemcreateprefab";
this.itemcreateprefab.Size = new System.Drawing.Size(205, 22);
this.itemcreateprefab.Size = new System.Drawing.Size(199, 22);
this.itemcreateprefab.Tag = "builder_createprefab";
this.itemcreateprefab.Text = "Create From Selection...";
this.itemcreateprefab.Click += new System.EventHandler(this.InvokeTaggedAction);
@ -653,13 +653,13 @@ namespace CodeImp.DoomBuilder.Windows
this.toolStripMenuItem11,
this.itemtestmap});
this.menutools.Name = "menutools";
this.menutools.Size = new System.Drawing.Size(44, 20);
this.menutools.Size = new System.Drawing.Size(48, 20);
this.menutools.Text = "Tools";
//
// itemreloadresources
//
this.itemreloadresources.Name = "itemreloadresources";
this.itemreloadresources.Size = new System.Drawing.Size(197, 22);
this.itemreloadresources.Size = new System.Drawing.Size(196, 22);
this.itemreloadresources.Tag = "builder_reloadresources";
this.itemreloadresources.Text = "Reload Resources";
this.itemreloadresources.Click += new System.EventHandler(this.InvokeTaggedAction);
@ -668,12 +668,12 @@ namespace CodeImp.DoomBuilder.Windows
//
this.toolStripMenuItem8.Margin = new System.Windows.Forms.Padding(0, 3, 0, 3);
this.toolStripMenuItem8.Name = "toolStripMenuItem8";
this.toolStripMenuItem8.Size = new System.Drawing.Size(194, 6);
this.toolStripMenuItem8.Size = new System.Drawing.Size(193, 6);
//
// configurationToolStripMenuItem
//
this.configurationToolStripMenuItem.Name = "configurationToolStripMenuItem";
this.configurationToolStripMenuItem.Size = new System.Drawing.Size(197, 22);
this.configurationToolStripMenuItem.Size = new System.Drawing.Size(196, 22);
this.configurationToolStripMenuItem.Tag = "builder_configuration";
this.configurationToolStripMenuItem.Text = "Game Configurations...";
this.configurationToolStripMenuItem.Click += new System.EventHandler(this.InvokeTaggedAction);
@ -681,7 +681,7 @@ namespace CodeImp.DoomBuilder.Windows
// preferencesToolStripMenuItem
//
this.preferencesToolStripMenuItem.Name = "preferencesToolStripMenuItem";
this.preferencesToolStripMenuItem.Size = new System.Drawing.Size(197, 22);
this.preferencesToolStripMenuItem.Size = new System.Drawing.Size(196, 22);
this.preferencesToolStripMenuItem.Tag = "builder_preferences";
this.preferencesToolStripMenuItem.Text = "Preferences...";
this.preferencesToolStripMenuItem.Click += new System.EventHandler(this.InvokeTaggedAction);
@ -690,13 +690,13 @@ namespace CodeImp.DoomBuilder.Windows
//
this.toolStripMenuItem11.Margin = new System.Windows.Forms.Padding(0, 3, 0, 3);
this.toolStripMenuItem11.Name = "toolStripMenuItem11";
this.toolStripMenuItem11.Size = new System.Drawing.Size(194, 6);
this.toolStripMenuItem11.Size = new System.Drawing.Size(193, 6);
//
// itemtestmap
//
this.itemtestmap.Image = global::CodeImp.DoomBuilder.Properties.Resources.Test;
this.itemtestmap.Name = "itemtestmap";
this.itemtestmap.Size = new System.Drawing.Size(197, 22);
this.itemtestmap.Size = new System.Drawing.Size(196, 22);
this.itemtestmap.Tag = "builder_testmap";
this.itemtestmap.Text = "Test Map";
this.itemtestmap.Click += new System.EventHandler(this.InvokeTaggedAction);
@ -706,13 +706,13 @@ namespace CodeImp.DoomBuilder.Windows
this.menuhelp.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.itemhelpabout});
this.menuhelp.Name = "menuhelp";
this.menuhelp.Size = new System.Drawing.Size(40, 20);
this.menuhelp.Size = new System.Drawing.Size(44, 20);
this.menuhelp.Text = "Help";
//
// itemhelpabout
//
this.itemhelpabout.Name = "itemhelpabout";
this.itemhelpabout.Size = new System.Drawing.Size(191, 22);
this.itemhelpabout.Size = new System.Drawing.Size(192, 22);
this.itemhelpabout.Text = "About Doom Builder...";
this.itemhelpabout.Click += new System.EventHandler(this.itemhelpabout_Click);
//
@ -1102,7 +1102,7 @@ namespace CodeImp.DoomBuilder.Windows
// itemgrid1024
//
this.itemgrid1024.Name = "itemgrid1024";
this.itemgrid1024.Size = new System.Drawing.Size(164, 22);
this.itemgrid1024.Size = new System.Drawing.Size(153, 22);
this.itemgrid1024.Tag = "1024";
this.itemgrid1024.Text = "1024 mp";
this.itemgrid1024.Click += new System.EventHandler(this.itemgridsize_Click);
@ -1110,7 +1110,7 @@ namespace CodeImp.DoomBuilder.Windows
// itemgrid512
//
this.itemgrid512.Name = "itemgrid512";
this.itemgrid512.Size = new System.Drawing.Size(164, 22);
this.itemgrid512.Size = new System.Drawing.Size(153, 22);
this.itemgrid512.Tag = "512";
this.itemgrid512.Text = "512 mp";
this.itemgrid512.Click += new System.EventHandler(this.itemgridsize_Click);
@ -1118,7 +1118,7 @@ namespace CodeImp.DoomBuilder.Windows
// itemgrid256
//
this.itemgrid256.Name = "itemgrid256";
this.itemgrid256.Size = new System.Drawing.Size(164, 22);
this.itemgrid256.Size = new System.Drawing.Size(153, 22);
this.itemgrid256.Tag = "256";
this.itemgrid256.Text = "256 mp";
this.itemgrid256.Click += new System.EventHandler(this.itemgridsize_Click);
@ -1126,7 +1126,7 @@ namespace CodeImp.DoomBuilder.Windows
// itemgrid128
//
this.itemgrid128.Name = "itemgrid128";
this.itemgrid128.Size = new System.Drawing.Size(164, 22);
this.itemgrid128.Size = new System.Drawing.Size(153, 22);
this.itemgrid128.Tag = "128";
this.itemgrid128.Text = "128 mp";
this.itemgrid128.Click += new System.EventHandler(this.itemgridsize_Click);
@ -1134,7 +1134,7 @@ namespace CodeImp.DoomBuilder.Windows
// itemgrid64
//
this.itemgrid64.Name = "itemgrid64";
this.itemgrid64.Size = new System.Drawing.Size(164, 22);
this.itemgrid64.Size = new System.Drawing.Size(153, 22);
this.itemgrid64.Tag = "64";
this.itemgrid64.Text = "64 mp";
this.itemgrid64.Click += new System.EventHandler(this.itemgridsize_Click);
@ -1142,7 +1142,7 @@ namespace CodeImp.DoomBuilder.Windows
// itemgrid32
//
this.itemgrid32.Name = "itemgrid32";
this.itemgrid32.Size = new System.Drawing.Size(164, 22);
this.itemgrid32.Size = new System.Drawing.Size(153, 22);
this.itemgrid32.Tag = "32";
this.itemgrid32.Text = "32 mp";
this.itemgrid32.Click += new System.EventHandler(this.itemgridsize_Click);
@ -1150,7 +1150,7 @@ namespace CodeImp.DoomBuilder.Windows
// itemgrid16
//
this.itemgrid16.Name = "itemgrid16";
this.itemgrid16.Size = new System.Drawing.Size(164, 22);
this.itemgrid16.Size = new System.Drawing.Size(153, 22);
this.itemgrid16.Tag = "16";
this.itemgrid16.Text = "16 mp";
this.itemgrid16.Click += new System.EventHandler(this.itemgridsize_Click);
@ -1158,7 +1158,7 @@ namespace CodeImp.DoomBuilder.Windows
// itemgrid8
//
this.itemgrid8.Name = "itemgrid8";
this.itemgrid8.Size = new System.Drawing.Size(164, 22);
this.itemgrid8.Size = new System.Drawing.Size(153, 22);
this.itemgrid8.Tag = "8";
this.itemgrid8.Text = "8 mp";
this.itemgrid8.Click += new System.EventHandler(this.itemgridsize_Click);
@ -1166,7 +1166,7 @@ namespace CodeImp.DoomBuilder.Windows
// itemgrid4
//
this.itemgrid4.Name = "itemgrid4";
this.itemgrid4.Size = new System.Drawing.Size(164, 22);
this.itemgrid4.Size = new System.Drawing.Size(153, 22);
this.itemgrid4.Tag = "4";
this.itemgrid4.Text = "4 mp";
this.itemgrid4.Click += new System.EventHandler(this.itemgridsize_Click);
@ -1174,7 +1174,7 @@ namespace CodeImp.DoomBuilder.Windows
// itemgridcustom
//
this.itemgridcustom.Name = "itemgridcustom";
this.itemgridcustom.Size = new System.Drawing.Size(164, 22);
this.itemgridcustom.Size = new System.Drawing.Size(153, 22);
this.itemgridcustom.Text = "Customize...";
this.itemgridcustom.Click += new System.EventHandler(this.itemgridcustom_Click);
//
@ -1213,7 +1213,7 @@ namespace CodeImp.DoomBuilder.Windows
// itemzoom200
//
this.itemzoom200.Name = "itemzoom200";
this.itemzoom200.Size = new System.Drawing.Size(167, 22);
this.itemzoom200.Size = new System.Drawing.Size(156, 22);
this.itemzoom200.Tag = "200";
this.itemzoom200.Text = "200%";
this.itemzoom200.Click += new System.EventHandler(this.itemzoomto_Click);
@ -1221,7 +1221,7 @@ namespace CodeImp.DoomBuilder.Windows
// itemzoom100
//
this.itemzoom100.Name = "itemzoom100";
this.itemzoom100.Size = new System.Drawing.Size(167, 22);
this.itemzoom100.Size = new System.Drawing.Size(156, 22);
this.itemzoom100.Tag = "100";
this.itemzoom100.Text = "100%";
this.itemzoom100.Click += new System.EventHandler(this.itemzoomto_Click);
@ -1229,7 +1229,7 @@ namespace CodeImp.DoomBuilder.Windows
// itemzoom50
//
this.itemzoom50.Name = "itemzoom50";
this.itemzoom50.Size = new System.Drawing.Size(167, 22);
this.itemzoom50.Size = new System.Drawing.Size(156, 22);
this.itemzoom50.Tag = "50";
this.itemzoom50.Text = "50%";
this.itemzoom50.Click += new System.EventHandler(this.itemzoomto_Click);
@ -1237,7 +1237,7 @@ namespace CodeImp.DoomBuilder.Windows
// itemzoom25
//
this.itemzoom25.Name = "itemzoom25";
this.itemzoom25.Size = new System.Drawing.Size(167, 22);
this.itemzoom25.Size = new System.Drawing.Size(156, 22);
this.itemzoom25.Tag = "25";
this.itemzoom25.Text = "25%";
this.itemzoom25.Click += new System.EventHandler(this.itemzoomto_Click);
@ -1245,7 +1245,7 @@ namespace CodeImp.DoomBuilder.Windows
// itemzoom10
//
this.itemzoom10.Name = "itemzoom10";
this.itemzoom10.Size = new System.Drawing.Size(167, 22);
this.itemzoom10.Size = new System.Drawing.Size(156, 22);
this.itemzoom10.Tag = "10";
this.itemzoom10.Text = "10%";
this.itemzoom10.Click += new System.EventHandler(this.itemzoomto_Click);
@ -1253,7 +1253,7 @@ namespace CodeImp.DoomBuilder.Windows
// itemzoom5
//
this.itemzoom5.Name = "itemzoom5";
this.itemzoom5.Size = new System.Drawing.Size(167, 22);
this.itemzoom5.Size = new System.Drawing.Size(156, 22);
this.itemzoom5.Tag = "5";
this.itemzoom5.Text = "5%";
this.itemzoom5.Click += new System.EventHandler(this.itemzoomto_Click);
@ -1261,7 +1261,7 @@ namespace CodeImp.DoomBuilder.Windows
// itemzoomfittoscreen
//
this.itemzoomfittoscreen.Name = "itemzoomfittoscreen";
this.itemzoomfittoscreen.Size = new System.Drawing.Size(167, 22);
this.itemzoomfittoscreen.Size = new System.Drawing.Size(156, 22);
this.itemzoomfittoscreen.Text = "Fit to screen";
this.itemzoomfittoscreen.Click += new System.EventHandler(this.itemzoomfittoscreen_Click);
//

View file

@ -1317,7 +1317,7 @@ namespace CodeImp.DoomBuilder.Windows
// Insert the button at the end of the toolbar
toolbar.Items.Add(button);
UpdateSeperators();
UpdateSeparators();
}
// Removes a button
@ -1328,34 +1328,44 @@ namespace CodeImp.DoomBuilder.Windows
// Remove button
toolbar.Items.Remove(button);
UpdateSeperators();
UpdateSeparators();
}
// This handle visibility changes in the toolbar buttons
private void ToolbarButtonVisibleChanged(object sender, EventArgs e)
{
// Update the seeprators
UpdateSeperators();
UpdateSeparators();
}
// This hides redundant seperators and shows single seperators
internal void UpdateSeparators()
{
UpdateToolStripSeparators(toolbar.Items, false);
UpdateToolStripSeparators(menumode.DropDownItems, true);
}
// This updates the seperators
// Hides redundant seperators and shows single seperators
private void UpdateSeperators()
private void UpdateToolStripSeparators(ToolStripItemCollection items, bool defaultvisible)
{
ToolStripItem pvi = null;
foreach(ToolStripItem i in toolbar.Items)
foreach(ToolStripItem i in items)
{
bool separatorvisible = false;
// This is a seperator?
if(i is ToolStripSeparator)
{
// Make visible when previous item was not a seperator
i.Visible = !(pvi is ToolStripSeparator);
separatorvisible = !(pvi is ToolStripSeparator) && (pvi != null);
i.Visible = separatorvisible;
}
// Keep as previous visible item
if(i.Visible) pvi = i;
if(i.Visible || separatorvisible || (defaultvisible && !(i is ToolStripSeparator))) pvi = i;
}
// Hide last item if it is a seperator
if(pvi is ToolStripSeparator) pvi.Visible = false;
}
@ -1396,11 +1406,35 @@ namespace CodeImp.DoomBuilder.Windows
// Remove it and restart
toolbar.Items.Remove(i);
menumode.DropDownItems.Remove(i);
i.Dispose();
}
// Done
editmodeitems.Clear();
UpdateSeperators();
UpdateSeparators();
}
// This adds an editing mode seperator on the toolbar and menu
internal void AddEditModeSeperator()
{
ToolStripSeparator item;
int index;
// Create a button
index = toolbar.Items.IndexOf(buttoneditmodesseperator);
item = new ToolStripSeparator();
item.Margin = new Padding(6, 0, 6, 0);
toolbar.Items.Insert(index, item);
editmodeitems.Add(item);
// Create menu item
index = menumode.DropDownItems.Count;
item = new ToolStripSeparator();
item.Margin = new Padding(0, 3, 0, 3);
menumode.DropDownItems.Insert(index, item);
editmodeitems.Add(item);
UpdateSeparators();
}
// This adds an editing mode button to the toolbar and edit menu
@ -1416,19 +1450,19 @@ namespace CodeImp.DoomBuilder.Windows
item = new ToolStripButton(modeinfo.ButtonDesc, modeinfo.ButtonImage, new EventHandler(EditModeButtonHandler));
item.DisplayStyle = ToolStripItemDisplayStyle.Image;
item.Tag = modeinfo;
item.Enabled = (General.Map != null);
toolbar.Items.Insert(index, item);
editmodeitems.Add(item);
UpdateSeperators();
// Create menu item
index = menumode.DropDownItems.Count;
item = new ToolStripMenuItem(controlname, modeinfo.ButtonImage, new EventHandler(EditModeButtonHandler));
item.Tag = modeinfo;
item.Enabled = (General.Map != null);
menumode.DropDownItems.Insert(index, item);
editmodeitems.Add(item);
item.Visible = true;
ApplyShortcutKeys(menumode.DropDownItems);
UpdateSeparators();
}
// This handles edit mode button clicks
@ -1816,6 +1850,7 @@ namespace CodeImp.DoomBuilder.Windows
// This sets up the modes menu
private void UpdateModeMenu()
{
menumode.Visible = (General.Map != null);
}
#endregion

View file

@ -195,6 +195,21 @@
<metadata name="linedefinfo.Locked" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="modename.Locked" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="vertexinfo.Locked" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="thinginfo.Locked" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="sectorinfo.Locked" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="linedefinfo.Locked" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="redrawtimer.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>304, 17</value>
</metadata>