# HG changeset patch # User IBBoard # Date 1253356021 0 # Node ID d6ff354a5d84bb84c0d7ec436463a4a134bf70a8 # Parent e6d0d9eababf76a6b68ab7b6124415d7c211419a Re #166: Move game system changing to part of army creation * Initial commit - code works but naming isn't correct * Remove system selection dialog * Add game system selection to FrmNewArmy * Populate race list based on game system selected * Always enable "New Army" button/menu item diff -r e6d0d9eababf -r d6ff354a5d84 FrmMain.cs --- a/FrmMain.cs Wed Sep 16 19:50:39 2009 +0000 +++ b/FrmMain.cs Sat Sep 19 10:27:01 2009 +0000 @@ -70,8 +70,6 @@ private IBBoard.Windows.Forms.IBBMenuItem miSaveArmy; private IBBoard.Windows.Forms.IBBMenuItem miSaveArmyAs; private System.Windows.Forms.MenuItem miSep2; - private IBBoard.Windows.Forms.IBBMenuItem miChangeSystem; - private System.Windows.Forms.MenuItem miSep1; private IBBoard.Windows.Forms.IBBMenuItem miReloadFiles; private System.Windows.Forms.MenuItem miSep3; private IBBoard.Windows.Forms.IBBMenuItem miExit; @@ -228,8 +226,6 @@ this.miExportArmyAs = new System.Windows.Forms.MenuItem(); this.miExportArmyAsBasicHTML = new System.Windows.Forms.MenuItem(); this.miCloseArmy = new IBBoard.Windows.Forms.IBBMenuItem(); - this.miSep1 = new System.Windows.Forms.MenuItem(); - this.miChangeSystem = 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(); @@ -287,7 +283,6 @@ // // toolBar // - this.toolBar.Appearance = System.Windows.Forms.ToolBarAppearance.Flat; this.toolBar.Buttons.AddRange(new System.Windows.Forms.ToolBarButton[] { this.bttnNewArmy, this.bttnOpenArmy, @@ -307,7 +302,6 @@ // // bttnNewArmy // - this.bttnNewArmy.Enabled = false; this.bttnNewArmy.ImageIndex = 0; this.bttnNewArmy.Name = "bttnNewArmy"; // @@ -372,8 +366,6 @@ this.miSaveArmyAs, this.miExportArmyAs, this.miCloseArmy, - this.miSep1, - this.miChangeSystem, this.miSep2, this.miReloadFiles, this.miSep3, @@ -382,7 +374,6 @@ // // miNewArmy // - this.miNewArmy.Enabled = false; this.miNewArmy.Index = 0; this.miNewArmy.Text = "&new army"; this.miNewArmy.Click += new System.EventHandler(this.miNewArmy_Click); @@ -428,36 +419,25 @@ this.miCloseArmy.Text = "&close army"; this.miCloseArmy.Click += new System.EventHandler(this.miCloseArmy_Click); // - // miSep1 - // - this.miSep1.Index = 6; - this.miSep1.Text = "-"; - // - // miChangeSystem - // - this.miChangeSystem.Index = 7; - this.miChangeSystem.Text = "change &game system"; - this.miChangeSystem.Click += new System.EventHandler(this.miChangeSystem_Click); - // // miSep2 // - this.miSep2.Index = 8; + this.miSep2.Index = 6; this.miSep2.Text = "-"; // // miReloadFiles // - this.miReloadFiles.Index = 9; + this.miReloadFiles.Index = 7; this.miReloadFiles.Text = "&reload files"; this.miReloadFiles.Click += new System.EventHandler(this.miReloadFiles_Click); // // miSep3 // - this.miSep3.Index = 10; + this.miSep3.Index = 8; this.miSep3.Text = "-"; // // miExit // - this.miExit.Index = 11; + this.miExit.Index = 9; this.miExit.Text = "e&xit"; this.miExit.Click += new System.EventHandler(this.miExit_Click); // @@ -795,39 +775,20 @@ } } - private GameSystem CurrentGameSystem + public static GameSystem CurrentGameSystem { get { return WarFoundryCore.CurrentGameSystem; } set { WarFoundryCore.CurrentGameSystem = value; } } - private static Army CurrentArmy + public static Army CurrentArmy { get { return WarFoundryCore.CurrentArmy; } set { WarFoundryCore.CurrentArmy = value; } } - private void SelectGameSystem() - { - FrmSelectSystem selectSystem = new FrmSelectSystem(); - DialogResult dr = selectSystem.ShowDialog(this); - - if (dr==DialogResult.OK) - { - CloseCurrentArmy(); - CurrentGameSystem = selectSystem.GameSystem; - } - } - - private void miChangeSystem_Click(object sender, System.EventArgs e) - { - SelectGameSystem(); - } - private void FrmMain_GameSystemChanged(GameSystem oldSystem, GameSystem newSystem) { - miNewArmy.Enabled = newSystem != null; - bttnNewArmy.Enabled = newSystem != null; SetAppTitle(); RemoveCategoryButtons(); AddCategoryButtons(); @@ -1252,7 +1213,7 @@ if (dr == DialogResult.OK) { - Army army = WarFoundryCore.CurrentArmy; + Army army = CurrentArmy; string filePath = dialog.FileName; logger.DebugFormat("Exporting {0} to {1} as basic HTML", army.Name, filePath); WarFoundryHtmlExporter.GetDefault().ExportArmy(army, filePath); diff -r e6d0d9eababf -r d6ff354a5d84 FrmNewArmy.cs --- a/FrmNewArmy.cs Wed Sep 16 19:50:39 2009 +0000 +++ b/FrmNewArmy.cs Sat Sep 19 10:27:01 2009 +0000 @@ -11,9 +11,9 @@ using IBBoard.Windows.Forms; using IBBoard.WarFoundry.API; using IBBoard.WarFoundry.API.Objects; -using IBBoard.Windows.Forms.I18N; - -namespace IBBoard.WarFoundry +using IBBoard.Windows.Forms.I18N; + +namespace IBBoard.WarFoundry.GUI.WinForms { /// /// Summary description for FrmNewArmy. @@ -28,24 +28,41 @@ private IBBoard.Windows.Forms.IBBLabel lblRaceList; private IBBoard.Windows.Forms.IBBButton bttnSelectRace; private System.Windows.Forms.ListBox lstRaces; - private Race[] races; private IBBoard.Windows.Forms.IBBLabel lblArmyName; private IBBoard.Windows.Forms.IBBLabel lblArmySize; - private System.Windows.Forms.NumericUpDown armySize; - private System.Windows.Forms.TextBox txtArmyName; + private System.Windows.Forms.NumericUpDown armySize; + private Label lblGameSystem; + private ComboBox gameSystems; + private System.Windows.Forms.TextBox txtArmyName; + + private GameSystem system; + private Race race; + private string armyName; + private int maxPoints; public FrmNewArmy(GameSystem system) { InitializeComponent(); - ControlTranslator.TranslateControl(this); - - races = WarFoundryLoader.GetDefault().GetRaces(system); - - for (int i = 0; i @@ -69,148 +86,176 @@ /// the contents of this method with the code editor. /// private void InitializeComponent() - { - System.Resources.ResourceManager resources = new System.Resources.ResourceManager(typeof(FrmNewArmy)); - this.lstRaces = new System.Windows.Forms.ListBox(); - this.bttnCancel = new IBBoard.Windows.Forms.IBBButton(); - this.lblRaceList = new IBBoard.Windows.Forms.IBBLabel(); - this.bttnSelectRace = new IBBoard.Windows.Forms.IBBButton(); - this.lblArmyName = new IBBoard.Windows.Forms.IBBLabel(); - this.txtArmyName = new System.Windows.Forms.TextBox(); - this.lblArmySize = new IBBoard.Windows.Forms.IBBLabel(); - this.armySize = new System.Windows.Forms.NumericUpDown(); - ((System.ComponentModel.ISupportInitialize)(this.armySize)).BeginInit(); - this.SuspendLayout(); - // - // lstRaces - // - this.lstRaces.Location = new System.Drawing.Point(88, 8); - this.lstRaces.Name = "lstRaces"; - this.lstRaces.Size = new System.Drawing.Size(272, 121); - this.lstRaces.TabIndex = 7; - this.lstRaces.SelectedIndexChanged += new System.EventHandler(this.lstRaces_SelectedIndexChanged); - // - // bttnCancel - // - this.bttnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel; - this.bttnCancel.FlatStyle = System.Windows.Forms.FlatStyle.System; - this.bttnCancel.Location = new System.Drawing.Point(8, 200); - this.bttnCancel.Name = "bttnCancel"; - this.bttnCancel.Size = new System.Drawing.Size(80, 24); - this.bttnCancel.TabIndex = 6; - this.bttnCancel.Text = "Cancel"; - this.bttnCancel.Click += new System.EventHandler(this.bttnCancel_Click); - // - // lblRaceList - // - this.lblRaceList.Location = new System.Drawing.Point(0, 8); - this.lblRaceList.Name = "lblRaceList"; - this.lblRaceList.Size = new System.Drawing.Size(88, 80); - this.lblRaceList.TabIndex = 5; - this.lblRaceList.Text = "race list"; - this.lblRaceList.TextAlign = System.Drawing.ContentAlignment.TopRight; - // - // bttnSelectRace - // - this.bttnSelectRace.Enabled = false; - this.bttnSelectRace.FlatStyle = System.Windows.Forms.FlatStyle.System; - this.bttnSelectRace.Location = new System.Drawing.Point(256, 200); - this.bttnSelectRace.Name = "bttnSelectRace"; - this.bttnSelectRace.Size = new System.Drawing.Size(104, 24); - this.bttnSelectRace.TabIndex = 4; - this.bttnSelectRace.Text = "create race"; - this.bttnSelectRace.Click += new System.EventHandler(this.bttnSelectRace_Click); - // - // lblArmyName - // - this.lblArmyName.Location = new System.Drawing.Point(0, 136); - this.lblArmyName.Name = "lblArmyName"; - this.lblArmyName.Size = new System.Drawing.Size(88, 32); - this.lblArmyName.TabIndex = 8; - this.lblArmyName.Text = "army name"; - this.lblArmyName.TextAlign = System.Drawing.ContentAlignment.TopRight; - // - // txtArmyName - // - this.txtArmyName.Location = new System.Drawing.Point(88, 136); - this.txtArmyName.Name = "txtArmyName"; - this.txtArmyName.Size = new System.Drawing.Size(272, 20); - this.txtArmyName.TabIndex = 9; - this.txtArmyName.Text = ""; - this.txtArmyName.TextChanged += new System.EventHandler(this.txtArmyName_TextChanged); - // - // lblArmySize - // - this.lblArmySize.Location = new System.Drawing.Point(0, 168); - this.lblArmySize.Name = "lblArmySize"; - this.lblArmySize.Size = new System.Drawing.Size(88, 32); - this.lblArmySize.TabIndex = 10; - this.lblArmySize.Text = "army size"; - this.lblArmySize.TextAlign = System.Drawing.ContentAlignment.TopRight; - // - // armySize - // - this.armySize.Increment = new System.Decimal(new int[] { - 50, - 0, - 0, - 0}); - this.armySize.Location = new System.Drawing.Point(88, 168); - this.armySize.Maximum = new System.Decimal(new int[] { - 1000000, - 0, - 0, - 0}); - this.armySize.Name = "armySize"; - this.armySize.TabIndex = 11; - this.armySize.ThousandsSeparator = true; - this.armySize.Value = new System.Decimal(new int[] { - 2000, - 0, - 0, - 0}); - // - // FrmNewArmy - // - this.AcceptButton = this.bttnSelectRace; - this.AutoScaleBaseSize = new System.Drawing.Size(5, 13); - this.CancelButton = this.bttnCancel; - this.ClientSize = new System.Drawing.Size(370, 228); - this.Controls.Add(this.armySize); - this.Controls.Add(this.lblArmySize); - this.Controls.Add(this.txtArmyName); - this.Controls.Add(this.lblArmyName); - this.Controls.Add(this.bttnCancel); - this.Controls.Add(this.lblRaceList); - this.Controls.Add(this.bttnSelectRace); - this.Controls.Add(this.lstRaces); - this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog; - this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); - this.MaximizeBox = false; - this.MinimizeBox = false; - this.Name = "FrmNewArmy"; - this.ShowInTaskbar = false; - this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; - this.Text = "FrmNewArmy"; - ((System.ComponentModel.ISupportInitialize)(this.armySize)).EndInit(); - this.ResumeLayout(false); - + { + System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(FrmNewArmy)); + this.lstRaces = new System.Windows.Forms.ListBox(); + this.bttnCancel = new IBBoard.Windows.Forms.IBBButton(); + this.lblRaceList = new IBBoard.Windows.Forms.IBBLabel(); + this.bttnSelectRace = new IBBoard.Windows.Forms.IBBButton(); + this.lblArmyName = new IBBoard.Windows.Forms.IBBLabel(); + this.txtArmyName = new System.Windows.Forms.TextBox(); + this.lblArmySize = new IBBoard.Windows.Forms.IBBLabel(); + this.armySize = new System.Windows.Forms.NumericUpDown(); + this.lblGameSystem = new System.Windows.Forms.Label(); + this.gameSystems = new System.Windows.Forms.ComboBox(); + ((System.ComponentModel.ISupportInitialize) (this.armySize)).BeginInit(); + this.SuspendLayout(); + // + // lstRaces + // + this.lstRaces.Location = new System.Drawing.Point(89, 33); + this.lstRaces.Name = "lstRaces"; + this.lstRaces.Size = new System.Drawing.Size(269, 121); + this.lstRaces.TabIndex = 7; + this.lstRaces.SelectedIndexChanged += new System.EventHandler(this.lstRaces_SelectedIndexChanged); + // + // bttnCancel + // + this.bttnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel; + this.bttnCancel.FlatStyle = System.Windows.Forms.FlatStyle.System; + this.bttnCancel.Location = new System.Drawing.Point(12, 231); + this.bttnCancel.Name = "bttnCancel"; + this.bttnCancel.Size = new System.Drawing.Size(80, 24); + this.bttnCancel.TabIndex = 6; + this.bttnCancel.Text = "Cancel"; + this.bttnCancel.Click += new System.EventHandler(this.bttnCancel_Click); + // + // lblRaceList + // + this.lblRaceList.Location = new System.Drawing.Point(12, 33); + this.lblRaceList.Name = "lblRaceList"; + this.lblRaceList.Size = new System.Drawing.Size(71, 80); + this.lblRaceList.TabIndex = 5; + this.lblRaceList.Text = "race list"; + this.lblRaceList.TextAlign = System.Drawing.ContentAlignment.TopRight; + // + // bttnSelectRace + // + this.bttnSelectRace.Enabled = false; + this.bttnSelectRace.FlatStyle = System.Windows.Forms.FlatStyle.System; + this.bttnSelectRace.Location = new System.Drawing.Point(254, 231); + this.bttnSelectRace.Name = "bttnSelectRace"; + this.bttnSelectRace.Size = new System.Drawing.Size(104, 24); + this.bttnSelectRace.TabIndex = 4; + this.bttnSelectRace.Text = "create race"; + this.bttnSelectRace.Click += new System.EventHandler(this.bttnSelectRace_Click); + // + // lblArmyName + // + this.lblArmyName.Location = new System.Drawing.Point(12, 163); + this.lblArmyName.Name = "lblArmyName"; + this.lblArmyName.Size = new System.Drawing.Size(71, 17); + this.lblArmyName.TabIndex = 8; + this.lblArmyName.Text = "army name"; + this.lblArmyName.TextAlign = System.Drawing.ContentAlignment.TopRight; + // + // txtArmyName + // + this.txtArmyName.Location = new System.Drawing.Point(89, 160); + this.txtArmyName.Name = "txtArmyName"; + this.txtArmyName.Size = new System.Drawing.Size(269, 20); + this.txtArmyName.TabIndex = 9; + this.txtArmyName.TextChanged += new System.EventHandler(this.txtArmyName_TextChanged); + // + // lblArmySize + // + this.lblArmySize.Location = new System.Drawing.Point(12, 188); + this.lblArmySize.Name = "lblArmySize"; + this.lblArmySize.Size = new System.Drawing.Size(71, 18); + this.lblArmySize.TabIndex = 10; + this.lblArmySize.Text = "army size"; + this.lblArmySize.TextAlign = System.Drawing.ContentAlignment.TopRight; + // + // armySize + // + this.armySize.Increment = new decimal(new int[] { + 50, + 0, + 0, + 0}); + this.armySize.Location = new System.Drawing.Point(89, 186); + this.armySize.Maximum = new decimal(new int[] { + 1000000, + 0, + 0, + 0}); + this.armySize.Name = "armySize"; + this.armySize.Size = new System.Drawing.Size(120, 20); + this.armySize.TabIndex = 11; + this.armySize.ThousandsSeparator = true; + this.armySize.Value = new decimal(new int[] { + 2000, + 0, + 0, + 0}); + // + // lblGameSystem + // + this.lblGameSystem.Location = new System.Drawing.Point(12, 9); + this.lblGameSystem.Name = "lblGameSystem"; + this.lblGameSystem.Size = new System.Drawing.Size(71, 18); + this.lblGameSystem.TabIndex = 12; + this.lblGameSystem.Text = "game system"; + this.lblGameSystem.TextAlign = System.Drawing.ContentAlignment.TopRight; + // + // gameSystems + // + this.gameSystems.FormattingEnabled = true; + this.gameSystems.Location = new System.Drawing.Point(89, 6); + this.gameSystems.Name = "gameSystems"; + this.gameSystems.Size = new System.Drawing.Size(269, 21); + this.gameSystems.TabIndex = 13; + this.gameSystems.SelectedValueChanged += new System.EventHandler(this.gameSystems_SelectedValueChanged); + // + // FrmNewArmy + // + this.AcceptButton = this.bttnSelectRace; + this.AutoScaleBaseSize = new System.Drawing.Size(5, 13); + this.CancelButton = this.bttnCancel; + this.ClientSize = new System.Drawing.Size(370, 267); + this.Controls.Add(this.gameSystems); + this.Controls.Add(this.lblGameSystem); + this.Controls.Add(this.armySize); + this.Controls.Add(this.lblArmySize); + this.Controls.Add(this.txtArmyName); + this.Controls.Add(this.lblArmyName); + this.Controls.Add(this.bttnCancel); + this.Controls.Add(this.lblRaceList); + this.Controls.Add(this.bttnSelectRace); + this.Controls.Add(this.lstRaces); + this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog; + this.Icon = ((System.Drawing.Icon) (resources.GetObject("$this.Icon"))); + this.MaximizeBox = false; + this.MinimizeBox = false; + this.Name = "FrmNewArmy"; + this.ShowInTaskbar = false; + this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; + this.Text = "FrmNewArmy"; + ((System.ComponentModel.ISupportInitialize) (this.armySize)).EndInit(); + this.ResumeLayout(false); + this.PerformLayout(); + } - #endregion + #endregion + + public GameSystem SelectedSystem + { + get { return system; } + } public Race SelectedRace { - get { return races[lstRaces.SelectedIndex]; } + get { return race; } } public string ArmyName { - get { return txtArmyName.Text; } + get { return armyName; } } public int ArmySize { - get { return (int)armySize.Value; } + get { return maxPoints; } } private void bttnCancel_Click(object sender, System.EventArgs e) @@ -221,8 +266,22 @@ private void bttnSelectRace_Click(object sender, System.EventArgs e) { - DialogResult = DialogResult.OK; + DialogResult = DialogResult.OK; + SetValues(); this.Close(); + } + + private void SetValues() + { + system = GetSelectedGameSystem(); + race = (Race) lstRaces.SelectedItem; + armyName = txtArmyName.Text; + maxPoints = (int) armySize.Value; + } + + private GameSystem GetSelectedGameSystem() + { + return (GameSystem) gameSystems.SelectedItem; } private void txtArmyName_TextChanged(object sender, System.EventArgs e) @@ -238,6 +297,17 @@ private void lstRaces_SelectedIndexChanged(object sender, System.EventArgs e) { setSelectRaceEnabledVal(); + } + + private void gameSystems_SelectedValueChanged(object sender, EventArgs e) + { + GameSystem selected = GetSelectedGameSystem(); + lstRaces.Items.Clear(); + + if (selected != null) + { + SetRaces(selected); + } } } } diff -r e6d0d9eababf -r d6ff354a5d84 FrmNewArmy.resx --- a/FrmNewArmy.resx Wed Sep 16 19:50:39 2009 +0000 +++ b/FrmNewArmy.resx Sat Sep 19 10:27:01 2009 +0000 @@ -3,7 +3,7 @@ + + + + + + + + + + + + + + + + + + - + + @@ -89,117 +109,16 @@ text/microsoft-resx - 1.3 + 2.0 - System.Resources.ResXResourceReader, System.Windows.Forms, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - Private - - - False - - - Private - - - False - - - Private - - - Private - - - False - - - Private - - - Private - - - False - - - Private - - - Private - - - False - - - Private - - - Private - - - Private - - - False - - - Private - - - False - - - Private - - - Private - - - False - - - Private - - - Private - - - False - - - (Default) - - - False - - - False - - - 8, 8 - - - True - - - 80 - - - True - - - FrmNewArmy - - - Private - - + + AAABAAQAEBAAAAEAIABoBAAARgAAABgYAAABACAAiAkAAK4EAAAgIAAAAQAgAKgQAAA2DgAAMDAAAAEA IACoJQAA3h4AACgAAAAQAAAAIAAAAAEAIAAAAAAAQAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA diff -r e6d0d9eababf -r d6ff354a5d84 FrmSelectSystem.cs --- a/FrmSelectSystem.cs Wed Sep 16 19:50:39 2009 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,167 +0,0 @@ -// This file (FrmSelectSystem.cs) is a part of the IBBoard.WarFoundry.GUI.WinForms project and is copyright 2007, 2008, 2009 IBBoard. -// -// The file and the library/program it is in are licensed and distributed, without warranty, under the GNU Affero GPL license, either version 3 of the License or (at your option) any later version. Please see COPYING for more information and the full license. - -using System; -using System.IO; -using System.Drawing; -using System.ComponentModel; -using System.Windows.Forms; -using IBBoard; -using IBBoard.Lang; -using IBBoard.WarFoundry.API; -using IBBoard.Windows.Forms; -using IBBoard.WarFoundry.API.Objects; -using IBBoard.Windows.Forms.I18N; - -namespace IBBoard.WarFoundry -{ - /// - /// Summary description for FrmSelectSystem. - /// - public class FrmSelectSystem : IBBoard.Windows.Forms.IBBForm - { - private System.Windows.Forms.ListBox lstSystems; - private IBBoard.Windows.Forms.IBBLabel lblSystemList; - /// - /// Required designer variable. - /// - private System.ComponentModel.Container components = null; - private IBBoard.Windows.Forms.IBBButton bttnCancel; - private IBBoard.Windows.Forms.IBBButton bttnSelectSystem; - private GameSystem selectedSystem; - - - public FrmSelectSystem() - { - // - // Required for Windows Form Designer support - // - InitializeComponent(); - - ControlTranslator.TranslateControl(this); - - lstSystems.Items.Clear(); - GameSystem[] systems = WarFoundryLoader.GetDefault().GetGameSystems(); - lstSystems.DataSource = systems; - lstSystems.DisplayMember = "Name"; - } - - /// - /// Clean up any resources being used. - /// - protected override void Dispose( bool disposing ) - { - if( disposing ) - { - if(components != null) - { - components.Dispose(); - } - } - base.Dispose( disposing ); - } - - #region Windows Form Designer generated code - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - this.lstSystems = new System.Windows.Forms.ListBox(); - this.bttnSelectSystem = new IBBoard.Windows.Forms.IBBButton(); - this.lblSystemList = new IBBoard.Windows.Forms.IBBLabel(); - this.bttnCancel = new IBBoard.Windows.Forms.IBBButton(); - this.SuspendLayout(); - // - // lstSystems - // - this.lstSystems.Location = new System.Drawing.Point(80, 8); - this.lstSystems.Name = "lstSystems"; - this.lstSystems.Size = new System.Drawing.Size(216, 95); - this.lstSystems.TabIndex = 0; - this.lstSystems.DoubleClick += new System.EventHandler(this.lstSystems_DoubleClick); - this.lstSystems.SelectedIndexChanged += new System.EventHandler(this.lstSystems_SelectedIndexChanged); - // - // bttnSelectSystem - // - this.bttnSelectSystem.Enabled = false; - this.bttnSelectSystem.FlatStyle = System.Windows.Forms.FlatStyle.System; - this.bttnSelectSystem.Location = new System.Drawing.Point(192, 112); - this.bttnSelectSystem.Name = "bttnSelectSystem"; - this.bttnSelectSystem.Size = new System.Drawing.Size(104, 24); - this.bttnSelectSystem.TabIndex = 1; - this.bttnSelectSystem.Text = "Select system"; - this.bttnSelectSystem.Click += new System.EventHandler(this.bttnSelectSystem_Click); - // - // lblSystemList - // - this.lblSystemList.Location = new System.Drawing.Point(0, 8); - this.lblSystemList.Name = "lblSystemList"; - this.lblSystemList.Size = new System.Drawing.Size(80, 80); - this.lblSystemList.TabIndex = 2; - this.lblSystemList.Text = "system list"; - this.lblSystemList.TextAlign = System.Drawing.ContentAlignment.TopRight; - // - // bttnCancel - // - this.bttnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel; - this.bttnCancel.FlatStyle = System.Windows.Forms.FlatStyle.System; - this.bttnCancel.Location = new System.Drawing.Point(8, 112); - this.bttnCancel.Name = "bttnCancel"; - this.bttnCancel.Size = new System.Drawing.Size(80, 24); - this.bttnCancel.TabIndex = 3; - this.bttnCancel.Text = "Cancel"; - this.bttnCancel.Click += new System.EventHandler(this.bttnCancel_Click); - // - // FrmSelectSystem - // - this.AcceptButton = this.bttnSelectSystem; - this.AutoScaleBaseSize = new System.Drawing.Size(5, 13); - this.CancelButton = this.bttnCancel; - this.ClientSize = new System.Drawing.Size(306, 142); - this.ControlBox = false; - this.Controls.Add(this.bttnCancel); - this.Controls.Add(this.lblSystemList); - this.Controls.Add(this.bttnSelectSystem); - this.Controls.Add(this.lstSystems); - this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog; - this.Name = "FrmSelectSystem"; - this.ShowInTaskbar = false; - this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; - this.Text = "FrmSelectSystem"; - this.ResumeLayout(false); - - } - #endregion - - private void lstSystems_SelectedIndexChanged(object sender, System.EventArgs e) - { - bttnSelectSystem.Enabled = (lstSystems.SelectedIndex>-1); - } - - private void bttnSelectSystem_Click(object sender, System.EventArgs e) - { - selectedSystem = (GameSystem) lstSystems.SelectedItem; - this.DialogResult = DialogResult.OK; - this.Close(); - } - - private void bttnCancel_Click(object sender, System.EventArgs e) - { - this.DialogResult = DialogResult.Cancel; - this.Close(); - } - - public GameSystem GameSystem - { - get { return selectedSystem; } - } - - private void lstSystems_DoubleClick(object sender, EventArgs e) - { - bttnSelectSystem_Click(null, null); - } - } -} diff -r e6d0d9eababf -r d6ff354a5d84 FrmSelectSystem.resources Binary file FrmSelectSystem.resources has changed diff -r e6d0d9eababf -r d6ff354a5d84 FrmSelectSystem.resx --- a/FrmSelectSystem.resx Wed Sep 16 19:50:39 2009 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,120 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - \ No newline at end of file diff -r e6d0d9eababf -r d6ff354a5d84 IBBoard.WarFoundry.GUI.WinForms.csproj --- a/IBBoard.WarFoundry.GUI.WinForms.csproj Wed Sep 16 19:50:39 2009 +0000 +++ b/IBBoard.WarFoundry.GUI.WinForms.csproj Sat Sep 19 10:27:01 2009 +0000 @@ -136,9 +136,6 @@ Form - - Form - Form @@ -174,10 +171,6 @@ FrmReplaceUnitEquipment.cs - - FrmSelectSystem.cs - Designer - FrmUnit.cs