Mercurial > repos > IBDev-IBBoard.WarFoundry.GUI.WinForms
changeset 225:5233147ca7e4
Re #101: Make army names and sizes modifiable after creation
* Add form for editing name and size
* Add edit options from army tree
* Add edit options from Edit menu
author | IBBoard <dev@ibboard.co.uk> |
---|---|
date | Mon, 29 Aug 2011 20:06:54 +0100 |
parents | 467decfdde8e |
children | 4ada3252d1ea |
files | FrmArmyTree.cs FrmArmyTree.resx FrmEditArmy.Designer.cs FrmEditArmy.cs FrmEditArmy.resx FrmMain.cs FrmMain.resx IBBoard.WarFoundry.GUI.WinForms.csproj |
diffstat | 8 files changed, 864 insertions(+), 470 deletions(-) [+] |
line wrap: on
line diff
--- a/FrmArmyTree.cs Mon Aug 29 15:17:59 2011 +0100 +++ b/FrmArmyTree.cs Mon Aug 29 20:06:54 2011 +0100 @@ -36,6 +36,7 @@ private IBBToolBarButton bttnEdit; private IBBToolBarButton bttnDelete; private ImageList imageList; + private IBBMenuItem miEditArmy; private CommandStack commandStack; public GameSystem CurrentGameSystem { @@ -102,100 +103,108 @@ /// </summary> private void InitializeComponent() { - this.components = new System.ComponentModel.Container(); - System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(FrmArmyTree)); - this.contextMenu = new System.Windows.Forms.ContextMenu(); - this.miEditUnit = new IBBoard.Windows.Forms.IBBMenuItem(); - this.miDeleteUnit = new IBBoard.Windows.Forms.IBBMenuItem(); - this.imageList = new System.Windows.Forms.ImageList(this.components); - this.toolBar = new System.Windows.Forms.ToolBar(); - this.bttnEdit = new IBBoard.Windows.Forms.IBBToolBarButton(); - this.bttnDelete = new IBBoard.Windows.Forms.IBBToolBarButton(); - this.treeView = new System.Windows.Forms.TreeView(); - this.SuspendLayout(); - // - // contextMenu - // - this.contextMenu.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] { + this.components = new System.ComponentModel.Container(); + System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(FrmArmyTree)); + this.contextMenu = new System.Windows.Forms.ContextMenu(); + this.miEditUnit = new IBBoard.Windows.Forms.IBBMenuItem(); + this.miDeleteUnit = new IBBoard.Windows.Forms.IBBMenuItem(); + this.imageList = new System.Windows.Forms.ImageList(this.components); + this.toolBar = new System.Windows.Forms.ToolBar(); + this.bttnEdit = new IBBoard.Windows.Forms.IBBToolBarButton(); + this.bttnDelete = new IBBoard.Windows.Forms.IBBToolBarButton(); + this.treeView = new System.Windows.Forms.TreeView(); + this.miEditArmy = new IBBoard.Windows.Forms.IBBMenuItem(); + this.SuspendLayout(); + // + // contextMenu + // + this.contextMenu.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] { + this.miEditArmy, this.miEditUnit, this.miDeleteUnit}); - this.contextMenu.Popup += new System.EventHandler(this.contextMenu_Popup); - // - // miEditUnit - // - this.miEditUnit.Index = 0; - this.miEditUnit.Text = "&edit unit"; - this.miEditUnit.Click += new System.EventHandler(this.miEdit_Click); - // - // miDeleteUnit - // - this.miDeleteUnit.Index = 1; - this.miDeleteUnit.Text = "&delete unit"; - this.miDeleteUnit.Click += new System.EventHandler(this.miDelete_Click); - // - // imageList - // - this.imageList.ImageStream = ((System.Windows.Forms.ImageListStreamer)(resources.GetObject("imageList.ImageStream"))); - this.imageList.TransparentColor = System.Drawing.Color.Transparent; - this.imageList.Images.SetKeyName(0, "gtk-edit.png"); - this.imageList.Images.SetKeyName(1, "edit-delete.png"); - // - // toolBar - // - this.toolBar.Buttons.AddRange(new System.Windows.Forms.ToolBarButton[] { + this.contextMenu.Popup += new System.EventHandler(this.contextMenu_Popup); + // + // miEditUnit + // + this.miEditUnit.Index = 1; + this.miEditUnit.Text = "&edit unit"; + this.miEditUnit.Click += new System.EventHandler(this.miEdit_Click); + // + // miDeleteUnit + // + this.miDeleteUnit.Index = 2; + this.miDeleteUnit.Text = "&delete unit"; + this.miDeleteUnit.Click += new System.EventHandler(this.miDelete_Click); + // + // imageList + // + this.imageList.ImageStream = ((System.Windows.Forms.ImageListStreamer)(resources.GetObject("imageList.ImageStream"))); + this.imageList.TransparentColor = System.Drawing.Color.Transparent; + this.imageList.Images.SetKeyName(0, "gtk-edit.png"); + this.imageList.Images.SetKeyName(1, "edit-delete.png"); + // + // toolBar + // + this.toolBar.Buttons.AddRange(new System.Windows.Forms.ToolBarButton[] { this.bttnEdit, this.bttnDelete}); - this.toolBar.ButtonSize = new System.Drawing.Size(16, 16); - this.toolBar.DropDownArrows = true; - this.toolBar.ImageList = this.imageList; - this.toolBar.Location = new System.Drawing.Point(0, 0); - this.toolBar.Name = "toolBar"; - this.toolBar.ShowToolTips = true; - this.toolBar.Size = new System.Drawing.Size(240, 28); - this.toolBar.TabIndex = 3; - this.toolBar.ButtonClick += new System.Windows.Forms.ToolBarButtonClickEventHandler(this.toolBar_ButtonClick); - // - // bttnEdit - // - this.bttnEdit.Enabled = false; - this.bttnEdit.ImageIndex = 0; - this.bttnEdit.Name = "bttnEdit"; - // - // bttnDelete - // - this.bttnDelete.Enabled = false; - this.bttnDelete.ImageIndex = 1; - this.bttnDelete.Name = "bttnDelete"; - // - // treeView - // - this.treeView.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) - | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.treeView.ContextMenu = this.contextMenu; - this.treeView.FullRowSelect = true; - this.treeView.Location = new System.Drawing.Point(0, 28); - this.treeView.Name = "treeView"; - this.treeView.Size = new System.Drawing.Size(240, 250); - this.treeView.TabIndex = 0; - this.treeView.DoubleClick += new System.EventHandler(this.treeView_DoubleClick); - this.treeView.AfterSelect += new System.Windows.Forms.TreeViewEventHandler(this.treeView_AfterSelect); - this.treeView.MouseDown += new System.Windows.Forms.MouseEventHandler(this.treeView_MouseDown); - // - // FrmArmyTree - // - this.AutoScaleBaseSize = new System.Drawing.Size(5, 13); - this.ClientSize = new System.Drawing.Size(240, 277); - this.ControlBox = false; - this.Controls.Add(this.toolBar); - this.Controls.Add(this.treeView); - this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.SizableToolWindow; - this.MaximizeBox = false; - this.MinimizeBox = false; - this.Name = "FrmArmyTree"; - this.Text = "FrmArmyTree"; - this.ResumeLayout(false); - this.PerformLayout(); + this.toolBar.ButtonSize = new System.Drawing.Size(16, 16); + this.toolBar.DropDownArrows = true; + this.toolBar.ImageList = this.imageList; + this.toolBar.Location = new System.Drawing.Point(0, 0); + this.toolBar.Name = "toolBar"; + this.toolBar.ShowToolTips = true; + this.toolBar.Size = new System.Drawing.Size(240, 28); + this.toolBar.TabIndex = 3; + this.toolBar.ButtonClick += new System.Windows.Forms.ToolBarButtonClickEventHandler(this.toolBar_ButtonClick); + // + // bttnEdit + // + this.bttnEdit.Enabled = false; + this.bttnEdit.ImageIndex = 0; + this.bttnEdit.Name = "bttnEdit"; + // + // bttnDelete + // + this.bttnDelete.Enabled = false; + this.bttnDelete.ImageIndex = 1; + this.bttnDelete.Name = "bttnDelete"; + // + // treeView + // + this.treeView.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) + | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.treeView.ContextMenu = this.contextMenu; + this.treeView.FullRowSelect = true; + this.treeView.Location = new System.Drawing.Point(0, 28); + this.treeView.Name = "treeView"; + this.treeView.Size = new System.Drawing.Size(240, 250); + this.treeView.TabIndex = 0; + this.treeView.AfterSelect += new System.Windows.Forms.TreeViewEventHandler(this.treeView_AfterSelect); + this.treeView.DoubleClick += new System.EventHandler(this.treeView_DoubleClick); + this.treeView.MouseDown += new System.Windows.Forms.MouseEventHandler(this.treeView_MouseDown); + // + // miEditArmy + // + this.miEditArmy.Index = 0; + this.miEditArmy.Text = "&edit army"; + this.miEditArmy.Click += new System.EventHandler(this.miEditArmy_Click); + // + // FrmArmyTree + // + this.AutoScaleBaseSize = new System.Drawing.Size(5, 13); + this.ClientSize = new System.Drawing.Size(240, 277); + this.ControlBox = false; + this.Controls.Add(this.toolBar); + this.Controls.Add(this.treeView); + this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.SizableToolWindow; + this.MaximizeBox = false; + this.MinimizeBox = false; + this.Name = "FrmArmyTree"; + this.Text = "FrmArmyTree"; + this.ResumeLayout(false); + this.PerformLayout(); } #endregion @@ -341,20 +350,25 @@ private void contextMenu_Popup(object sender, System.EventArgs e) { TreeNode node = treeView.SelectedNode; + Object tag = (node != null) ? node.Tag : null; - if (node!=null && node.Tag is Unit) + if (tag is Unit) { - foreach(MenuItem item in contextMenu.MenuItems) - { - item.Visible = true; - } + miDeleteUnit.Visible = true; + miEditUnit.Visible = true; + miEditArmy.Visible = false; + } + else if (tag is Army) + { + miDeleteUnit.Visible = false; + miEditUnit.Visible = false; + miEditArmy.Visible = true; } else { - foreach(MenuItem item in contextMenu.MenuItems) - { - item.Visible = false; - } + miDeleteUnit.Visible = false; + miEditUnit.Visible = false; + miEditArmy.Visible = false; } } @@ -394,15 +408,15 @@ private void miEdit_Click(object sender, System.EventArgs e) { - EditUnit(); + EditTreeItem(); } private void treeView_DoubleClick(object sender, System.EventArgs e) { - EditUnit(); + EditTreeItem(); } - private void EditUnit() + private void EditTreeItem() { TreeNode selected = treeView.SelectedNode; object tagData = selected.Tag; @@ -412,6 +426,10 @@ Unit unit = (Unit) tagData; MdiParent.OpenUnitDialog(unit); } + else if (tagData is Army) + { + EditArmy((Army)tagData); + } } private void UpdateUnitName(WarFoundryObject obj, string oldValue, string newValue) @@ -454,7 +472,7 @@ } else if (e.Button == bttnEdit) { - EditUnit(); + EditTreeItem(); } } @@ -463,7 +481,19 @@ TreeNode node = treeView.SelectedNode; bttnDelete.Enabled = (node != null && node.Tag is Unit); - bttnEdit.Enabled = bttnDelete.Enabled; + bttnEdit.Enabled = (node != null && (node.Tag is Unit || node.Tag is Army)); + } + + private void miEditArmy_Click(object sender, EventArgs e) + { + Army army = treeView.SelectedNode.Tag as Army; + EditArmy(army); + } + + private void EditArmy(Army army) + { + FrmEditArmy editForm = new FrmEditArmy(commandStack, army); + editForm.ShowDialog(this.ParentForm); } } }
--- a/FrmArmyTree.resx Mon Aug 29 15:17:59 2011 +0100 +++ b/FrmArmyTree.resx Mon Aug 29 20:06:54 2011 +0100 @@ -125,7 +125,7 @@ </metadata> <data name="imageList.ImageStream" mimetype="application/x-microsoft.net.object.binary.base64"> <value> - AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj0yLjAuMC4w + AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj00LjAuMC4w LCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAACZTeXN0 ZW0uV2luZG93cy5Gb3Jtcy5JbWFnZUxpc3RTdHJlYW1lcgEAAAAERGF0YQcCAgAAAAkDAAAADwMAAABO BwAAAk1TRnQBSQFMAgEBAgEAAQQBAAEEAQABEAEAARABAAT/ARkBAAj/AUIBTQE2BwABNgMAASgDAAFA
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/FrmEditArmy.Designer.cs Mon Aug 29 20:06:54 2011 +0100 @@ -0,0 +1,146 @@ +namespace IBBoard.WarFoundry.GUI.WinForms +{ + partial class FrmEditArmy + { + /// <summary> + /// Required designer variable. + /// </summary> + private System.ComponentModel.IContainer components = null; + + /// <summary> + /// Clean up any resources being used. + /// </summary> + /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param> + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// <summary> + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// </summary> + private void InitializeComponent() + { + this.bttnOkay = new IBBoard.Windows.Forms.IBBButton(); + this.armySize = new System.Windows.Forms.NumericUpDown(); + this.lblArmySize = new IBBoard.Windows.Forms.IBBLabel(); + this.txtArmyName = new System.Windows.Forms.TextBox(); + this.lblArmyName = new IBBoard.Windows.Forms.IBBLabel(); + this.bttnCancel = new IBBoard.Windows.Forms.IBBButton(); + ((System.ComponentModel.ISupportInitialize)(this.armySize)).BeginInit(); + this.SuspendLayout(); + // + // bttnOkay + // + this.bttnOkay.Location = new System.Drawing.Point(330, 76); + this.bttnOkay.Name = "bttnOkay"; + this.bttnOkay.Size = new System.Drawing.Size(75, 23); + this.bttnOkay.TabIndex = 13; + this.bttnOkay.Text = "okay"; + this.bttnOkay.UseVisualStyleBackColor = true; + this.bttnOkay.Click += new System.EventHandler(this.bttnOkay_Click); + // + // armySize + // + this.armySize.Increment = new decimal(new int[] { + 50, + 0, + 0, + 0}); + this.armySize.Location = new System.Drawing.Point(140, 38); + this.armySize.Maximum = new decimal(new int[] { + 1000000, + 0, + 0, + 0}); + this.armySize.Name = "armySize"; + this.armySize.Size = new System.Drawing.Size(99, 20); + this.armySize.TabIndex = 17; + this.armySize.ThousandsSeparator = true; + this.armySize.Value = new decimal(new int[] { + 2000, + 0, + 0, + 0}); + this.armySize.ValueChanged += new System.EventHandler(this.armySize_ValueChanged); + this.armySize.KeyUp += new System.Windows.Forms.KeyEventHandler(this.armySize_KeyUp); + // + // lblArmySize + // + this.lblArmySize.Location = new System.Drawing.Point(12, 40); + this.lblArmySize.Name = "lblArmySize"; + this.lblArmySize.Size = new System.Drawing.Size(122, 18); + this.lblArmySize.TabIndex = 16; + this.lblArmySize.Text = "army size"; + this.lblArmySize.TextAlign = System.Drawing.ContentAlignment.TopRight; + // + // txtArmyName + // + this.txtArmyName.Location = new System.Drawing.Point(140, 12); + this.txtArmyName.Name = "txtArmyName"; + this.txtArmyName.Size = new System.Drawing.Size(265, 20); + this.txtArmyName.TabIndex = 15; + this.txtArmyName.TextChanged += new System.EventHandler(this.txtArmyName_TextChanged); + // + // lblArmyName + // + this.lblArmyName.Location = new System.Drawing.Point(12, 15); + this.lblArmyName.Name = "lblArmyName"; + this.lblArmyName.Size = new System.Drawing.Size(122, 17); + this.lblArmyName.TabIndex = 14; + this.lblArmyName.Text = "army name"; + this.lblArmyName.TextAlign = System.Drawing.ContentAlignment.TopRight; + // + // bttnCancel + // + this.bttnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel; + this.bttnCancel.Location = new System.Drawing.Point(13, 76); + this.bttnCancel.Name = "bttnCancel"; + this.bttnCancel.Size = new System.Drawing.Size(75, 23); + this.bttnCancel.TabIndex = 18; + this.bttnCancel.Text = "cancel"; + this.bttnCancel.UseVisualStyleBackColor = true; + this.bttnCancel.Click += new System.EventHandler(this.bttnCancel_Click); + // + // FrmEditArmy + // + this.AcceptButton = this.bttnOkay; + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.CancelButton = this.bttnCancel; + this.ClientSize = new System.Drawing.Size(417, 111); + this.Controls.Add(this.bttnCancel); + this.Controls.Add(this.armySize); + this.Controls.Add(this.lblArmySize); + this.Controls.Add(this.txtArmyName); + this.Controls.Add(this.lblArmyName); + this.Controls.Add(this.bttnOkay); + this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog; + this.Name = "FrmEditArmy"; + this.ShowIcon = false; + this.ShowInTaskbar = false; + this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; + this.Text = "edit army"; + ((System.ComponentModel.ISupportInitialize)(this.armySize)).EndInit(); + this.ResumeLayout(false); + this.PerformLayout(); + + } + + #endregion + + private Windows.Forms.IBBButton bttnOkay; + private System.Windows.Forms.NumericUpDown armySize; + private Windows.Forms.IBBLabel lblArmySize; + private System.Windows.Forms.TextBox txtArmyName; + private Windows.Forms.IBBLabel lblArmyName; + private Windows.Forms.IBBButton bttnCancel; + } +} \ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/FrmEditArmy.cs Mon Aug 29 20:06:54 2011 +0100 @@ -0,0 +1,64 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Drawing; +using System.Text; +using System.Windows.Forms; +using IBBoard.Commands; +using IBBoard.WarFoundry.API.Commands; +using IBBoard.WarFoundry.API.Objects; + +namespace IBBoard.WarFoundry.GUI.WinForms +{ + public partial class FrmEditArmy : Form + { + private Army army; + private CommandStack stack; + + public FrmEditArmy(CommandStack cmdStack, Army toEdit) + { + army = toEdit; + stack = cmdStack; + InitializeComponent(); + txtArmyName.Text = army.Name; + armySize.Value = army.MaxPoints; + } + + private void bttnOkay_Click(object sender, EventArgs e) + { + EditArmyCommand command = new EditArmyCommand(army); + command.NewName = txtArmyName.Text; + command.NewSize = (int)armySize.Value; + stack.Execute(command); + DialogResult = DialogResult.OK; + Close(); + } + + private void bttnCancel_Click(object sender, EventArgs e) + { + Close(); + } + + private void armySize_ValueChanged(object sender, EventArgs e) + { + SetOkayEnabled(); + } + + private void SetOkayEnabled() + { + string trimmedName = txtArmyName.Text.Trim(); + bttnOkay.Enabled = ((army.MaxPoints != armySize.Value || army.Name != trimmedName) && trimmedName != ""); + } + + private void txtArmyName_TextChanged(object sender, EventArgs e) + { + SetOkayEnabled(); + } + + private void armySize_KeyUp(object sender, KeyEventArgs e) + { + SetOkayEnabled(); + } + } +}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/FrmEditArmy.resx Mon Aug 29 20:06:54 2011 +0100 @@ -0,0 +1,120 @@ +<?xml version="1.0" encoding="utf-8"?> +<root> + <!-- + Microsoft ResX Schema + + Version 2.0 + + The primary goals of this format is to allow a simple XML format + that is mostly human readable. The generation and parsing of the + various data types are done through the TypeConverter classes + associated with the data types. + + Example: + + ... ado.net/XML headers & schema ... + <resheader name="resmimetype">text/microsoft-resx</resheader> + <resheader name="version">2.0</resheader> + <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader> + <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader> + <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data> + <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data> + <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64"> + <value>[base64 mime encoded serialized .NET Framework object]</value> + </data> + <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> + <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value> + <comment>This is a comment</comment> + </data> + + There are any number of "resheader" rows that contain simple + name/value pairs. + + Each data row contains a name, and value. The row also contains a + type or mimetype. Type corresponds to a .NET class that support + text/value conversion through the TypeConverter architecture. + Classes that don't support this are serialized and stored with the + mimetype set. + + The mimetype is used for serialized objects, and tells the + ResXResourceReader how to depersist the object. This is currently not + extensible. For a given mimetype the value must be set accordingly: + + Note - application/x-microsoft.net.object.binary.base64 is the format + that the ResXResourceWriter will generate, however the reader can + read any of the formats listed below. + + mimetype: application/x-microsoft.net.object.binary.base64 + value : The object must be serialized with + : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter + : and then encoded with base64 encoding. + + mimetype: application/x-microsoft.net.object.soap.base64 + value : The object must be serialized with + : System.Runtime.Serialization.Formatters.Soap.SoapFormatter + : and then encoded with base64 encoding. + + mimetype: application/x-microsoft.net.object.bytearray.base64 + value : The object must be serialized into a byte array + : using a System.ComponentModel.TypeConverter + : and then encoded with base64 encoding. + --> + <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"> + <xsd:import namespace="http://www.w3.org/XML/1998/namespace" /> + <xsd:element name="root" msdata:IsDataSet="true"> + <xsd:complexType> + <xsd:choice maxOccurs="unbounded"> + <xsd:element name="metadata"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="value" type="xsd:string" minOccurs="0" /> + </xsd:sequence> + <xsd:attribute name="name" use="required" type="xsd:string" /> + <xsd:attribute name="type" type="xsd:string" /> + <xsd:attribute name="mimetype" type="xsd:string" /> + <xsd:attribute ref="xml:space" /> + </xsd:complexType> + </xsd:element> + <xsd:element name="assembly"> + <xsd:complexType> + <xsd:attribute name="alias" type="xsd:string" /> + <xsd:attribute name="name" type="xsd:string" /> + </xsd:complexType> + </xsd:element> + <xsd:element name="data"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> + <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" /> + </xsd:sequence> + <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" /> + <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" /> + <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" /> + <xsd:attribute ref="xml:space" /> + </xsd:complexType> + </xsd:element> + <xsd:element name="resheader"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> + </xsd:sequence> + <xsd:attribute name="name" type="xsd:string" use="required" /> + </xsd:complexType> + </xsd:element> + </xsd:choice> + </xsd:complexType> + </xsd:element> + </xsd:schema> + <resheader name="resmimetype"> + <value>text/microsoft-resx</value> + </resheader> + <resheader name="version"> + <value>2.0</value> + </resheader> + <resheader name="reader"> + <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> + </resheader> + <resheader name="writer"> + <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> + </resheader> +</root> \ No newline at end of file
--- a/FrmMain.cs Mon Aug 29 15:17:59 2011 +0100 +++ b/FrmMain.cs Mon Aug 29 20:06:54 2011 +0100 @@ -94,6 +94,8 @@ private ToolStripSeparator toolStripSeparator4; private IBBToolStripMenuItem miPreferences; private IBBToolStripMenuItem miExportArmyAsBasicXml; + private IBBToolStripMenuItem miEditArmy; + private ToolStripSeparator toolStripSeparator5; private IBBToolStripMenuItem miAbout; @@ -243,73 +245,203 @@ /// </summary> private void InitializeComponent() { - this.components = new System.ComponentModel.Container(); - System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(FrmMain)); - this.undoMenu = new System.Windows.Forms.ContextMenu(); - this.redoMenu = new System.Windows.Forms.ContextMenu(); - this.mainMenu = new System.Windows.Forms.MainMenu(this.components); - this.openArmyDialog = new System.Windows.Forms.OpenFileDialog(); - this.saveArmyDialog = new System.Windows.Forms.SaveFileDialog(); - this.menuStrip = new System.Windows.Forms.MenuStrip(); - this.menuFile = new IBBoard.Windows.Forms.IBBToolStripMenuItem(); - this.miNewArmy = new IBBoard.Windows.Forms.IBBToolStripMenuItem(); - this.miOpenArmy = new IBBoard.Windows.Forms.IBBToolStripMenuItem(); - this.miSaveArmy = new IBBoard.Windows.Forms.IBBToolStripMenuItem(); - this.miSaveArmyAs = new IBBoard.Windows.Forms.IBBToolStripMenuItem(); - this.miExportArmyAs = new IBBoard.Windows.Forms.IBBToolStripMenuItem(); - this.miExportArmyAsBasicHTML = new IBBoard.Windows.Forms.IBBToolStripMenuItem(); - this.miExportArmyAsBasicXml = new IBBoard.Windows.Forms.IBBToolStripMenuItem(); - this.miCloseArmy = new IBBoard.Windows.Forms.IBBToolStripMenuItem(); - this.toolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator(); - this.miReloadFiles = new IBBoard.Windows.Forms.IBBToolStripMenuItem(); - this.toolStripSeparator2 = new System.Windows.Forms.ToolStripSeparator(); - this.miExit = new IBBoard.Windows.Forms.IBBToolStripMenuItem(); - this.menuEdit = new IBBoard.Windows.Forms.IBBToolStripMenuItem(); - this.miUndo = new IBBoard.Windows.Forms.IBBToolStripMenuItem(); - this.miRedo = new IBBoard.Windows.Forms.IBBToolStripMenuItem(); - this.toolStripSeparator4 = new System.Windows.Forms.ToolStripSeparator(); - this.miPreferences = new IBBoard.Windows.Forms.IBBToolStripMenuItem(); - this.menuHelp = new IBBoard.Windows.Forms.IBBToolStripMenuItem(); - this.miAbout = new IBBoard.Windows.Forms.IBBToolStripMenuItem(); - this.mainToolStrip = new System.Windows.Forms.ToolStrip(); - this.bttnNewArmy = new IBBoard.Windows.Forms.IBBToolStripButton(); - this.bttnOpenArmy = new IBBoard.Windows.Forms.IBBToolStripButton(); - this.bttnSaveArmy = new IBBoard.Windows.Forms.IBBToolStripButton(); - this.toolStripSeparator3 = new System.Windows.Forms.ToolStripSeparator(); - this.bttnUndo = new IBBoard.Windows.Forms.IBBToolStripSplitButton(); - this.bttnRedo = new IBBoard.Windows.Forms.IBBToolStripSplitButton(); - this.catToolStrip = new System.Windows.Forms.ToolStrip(); - this.statusBar = new IBBoard.Windows.Forms.ColorableStatusBar(); - this.sbMainPanel = new IBBoard.Windows.Forms.ColorableStatusBarPanel(); - this.sbErrorPanel = new IBBoard.Windows.Forms.ColorableStatusBarPanel(); - this.sbPointsPanel = new IBBoard.Windows.Forms.ColorableStatusBarPanel(); - this.toolStripPanel = new System.Windows.Forms.ToolStripPanel(); - this.menuStrip.SuspendLayout(); - this.mainToolStrip.SuspendLayout(); - ((System.ComponentModel.ISupportInitialize)(this.sbMainPanel)).BeginInit(); - ((System.ComponentModel.ISupportInitialize)(this.sbErrorPanel)).BeginInit(); - ((System.ComponentModel.ISupportInitialize)(this.sbPointsPanel)).BeginInit(); - this.SuspendLayout(); - // - // saveArmyDialog - // - this.saveArmyDialog.Title = "Translatable:saveArmyDialog"; - // - // menuStrip - // - this.menuStrip.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.components = new System.ComponentModel.Container(); + System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(FrmMain)); + this.undoMenu = new System.Windows.Forms.ContextMenu(); + this.redoMenu = new System.Windows.Forms.ContextMenu(); + this.mainMenu = new System.Windows.Forms.MainMenu(this.components); + this.openArmyDialog = new System.Windows.Forms.OpenFileDialog(); + this.saveArmyDialog = new System.Windows.Forms.SaveFileDialog(); + this.menuStrip = new System.Windows.Forms.MenuStrip(); + this.mainToolStrip = new System.Windows.Forms.ToolStrip(); + this.toolStripSeparator3 = new System.Windows.Forms.ToolStripSeparator(); + this.catToolStrip = new System.Windows.Forms.ToolStrip(); + this.toolStripPanel = new System.Windows.Forms.ToolStripPanel(); + this.bttnNewArmy = new IBBoard.Windows.Forms.IBBToolStripButton(); + this.bttnOpenArmy = new IBBoard.Windows.Forms.IBBToolStripButton(); + this.bttnSaveArmy = new IBBoard.Windows.Forms.IBBToolStripButton(); + this.bttnUndo = new IBBoard.Windows.Forms.IBBToolStripSplitButton(); + this.bttnRedo = new IBBoard.Windows.Forms.IBBToolStripSplitButton(); + this.statusBar = new IBBoard.Windows.Forms.ColorableStatusBar(); + this.sbMainPanel = new IBBoard.Windows.Forms.ColorableStatusBarPanel(); + this.sbErrorPanel = new IBBoard.Windows.Forms.ColorableStatusBarPanel(); + this.sbPointsPanel = new IBBoard.Windows.Forms.ColorableStatusBarPanel(); + this.menuFile = new IBBoard.Windows.Forms.IBBToolStripMenuItem(); + this.miNewArmy = new IBBoard.Windows.Forms.IBBToolStripMenuItem(); + this.miOpenArmy = new IBBoard.Windows.Forms.IBBToolStripMenuItem(); + this.miSaveArmy = new IBBoard.Windows.Forms.IBBToolStripMenuItem(); + this.miSaveArmyAs = new IBBoard.Windows.Forms.IBBToolStripMenuItem(); + this.miExportArmyAs = new IBBoard.Windows.Forms.IBBToolStripMenuItem(); + this.miExportArmyAsBasicHTML = new IBBoard.Windows.Forms.IBBToolStripMenuItem(); + this.miExportArmyAsBasicXml = new IBBoard.Windows.Forms.IBBToolStripMenuItem(); + this.miCloseArmy = new IBBoard.Windows.Forms.IBBToolStripMenuItem(); + this.toolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator(); + this.miReloadFiles = new IBBoard.Windows.Forms.IBBToolStripMenuItem(); + this.toolStripSeparator2 = new System.Windows.Forms.ToolStripSeparator(); + this.miExit = new IBBoard.Windows.Forms.IBBToolStripMenuItem(); + this.menuEdit = new IBBoard.Windows.Forms.IBBToolStripMenuItem(); + this.miUndo = new IBBoard.Windows.Forms.IBBToolStripMenuItem(); + this.miRedo = new IBBoard.Windows.Forms.IBBToolStripMenuItem(); + this.toolStripSeparator4 = new System.Windows.Forms.ToolStripSeparator(); + this.miEditArmy = new IBBoard.Windows.Forms.IBBToolStripMenuItem(); + this.toolStripSeparator5 = new System.Windows.Forms.ToolStripSeparator(); + this.miPreferences = new IBBoard.Windows.Forms.IBBToolStripMenuItem(); + this.menuHelp = new IBBoard.Windows.Forms.IBBToolStripMenuItem(); + this.miAbout = new IBBoard.Windows.Forms.IBBToolStripMenuItem(); + this.menuStrip.SuspendLayout(); + this.mainToolStrip.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.sbMainPanel)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.sbErrorPanel)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.sbPointsPanel)).BeginInit(); + this.SuspendLayout(); + // + // saveArmyDialog + // + this.saveArmyDialog.Title = "Translatable:saveArmyDialog"; + // + // menuStrip + // + this.menuStrip.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { this.menuFile, this.menuEdit, this.menuHelp}); - this.menuStrip.Location = new System.Drawing.Point(0, 0); - this.menuStrip.Name = "menuStrip"; - this.menuStrip.Size = new System.Drawing.Size(790, 24); - this.menuStrip.TabIndex = 6; - this.menuStrip.Text = "menuStrip1"; - // - // menuFile - // - this.menuFile.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.menuStrip.Location = new System.Drawing.Point(0, 0); + this.menuStrip.Name = "menuStrip"; + this.menuStrip.Size = new System.Drawing.Size(790, 24); + this.menuStrip.TabIndex = 6; + this.menuStrip.Text = "menuStrip1"; + // + // mainToolStrip + // + this.mainToolStrip.Dock = System.Windows.Forms.DockStyle.None; + this.mainToolStrip.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.bttnNewArmy, + this.bttnOpenArmy, + this.bttnSaveArmy, + this.toolStripSeparator3, + this.bttnUndo, + this.bttnRedo}); + this.mainToolStrip.Location = new System.Drawing.Point(0, 24); + this.mainToolStrip.Name = "mainToolStrip"; + this.mainToolStrip.Size = new System.Drawing.Size(151, 25); + this.mainToolStrip.TabIndex = 8; + // + // toolStripSeparator3 + // + this.toolStripSeparator3.Name = "toolStripSeparator3"; + this.toolStripSeparator3.Size = new System.Drawing.Size(6, 25); + // + // catToolStrip + // + this.catToolStrip.Dock = System.Windows.Forms.DockStyle.None; + this.catToolStrip.Location = new System.Drawing.Point(161, 24); + this.catToolStrip.Name = "catToolStrip"; + this.catToolStrip.Size = new System.Drawing.Size(111, 25); + this.catToolStrip.TabIndex = 9; + this.catToolStrip.Visible = false; + // + // toolStripPanel + // + this.toolStripPanel.Dock = System.Windows.Forms.DockStyle.Top; + this.toolStripPanel.Location = new System.Drawing.Point(0, 24); + this.toolStripPanel.Name = "toolStripPanel"; + this.toolStripPanel.Orientation = System.Windows.Forms.Orientation.Horizontal; + this.toolStripPanel.RowMargin = new System.Windows.Forms.Padding(3, 0, 0, 0); + this.toolStripPanel.Size = new System.Drawing.Size(790, 0); + // + // bttnNewArmy + // + this.bttnNewArmy.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; + this.bttnNewArmy.Image = global::IBBoard.WarFoundry.GUI.WinForms.Properties.Resources.document_new; + this.bttnNewArmy.ImageTransparentColor = System.Drawing.Color.Magenta; + this.bttnNewArmy.Name = "bttnNewArmy"; + this.bttnNewArmy.Size = new System.Drawing.Size(23, 22); + this.bttnNewArmy.Text = "new army"; + this.bttnNewArmy.Click += new System.EventHandler(this.miNewArmy_Click); + // + // bttnOpenArmy + // + this.bttnOpenArmy.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; + this.bttnOpenArmy.Image = global::IBBoard.WarFoundry.GUI.WinForms.Properties.Resources.document_open; + this.bttnOpenArmy.ImageTransparentColor = System.Drawing.Color.Magenta; + this.bttnOpenArmy.Name = "bttnOpenArmy"; + this.bttnOpenArmy.Size = new System.Drawing.Size(23, 22); + this.bttnOpenArmy.Text = "open army"; + this.bttnOpenArmy.Click += new System.EventHandler(this.miOpenArmy_Click); + // + // bttnSaveArmy + // + this.bttnSaveArmy.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; + this.bttnSaveArmy.Enabled = false; + this.bttnSaveArmy.Image = global::IBBoard.WarFoundry.GUI.WinForms.Properties.Resources.document_save; + this.bttnSaveArmy.ImageTransparentColor = System.Drawing.Color.Magenta; + this.bttnSaveArmy.Name = "bttnSaveArmy"; + this.bttnSaveArmy.Size = new System.Drawing.Size(23, 22); + this.bttnSaveArmy.Text = "save army"; + this.bttnSaveArmy.Click += new System.EventHandler(this.miSaveArmy_Click); + // + // bttnUndo + // + this.bttnUndo.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; + this.bttnUndo.Enabled = false; + this.bttnUndo.Image = global::IBBoard.WarFoundry.GUI.WinForms.Properties.Resources.edit_undo; + this.bttnUndo.ImageTransparentColor = System.Drawing.Color.Magenta; + this.bttnUndo.Name = "bttnUndo"; + this.bttnUndo.Size = new System.Drawing.Size(32, 22); + this.bttnUndo.Text = "undo"; + this.bttnUndo.ButtonClick += new System.EventHandler(this.miUndo_Click); + // + // bttnRedo + // + this.bttnRedo.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; + this.bttnRedo.Enabled = false; + this.bttnRedo.Image = global::IBBoard.WarFoundry.GUI.WinForms.Properties.Resources.edit_redo; + this.bttnRedo.ImageTransparentColor = System.Drawing.Color.Magenta; + this.bttnRedo.Name = "bttnRedo"; + this.bttnRedo.Size = new System.Drawing.Size(32, 22); + this.bttnRedo.Text = "redo"; + this.bttnRedo.ButtonClick += new System.EventHandler(this.miRedo_Click); + // + // statusBar + // + this.statusBar.Location = new System.Drawing.Point(0, 586); + this.statusBar.Name = "statusBar"; + this.statusBar.Panels.AddRange(new System.Windows.Forms.StatusBarPanel[] { + this.sbMainPanel, + this.sbErrorPanel, + this.sbPointsPanel}); + this.statusBar.ShowPanels = true; + this.statusBar.Size = new System.Drawing.Size(790, 22); + this.statusBar.TabIndex = 1; + this.statusBar.DrawItem += new System.Windows.Forms.StatusBarDrawItemEventHandler(this.statusBar_DrawItem); + this.statusBar.PanelClick += new System.Windows.Forms.StatusBarPanelClickEventHandler(this.statusBar_PanelClick); + // + // sbMainPanel + // + this.sbMainPanel.AutoSize = System.Windows.Forms.StatusBarPanelAutoSize.Spring; + this.sbMainPanel.Color = System.Drawing.SystemColors.WindowText; + this.sbMainPanel.Name = "sbMainPanel"; + this.sbMainPanel.Style = System.Windows.Forms.StatusBarPanelStyle.OwnerDraw; + this.sbMainPanel.Width = 473; + // + // sbErrorPanel + // + this.sbErrorPanel.Color = System.Drawing.SystemColors.WindowText; + this.sbErrorPanel.Name = "sbErrorPanel"; + this.sbErrorPanel.Style = System.Windows.Forms.StatusBarPanelStyle.OwnerDraw; + this.sbErrorPanel.Width = 150; + // + // sbPointsPanel + // + this.sbPointsPanel.Color = System.Drawing.SystemColors.WindowText; + this.sbPointsPanel.Name = "sbPointsPanel"; + this.sbPointsPanel.Style = System.Windows.Forms.StatusBarPanelStyle.OwnerDraw; + this.sbPointsPanel.ToolTipText = "current points total"; + this.sbPointsPanel.Width = 150; + // + // menuFile + // + this.menuFile.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { this.miNewArmy, this.miOpenArmy, this.miSaveArmy, @@ -320,303 +452,189 @@ this.miReloadFiles, this.toolStripSeparator2, this.miExit}); - this.menuFile.Name = "menuFile"; - this.menuFile.Size = new System.Drawing.Size(35, 20); - this.menuFile.Text = "&file"; - // - // miNewArmy - // - this.miNewArmy.Name = "miNewArmy"; - this.miNewArmy.Size = new System.Drawing.Size(160, 22); - this.miNewArmy.Text = "&new army"; - this.miNewArmy.Click += new System.EventHandler(this.miNewArmy_Click); - // - // miOpenArmy - // - this.miOpenArmy.Name = "miOpenArmy"; - this.miOpenArmy.Size = new System.Drawing.Size(160, 22); - this.miOpenArmy.Text = "&open army"; - this.miOpenArmy.Click += new System.EventHandler(this.miOpenArmy_Click); - // - // miSaveArmy - // - this.miSaveArmy.Enabled = false; - this.miSaveArmy.Name = "miSaveArmy"; - this.miSaveArmy.Size = new System.Drawing.Size(160, 22); - this.miSaveArmy.Text = "&save army"; - this.miSaveArmy.Click += new System.EventHandler(this.miSaveArmy_Click); - // - // miSaveArmyAs - // - this.miSaveArmyAs.Enabled = false; - this.miSaveArmyAs.Name = "miSaveArmyAs"; - this.miSaveArmyAs.Size = new System.Drawing.Size(160, 22); - this.miSaveArmyAs.Text = "save army &as..."; - this.miSaveArmyAs.Click += new System.EventHandler(this.miSaveArmyAs_Click); - // - // miExportArmyAs - // - this.miExportArmyAs.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.menuFile.Name = "menuFile"; + this.menuFile.Size = new System.Drawing.Size(33, 20); + this.menuFile.Text = "&file"; + // + // miNewArmy + // + this.miNewArmy.Name = "miNewArmy"; + this.miNewArmy.Size = new System.Drawing.Size(170, 22); + this.miNewArmy.Text = "&new army"; + this.miNewArmy.Click += new System.EventHandler(this.miNewArmy_Click); + // + // miOpenArmy + // + this.miOpenArmy.Name = "miOpenArmy"; + this.miOpenArmy.Size = new System.Drawing.Size(170, 22); + this.miOpenArmy.Text = "&open army"; + this.miOpenArmy.Click += new System.EventHandler(this.miOpenArmy_Click); + // + // miSaveArmy + // + this.miSaveArmy.Enabled = false; + this.miSaveArmy.Name = "miSaveArmy"; + this.miSaveArmy.Size = new System.Drawing.Size(170, 22); + this.miSaveArmy.Text = "&save army"; + this.miSaveArmy.Click += new System.EventHandler(this.miSaveArmy_Click); + // + // miSaveArmyAs + // + this.miSaveArmyAs.Enabled = false; + this.miSaveArmyAs.Name = "miSaveArmyAs"; + this.miSaveArmyAs.Size = new System.Drawing.Size(170, 22); + this.miSaveArmyAs.Text = "save army &as..."; + this.miSaveArmyAs.Click += new System.EventHandler(this.miSaveArmyAs_Click); + // + // miExportArmyAs + // + this.miExportArmyAs.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { this.miExportArmyAsBasicHTML, this.miExportArmyAsBasicXml}); - this.miExportArmyAs.Enabled = false; - this.miExportArmyAs.Name = "miExportArmyAs"; - this.miExportArmyAs.Size = new System.Drawing.Size(160, 22); - this.miExportArmyAs.Text = "export army as..."; - // - // miExportArmyAsBasicHTML - // - this.miExportArmyAsBasicHTML.Name = "miExportArmyAsBasicHTML"; - this.miExportArmyAsBasicHTML.Size = new System.Drawing.Size(152, 22); - this.miExportArmyAsBasicHTML.Text = "&basic html"; - this.miExportArmyAsBasicHTML.Click += new System.EventHandler(this.miExportArmyAsBasicHTML_Click); - // - // miExportArmyAsBasicXml - // - this.miExportArmyAsBasicXml.Name = "miExportArmyAsBasicXml"; - this.miExportArmyAsBasicXml.Size = new System.Drawing.Size(152, 22); - this.miExportArmyAsBasicXml.Text = "basic xml"; - this.miExportArmyAsBasicXml.Click += new System.EventHandler(this.miExportArmyAsBasicXml_Click); - // - // miCloseArmy - // - this.miCloseArmy.Enabled = false; - this.miCloseArmy.Name = "miCloseArmy"; - this.miCloseArmy.Size = new System.Drawing.Size(160, 22); - this.miCloseArmy.Text = "&close army"; - this.miCloseArmy.Click += new System.EventHandler(this.miCloseArmy_Click); - // - // toolStripSeparator1 - // - this.toolStripSeparator1.Name = "toolStripSeparator1"; - this.toolStripSeparator1.Size = new System.Drawing.Size(157, 6); - // - // miReloadFiles - // - this.miReloadFiles.Name = "miReloadFiles"; - this.miReloadFiles.Size = new System.Drawing.Size(160, 22); - this.miReloadFiles.Text = "&reload files"; - this.miReloadFiles.Click += new System.EventHandler(this.miReloadFiles_Click); - // - // toolStripSeparator2 - // - this.toolStripSeparator2.Name = "toolStripSeparator2"; - this.toolStripSeparator2.Size = new System.Drawing.Size(157, 6); - // - // miExit - // - this.miExit.Name = "miExit"; - this.miExit.Size = new System.Drawing.Size(160, 22); - this.miExit.Text = "e&xit"; - this.miExit.Click += new System.EventHandler(this.miExit_Click); - // - // menuEdit - // - this.menuEdit.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.miExportArmyAs.Enabled = false; + this.miExportArmyAs.Name = "miExportArmyAs"; + this.miExportArmyAs.Size = new System.Drawing.Size(170, 22); + this.miExportArmyAs.Text = "export army as..."; + // + // miExportArmyAsBasicHTML + // + this.miExportArmyAsBasicHTML.Name = "miExportArmyAsBasicHTML"; + this.miExportArmyAsBasicHTML.Size = new System.Drawing.Size(132, 22); + this.miExportArmyAsBasicHTML.Text = "&basic html"; + this.miExportArmyAsBasicHTML.Click += new System.EventHandler(this.miExportArmyAsBasicHTML_Click); + // + // miExportArmyAsBasicXml + // + this.miExportArmyAsBasicXml.Name = "miExportArmyAsBasicXml"; + this.miExportArmyAsBasicXml.Size = new System.Drawing.Size(132, 22); + this.miExportArmyAsBasicXml.Text = "basic xml"; + this.miExportArmyAsBasicXml.Click += new System.EventHandler(this.miExportArmyAsBasicXml_Click); + // + // miCloseArmy + // + this.miCloseArmy.Enabled = false; + this.miCloseArmy.Name = "miCloseArmy"; + this.miCloseArmy.Size = new System.Drawing.Size(170, 22); + this.miCloseArmy.Text = "&close army"; + this.miCloseArmy.Click += new System.EventHandler(this.miCloseArmy_Click); + // + // toolStripSeparator1 + // + this.toolStripSeparator1.Name = "toolStripSeparator1"; + this.toolStripSeparator1.Size = new System.Drawing.Size(167, 6); + // + // miReloadFiles + // + this.miReloadFiles.Name = "miReloadFiles"; + this.miReloadFiles.Size = new System.Drawing.Size(170, 22); + this.miReloadFiles.Text = "&reload files"; + this.miReloadFiles.Click += new System.EventHandler(this.miReloadFiles_Click); + // + // toolStripSeparator2 + // + this.toolStripSeparator2.Name = "toolStripSeparator2"; + this.toolStripSeparator2.Size = new System.Drawing.Size(167, 6); + // + // miExit + // + this.miExit.Name = "miExit"; + this.miExit.Size = new System.Drawing.Size(170, 22); + this.miExit.Text = "e&xit"; + this.miExit.Click += new System.EventHandler(this.miExit_Click); + // + // menuEdit + // + this.menuEdit.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { this.miUndo, this.miRedo, this.toolStripSeparator4, + this.miEditArmy, + this.toolStripSeparator5, this.miPreferences}); - this.menuEdit.Name = "menuEdit"; - this.menuEdit.Size = new System.Drawing.Size(39, 20); - this.menuEdit.Text = "&edit"; - // - // miUndo - // - this.miUndo.Enabled = false; - this.miUndo.Name = "miUndo"; - this.miUndo.Size = new System.Drawing.Size(135, 22); - this.miUndo.Text = "&undo"; - this.miUndo.Click += new System.EventHandler(this.miUndo_Click); - // - // miRedo - // - this.miRedo.Enabled = false; - this.miRedo.Name = "miRedo"; - this.miRedo.Size = new System.Drawing.Size(135, 22); - this.miRedo.Text = "&redo"; - this.miRedo.Click += new System.EventHandler(this.miRedo_Click); - // - // toolStripSeparator4 - // - this.toolStripSeparator4.Name = "toolStripSeparator4"; - this.toolStripSeparator4.Size = new System.Drawing.Size(132, 6); - // - // miPreferences - // - this.miPreferences.Name = "miPreferences"; - this.miPreferences.Size = new System.Drawing.Size(135, 22); - this.miPreferences.Text = "&preferences"; - this.miPreferences.Click += new System.EventHandler(this.miPreferences_Click); - // - // menuHelp - // - this.menuHelp.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.menuEdit.Name = "menuEdit"; + this.menuEdit.Size = new System.Drawing.Size(37, 20); + this.menuEdit.Text = "&edit"; + // + // miUndo + // + this.miUndo.Enabled = false; + this.miUndo.Name = "miUndo"; + this.miUndo.Size = new System.Drawing.Size(152, 22); + this.miUndo.Text = "&undo"; + this.miUndo.Click += new System.EventHandler(this.miUndo_Click); + // + // miRedo + // + this.miRedo.Enabled = false; + this.miRedo.Name = "miRedo"; + this.miRedo.Size = new System.Drawing.Size(152, 22); + this.miRedo.Text = "&redo"; + this.miRedo.Click += new System.EventHandler(this.miRedo_Click); + // + // toolStripSeparator4 + // + this.toolStripSeparator4.Name = "toolStripSeparator4"; + this.toolStripSeparator4.Size = new System.Drawing.Size(149, 6); + // + // miEditArmy + // + this.miEditArmy.Name = "miEditArmy"; + this.miEditArmy.Size = new System.Drawing.Size(152, 22); + this.miEditArmy.Text = "&edit army"; + this.miEditArmy.Click += new System.EventHandler(this.miEditArmy_Click); + // + // toolStripSeparator5 + // + this.toolStripSeparator5.Name = "toolStripSeparator5"; + this.toolStripSeparator5.Size = new System.Drawing.Size(149, 6); + // + // miPreferences + // + this.miPreferences.Name = "miPreferences"; + this.miPreferences.Size = new System.Drawing.Size(152, 22); + this.miPreferences.Text = "&preferences"; + this.miPreferences.Click += new System.EventHandler(this.miPreferences_Click); + // + // menuHelp + // + this.menuHelp.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { this.miAbout}); - this.menuHelp.Name = "menuHelp"; - this.menuHelp.Size = new System.Drawing.Size(42, 20); - this.menuHelp.Text = "&help"; - // - // miAbout - // - this.miAbout.Name = "miAbout"; - this.miAbout.Size = new System.Drawing.Size(105, 22); - this.miAbout.Text = "&about"; - this.miAbout.Click += new System.EventHandler(this.miAbout_Click); - // - // mainToolStrip - // - this.mainToolStrip.Dock = System.Windows.Forms.DockStyle.None; - this.mainToolStrip.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { - this.bttnNewArmy, - this.bttnOpenArmy, - this.bttnSaveArmy, - this.toolStripSeparator3, - this.bttnUndo, - this.bttnRedo}); - this.mainToolStrip.Location = new System.Drawing.Point(0, 24); - this.mainToolStrip.Name = "mainToolStrip"; - this.mainToolStrip.Size = new System.Drawing.Size(151, 25); - this.mainToolStrip.TabIndex = 8; - // - // bttnNewArmy - // - this.bttnNewArmy.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; - this.bttnNewArmy.Image = global::IBBoard.WarFoundry.GUI.WinForms.Properties.Resources.document_new; - this.bttnNewArmy.ImageTransparentColor = System.Drawing.Color.Magenta; - this.bttnNewArmy.Name = "bttnNewArmy"; - this.bttnNewArmy.Size = new System.Drawing.Size(23, 22); - this.bttnNewArmy.Text = "new army"; - this.bttnNewArmy.Click += new System.EventHandler(this.miNewArmy_Click); - // - // bttnOpenArmy - // - this.bttnOpenArmy.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; - this.bttnOpenArmy.Image = global::IBBoard.WarFoundry.GUI.WinForms.Properties.Resources.document_open; - this.bttnOpenArmy.ImageTransparentColor = System.Drawing.Color.Magenta; - this.bttnOpenArmy.Name = "bttnOpenArmy"; - this.bttnOpenArmy.Size = new System.Drawing.Size(23, 22); - this.bttnOpenArmy.Text = "open army"; - this.bttnOpenArmy.Click += new System.EventHandler(this.miOpenArmy_Click); - // - // bttnSaveArmy - // - this.bttnSaveArmy.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; - this.bttnSaveArmy.Enabled = false; - this.bttnSaveArmy.Image = global::IBBoard.WarFoundry.GUI.WinForms.Properties.Resources.document_save; - this.bttnSaveArmy.ImageTransparentColor = System.Drawing.Color.Magenta; - this.bttnSaveArmy.Name = "bttnSaveArmy"; - this.bttnSaveArmy.Size = new System.Drawing.Size(23, 22); - this.bttnSaveArmy.Text = "save army"; - this.bttnSaveArmy.Click += new System.EventHandler(this.miSaveArmy_Click); - // - // toolStripSeparator3 - // - this.toolStripSeparator3.Name = "toolStripSeparator3"; - this.toolStripSeparator3.Size = new System.Drawing.Size(6, 25); - // - // bttnUndo - // - this.bttnUndo.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; - this.bttnUndo.Enabled = false; - this.bttnUndo.Image = global::IBBoard.WarFoundry.GUI.WinForms.Properties.Resources.edit_undo; - this.bttnUndo.ImageTransparentColor = System.Drawing.Color.Magenta; - this.bttnUndo.Name = "bttnUndo"; - this.bttnUndo.Size = new System.Drawing.Size(32, 22); - this.bttnUndo.Text = "undo"; - this.bttnUndo.ButtonClick += new System.EventHandler(this.miUndo_Click); - // - // bttnRedo - // - this.bttnRedo.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; - this.bttnRedo.Enabled = false; - this.bttnRedo.Image = global::IBBoard.WarFoundry.GUI.WinForms.Properties.Resources.edit_redo; - this.bttnRedo.ImageTransparentColor = System.Drawing.Color.Magenta; - this.bttnRedo.Name = "bttnRedo"; - this.bttnRedo.Size = new System.Drawing.Size(32, 22); - this.bttnRedo.Text = "redo"; - this.bttnRedo.ButtonClick += new System.EventHandler(this.miRedo_Click); - // - // catToolStrip - // - this.catToolStrip.Dock = System.Windows.Forms.DockStyle.None; - this.catToolStrip.Location = new System.Drawing.Point(161, 24); - this.catToolStrip.Name = "catToolStrip"; - this.catToolStrip.Size = new System.Drawing.Size(111, 25); - this.catToolStrip.TabIndex = 9; - this.catToolStrip.Visible = false; - // - // statusBar - // - this.statusBar.Location = new System.Drawing.Point(0, 586); - this.statusBar.Name = "statusBar"; - this.statusBar.Panels.AddRange(new System.Windows.Forms.StatusBarPanel[] { - this.sbMainPanel, - this.sbErrorPanel, - this.sbPointsPanel}); - this.statusBar.ShowPanels = true; - this.statusBar.Size = new System.Drawing.Size(790, 22); - this.statusBar.TabIndex = 1; - this.statusBar.DrawItem += new System.Windows.Forms.StatusBarDrawItemEventHandler(this.statusBar_DrawItem); - this.statusBar.PanelClick += new System.Windows.Forms.StatusBarPanelClickEventHandler(this.statusBar_PanelClick); - // - // sbMainPanel - // - this.sbMainPanel.AutoSize = System.Windows.Forms.StatusBarPanelAutoSize.Spring; - this.sbMainPanel.Color = System.Drawing.SystemColors.WindowText; - this.sbMainPanel.Name = "sbMainPanel"; - this.sbMainPanel.Style = System.Windows.Forms.StatusBarPanelStyle.OwnerDraw; - this.sbMainPanel.Width = 473; - // - // sbErrorPanel - // - this.sbErrorPanel.Color = System.Drawing.SystemColors.WindowText; - this.sbErrorPanel.Name = "sbErrorPanel"; - this.sbErrorPanel.Style = System.Windows.Forms.StatusBarPanelStyle.OwnerDraw; - this.sbErrorPanel.Width = 150; - // - // sbPointsPanel - // - this.sbPointsPanel.Color = System.Drawing.SystemColors.WindowText; - this.sbPointsPanel.Name = "sbPointsPanel"; - this.sbPointsPanel.Style = System.Windows.Forms.StatusBarPanelStyle.OwnerDraw; - this.sbPointsPanel.ToolTipText = "current points total"; - this.sbPointsPanel.Width = 150; - // - // toolStripPanel - // - this.toolStripPanel.Dock = System.Windows.Forms.DockStyle.Top; - this.toolStripPanel.Location = new System.Drawing.Point(0, 24); - this.toolStripPanel.Name = "toolStripPanel"; - this.toolStripPanel.Orientation = System.Windows.Forms.Orientation.Horizontal; - this.toolStripPanel.RowMargin = new System.Windows.Forms.Padding(3, 0, 0, 0); - this.toolStripPanel.Size = new System.Drawing.Size(790, 0); - // - // FrmMain - // - this.AutoScaleBaseSize = new System.Drawing.Size(5, 13); - this.ClientSize = new System.Drawing.Size(790, 608); - this.Controls.Add(this.mainToolStrip); - this.Controls.Add(this.toolStripPanel); - this.Controls.Add(this.statusBar); - this.Controls.Add(this.catToolStrip); - this.Controls.Add(this.menuStrip); - this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); - this.IsMdiContainer = true; - this.MainMenuStrip = this.menuStrip; - this.Menu = this.mainMenu; - this.Name = "FrmMain"; - this.Text = "WarFoundry"; - this.Load += new System.EventHandler(this.FrmMain_Load); - this.menuStrip.ResumeLayout(false); - this.menuStrip.PerformLayout(); - this.mainToolStrip.ResumeLayout(false); - this.mainToolStrip.PerformLayout(); - ((System.ComponentModel.ISupportInitialize)(this.sbMainPanel)).EndInit(); - ((System.ComponentModel.ISupportInitialize)(this.sbErrorPanel)).EndInit(); - ((System.ComponentModel.ISupportInitialize)(this.sbPointsPanel)).EndInit(); - this.ResumeLayout(false); - this.PerformLayout(); + this.menuHelp.Name = "menuHelp"; + this.menuHelp.Size = new System.Drawing.Size(39, 20); + this.menuHelp.Text = "&help"; + // + // miAbout + // + this.miAbout.Name = "miAbout"; + this.miAbout.Size = new System.Drawing.Size(113, 22); + this.miAbout.Text = "&about"; + this.miAbout.Click += new System.EventHandler(this.miAbout_Click); + // + // FrmMain + // + this.AutoScaleBaseSize = new System.Drawing.Size(5, 13); + this.ClientSize = new System.Drawing.Size(790, 608); + this.Controls.Add(this.mainToolStrip); + this.Controls.Add(this.toolStripPanel); + this.Controls.Add(this.statusBar); + this.Controls.Add(this.catToolStrip); + this.Controls.Add(this.menuStrip); + this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); + this.IsMdiContainer = true; + this.MainMenuStrip = this.menuStrip; + this.Menu = this.mainMenu; + this.Name = "FrmMain"; + this.Text = "WarFoundry"; + this.Load += new System.EventHandler(this.FrmMain_Load); + this.menuStrip.ResumeLayout(false); + this.menuStrip.PerformLayout(); + this.mainToolStrip.ResumeLayout(false); + this.mainToolStrip.PerformLayout(); + ((System.ComponentModel.ISupportInitialize)(this.sbMainPanel)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.sbErrorPanel)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.sbPointsPanel)).EndInit(); + this.ResumeLayout(false); + this.PerformLayout(); } #endregion @@ -895,6 +913,7 @@ loadedFilePath = null; miSaveArmy.Enabled = false; bttnSaveArmy.Enabled = false; + miEditArmy.Enabled = (CurrentArmy == null); //TODO: Subscribe to an "army changed" event here SetPointsPanelText(); SetAppTitle(); @@ -1428,5 +1447,11 @@ Form xmlOutput = new FrmXmlExport(CurrentArmy); xmlOutput.ShowDialog(this); } + + private void miEditArmy_Click(object sender, EventArgs e) + { + FrmEditArmy editArmy = new FrmEditArmy(commandStack, CurrentArmy); + editArmy.ShowDialog(this); + } } }
--- a/FrmMain.resx Mon Aug 29 15:17:59 2011 +0100 +++ b/FrmMain.resx Mon Aug 29 20:06:54 2011 +0100 @@ -112,36 +112,36 @@ <value>2.0</value> </resheader> <resheader name="reader"> - <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> + <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> </resheader> <resheader name="writer"> - <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> + <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> </resheader> - <metadata name="undoMenu.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> + <metadata name="undoMenu.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> <value>17, 17</value> </metadata> - <metadata name="redoMenu.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> + <metadata name="redoMenu.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> <value>122, 17</value> </metadata> - <metadata name="mainMenu.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> + <metadata name="mainMenu.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> <value>334, 17</value> </metadata> - <metadata name="openArmyDialog.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> + <metadata name="openArmyDialog.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> <value>438, 17</value> </metadata> - <metadata name="saveArmyDialog.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> + <metadata name="saveArmyDialog.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> <value>573, 17</value> </metadata> - <metadata name="menuStrip.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> + <metadata name="menuStrip.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> <value>835, 17</value> </metadata> - <metadata name="mainToolStrip.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> + <metadata name="mainToolStrip.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> <value>17, 54</value> </metadata> - <metadata name="catToolStrip.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> + <metadata name="catToolStrip.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> <value>138, 54</value> </metadata> - <assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" /> + <assembly alias="System.Drawing" name="System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" /> <data name="$this.Icon" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> <value> AAABAAEAEBAAAAEAIABoBAAAFgAAACgAAAAQAAAAIAAAAAEAIAAAAAAAAAAAABMLAAATCwAAAAAAAAAA
--- a/IBBoard.WarFoundry.GUI.WinForms.csproj Mon Aug 29 15:17:59 2011 +0100 +++ b/IBBoard.WarFoundry.GUI.WinForms.csproj Mon Aug 29 20:06:54 2011 +0100 @@ -127,6 +127,12 @@ <Compile Include="AssemblyInfo.cs"> <SubType>Code</SubType> </Compile> + <Compile Include="FrmEditArmy.cs"> + <SubType>Form</SubType> + </Compile> + <Compile Include="FrmEditArmy.Designer.cs"> + <DependentUpon>FrmEditArmy.cs</DependentUpon> + </Compile> <Compile Include="FrmAbout.cs"> <SubType>Form</SubType> </Compile> @@ -193,6 +199,9 @@ <DependentUpon>FrmArmyTree.cs</DependentUpon> <SubType>Designer</SubType> </EmbeddedResource> + <EmbeddedResource Include="FrmEditArmy.resx"> + <DependentUpon>FrmEditArmy.cs</DependentUpon> + </EmbeddedResource> <EmbeddedResource Include="FrmEditUnitEquipment.resx"> <DependentUpon>FrmEditUnitEquipment.cs</DependentUpon> <SubType>Designer</SubType>