# HG changeset patch # User IBBoard # Date 1263659772 0 # Node ID d68992a831df6c6d012128eb494a7372043c8bdc # Parent 1b603f97e7de45b9f9c8130474a8244b33d178c9 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 diff -r 1b603f97e7de -r d68992a831df FrmChangeGameSystem.cs --- a/FrmChangeGameSystem.cs Sat Jan 16 11:07:15 2010 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,84 +0,0 @@ -// This file (FrmChangeGameSystem.cs) is a part of the IBBoard.WarFoundry.GTK project and is copyright 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 IBBoard.WarFoundry.API; -using IBBoard.WarFoundry.API.Objects; -using Gtk; -using log4net; - -namespace IBBoard.WarFoundry.GTK -{ - public partial class FrmChangeGameSystem : Dialog - { - private ILog logger = LogManager.GetLogger(typeof(FrmChangeGameSystem)); - //private AbstractNativeWarFoundryFactory factory; - private GameSystem selectedSystem; - - public FrmChangeGameSystem(Window parent) : base("Change Game System", parent, DialogFlags.Modal) - { - this.Build(); - lstGameSystems.Selection.Changed+= new EventHandler(OnSelectionChanged); - TreeViewColumn gameSystemColumn = new TreeViewColumn (); - gameSystemColumn.Title = "Game System"; - CellRendererText gameSystemCell = new CellRendererText (); - gameSystemColumn.PackStart (gameSystemCell, true); - lstGameSystems.AppendColumn(gameSystemColumn); - gameSystemColumn.SetCellDataFunc (gameSystemCell, new TreeCellDataFunc (RenderSystemName)); - ListStore store = new ListStore(typeof(GameSystem)); - - foreach (GameSystem system in WarFoundryLoader.GetDefault().GetGameSystems()) - { - store.AppendValues(system); - } - - lstGameSystems.Model = store; - } - - private void RenderSystemName(TreeViewColumn column, CellRenderer cell, TreeModel model, TreeIter iter) - { - GameSystem system = (GameSystem) model.GetValue(iter, 0); - (cell as CellRendererText).Text = system.Name; - } - - protected virtual void OnGameSystemOkayClicked(object sender, EventArgs e) - { - logger.Debug("Okay clicked"); - SetReturnValue(); - Respond(ResponseType.Ok); - } - - private void SetReturnValue() - { - TreeModel model; - TreeIter iter; - lstGameSystems.Selection.GetSelected (out model, out iter); - selectedSystem = (GameSystem) model.GetValue(iter, 0); - } - - protected virtual void OnSelectionChanged(object o, EventArgs e) - { - logger.Debug("Selection changed"); - buttonOk.Sensitive = (lstGameSystems.Selection.CountSelectedRows() > 0); - } - - protected virtual void OnCancel (object sender, System.EventArgs e) - { - logger.Debug("Cancel clicked"); - Respond(ResponseType.Cancel); - } - - protected virtual void lstGameSystemsRowActivated (object o, Gtk.RowActivatedArgs args) - { - logger.Debug("List row double-clicked"); - SetReturnValue(); - Respond(ResponseType.Ok); - } - - public GameSystem SelectedSystem - { - get { return selectedSystem; } - } - } -} diff -r 1b603f97e7de -r d68992a831df FrmMainWindow.cs --- a/FrmMainWindow.cs Sat Jan 16 11:07:15 2010 +0000 +++ b/FrmMainWindow.cs Sat Jan 16 16:36:12 2010 +0000 @@ -360,11 +360,6 @@ Application.Quit(); } - protected virtual void OnChangeGameSystemActivated(object sender, System.EventArgs e) - { - ChangeCurrentGameSystem(); - } - protected virtual void OnCreateArmyActivated(object sender, System.EventArgs e) { CreateNewArmy(); @@ -444,8 +439,6 @@ { system = newSys; SetAppTitle(); - miCreateArmy.Sensitive = system!=null; - newArmyButton.Sensitive = system!=null; RemoveCategoryButtons(); if (system!=null) @@ -882,25 +875,6 @@ newArmy.Destroy(); } - private void ChangeCurrentGameSystem() - { - logger.Debug("Changing game system"); - FrmChangeGameSystem dialog = new FrmChangeGameSystem(this); - ResponseType type = (ResponseType)dialog.Run(); - dialog.Hide(); - - if (type == ResponseType.Ok) - { - WarFoundryCore.CurrentGameSystem = dialog.SelectedSystem; - } - else - { - logger.Debug("Game system change cancelled"); - } - - dialog.Destroy(); - } - protected virtual void undoTBButtonActivated (object sender, System.EventArgs e) { CommandStack.Undo(); diff -r 1b603f97e7de -r d68992a831df FrmNewArmy.cs --- a/FrmNewArmy.cs Sat Jan 16 11:07:15 2010 +0000 +++ b/FrmNewArmy.cs Sat Jan 16 16:36:12 2010 +0000 @@ -7,6 +7,7 @@ using IBBoard.Lang; using IBBoard.WarFoundry.API; using IBBoard.WarFoundry.API.Objects; +using IBBoard.GtkSharp; using log4net; namespace IBBoard.WarFoundry.GTK @@ -14,7 +15,6 @@ public partial class FrmNewArmy : Dialog, ITranslatable { private ILog logger = LogManager.GetLogger(typeof(FrmNewArmy)); - private GameSystem system; private Race race; private string armyName; private int pointsValue; @@ -23,22 +23,32 @@ { this.Build(); - system = gameSystem; + GameSystem[] gameSystems = WarFoundryLoader.GetDefault().GetGameSystems(); + ComboBoxUtils.FillCombo(systemCombo, gameSystems, delegate(GameSystem sys){return sys.Name;}); + + if (gameSystem != null) + { + ComboBoxUtils.SelectItem(systemCombo, gameSystem); + } + else if (gameSystems.Length == 1) + { + ComboBoxUtils.SelectIndex(systemCombo, 0); + } + lstRaces.Selection.Changed+= new EventHandler(OnSelectionChanged); + TreeViewColumn raceColumn = new TreeViewColumn (); raceColumn.Title = "Race"; CellRendererText raceCell = new CellRendererText (); raceColumn.PackStart (raceCell, true); lstRaces.AppendColumn(raceColumn); raceColumn.SetCellDataFunc(raceCell, new TreeCellDataFunc(RenderRaceName)); - ListStore store = new ListStore(typeof(Race)); + - foreach (Race r in WarFoundryLoader.GetDefault().GetRaces(system)) + if (gameSystem!=null) { - store.AppendValues(r); + SetRaces(gameSystem); } - - lstRaces.Model = store; } public string Text @@ -55,13 +65,13 @@ protected virtual void OnSelectionChanged(object o, EventArgs e) { - logger.Debug("Selection changed"); - setOkayButtonState(); + logger.Debug("Race selection changed"); + SetOkayButtonState(); } - private void setOkayButtonState() + private void SetOkayButtonState() { - bttnCreate.Sensitive = (lstRaces.Selection.CountSelectedRows() > 0 && txtArmyName.Text!="" && sbPointsValue.Value > 0); + bttnCreate.Sensitive = (lstRaces.Selection.CountSelectedRows() == 1 && txtArmyName.Text!="" && sbPointsValue.Value > 0); } protected virtual void OnCreateClicked (object sender, System.EventArgs e) @@ -82,17 +92,40 @@ protected virtual void OnTextChanged (object sender, System.EventArgs e) { - setOkayButtonState(); + SetOkayButtonState(); } protected virtual void OnSpinChangeValue (object o, Gtk.ChangeValueArgs args) { - setOkayButtonState(); + SetOkayButtonState(); } protected virtual void OnSpinValueChanged (object sender, System.EventArgs e) { - setOkayButtonState(); + SetOkayButtonState(); + } + + protected virtual void OnSystemComboChanged (object sender, System.EventArgs e) + { + GameSystem system = ComboBoxUtils.GetSelectedItem(systemCombo); + SetRaces(system); + logger.Debug("System selection changed: " + (system == null ? "null" : system.Name)); + SetOkayButtonState(); + } + + private void SetRaces(GameSystem system) + { + ListStore store = new ListStore(typeof(Race)); + + if (system != null) + { + foreach (Race race in WarFoundryLoader.GetDefault().GetRaces(system)) + { + store.AppendValues(race); + } + } + + lstRaces.Model = store; } public Race SelectedRace diff -r 1b603f97e7de -r d68992a831df IBBoard.WarFoundry.GUI.GTK.csproj --- a/IBBoard.WarFoundry.GUI.GTK.csproj Sat Jan 16 11:07:15 2010 +0000 +++ b/IBBoard.WarFoundry.GUI.GTK.csproj Sat Jan 16 16:36:12 2010 +0000 @@ -41,13 +41,11 @@ --> - - diff -r 1b603f97e7de -r d68992a831df gtk-gui/IBBoard.WarFoundry.GTK.FrmChangeGameSystem.cs --- a/gtk-gui/IBBoard.WarFoundry.GTK.FrmChangeGameSystem.cs Sat Jan 16 11:07:15 2010 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,120 +0,0 @@ -// ------------------------------------------------------------------------------ -// -// This code was generated by a tool. -// -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// -// ------------------------------------------------------------------------------ - -namespace IBBoard.WarFoundry.GTK { - - - public partial class FrmChangeGameSystem { - - private Gtk.HBox hbox1; - - private Gtk.Label lblGameSystem; - - private Gtk.ScrolledWindow GtkScrolledWindow; - - private Gtk.TreeView lstGameSystems; - - private Gtk.Button buttonCancel; - - private Gtk.Button buttonOk; - - protected virtual void Build() { - Stetic.Gui.Initialize(this); - // Widget IBBoard.WarFoundry.GTK.FrmChangeGameSystem - this.Name = "IBBoard.WarFoundry.GTK.FrmChangeGameSystem"; - this.Title = Mono.Unix.Catalog.GetString("Change Game System"); - this.Icon = Gdk.Pixbuf.LoadFromResource("App.ico"); - this.TypeHint = ((Gdk.WindowTypeHint)(1)); - this.WindowPosition = ((Gtk.WindowPosition)(4)); - this.Modal = true; - this.Resizable = false; - this.AllowGrow = false; - this.DefaultWidth = 400; - this.DefaultHeight = 300; - this.SkipPagerHint = true; - this.SkipTaskbarHint = true; - // Internal child IBBoard.WarFoundry.GTK.FrmChangeGameSystem.VBox - Gtk.VBox w1 = this.VBox; - w1.Name = "dialog1_VBox"; - w1.Spacing = 6; - w1.BorderWidth = ((uint)(2)); - // Container child dialog1_VBox.Gtk.Box+BoxChild - this.hbox1 = new Gtk.HBox(); - this.hbox1.Name = "hbox1"; - this.hbox1.Spacing = 6; - // Container child hbox1.Gtk.Box+BoxChild - this.lblGameSystem = new Gtk.Label(); - this.lblGameSystem.Name = "lblGameSystem"; - this.lblGameSystem.LabelProp = Mono.Unix.Catalog.GetString("Game System"); - this.hbox1.Add(this.lblGameSystem); - Gtk.Box.BoxChild w2 = ((Gtk.Box.BoxChild)(this.hbox1[this.lblGameSystem])); - w2.Position = 0; - w2.Expand = false; - w2.Fill = false; - // Container child hbox1.Gtk.Box+BoxChild - this.GtkScrolledWindow = new Gtk.ScrolledWindow(); - this.GtkScrolledWindow.Name = "GtkScrolledWindow"; - this.GtkScrolledWindow.ShadowType = ((Gtk.ShadowType)(1)); - // Container child GtkScrolledWindow.Gtk.Container+ContainerChild - this.lstGameSystems = new Gtk.TreeView(); - this.lstGameSystems.WidthRequest = 250; - this.lstGameSystems.HeightRequest = 125; - this.lstGameSystems.CanFocus = true; - this.lstGameSystems.Name = "lstGameSystems"; - this.lstGameSystems.HeadersVisible = false; - this.GtkScrolledWindow.Add(this.lstGameSystems); - this.hbox1.Add(this.GtkScrolledWindow); - Gtk.Box.BoxChild w4 = ((Gtk.Box.BoxChild)(this.hbox1[this.GtkScrolledWindow])); - w4.Position = 1; - w1.Add(this.hbox1); - Gtk.Box.BoxChild w5 = ((Gtk.Box.BoxChild)(w1[this.hbox1])); - w5.Position = 0; - // Internal child IBBoard.WarFoundry.GTK.FrmChangeGameSystem.ActionArea - Gtk.HButtonBox w6 = this.ActionArea; - w6.Name = "dialog1_ActionArea"; - w6.Spacing = 6; - w6.BorderWidth = ((uint)(5)); - w6.LayoutStyle = ((Gtk.ButtonBoxStyle)(4)); - // Container child dialog1_ActionArea.Gtk.ButtonBox+ButtonBoxChild - this.buttonCancel = new Gtk.Button(); - this.buttonCancel.CanDefault = true; - this.buttonCancel.CanFocus = true; - this.buttonCancel.Name = "buttonCancel"; - this.buttonCancel.UseStock = true; - this.buttonCancel.UseUnderline = true; - this.buttonCancel.Label = "gtk-cancel"; - this.AddActionWidget(this.buttonCancel, -6); - Gtk.ButtonBox.ButtonBoxChild w7 = ((Gtk.ButtonBox.ButtonBoxChild)(w6[this.buttonCancel])); - w7.Expand = false; - w7.Fill = false; - // Container child dialog1_ActionArea.Gtk.ButtonBox+ButtonBoxChild - this.buttonOk = new Gtk.Button(); - this.buttonOk.Sensitive = false; - this.buttonOk.CanDefault = true; - this.buttonOk.CanFocus = true; - this.buttonOk.Name = "buttonOk"; - this.buttonOk.UseStock = true; - this.buttonOk.UseUnderline = true; - this.buttonOk.Label = "gtk-ok"; - this.AddActionWidget(this.buttonOk, -5); - Gtk.ButtonBox.ButtonBoxChild w8 = ((Gtk.ButtonBox.ButtonBoxChild)(w6[this.buttonOk])); - w8.Position = 1; - w8.Expand = false; - w8.Fill = false; - if ((this.Child != null)) { - this.Child.ShowAll(); - } - this.Show(); - this.lstGameSystems.RowActivated += new Gtk.RowActivatedHandler(this.lstGameSystemsRowActivated); - this.buttonCancel.Clicked += new System.EventHandler(this.OnCancel); - this.buttonOk.Clicked += new System.EventHandler(this.OnGameSystemOkayClicked); - } - } -} diff -r 1b603f97e7de -r d68992a831df gtk-gui/IBBoard.WarFoundry.GTK.FrmMainWindow.cs --- a/gtk-gui/IBBoard.WarFoundry.GTK.FrmMainWindow.cs Sat Jan 16 11:07:15 2010 +0000 +++ b/gtk-gui/IBBoard.WarFoundry.GTK.FrmMainWindow.cs Sat Jan 16 16:36:12 2010 +0000 @@ -27,8 +27,6 @@ private Gtk.Action miCloseArmy; - private Gtk.Action miChangeGameSystem; - private Gtk.Action miReloadFiles; private Gtk.Action miExit; @@ -86,7 +84,6 @@ this.menuFile.ShortLabel = Mono.Unix.Catalog.GetString("File"); w1.Add(this.menuFile, null); this.miCreateArmy = new Gtk.Action("miCreateArmy", Mono.Unix.Catalog.GetString("Create army"), null, "gtk-new"); - this.miCreateArmy.Sensitive = false; this.miCreateArmy.ShortLabel = Mono.Unix.Catalog.GetString("Create army"); w1.Add(this.miCreateArmy, null); this.miOpenArmy = new Gtk.Action("miOpenArmy", Mono.Unix.Catalog.GetString("Open army"), null, "gtk-open"); @@ -104,9 +101,6 @@ this.miCloseArmy.Sensitive = false; this.miCloseArmy.ShortLabel = Mono.Unix.Catalog.GetString("Close army"); w1.Add(this.miCloseArmy, null); - this.miChangeGameSystem = new Gtk.Action("miChangeGameSystem", Mono.Unix.Catalog.GetString("Change game system"), null, null); - this.miChangeGameSystem.ShortLabel = Mono.Unix.Catalog.GetString("Change game system"); - w1.Add(this.miChangeGameSystem, null); this.miReloadFiles = new Gtk.Action("miReloadFiles", Mono.Unix.Catalog.GetString("Reload files"), null, "gtk-refresh"); this.miReloadFiles.Sensitive = false; this.miReloadFiles.ShortLabel = Mono.Unix.Catalog.GetString("Reload files"); @@ -135,7 +129,6 @@ this.miDebugInformation.ShortLabel = Mono.Unix.Catalog.GetString("Debug Information"); w1.Add(this.miDebugInformation, null); this.newArmyButton = new Gtk.Action("newArmyButton", null, null, "gtk-new"); - this.newArmyButton.Sensitive = false; w1.Add(this.newArmyButton, null); this.openArmyButton = new Gtk.Action("openArmyButton", null, null, "gtk-open"); w1.Add(this.openArmyButton, null); @@ -168,7 +161,7 @@ this.vbox1 = new Gtk.VBox(); this.vbox1.Name = "vbox1"; // Container child vbox1.Gtk.Box+BoxChild - this.UIManager.AddUiFromString(""); + this.UIManager.AddUiFromString(""); this.menubar1 = ((Gtk.MenuBar)(this.UIManager.GetWidget("/menubar1"))); this.menubar1.Name = "menubar1"; this.vbox1.Add(this.menubar1); @@ -231,7 +224,6 @@ this.miSaveArmy.Activated += new System.EventHandler(this.OnSaveArmyActivated); this.miSaveArmyAs.Activated += new System.EventHandler(this.OnSaveArmyAsActivated); this.miCloseArmy.Activated += new System.EventHandler(this.OnCloseArmyActivated); - this.miChangeGameSystem.Activated += new System.EventHandler(this.OnChangeGameSystemActivated); this.miReloadFiles.Activated += new System.EventHandler(this.OnReloadFilesActivated); this.miExit.Activated += new System.EventHandler(this.OnExitActivated); this.newArmyButton.Activated += new System.EventHandler(this.newTBButtonActivated); diff -r 1b603f97e7de -r d68992a831df gtk-gui/IBBoard.WarFoundry.GTK.FrmNewArmy.cs --- 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); diff -r 1b603f97e7de -r d68992a831df gtk-gui/gui.stetic --- a/gtk-gui/gui.stetic Sat Jan 16 11:07:15 2010 +0000 +++ b/gtk-gui/gui.stetic Sat Jan 16 16:36:12 2010 +0000 @@ -18,7 +18,6 @@ Action Create army - False Create army gtk-new @@ -54,12 +53,6 @@ gtk-close - - Action - Change game system - Change game system - - Action Reload files @@ -113,7 +106,6 @@ Action - False gtk-new @@ -187,8 +179,6 @@ - - @@ -216,6 +206,7 @@ 36 False Icons + LargeToolbar @@ -284,7 +275,7 @@ - + ButtonPressMask Create new army @@ -303,7 +294,7 @@ - 3 + 4 2 6 6 @@ -323,11 +314,14 @@ + 1 + 2 1 2 True + Fill Fill - True + False True False False @@ -365,13 +359,14 @@ - 2 - 3 + 3 + 4 1 2 True + Fill Fill - True + False True False False @@ -385,6 +380,8 @@ Race + 1 + 2 True Fill Fill @@ -402,8 +399,8 @@ Army name - 1 - 2 + 2 + 3 True Fill Fill @@ -421,8 +418,8 @@ Points value - 2 - 3 + 3 + 4 True Fill Fill @@ -435,6 +432,43 @@ + + + game system + + + True + Fill + Fill + False + True + False + False + True + False + + + + + + True + + + + + 1 + 2 + False + Fill + True + True + False + False + True + False + + + True @@ -443,13 +477,14 @@ - 1 - 2 + 2 + 3 1 2 True + Fill Fill - True + False True False False