Mercurial > repos > IBBoard.WarFoundry.GUI.WinForms
changeset 54:d6ff354a5d84
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
author | IBBoard <dev@ibboard.co.uk> |
---|---|
date | Sat, 19 Sep 2009 10:27:01 +0000 |
parents | e6d0d9eababf |
children | 346b4ac34997 |
files | FrmMain.cs FrmNewArmy.cs FrmNewArmy.resx FrmSelectSystem.cs FrmSelectSystem.resources FrmSelectSystem.resx IBBoard.WarFoundry.GUI.WinForms.csproj |
diffstat | 7 files changed, 254 insertions(+), 598 deletions(-) [+] |
line wrap: on
line diff
--- 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);
--- 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> /// 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<races.Length; i++) - { - lstRaces.Items.Add(races[i].Name); + ControlTranslator.TranslateControl(this); + + foreach (GameSystem gameSystem in WarFoundryLoader.GetDefault().GetGameSystems()) + { + gameSystems.Items.Add(gameSystem); + } + + if (WarFoundryCore.CurrentGameSystem != null) + { + gameSystems.SelectedItem = FrmMain.CurrentGameSystem; } + } + + private void SetRaces(GameSystem system) + { + foreach (Race race in WarFoundryLoader.GetDefault().GetRaces(system)) + { + lstRaces.Items.Add(race); + } } /// <summary> @@ -69,148 +86,176 @@ /// the contents of this method with the code editor. /// </summary> 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); + } } } }
--- 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 @@ <!-- Microsoft ResX Schema - Version 1.3 + 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 @@ -14,16 +14,17 @@ ... ado.net/XML headers & schema ... <resheader name="resmimetype">text/microsoft-resx</resheader> - <resheader name="version">1.3</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">this is my long string</data> + <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"> - [base64 mime encoded serialized .NET Framework object] + <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"> - [base64 mime encoded string representing a byte array form of the .NET Framework object] + <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 @@ -35,7 +36,7 @@ Classes that don't support this are serialized and stored with the mimetype set. - The mimetype is used forserialized objects, and tells the + 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: @@ -45,7 +46,7 @@ mimetype: application/x-microsoft.net.object.binary.base64 value : The object must be serialized with - : System.Serialization.Formatters.Binary.BinaryFormatter + : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter : and then encoded with base64 encoding. mimetype: application/x-microsoft.net.object.soap.base64 @@ -59,18 +60,37 @@ : 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" msdata:Ordinal="1" /> + <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"> @@ -89,117 +109,16 @@ <value>text/microsoft-resx</value> </resheader> <resheader name="version"> - <value>1.3</value> + <value>2.0</value> </resheader> <resheader name="reader"> - <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=1.0.5000.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=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> + <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> </resheader> - <data name="lstRaces.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> - <value>Private</value> - </data> - <data name="lstRaces.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> - <value>False</value> - </data> - <data name="lstRaces.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> - <value>Private</value> - </data> - <data name="bttnCancel.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> - <value>False</value> - </data> - <data name="bttnCancel.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> - <value>Private</value> - </data> - <data name="bttnCancel.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> - <value>Private</value> - </data> - <data name="lblRaceList.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> - <value>False</value> - </data> - <data name="lblRaceList.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> - <value>Private</value> - </data> - <data name="lblRaceList.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> - <value>Private</value> - </data> - <data name="bttnSelectRace.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> - <value>False</value> - </data> - <data name="bttnSelectRace.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> - <value>Private</value> - </data> - <data name="bttnSelectRace.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> - <value>Private</value> - </data> - <data name="lblArmyName.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> - <value>False</value> - </data> - <data name="lblArmyName.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> - <value>Private</value> - </data> - <data name="lblArmyName.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> - <value>Private</value> - </data> - <data name="txtArmyName.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> - <value>Private</value> - </data> - <data name="txtArmyName.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> - <value>False</value> - </data> - <data name="txtArmyName.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> - <value>Private</value> - </data> - <data name="lblArmySize.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> - <value>False</value> - </data> - <data name="lblArmySize.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> - <value>Private</value> - </data> - <data name="lblArmySize.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> - <value>Private</value> - </data> - <data name="armySize.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> - <value>False</value> - </data> - <data name="armySize.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> - <value>Private</value> - </data> - <data name="armySize.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> - <value>Private</value> - </data> - <data name="$this.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> - <value>False</value> - </data> - <data name="$this.Language" type="System.Globalization.CultureInfo, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> - <value>(Default)</value> - </data> - <data name="$this.TrayLargeIcon" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> - <value>False</value> - </data> - <data name="$this.Localizable" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> - <value>False</value> - </data> - <data name="$this.GridSize" type="System.Drawing.Size, System.Drawing, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> - <value>8, 8</value> - </data> - <data name="$this.DrawGrid" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> - <value>True</value> - </data> - <data name="$this.TrayHeight" type="System.Int32, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> - <value>80</value> - </data> - <data name="$this.SnapToGrid" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> - <value>True</value> - </data> - <data name="$this.Name"> - <value>FrmNewArmy</value> - </data> - <data name="$this.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> - <value>Private</value> - </data> - <data name="$this.Icon" type="System.Drawing.Icon, System.Drawing, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" mimetype="application/x-microsoft.net.object.bytearray.base64"> + <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> AAABAAQAEBAAAAEAIABoBAAARgAAABgYAAABACAAiAkAAK4EAAAgIAAAAQAgAKgQAAA2DgAAMDAAAAEA IACoJQAA3h4AACgAAAAQAAAAIAAAAAEAIAAAAAAAQAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
--- 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> - /// Summary description for FrmSelectSystem. - /// </summary> - public class FrmSelectSystem : IBBoard.Windows.Forms.IBBForm - { - private System.Windows.Forms.ListBox lstSystems; - private IBBoard.Windows.Forms.IBBLabel lblSystemList; - /// <summary> - /// Required designer variable. - /// </summary> - 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"; - } - - /// <summary> - /// Clean up any resources being used. - /// </summary> - protected override void Dispose( bool disposing ) - { - if( disposing ) - { - if(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.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); - } - } -}
--- 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 @@ -<?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/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 @@ <Compile Include="FrmReplaceUnitEquipment.cs"> <SubType>Form</SubType> </Compile> - <Compile Include="FrmSelectSystem.cs"> - <SubType>Form</SubType> - </Compile> <Compile Include="FrmUnit.cs"> <SubType>Form</SubType> </Compile> @@ -174,10 +171,6 @@ <EmbeddedResource Include="FrmReplaceUnitEquipment.resx"> <DependentUpon>FrmReplaceUnitEquipment.cs</DependentUpon> </EmbeddedResource> - <EmbeddedResource Include="FrmSelectSystem.resx"> - <DependentUpon>FrmSelectSystem.cs</DependentUpon> - <SubType>Designer</SubType> - </EmbeddedResource> <EmbeddedResource Include="FrmUnit.resx"> <DependentUpon>FrmUnit.cs</DependentUpon> </EmbeddedResource>