Mercurial > repos > IBDev-IBBoard.WarFoundry.GUI.WinForms
changeset 123:ff931ff5891c
Re #88: Complete initial WinForms UI
* Switch to new style menu (needs translation doing)
author | IBBoard <dev@ibboard.co.uk> |
---|---|
date | Sat, 27 Feb 2010 21:01:52 +0000 |
parents | 0c118c2bdd61 |
children | 4acfce15b222 |
files | FrmMain.cs FrmMain.resx |
diffstat | 2 files changed, 115 insertions(+), 122 deletions(-) [+] |
line wrap: on
line diff
--- a/FrmMain.cs Tue Feb 09 20:58:41 2010 +0000 +++ b/FrmMain.cs Sat Feb 27 21:01:52 2010 +0000 @@ -66,21 +66,6 @@ private IBBoard.Windows.Forms.IBBToolBarButton bttnUndo; private IBBoard.Windows.Forms.IBBToolBarButton bttnRedo; private System.Windows.Forms.MainMenu mainMenu; - private IBBoard.Windows.Forms.IBBMenuItem menuFile; - private IBBoard.Windows.Forms.IBBMenuItem miNewArmy; - private IBBoard.Windows.Forms.IBBMenuItem miOpenArmy; - private IBBoard.Windows.Forms.IBBMenuItem miCloseArmy; - private IBBoard.Windows.Forms.IBBMenuItem miSaveArmy; - private IBBoard.Windows.Forms.IBBMenuItem miSaveArmyAs; - private System.Windows.Forms.MenuItem miSep2; - private IBBoard.Windows.Forms.IBBMenuItem miReloadFiles; - private System.Windows.Forms.MenuItem miSep3; - private IBBoard.Windows.Forms.IBBMenuItem miExit; - private IBBoard.Windows.Forms.IBBMenuItem menuEdit; - private IBBoard.Windows.Forms.IBBMenuItem miUndo; - private IBBoard.Windows.Forms.IBBMenuItem miRedo; - private IBBoard.Windows.Forms.IBBMenuItem menuHelp; - private IBBoard.Windows.Forms.IBBMenuItem miAbout; private IBBoard.Windows.Forms.ColorableStatusBarPanel sbMainPanel; private IBBoard.Windows.Forms.ColorableStatusBarPanel sbErrorPanel; private IBBoard.Windows.Forms.ColorableStatusBarPanel sbPointsPanel; @@ -88,9 +73,24 @@ private System.Windows.Forms.ContextMenu redoMenu; private IBBoard.Windows.Forms.ColorableStatusBar statusBar; private System.Windows.Forms.Timer statusBarTimer; - private IBBoard.Windows.Forms.IBBMenuItem miExportArmyAs; - private IBBoard.Windows.Forms.IBBMenuItem miExportArmyAsBasicHTML; - private System.Windows.Forms.Panel pnlRight; + private MenuStrip menuStrip1; + private ToolStripMenuItem menuFile; + private ToolStripMenuItem miNewArmy; + private ToolStripMenuItem miOpenArmy; + private ToolStripMenuItem miSaveArmy; + private ToolStripMenuItem miSaveArmyAs; + private ToolStripMenuItem miExportArmyAs; + private ToolStripMenuItem miExportArmyAsBasicHTML; + private ToolStripMenuItem miCloseArmy; + private ToolStripSeparator toolStripSeparator1; + private ToolStripMenuItem miReloadFiles; + private ToolStripSeparator toolStripSeparator2; + private ToolStripMenuItem miExit; + private ToolStripMenuItem menuEdit; + private ToolStripMenuItem miUndo; + private ToolStripMenuItem miRedo; + private ToolStripMenuItem menuHelp; + private ToolStripMenuItem miAbout; /// <summary> /// The main entry point for the application. @@ -231,30 +231,31 @@ this.redoMenu = new System.Windows.Forms.ContextMenu(); this.buttonIcons = new System.Windows.Forms.ImageList(this.components); this.mainMenu = new System.Windows.Forms.MainMenu(this.components); - this.menuFile = new IBBoard.Windows.Forms.IBBMenuItem(); - this.miNewArmy = new IBBoard.Windows.Forms.IBBMenuItem(); - this.miOpenArmy = new IBBoard.Windows.Forms.IBBMenuItem(); - this.miSaveArmy = new IBBoard.Windows.Forms.IBBMenuItem(); - this.miSaveArmyAs = new IBBoard.Windows.Forms.IBBMenuItem(); - this.miExportArmyAs = new IBBoard.Windows.Forms.IBBMenuItem(); - this.miExportArmyAsBasicHTML = new IBBoard.Windows.Forms.IBBMenuItem(); - this.miCloseArmy = new IBBoard.Windows.Forms.IBBMenuItem(); - this.miSep2 = new System.Windows.Forms.MenuItem(); - this.miReloadFiles = new IBBoard.Windows.Forms.IBBMenuItem(); - this.miSep3 = new System.Windows.Forms.MenuItem(); - this.miExit = new IBBoard.Windows.Forms.IBBMenuItem(); - this.menuEdit = new IBBoard.Windows.Forms.IBBMenuItem(); - this.miUndo = new IBBoard.Windows.Forms.IBBMenuItem(); - this.miRedo = new IBBoard.Windows.Forms.IBBMenuItem(); - this.menuHelp = new IBBoard.Windows.Forms.IBBMenuItem(); - this.miAbout = new IBBoard.Windows.Forms.IBBMenuItem(); this.openArmyDialog = new System.Windows.Forms.OpenFileDialog(); this.saveArmyDialog = new System.Windows.Forms.SaveFileDialog(); - this.pnlRight = new System.Windows.Forms.Panel(); this.statusBarTimer = new System.Windows.Forms.Timer(this.components); - ((System.ComponentModel.ISupportInitialize) (this.sbMainPanel)).BeginInit(); - ((System.ComponentModel.ISupportInitialize) (this.sbErrorPanel)).BeginInit(); - ((System.ComponentModel.ISupportInitialize) (this.sbPointsPanel)).BeginInit(); + this.menuStrip1 = new System.Windows.Forms.MenuStrip(); + this.menuFile = new System.Windows.Forms.ToolStripMenuItem(); + this.miNewArmy = new System.Windows.Forms.ToolStripMenuItem(); + this.miOpenArmy = new System.Windows.Forms.ToolStripMenuItem(); + this.miSaveArmy = new System.Windows.Forms.ToolStripMenuItem(); + this.miSaveArmyAs = new System.Windows.Forms.ToolStripMenuItem(); + this.miExportArmyAs = new System.Windows.Forms.ToolStripMenuItem(); + this.miExportArmyAsBasicHTML = new System.Windows.Forms.ToolStripMenuItem(); + this.miCloseArmy = new System.Windows.Forms.ToolStripMenuItem(); + this.toolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator(); + this.miReloadFiles = new System.Windows.Forms.ToolStripMenuItem(); + this.toolStripSeparator2 = new System.Windows.Forms.ToolStripSeparator(); + this.miExit = new System.Windows.Forms.ToolStripMenuItem(); + this.menuEdit = new System.Windows.Forms.ToolStripMenuItem(); + this.miUndo = new System.Windows.Forms.ToolStripMenuItem(); + this.miRedo = new System.Windows.Forms.ToolStripMenuItem(); + this.menuHelp = new System.Windows.Forms.ToolStripMenuItem(); + this.miAbout = new System.Windows.Forms.ToolStripMenuItem(); + ((System.ComponentModel.ISupportInitialize)(this.sbMainPanel)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.sbErrorPanel)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.sbPointsPanel)).BeginInit(); + this.menuStrip1.SuspendLayout(); this.SuspendLayout(); // // statusBar @@ -307,7 +308,7 @@ this.toolBar.ButtonSize = new System.Drawing.Size(16, 16); this.toolBar.DropDownArrows = true; this.toolBar.ImageList = this.buttonIcons; - this.toolBar.Location = new System.Drawing.Point(0, 0); + this.toolBar.Location = new System.Drawing.Point(0, 24); this.toolBar.Name = "toolBar"; this.toolBar.ShowToolTips = true; this.toolBar.Size = new System.Drawing.Size(790, 28); @@ -353,7 +354,7 @@ // // buttonIcons // - this.buttonIcons.ImageStream = ((System.Windows.Forms.ImageListStreamer) (resources.GetObject("buttonIcons.ImageStream"))); + this.buttonIcons.ImageStream = ((System.Windows.Forms.ImageListStreamer)(resources.GetObject("buttonIcons.ImageStream"))); this.buttonIcons.TransparentColor = System.Drawing.Color.Transparent; this.buttonIcons.Images.SetKeyName(0, ""); this.buttonIcons.Images.SetKeyName(1, ""); @@ -363,185 +364,181 @@ this.buttonIcons.Images.SetKeyName(5, ""); this.buttonIcons.Images.SetKeyName(6, ""); // - // mainMenu + // saveArmyDialog + // + this.saveArmyDialog.Title = "Translatable:saveArmyDialog"; + // + // statusBarTimer // - this.mainMenu.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] { + this.statusBarTimer.Interval = 5000; + this.statusBarTimer.Tick += new System.EventHandler(this.statusBarTimer_Tick); + // + // menuStrip1 + // + this.menuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { this.menuFile, this.menuEdit, this.menuHelp}); + this.menuStrip1.Location = new System.Drawing.Point(0, 0); + this.menuStrip1.Name = "menuStrip1"; + this.menuStrip1.Size = new System.Drawing.Size(790, 24); + this.menuStrip1.TabIndex = 6; + this.menuStrip1.Text = "menuStrip1"; // // menuFile // - this.menuFile.Index = 0; - this.menuFile.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] { + this.menuFile.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { this.miNewArmy, this.miOpenArmy, this.miSaveArmy, this.miSaveArmyAs, this.miExportArmyAs, this.miCloseArmy, - this.miSep2, + this.toolStripSeparator1, this.miReloadFiles, - this.miSep3, + this.toolStripSeparator2, this.miExit}); + this.menuFile.Name = "menuFile"; + this.menuFile.Size = new System.Drawing.Size(33, 20); this.menuFile.Text = "&file"; - this.menuFile.Name = "menuFile"; // // miNewArmy // - this.miNewArmy.Index = 0; + 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); - this.miNewArmy.Name = "miNewArmy"; // // miOpenArmy // - this.miOpenArmy.Index = 1; + 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); - this.miOpenArmy.Name = "miOpenArmy"; // // miSaveArmy // this.miSaveArmy.Enabled = false; - this.miSaveArmy.Index = 2; + 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); - this.miSaveArmy.Name = "miSaveArmy"; // // miSaveArmyAs // this.miSaveArmyAs.Enabled = false; - this.miSaveArmyAs.Index = 3; + 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); - this.miSaveArmyAs.Name = "miSaveArmyAs"; // // miExportArmyAs // + this.miExportArmyAs.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.miExportArmyAsBasicHTML}); this.miExportArmyAs.Enabled = false; - this.miExportArmyAs.Index = 4; - this.miExportArmyAs.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] { - this.miExportArmyAsBasicHTML}); + this.miExportArmyAs.Name = "miExportArmyAs"; + this.miExportArmyAs.Size = new System.Drawing.Size(164, 22); this.miExportArmyAs.Text = "export army as..."; - this.miExportArmyAs.Name = "miExportArmyAs"; // // miExportArmyAsBasicHTML // - this.miExportArmyAsBasicHTML.Index = 0; - this.miExportArmyAsBasicHTML.Text = "basic html"; + 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); - this.miExportArmyAsBasicHTML.Name = "miExportArmyAsBasicHTML"; // // miCloseArmy // this.miCloseArmy.Enabled = false; - this.miCloseArmy.Index = 5; + 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); - this.miCloseArmy.Name = "miCloseArmy"; + // + // toolStripSeparator1 // - // miSep2 - // - this.miSep2.Index = 6; - this.miSep2.Text = "-"; + this.toolStripSeparator1.Name = "toolStripSeparator1"; + this.toolStripSeparator1.Size = new System.Drawing.Size(161, 6); // // miReloadFiles // - this.miReloadFiles.Index = 7; + 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); - this.miReloadFiles.Name = "miReloadFiles"; + // + // toolStripSeparator2 // - // miSep3 - // - this.miSep3.Index = 8; - this.miSep3.Text = "-"; + this.toolStripSeparator2.Name = "toolStripSeparator2"; + this.toolStripSeparator2.Size = new System.Drawing.Size(161, 6); // // miExit // - this.miExit.Index = 9; + 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); - this.miExit.Name = "miExit"; // // menuEdit // - this.menuEdit.Index = 1; - this.menuEdit.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] { + this.menuEdit.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { this.miUndo, this.miRedo}); + this.menuEdit.Name = "menuEdit"; + this.menuEdit.Size = new System.Drawing.Size(36, 20); this.menuEdit.Text = "&edit"; - this.menuEdit.Name = "menuEdit"; // // miUndo // this.miUndo.Enabled = false; - this.miUndo.Index = 0; + 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); - this.miUndo.Name = "miUndo"; // // miRedo // this.miRedo.Enabled = false; - this.miRedo.Index = 1; + 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); - this.miRedo.Name = "miRedo"; // // menuHelp // - this.menuHelp.Index = 2; - this.menuHelp.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] { + 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"; - this.menuHelp.Name = "menuHelp"; // // miAbout // - this.miAbout.Index = 0; + this.miAbout.Name = "miAbout"; + this.miAbout.Size = new System.Drawing.Size(152, 22); this.miAbout.Text = "&about"; - this.miAbout.Name = "miAbout"; this.miAbout.Click += new System.EventHandler(this.miAbout_Click); // - // saveArmyDialog - // - this.saveArmyDialog.Title = "Translatable:saveArmyDialog"; - // - // pnlRight - // - this.pnlRight.Anchor = ((System.Windows.Forms.AnchorStyles) (((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) - | System.Windows.Forms.AnchorStyles.Right))); - this.pnlRight.BackColor = System.Drawing.SystemColors.AppWorkspace; - this.pnlRight.Location = new System.Drawing.Point(724, 30); - this.pnlRight.Name = "pnlRight"; - this.pnlRight.Size = new System.Drawing.Size(64, 514); - this.pnlRight.TabIndex = 4; - this.pnlRight.Visible = false; - this.pnlRight.Paint += new System.Windows.Forms.PaintEventHandler(this.pnlRight_Paint); - // - // statusBarTimer - // - this.statusBarTimer.Interval = 5000; - this.statusBarTimer.Tick += new System.EventHandler(this.statusBarTimer_Tick); - // // FrmMain // this.AutoScaleBaseSize = new System.Drawing.Size(5, 13); this.ClientSize = new System.Drawing.Size(790, 568); - this.Controls.Add(this.pnlRight); this.Controls.Add(this.toolBar); this.Controls.Add(this.statusBar); - this.Icon = ((System.Drawing.Icon) (resources.GetObject("$this.Icon"))); + this.Controls.Add(this.menuStrip1); + this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); this.IsMdiContainer = true; + this.MainMenuStrip = this.menuStrip1; this.Menu = this.mainMenu; this.Name = "FrmMain"; this.Text = "WarFoundry"; this.Load += new System.EventHandler(this.FrmMain_Load); - ((System.ComponentModel.ISupportInitialize) (this.sbMainPanel)).EndInit(); - ((System.ComponentModel.ISupportInitialize) (this.sbErrorPanel)).EndInit(); - ((System.ComponentModel.ISupportInitialize) (this.sbPointsPanel)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.sbMainPanel)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.sbErrorPanel)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.sbPointsPanel)).EndInit(); + this.menuStrip1.ResumeLayout(false); + this.menuStrip1.PerformLayout(); this.ResumeLayout(false); this.PerformLayout(); @@ -1196,13 +1193,6 @@ } }*/ - public void pnlRight_Paint(object sender, System.Windows.Forms.PaintEventArgs e) - { - HatchBrush dockCueBrush = new HatchBrush(HatchStyle.LightDownwardDiagonal, Color.White, Color.Gray); - Pen dockCuePen = new Pen(dockCueBrush, 10); - e.Graphics.DrawRectangle(dockCuePen, new Rectangle(pnlRight.Left, pnlRight.Top, pnlRight.Width, pnlRight.Height)); - } - private void miUndo_Click(object sender, System.EventArgs e) { UndoLastAction();
--- a/FrmMain.resx Tue Feb 09 20:58:41 2010 +0000 +++ b/FrmMain.resx Sat Feb 27 21:01:52 2010 +0000 @@ -252,6 +252,9 @@ <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="menuStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> + <value>835, 17</value> + </metadata> <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>