Mercurial > repos > IBBoard.WarFoundry.GUI.WinForms
changeset 196:15148d255e50
* First stab at displaying new unit requirements
no-open-ticket
author | IBBoard <dev@ibboard.co.uk> |
---|---|
date | Sun, 01 May 2011 11:05:29 +0000 |
parents | 983d96be91f5 |
children | 10ba2c5340b2 |
files | FrmMain.cs FrmMain.resx |
diffstat | 2 files changed, 361 insertions(+), 386 deletions(-) [+] |
line wrap: on
line diff
--- a/FrmMain.cs Sun May 01 10:51:30 2011 +0000 +++ b/FrmMain.cs Sun May 01 11:05:29 2011 +0000 @@ -24,6 +24,7 @@ using IBBoard.WarFoundry.API.Commands; using IBBoard.WarFoundry.API.Exporters; using IBBoard.WarFoundry.API.Objects; +using IBBoard.WarFoundry.API.Objects.Requirement; using IBBoard.WarFoundry.API.Util; using IBBoard.WarFoundry.API.Savers; using IBBoard.WarFoundry.API.Savers.Xml; @@ -70,8 +71,7 @@ private IBBoard.Windows.Forms.ColorableStatusBarPanel sbPointsPanel; private System.Windows.Forms.ContextMenu undoMenu; private System.Windows.Forms.ContextMenu redoMenu; - private IBBoard.Windows.Forms.ColorableStatusBar statusBar; - private System.Windows.Forms.Timer statusBarTimer; + private IBBoard.Windows.Forms.ColorableStatusBar statusBar; private MenuStrip menuStrip; private IBBToolStripMenuItem menuFile; private IBBToolStripMenuItem miNewArmy; @@ -251,78 +251,72 @@ /// </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.statusBarTimer = new System.Windows.Forms.Timer(this.components); - 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.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.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.toolStripSeparator4 = new System.Windows.Forms.ToolStripSeparator(); - this.miPreferences = 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"; - // - // statusBarTimer - // - this.statusBarTimer.Interval = 5000; - this.statusBarTimer.Tick += new System.EventHandler(this.statusBarTimer_Tick); - // - // 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.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.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.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"; + // + // menuFile + // + this.menuFile.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { this.miNewArmy, this.miOpenArmy, this.miSaveArmy, @@ -333,295 +327,295 @@ this.miReloadFiles, this.toolStripSeparator2, this.miExit}); - 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(164, 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(164, 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(164, 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(164, 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(164, 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(164, 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(164, 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(164, 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.miExportArmyAs.Enabled = false; - this.miExportArmyAs.Name = "miExportArmyAs"; - this.miExportArmyAs.Size = new System.Drawing.Size(164, 22); - this.miExportArmyAs.Text = "export army as..."; - // - // miExportArmyAsBasicHTML - // - this.miExportArmyAsBasicHTML.Name = "miExportArmyAsBasicHTML"; - this.miExportArmyAsBasicHTML.Size = new System.Drawing.Size(130, 22); - this.miExportArmyAsBasicHTML.Text = "&basic html"; - this.miExportArmyAsBasicHTML.Click += new System.EventHandler(this.miExportArmyAsBasicHTML_Click); - // - // miCloseArmy - // - this.miCloseArmy.Enabled = false; - this.miCloseArmy.Name = "miCloseArmy"; - this.miCloseArmy.Size = new System.Drawing.Size(164, 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(161, 6); - // - // miReloadFiles - // - this.miReloadFiles.Name = "miReloadFiles"; - this.miReloadFiles.Size = new System.Drawing.Size(164, 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(161, 6); - // - // miExit - // - this.miExit.Name = "miExit"; - this.miExit.Size = new System.Drawing.Size(164, 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(164, 22); + this.miExportArmyAs.Text = "export army as..."; + // + // miExportArmyAsBasicHTML + // + this.miExportArmyAsBasicHTML.Name = "miExportArmyAsBasicHTML"; + this.miExportArmyAsBasicHTML.Size = new System.Drawing.Size(130, 22); + this.miExportArmyAsBasicHTML.Text = "&basic html"; + this.miExportArmyAsBasicHTML.Click += new System.EventHandler(this.miExportArmyAsBasicHTML_Click); + // + // miCloseArmy + // + this.miCloseArmy.Enabled = false; + this.miCloseArmy.Name = "miCloseArmy"; + this.miCloseArmy.Size = new System.Drawing.Size(164, 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(161, 6); + // + // miReloadFiles + // + this.miReloadFiles.Name = "miReloadFiles"; + this.miReloadFiles.Size = new System.Drawing.Size(164, 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(161, 6); + // + // miExit + // + this.miExit.Name = "miExit"; + this.miExit.Size = new System.Drawing.Size(164, 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.miPreferences}); - this.menuEdit.Name = "menuEdit"; - this.menuEdit.Size = new System.Drawing.Size(36, 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); - // - // menuHelp - // - this.menuHelp.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.menuEdit.Name = "menuEdit"; + this.menuEdit.Size = new System.Drawing.Size(36, 20); + this.menuEdit.Text = "&edit"; + // + // miUndo + // + this.miUndo.Enabled = false; + this.miUndo.Name = "miUndo"; + this.miUndo.Size = new System.Drawing.Size(142, 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(142, 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(139, 6); + // + // miPreferences + // + this.miPreferences.Name = "miPreferences"; + this.miPreferences.Size = new System.Drawing.Size(142, 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(39, 20); - this.menuHelp.Text = "&help"; - // - // miAbout - // - this.miAbout.Name = "miAbout"; - this.miAbout.Size = new System.Drawing.Size(109, 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.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(109, 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.mainToolStrip.Location = new System.Drawing.Point(0, 24); + this.mainToolStrip.Name = "mainToolStrip"; + this.mainToolStrip.Size = new System.Drawing.Size(182, 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.PanelClick += new System.Windows.Forms.StatusBarPanelClickEventHandler(this.statusBar_PanelClick); - this.statusBar.DrawItem += new System.Windows.Forms.StatusBarDrawItemEventHandler(this.statusBar_DrawItem); - // - // 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); - // - // toolStripSeparator4 - // - this.toolStripSeparator4.Name = "toolStripSeparator4"; - this.toolStripSeparator4.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); - // - // 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.statusBar.ShowPanels = true; + this.statusBar.Size = new System.Drawing.Size(790, 22); + this.statusBar.TabIndex = 1; + this.statusBar.PanelClick += new System.Windows.Forms.StatusBarPanelClickEventHandler(this.statusBar_PanelClick); + this.statusBar.DrawItem += new System.Windows.Forms.StatusBarDrawItemEventHandler(this.statusBar_DrawItem); + // + // 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(); } #endregion @@ -900,6 +894,7 @@ loadedFilePath = null; miSaveArmy.Enabled = false; bttnSaveArmy.Enabled = false; + //TODO: Subscribe to an "army changed" event here SetPointsPanelText(); SetAppTitle(); } @@ -1221,19 +1216,30 @@ private void FrmMain_UnitAddedMethod(object unitObj) { + ValidateArmy(); + } + + private void ValidateArmy() + { + if (Validates.AsOkay(RequirementHandler.ValidateArmy(CurrentArmy))) + { + sbErrorPanel.Text = ""; + sbErrorPanel.Tag = ""; + } + else + { + sbErrorPanel.Text = "Validation errors exist"; + sbErrorPanel.Tag = "One or more army requirements have not been met"; + } + } + + private void FrmMain_UnitRemovedMethod(object unitObj) + { + ValidateArmy(); + if (unitObj is Unit) { Unit unit = (Unit)unitObj; - sbErrorPanel.Text = ""; - } - } - - private void FrmMain_UnitRemovedMethod(object unitObj) - { - if (unitObj is Unit) - { - Unit unit = (Unit)unitObj; - sbErrorPanel.Text = ""; //check if window is open, and close it if it is foreach (Form frm in this.MdiChildren) @@ -1250,27 +1256,6 @@ } } - /*private void FrmMain_FailedUnitRequirement(FailedUnitRequirement failedRequirement) - { - sbErrorPanel.Text = Translation.GetTranslation("UnitRequirementFailed", "Unit Requirement Failed"); - sbErrorPanel.Tag = failedRequirement.Description; - }*/ - - /*public void MdiChildMoved() - { - Point mouseAt = PointToClient(ActiveMdiChild.Location); - - if (Comparisons.ValueWithinAmount(pnlRight.Right, ActiveMdiChild.Right, 10)) - { - pnlRight.Visible = true; - //pnlRight.Container.Add(ActiveMdiChild); - } - else - { - pnlRight.Visible = false; - } - }*/ - private void miUndo_Click(object sender, System.EventArgs e) { UndoLastAction(); @@ -1380,13 +1365,6 @@ { WarFoundryLoader.GetDefault().LoadFiles(); sbMainPanel.Text = Translation.GetTranslation("GameSystemFilesReloaded", "Game system and race files reloaded"); - statusBarTimer.Enabled = true; - } - - private void statusBarTimer_Tick(object sender, System.EventArgs e) - { - sbMainPanel.Text = ""; - statusBarTimer.Enabled = false; } private void statusBar_PanelClick(object sender, StatusBarPanelClickEventArgs e)
--- a/FrmMain.resx Sun May 01 10:51:30 2011 +0000 +++ b/FrmMain.resx Sun May 01 11:05:29 2011 +0000 @@ -132,9 +132,6 @@ <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="statusBarTimer.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> - <value>707, 17</value> - </metadata> <metadata name="menuStrip.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> <value>835, 17</value> </metadata>