Mercurial > repos > IBDev-IBBoard.WarFoundry.GUI.GTK
diff gtk-gui/IBBoard.WarFoundry.GTK.FrmNewArmy.cs @ 36:d68992a831df
Fixes #182: Make GTK# more like WinForms UI
* Remove "Change Game System" option
* Delete "Change Game System" dialogs
* Add game system selection to army creation
author | IBBoard <dev@ibboard.co.uk> |
---|---|
date | Sat, 16 Jan 2010 16:36:12 +0000 |
parents | 1b603f97e7de |
children | 0bd9c85d3c5d |
line wrap: on
line diff
--- a/gtk-gui/IBBoard.WarFoundry.GTK.FrmNewArmy.cs Sat Jan 16 11:07:15 2010 +0000 +++ b/gtk-gui/IBBoard.WarFoundry.GTK.FrmNewArmy.cs Sat Jan 16 16:36:12 2010 +0000 @@ -29,6 +29,10 @@ private Gtk.Label label3; + private Gtk.Label label4; + + private Gtk.ComboBoxEntry systemCombo; + private Gtk.Entry txtArmyName; private Gtk.Button bttnCancel; @@ -52,7 +56,7 @@ w1.Name = "dialog_VBox"; w1.BorderWidth = ((uint)(2)); // Container child dialog_VBox.Gtk.Box+BoxChild - this.table1 = new Gtk.Table(((uint)(3)), ((uint)(2)), false); + this.table1 = new Gtk.Table(((uint)(4)), ((uint)(2)), false); this.table1.Name = "table1"; this.table1.RowSpacing = ((uint)(6)); this.table1.ColumnSpacing = ((uint)(6)); @@ -70,8 +74,11 @@ this.GtkScrolledWindow.Add(this.lstRaces); this.table1.Add(this.GtkScrolledWindow); Gtk.Table.TableChild w3 = ((Gtk.Table.TableChild)(this.table1[this.GtkScrolledWindow])); + w3.TopAttach = ((uint)(1)); + w3.BottomAttach = ((uint)(2)); w3.LeftAttach = ((uint)(1)); w3.RightAttach = ((uint)(2)); + w3.XOptions = ((Gtk.AttachOptions)(4)); w3.YOptions = ((Gtk.AttachOptions)(4)); // Container child table1.Gtk.Table+TableChild this.hbox2 = new Gtk.HBox(); @@ -92,10 +99,11 @@ w4.Fill = false; this.table1.Add(this.hbox2); Gtk.Table.TableChild w5 = ((Gtk.Table.TableChild)(this.table1[this.hbox2])); - w5.TopAttach = ((uint)(2)); - w5.BottomAttach = ((uint)(3)); + w5.TopAttach = ((uint)(3)); + w5.BottomAttach = ((uint)(4)); w5.LeftAttach = ((uint)(1)); w5.RightAttach = ((uint)(2)); + w5.XOptions = ((Gtk.AttachOptions)(4)); w5.YOptions = ((Gtk.AttachOptions)(4)); // Container child table1.Gtk.Table+TableChild this.label1 = new Gtk.Label(); @@ -103,6 +111,8 @@ this.label1.LabelProp = Mono.Unix.Catalog.GetString("Race"); this.table1.Add(this.label1); Gtk.Table.TableChild w6 = ((Gtk.Table.TableChild)(this.table1[this.label1])); + w6.TopAttach = ((uint)(1)); + w6.BottomAttach = ((uint)(2)); w6.XOptions = ((Gtk.AttachOptions)(4)); w6.YOptions = ((Gtk.AttachOptions)(4)); // Container child table1.Gtk.Table+TableChild @@ -111,8 +121,8 @@ this.label2.LabelProp = Mono.Unix.Catalog.GetString("Army name"); this.table1.Add(this.label2); Gtk.Table.TableChild w7 = ((Gtk.Table.TableChild)(this.table1[this.label2])); - w7.TopAttach = ((uint)(1)); - w7.BottomAttach = ((uint)(2)); + w7.TopAttach = ((uint)(2)); + w7.BottomAttach = ((uint)(3)); w7.XOptions = ((Gtk.AttachOptions)(4)); w7.YOptions = ((Gtk.AttachOptions)(4)); // Container child table1.Gtk.Table+TableChild @@ -121,37 +131,54 @@ this.label3.LabelProp = Mono.Unix.Catalog.GetString("Points value"); this.table1.Add(this.label3); Gtk.Table.TableChild w8 = ((Gtk.Table.TableChild)(this.table1[this.label3])); - w8.TopAttach = ((uint)(2)); - w8.BottomAttach = ((uint)(3)); + w8.TopAttach = ((uint)(3)); + w8.BottomAttach = ((uint)(4)); w8.XOptions = ((Gtk.AttachOptions)(4)); w8.YOptions = ((Gtk.AttachOptions)(4)); // Container child table1.Gtk.Table+TableChild + this.label4 = new Gtk.Label(); + this.label4.Name = "label4"; + this.label4.LabelProp = Mono.Unix.Catalog.GetString("game system"); + this.table1.Add(this.label4); + Gtk.Table.TableChild w9 = ((Gtk.Table.TableChild)(this.table1[this.label4])); + w9.XOptions = ((Gtk.AttachOptions)(4)); + w9.YOptions = ((Gtk.AttachOptions)(4)); + // Container child table1.Gtk.Table+TableChild + this.systemCombo = Gtk.ComboBoxEntry.NewText(); + this.systemCombo.Name = "systemCombo"; + this.table1.Add(this.systemCombo); + Gtk.Table.TableChild w10 = ((Gtk.Table.TableChild)(this.table1[this.systemCombo])); + w10.LeftAttach = ((uint)(1)); + w10.RightAttach = ((uint)(2)); + w10.YOptions = ((Gtk.AttachOptions)(4)); + // Container child table1.Gtk.Table+TableChild this.txtArmyName = new Gtk.Entry(); this.txtArmyName.CanFocus = true; this.txtArmyName.Name = "txtArmyName"; this.txtArmyName.IsEditable = true; this.txtArmyName.InvisibleChar = '•'; this.table1.Add(this.txtArmyName); - Gtk.Table.TableChild w9 = ((Gtk.Table.TableChild)(this.table1[this.txtArmyName])); - w9.TopAttach = ((uint)(1)); - w9.BottomAttach = ((uint)(2)); - w9.LeftAttach = ((uint)(1)); - w9.RightAttach = ((uint)(2)); - w9.YOptions = ((Gtk.AttachOptions)(4)); + Gtk.Table.TableChild w11 = ((Gtk.Table.TableChild)(this.table1[this.txtArmyName])); + w11.TopAttach = ((uint)(2)); + w11.BottomAttach = ((uint)(3)); + w11.LeftAttach = ((uint)(1)); + w11.RightAttach = ((uint)(2)); + w11.XOptions = ((Gtk.AttachOptions)(4)); + w11.YOptions = ((Gtk.AttachOptions)(4)); w1.Add(this.table1); - Gtk.Box.BoxChild w10 = ((Gtk.Box.BoxChild)(w1[this.table1])); - w10.Position = 0; - w10.Expand = false; - w10.Fill = false; - w10.Padding = ((uint)(6)); + Gtk.Box.BoxChild w12 = ((Gtk.Box.BoxChild)(w1[this.table1])); + w12.Position = 0; + w12.Expand = false; + w12.Fill = false; + w12.Padding = ((uint)(6)); // Internal child IBBoard.WarFoundry.GTK.FrmNewArmy.ActionArea - Gtk.HButtonBox w11 = this.ActionArea; - w11.CanFocus = true; - w11.Events = ((Gdk.EventMask)(256)); - w11.Name = "WarFoundrySharp.FrmNewArmy_ActionArea"; - w11.Spacing = 6; - w11.BorderWidth = ((uint)(5)); - w11.LayoutStyle = ((Gtk.ButtonBoxStyle)(4)); + Gtk.HButtonBox w13 = this.ActionArea; + w13.CanFocus = true; + w13.Events = ((Gdk.EventMask)(256)); + w13.Name = "WarFoundrySharp.FrmNewArmy_ActionArea"; + w13.Spacing = 6; + w13.BorderWidth = ((uint)(5)); + w13.LayoutStyle = ((Gtk.ButtonBoxStyle)(4)); // Container child WarFoundrySharp.FrmNewArmy_ActionArea.Gtk.ButtonBox+ButtonBoxChild this.bttnCancel = new Gtk.Button(); this.bttnCancel.CanFocus = true; @@ -160,9 +187,9 @@ this.bttnCancel.UseUnderline = true; this.bttnCancel.Label = "gtk-cancel"; this.AddActionWidget(this.bttnCancel, -6); - Gtk.ButtonBox.ButtonBoxChild w12 = ((Gtk.ButtonBox.ButtonBoxChild)(w11[this.bttnCancel])); - w12.Expand = false; - w12.Fill = false; + Gtk.ButtonBox.ButtonBoxChild w14 = ((Gtk.ButtonBox.ButtonBoxChild)(w13[this.bttnCancel])); + w14.Expand = false; + w14.Fill = false; // Container child WarFoundrySharp.FrmNewArmy_ActionArea.Gtk.ButtonBox+ButtonBoxChild this.bttnCreate = new Gtk.Button(); this.bttnCreate.Sensitive = false; @@ -171,33 +198,34 @@ this.bttnCreate.Name = "bttnCreate"; this.bttnCreate.UseUnderline = true; // Container child bttnCreate.Gtk.Container+ContainerChild - Gtk.Alignment w13 = new Gtk.Alignment(0.5F, 0.5F, 0F, 0F); + Gtk.Alignment w15 = new Gtk.Alignment(0.5F, 0.5F, 0F, 0F); // Container child GtkAlignment.Gtk.Container+ContainerChild - Gtk.HBox w14 = new Gtk.HBox(); - w14.Spacing = 2; + Gtk.HBox w16 = new Gtk.HBox(); + w16.Spacing = 2; // Container child GtkHBox.Gtk.Container+ContainerChild - Gtk.Image w15 = new Gtk.Image(); - w15.Pixbuf = Stetic.IconLoader.LoadIcon(this, "gtk-ok", Gtk.IconSize.Menu, 16); - w14.Add(w15); + Gtk.Image w17 = new Gtk.Image(); + w17.Pixbuf = Stetic.IconLoader.LoadIcon(this, "gtk-ok", Gtk.IconSize.Menu, 16); + w16.Add(w17); // Container child GtkHBox.Gtk.Container+ContainerChild - Gtk.Label w17 = new Gtk.Label(); - w17.LabelProp = Mono.Unix.Catalog.GetString("C_reate"); - w17.UseUnderline = true; - w14.Add(w17); - w13.Add(w14); - this.bttnCreate.Add(w13); + Gtk.Label w19 = new Gtk.Label(); + w19.LabelProp = Mono.Unix.Catalog.GetString("C_reate"); + w19.UseUnderline = true; + w16.Add(w19); + w15.Add(w16); + this.bttnCreate.Add(w15); this.AddActionWidget(this.bttnCreate, -5); - Gtk.ButtonBox.ButtonBoxChild w21 = ((Gtk.ButtonBox.ButtonBoxChild)(w11[this.bttnCreate])); - w21.Position = 1; - w21.Expand = false; - w21.Fill = false; + Gtk.ButtonBox.ButtonBoxChild w23 = ((Gtk.ButtonBox.ButtonBoxChild)(w13[this.bttnCreate])); + w23.Position = 1; + w23.Expand = false; + w23.Fill = false; if ((this.Child != null)) { this.Child.ShowAll(); } - this.DefaultWidth = 400; - this.DefaultHeight = 322; + this.DefaultWidth = 370; + this.DefaultHeight = 348; this.Show(); this.txtArmyName.Changed += new System.EventHandler(this.OnTextChanged); + this.systemCombo.Changed += new System.EventHandler(this.OnSystemComboChanged); this.sbPointsValue.ChangeValue += new Gtk.ChangeValueHandler(this.OnSpinChangeValue); this.sbPointsValue.ValueChanged += new System.EventHandler(this.OnSpinValueChanged); this.sbPointsValue.Changed += new System.EventHandler(this.OnSpinValueChanged);