Mercurial > repos > IBBoard.WarFoundry.GUI.WinForms
changeset 29:f72a3da5059b
Re #88: Complete initial WinForms UI
* Make double-click on system selection list pick that item
author | IBBoard <dev@ibboard.co.uk> |
---|---|
date | Sat, 01 Aug 2009 19:57:08 +0000 |
parents | fcfe7e12616a |
children | eb470dc9aaa6 |
files | FrmSelectSystem.cs FrmSelectSystem.resx |
diffstat | 2 files changed, 101 insertions(+), 141 deletions(-) [+] |
line wrap: on
line diff
--- a/FrmSelectSystem.cs Sat Aug 01 16:07:15 2009 +0000 +++ b/FrmSelectSystem.cs Sat Aug 01 19:57:08 2009 +0000 @@ -69,70 +69,71 @@ /// 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.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); - + { + 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 @@ -157,6 +158,11 @@ public GameSystem GameSystem { get { return selectedSystem; } + } + + private void lstSystems_DoubleClick(object sender, EventArgs e) + { + bttnSelectSystem_Click(null, null); } } }
--- a/FrmSelectSystem.resx Sat Aug 01 16:07:15 2009 +0000 +++ b/FrmSelectSystem.resx Sat Aug 01 19:57:08 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,78 +109,12 @@ <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="lstSystems.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> - <value>Private</value> - </data> - <data name="lstSystems.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> - <value>False</value> - </data> - <data name="lstSystems.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> - <value>Private</value> - </data> - <data name="bttnSelectSystem.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> - <value>False</value> - </data> - <data name="bttnSelectSystem.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> - <value>Private</value> - </data> - <data name="bttnSelectSystem.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> - <value>Private</value> - </data> - <data name="lblSystemList.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> - <value>False</value> - </data> - <data name="lblSystemList.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> - <value>Private</value> - </data> - <data name="lblSystemList.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="$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.Name"> - <value>FrmSelectSystem</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.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> - <value>Private</value> - </data> </root> \ No newline at end of file