comparison gtk-gui/IBBoard.WarFoundry.GUI.GTK.FrmAddEquipment.cs @ 61:e7ad676a7344

Re #60: Add UI to add/remove/edit weapons in GTK * Add events to track equipment amount and amount changing * Select most appropriate equipment type by default * Add methods an implementation for enabling/disabling Okay button
author IBBoard <dev@ibboard.co.uk>
date Sun, 29 Aug 2010 15:09:34 +0000
parents eb7db8495bb5
children 77448375d2f9
comparison
equal deleted inserted replaced
60:04c0f6a7625c 61:e7ad676a7344
16 16
17 private global::Gtk.Label lblEquipAll; 17 private global::Gtk.Label lblEquipAll;
18 18
19 private global::Gtk.Label lblPercent; 19 private global::Gtk.Label lblPercent;
20 20
21 private global::Gtk.SpinButton numericAmount;
22
23 private global::Gtk.SpinButton percentageAmount;
24
21 private global::Gtk.RadioButton rbEquipAll; 25 private global::Gtk.RadioButton rbEquipAll;
22 26
23 private global::Gtk.RadioButton rbEquipNumeric; 27 private global::Gtk.RadioButton rbEquipNumeric;
24 28
25 private global::Gtk.RadioButton rbEquipPercent; 29 private global::Gtk.RadioButton rbEquipPercent;
26
27 private global::Gtk.SpinButton numericAmount;
28
29 private global::Gtk.SpinButton percentageAmount;
30 30
31 private global::Gtk.Label lblEquipAmount; 31 private global::Gtk.Label lblEquipAmount;
32 32
33 private global::Gtk.Label lblEquipment; 33 private global::Gtk.Label lblEquipment;
34 34
97 w5.LeftAttach = ((uint)(2)); 97 w5.LeftAttach = ((uint)(2));
98 w5.RightAttach = ((uint)(3)); 98 w5.RightAttach = ((uint)(3));
99 w5.XOptions = ((global::Gtk.AttachOptions)(4)); 99 w5.XOptions = ((global::Gtk.AttachOptions)(4));
100 w5.YOptions = ((global::Gtk.AttachOptions)(4)); 100 w5.YOptions = ((global::Gtk.AttachOptions)(4));
101 // Container child table2.Gtk.Table+TableChild 101 // Container child table2.Gtk.Table+TableChild
102 this.rbEquipAll = new global::Gtk.RadioButton("");
103 this.rbEquipAll.CanFocus = true;
104 this.rbEquipAll.Name = "rbEquipAll";
105 this.rbEquipAll.DrawIndicator = true;
106 this.rbEquipAll.UseUnderline = true;
107 this.rbEquipAll.Group = new global::GLib.SList(global::System.IntPtr.Zero);
108 this.table2.Add(this.rbEquipAll);
109 global::Gtk.Table.TableChild w6 = ((global::Gtk.Table.TableChild)(this.table2[this.rbEquipAll]));
110 w6.TopAttach = ((uint)(2));
111 w6.BottomAttach = ((uint)(3));
112 w6.XOptions = ((global::Gtk.AttachOptions)(4));
113 w6.YOptions = ((global::Gtk.AttachOptions)(4));
114 // Container child table2.Gtk.Table+TableChild
115 this.rbEquipNumeric = new global::Gtk.RadioButton("");
116 this.rbEquipNumeric.CanFocus = true;
117 this.rbEquipNumeric.Name = "rbEquipNumeric";
118 this.rbEquipNumeric.DrawIndicator = true;
119 this.rbEquipNumeric.UseUnderline = true;
120 this.rbEquipNumeric.Group = this.rbEquipAll.Group;
121 this.table2.Add(this.rbEquipNumeric);
122 global::Gtk.Table.TableChild w7 = ((global::Gtk.Table.TableChild)(this.table2[this.rbEquipNumeric]));
123 w7.XOptions = ((global::Gtk.AttachOptions)(4));
124 w7.YOptions = ((global::Gtk.AttachOptions)(4));
125 // Container child table2.Gtk.Table+TableChild
126 this.rbEquipPercent = new global::Gtk.RadioButton("");
127 this.rbEquipPercent.CanFocus = true;
128 this.rbEquipPercent.Name = "rbEquipPercent";
129 this.rbEquipPercent.DrawIndicator = true;
130 this.rbEquipPercent.UseUnderline = true;
131 this.rbEquipPercent.Group = this.rbEquipAll.Group;
132 this.table2.Add(this.rbEquipPercent);
133 global::Gtk.Table.TableChild w8 = ((global::Gtk.Table.TableChild)(this.table2[this.rbEquipPercent]));
134 w8.TopAttach = ((uint)(1));
135 w8.BottomAttach = ((uint)(2));
136 w8.XOptions = ((global::Gtk.AttachOptions)(4));
137 w8.YOptions = ((global::Gtk.AttachOptions)(4));
138 // Container child table2.Gtk.Table+TableChild
139 this.numericAmount = new global::Gtk.SpinButton(0, 100, 1); 102 this.numericAmount = new global::Gtk.SpinButton(0, 100, 1);
140 this.numericAmount.CanFocus = true; 103 this.numericAmount.CanFocus = true;
141 this.numericAmount.Name = "numericAmount"; 104 this.numericAmount.Name = "numericAmount";
142 this.numericAmount.Adjustment.PageIncrement = 10; 105 this.numericAmount.Adjustment.PageIncrement = 10;
143 this.numericAmount.ClimbRate = 1; 106 this.numericAmount.ClimbRate = 1;
144 this.numericAmount.Numeric = true; 107 this.numericAmount.Numeric = true;
145 this.table2.Add(this.numericAmount); 108 this.table2.Add(this.numericAmount);
146 global::Gtk.Table.TableChild w9 = ((global::Gtk.Table.TableChild)(this.table2[this.numericAmount])); 109 global::Gtk.Table.TableChild w6 = ((global::Gtk.Table.TableChild)(this.table2[this.numericAmount]));
147 w9.LeftAttach = ((uint)(1)); 110 w6.LeftAttach = ((uint)(1));
148 w9.RightAttach = ((uint)(2)); 111 w6.RightAttach = ((uint)(2));
149 w9.XOptions = ((global::Gtk.AttachOptions)(0)); 112 w6.XOptions = ((global::Gtk.AttachOptions)(0));
150 w9.YOptions = ((global::Gtk.AttachOptions)(4)); 113 w6.YOptions = ((global::Gtk.AttachOptions)(4));
151 // Container child table2.Gtk.Table+TableChild 114 // Container child table2.Gtk.Table+TableChild
152 this.percentageAmount = new global::Gtk.SpinButton(0, 100, 1); 115 this.percentageAmount = new global::Gtk.SpinButton(0, 100, 1);
153 this.percentageAmount.CanFocus = true; 116 this.percentageAmount.CanFocus = true;
154 this.percentageAmount.Name = "percentageAmount"; 117 this.percentageAmount.Name = "percentageAmount";
155 this.percentageAmount.Adjustment.PageIncrement = 10; 118 this.percentageAmount.Adjustment.PageIncrement = 10;
156 this.percentageAmount.ClimbRate = 1; 119 this.percentageAmount.ClimbRate = 1;
157 this.percentageAmount.Digits = ((uint)(1)); 120 this.percentageAmount.Digits = ((uint)(1));
158 this.percentageAmount.Numeric = true; 121 this.percentageAmount.Numeric = true;
159 this.table2.Add(this.percentageAmount); 122 this.table2.Add(this.percentageAmount);
160 global::Gtk.Table.TableChild w10 = ((global::Gtk.Table.TableChild)(this.table2[this.percentageAmount])); 123 global::Gtk.Table.TableChild w7 = ((global::Gtk.Table.TableChild)(this.table2[this.percentageAmount]));
124 w7.TopAttach = ((uint)(1));
125 w7.BottomAttach = ((uint)(2));
126 w7.LeftAttach = ((uint)(1));
127 w7.RightAttach = ((uint)(2));
128 w7.XOptions = ((global::Gtk.AttachOptions)(0));
129 w7.YOptions = ((global::Gtk.AttachOptions)(4));
130 // Container child table2.Gtk.Table+TableChild
131 this.rbEquipAll = new global::Gtk.RadioButton("");
132 this.rbEquipAll.CanFocus = true;
133 this.rbEquipAll.Name = "rbEquipAll";
134 this.rbEquipAll.DrawIndicator = true;
135 this.rbEquipAll.UseUnderline = true;
136 this.rbEquipAll.Group = new global::GLib.SList(global::System.IntPtr.Zero);
137 this.table2.Add(this.rbEquipAll);
138 global::Gtk.Table.TableChild w8 = ((global::Gtk.Table.TableChild)(this.table2[this.rbEquipAll]));
139 w8.TopAttach = ((uint)(2));
140 w8.BottomAttach = ((uint)(3));
141 w8.XOptions = ((global::Gtk.AttachOptions)(4));
142 w8.YOptions = ((global::Gtk.AttachOptions)(4));
143 // Container child table2.Gtk.Table+TableChild
144 this.rbEquipNumeric = new global::Gtk.RadioButton("");
145 this.rbEquipNumeric.CanFocus = true;
146 this.rbEquipNumeric.Name = "rbEquipNumeric";
147 this.rbEquipNumeric.DrawIndicator = true;
148 this.rbEquipNumeric.UseUnderline = true;
149 this.rbEquipNumeric.Group = this.rbEquipAll.Group;
150 this.table2.Add(this.rbEquipNumeric);
151 global::Gtk.Table.TableChild w9 = ((global::Gtk.Table.TableChild)(this.table2[this.rbEquipNumeric]));
152 w9.XOptions = ((global::Gtk.AttachOptions)(4));
153 w9.YOptions = ((global::Gtk.AttachOptions)(4));
154 // Container child table2.Gtk.Table+TableChild
155 this.rbEquipPercent = new global::Gtk.RadioButton("");
156 this.rbEquipPercent.CanFocus = true;
157 this.rbEquipPercent.Name = "rbEquipPercent";
158 this.rbEquipPercent.DrawIndicator = true;
159 this.rbEquipPercent.UseUnderline = true;
160 this.rbEquipPercent.Group = this.rbEquipAll.Group;
161 this.table2.Add(this.rbEquipPercent);
162 global::Gtk.Table.TableChild w10 = ((global::Gtk.Table.TableChild)(this.table2[this.rbEquipPercent]));
161 w10.TopAttach = ((uint)(1)); 163 w10.TopAttach = ((uint)(1));
162 w10.BottomAttach = ((uint)(2)); 164 w10.BottomAttach = ((uint)(2));
163 w10.LeftAttach = ((uint)(1)); 165 w10.XOptions = ((global::Gtk.AttachOptions)(4));
164 w10.RightAttach = ((uint)(2));
165 w10.XOptions = ((global::Gtk.AttachOptions)(0));
166 w10.YOptions = ((global::Gtk.AttachOptions)(4)); 166 w10.YOptions = ((global::Gtk.AttachOptions)(4));
167 this.hbox2.Add(this.table2); 167 this.hbox2.Add(this.table2);
168 global::Gtk.Box.BoxChild w11 = ((global::Gtk.Box.BoxChild)(this.hbox2[this.table2])); 168 global::Gtk.Box.BoxChild w11 = ((global::Gtk.Box.BoxChild)(this.hbox2[this.table2]));
169 w11.Position = 0; 169 w11.Position = 0;
170 w11.Expand = false; 170 w11.Expand = false;
211 this.buttonCancel.CanFocus = true; 211 this.buttonCancel.CanFocus = true;
212 this.buttonCancel.Name = "buttonCancel"; 212 this.buttonCancel.Name = "buttonCancel";
213 this.buttonCancel.UseStock = true; 213 this.buttonCancel.UseStock = true;
214 this.buttonCancel.UseUnderline = true; 214 this.buttonCancel.UseUnderline = true;
215 this.buttonCancel.Label = "gtk-cancel"; 215 this.buttonCancel.Label = "gtk-cancel";
216 this.buttonCancel.Clicked+= CancelButtonClicked;
217 this.AddActionWidget(this.buttonCancel, -6); 216 this.AddActionWidget(this.buttonCancel, -6);
218 global::Gtk.ButtonBox.ButtonBoxChild w17 = ((global::Gtk.ButtonBox.ButtonBoxChild)(w16[this.buttonCancel])); 217 global::Gtk.ButtonBox.ButtonBoxChild w17 = ((global::Gtk.ButtonBox.ButtonBoxChild)(w16[this.buttonCancel]));
219 w17.Expand = false; 218 w17.Expand = false;
220 w17.Fill = false; 219 w17.Fill = false;
221 // Container child dialog1_ActionArea.Gtk.ButtonBox+ButtonBoxChild 220 // Container child dialog1_ActionArea.Gtk.ButtonBox+ButtonBoxChild
236 this.Child.ShowAll(); 235 this.Child.ShowAll();
237 } 236 }
238 this.DefaultWidth = 400; 237 this.DefaultWidth = 400;
239 this.DefaultHeight = 300; 238 this.DefaultHeight = 300;
240 this.Show(); 239 this.Show();
240 this.rbEquipNumeric.Clicked += new global::System.EventHandler(this.RadioButtonClicked);
241 this.percentageAmount.ValueChanged += new global::System.EventHandler(this.SpinButtonValueChanged);
242 this.numericAmount.ValueChanged += new global::System.EventHandler(this.SpinButtonValueChanged);
243 this.buttonCancel.Clicked += new global::System.EventHandler(this.CancelButtonClicked);
244 this.buttonOk.Clicked += new global::System.EventHandler(this.OkayButtonClicked);
241 } 245 }
242 } 246 }
243 } 247 }