Mercurial > repos > IBBoard.WarFoundry.GUI.GTK
diff Widgets/UnitDisplayWidget.cs @ 51:dafbd432ca23
Re #60: Add UI to add/remove/edit weapons in GTK
* Start to implement Add functionality using a new abstraction concept that keeps the UI dumb and keeps the logic in a cross-toolkit controller
author | IBBoard <dev@ibboard.co.uk> |
---|---|
date | Sat, 21 Aug 2010 20:00:03 +0000 |
parents | d29ad8445461 |
children | 4bad8cb3f889 |
line wrap: on
line diff
--- a/Widgets/UnitDisplayWidget.cs Sun Aug 15 16:02:49 2010 +0000 +++ b/Widgets/UnitDisplayWidget.cs Sat Aug 21 20:00:03 2010 +0000 @@ -9,6 +9,7 @@ using IBBoard.WarFoundry.API; using IBBoard.WarFoundry.API.Objects; using IBBoard.WarFoundry.API.Commands; +using IBBoard.WarFoundry.GUI.GTK.UIControl; namespace IBBoard.WarFoundry.GTK.Widgets { @@ -107,7 +108,7 @@ [GLib.ConnectBefore ()] protected virtual void OnUnitSizeKeyPress (object o, Gtk.KeyPressEventArgs args) { - if (args.Event.Key == Gdk.Key.Return) + if (args.Event.Key == Gdk.Key.Return || args.Event.Key == Gdk.Key.KP_Enter) { SetNewUnitSize(); } @@ -138,11 +139,23 @@ private void SetNewUnitName() { - if (unitName.Text!=unit.Name) + if (unitName.Text != unit.Name) { SetNameCommand cmd = new SetNameCommand(unit, unitName.Text); stack.Execute(cmd); } } + + private void OnBttnAddEquipmentActivated(object sender, System.EventArgs e) + { + Console.WriteLine("Add button clicked"); + AddEquipment(); + } + + private void AddEquipment() + { + AddEquipmentUIControl addEquipment = new AddEquipmentUIControl(unit, stack); + addEquipment.Show(); + } } }