comparison gtk-gui/IBBoard.WarFoundry.GUI.GTK.Widgets.UnitDisplayWidget.cs @ 96:b4416ca69153

Fixes #309: Add initial preference dialog with language support * Hook up events so that everything translates itself when languages change Re #308: Make GTK# UI translatable * Update English and French translations (using Google Translate) * Begin to standardise on WinForms names for widgets for maximum reusability of translation files * Make some preference and credit buttons translatable
author IBBoard <dev@ibboard.co.uk>
date Sun, 02 Jan 2011 15:12:31 +0000
parents e40d892a2298
children 560eb34acd17
comparison
equal deleted inserted replaced
95:ea4069bbe6e9 96:b4416ca69153
11 private global::Gtk.ScrolledWindow statsScrollPanel; 11 private global::Gtk.ScrolledWindow statsScrollPanel;
12 private global::Gtk.VBox statsRepeatBox; 12 private global::Gtk.VBox statsRepeatBox;
13 private global::Gtk.HSeparator hseparator1; 13 private global::Gtk.HSeparator hseparator1;
14 private global::Gtk.HBox hbox2; 14 private global::Gtk.HBox hbox2;
15 private global::Gtk.Table table1; 15 private global::Gtk.Table table1;
16 private global::IBBoard.GtkSharp.Translatable.TranslatableLabel equipmentLabel;
17 private global::Gtk.ScrolledWindow GtkScrolledWindow2; 16 private global::Gtk.ScrolledWindow GtkScrolledWindow2;
18 private global::Gtk.NodeView equipmentList; 17 private global::Gtk.NodeView equipmentList;
19 private global::Gtk.ScrolledWindow GtkScrolledWindow3; 18 private global::Gtk.ScrolledWindow GtkScrolledWindow3;
20 private global::Gtk.TextView notesView; 19 private global::Gtk.TextView notesView;
21 private global::Gtk.ScrolledWindow GtkScrolledWindow4; 20 private global::Gtk.ScrolledWindow GtkScrolledWindow4;
22 private global::Gtk.NodeView abilitiesList; 21 private global::Gtk.NodeView abilitiesList;
23 private global::IBBoard.GtkSharp.Translatable.TranslatableLabel lblAbilities; 22 private global::IBBoard.GtkSharp.Translatable.TranslatableLabel lblAbilities;
23 private global::IBBoard.GtkSharp.Translatable.TranslatableLabel lblEquip;
24 private global::IBBoard.GtkSharp.Translatable.TranslatableLabel lblNotes; 24 private global::IBBoard.GtkSharp.Translatable.TranslatableLabel lblNotes;
25 private global::Gtk.VBox vbox3; 25 private global::Gtk.VBox vbox3;
26 private global::IBBoard.GtkSharp.Translatable.TranslatableButton bttnAddEquipment; 26 private global::IBBoard.GtkSharp.Translatable.TranslatableButton bttnAddWeapon;
27 private global::IBBoard.GtkSharp.Translatable.TranslatableButton bttnEditEquipment; 27 private global::IBBoard.GtkSharp.Translatable.TranslatableButton bttnEditWeapon;
28 private global::IBBoard.GtkSharp.Translatable.TranslatableButton bttnReplaceEquipment; 28 private global::IBBoard.GtkSharp.Translatable.TranslatableButton bttnReplaceWeapon;
29 private global::IBBoard.GtkSharp.Translatable.TranslatableButton bttnRemoveEquipment; 29 private global::IBBoard.GtkSharp.Translatable.TranslatableButton bttnRemoveWeapon;
30 30
31 protected virtual void Build() 31 protected virtual void Build()
32 { 32 {
33 global::Stetic.Gui.Initialize(this); 33 global::Stetic.Gui.Initialize(this);
34 // Widget IBBoard.WarFoundry.GUI.GTK.Widgets.UnitDisplayWidget 34 // Widget IBBoard.WarFoundry.GUI.GTK.Widgets.UnitDisplayWidget
101 this.table1 = new global::Gtk.Table(((uint)(3)), ((uint)(2)), false); 101 this.table1 = new global::Gtk.Table(((uint)(3)), ((uint)(2)), false);
102 this.table1.Name = "table1"; 102 this.table1.Name = "table1";
103 this.table1.RowSpacing = ((uint)(6)); 103 this.table1.RowSpacing = ((uint)(6));
104 this.table1.ColumnSpacing = ((uint)(6)); 104 this.table1.ColumnSpacing = ((uint)(6));
105 // Container child table1.Gtk.Table+TableChild 105 // Container child table1.Gtk.Table+TableChild
106 this.equipmentLabel = new global::IBBoard.GtkSharp.Translatable.TranslatableLabel();
107 this.equipmentLabel.Name = "equipmentLabel";
108 this.equipmentLabel.LabelProp = global::Mono.Unix.Catalog.GetString("equipment:");
109 this.table1.Add(this.equipmentLabel);
110 global::Gtk.Table.TableChild w9 = ((global::Gtk.Table.TableChild)(this.table1[this.equipmentLabel]));
111 w9.XOptions = ((global::Gtk.AttachOptions)(4));
112 w9.YOptions = ((global::Gtk.AttachOptions)(4));
113 // Container child table1.Gtk.Table+TableChild
114 this.GtkScrolledWindow2 = new global::Gtk.ScrolledWindow(); 106 this.GtkScrolledWindow2 = new global::Gtk.ScrolledWindow();
115 this.GtkScrolledWindow2.Name = "GtkScrolledWindow2"; 107 this.GtkScrolledWindow2.Name = "GtkScrolledWindow2";
116 this.GtkScrolledWindow2.ShadowType = ((global::Gtk.ShadowType)(1)); 108 this.GtkScrolledWindow2.ShadowType = ((global::Gtk.ShadowType)(1));
117 // Container child GtkScrolledWindow2.Gtk.Container+ContainerChild 109 // Container child GtkScrolledWindow2.Gtk.Container+ContainerChild
118 this.equipmentList = new global::Gtk.NodeView(); 110 this.equipmentList = new global::Gtk.NodeView();
119 this.equipmentList.CanFocus = true; 111 this.equipmentList.CanFocus = true;
120 this.equipmentList.Name = "equipmentList"; 112 this.equipmentList.Name = "equipmentList";
121 this.equipmentList.HeadersVisible = false; 113 this.equipmentList.HeadersVisible = false;
122 this.GtkScrolledWindow2.Add(this.equipmentList); 114 this.GtkScrolledWindow2.Add(this.equipmentList);
123 this.table1.Add(this.GtkScrolledWindow2); 115 this.table1.Add(this.GtkScrolledWindow2);
124 global::Gtk.Table.TableChild w11 = ((global::Gtk.Table.TableChild)(this.table1[this.GtkScrolledWindow2])); 116 global::Gtk.Table.TableChild w10 = ((global::Gtk.Table.TableChild)(this.table1[this.GtkScrolledWindow2]));
125 w11.LeftAttach = ((uint)(1)); 117 w10.LeftAttach = ((uint)(1));
126 w11.RightAttach = ((uint)(2)); 118 w10.RightAttach = ((uint)(2));
127 w11.YOptions = ((global::Gtk.AttachOptions)(4)); 119 w10.YOptions = ((global::Gtk.AttachOptions)(4));
128 // Container child table1.Gtk.Table+TableChild 120 // Container child table1.Gtk.Table+TableChild
129 this.GtkScrolledWindow3 = new global::Gtk.ScrolledWindow(); 121 this.GtkScrolledWindow3 = new global::Gtk.ScrolledWindow();
130 this.GtkScrolledWindow3.Name = "GtkScrolledWindow3"; 122 this.GtkScrolledWindow3.Name = "GtkScrolledWindow3";
131 this.GtkScrolledWindow3.ShadowType = ((global::Gtk.ShadowType)(1)); 123 this.GtkScrolledWindow3.ShadowType = ((global::Gtk.ShadowType)(1));
132 // Container child GtkScrolledWindow3.Gtk.Container+ContainerChild 124 // Container child GtkScrolledWindow3.Gtk.Container+ContainerChild
134 this.notesView.CanFocus = true; 126 this.notesView.CanFocus = true;
135 this.notesView.Name = "notesView"; 127 this.notesView.Name = "notesView";
136 this.notesView.Editable = false; 128 this.notesView.Editable = false;
137 this.GtkScrolledWindow3.Add(this.notesView); 129 this.GtkScrolledWindow3.Add(this.notesView);
138 this.table1.Add(this.GtkScrolledWindow3); 130 this.table1.Add(this.GtkScrolledWindow3);
139 global::Gtk.Table.TableChild w13 = ((global::Gtk.Table.TableChild)(this.table1[this.GtkScrolledWindow3])); 131 global::Gtk.Table.TableChild w12 = ((global::Gtk.Table.TableChild)(this.table1[this.GtkScrolledWindow3]));
140 w13.TopAttach = ((uint)(2)); 132 w12.TopAttach = ((uint)(2));
141 w13.BottomAttach = ((uint)(3)); 133 w12.BottomAttach = ((uint)(3));
142 w13.LeftAttach = ((uint)(1)); 134 w12.LeftAttach = ((uint)(1));
143 w13.RightAttach = ((uint)(2)); 135 w12.RightAttach = ((uint)(2));
144 w13.YOptions = ((global::Gtk.AttachOptions)(4)); 136 w12.YOptions = ((global::Gtk.AttachOptions)(4));
145 // Container child table1.Gtk.Table+TableChild 137 // Container child table1.Gtk.Table+TableChild
146 this.GtkScrolledWindow4 = new global::Gtk.ScrolledWindow(); 138 this.GtkScrolledWindow4 = new global::Gtk.ScrolledWindow();
147 this.GtkScrolledWindow4.Name = "GtkScrolledWindow4"; 139 this.GtkScrolledWindow4.Name = "GtkScrolledWindow4";
148 this.GtkScrolledWindow4.ShadowType = ((global::Gtk.ShadowType)(1)); 140 this.GtkScrolledWindow4.ShadowType = ((global::Gtk.ShadowType)(1));
149 // Container child GtkScrolledWindow4.Gtk.Container+ContainerChild 141 // Container child GtkScrolledWindow4.Gtk.Container+ContainerChild
151 this.abilitiesList.CanFocus = true; 143 this.abilitiesList.CanFocus = true;
152 this.abilitiesList.Name = "abilitiesList"; 144 this.abilitiesList.Name = "abilitiesList";
153 this.abilitiesList.HeadersVisible = false; 145 this.abilitiesList.HeadersVisible = false;
154 this.GtkScrolledWindow4.Add(this.abilitiesList); 146 this.GtkScrolledWindow4.Add(this.abilitiesList);
155 this.table1.Add(this.GtkScrolledWindow4); 147 this.table1.Add(this.GtkScrolledWindow4);
156 global::Gtk.Table.TableChild w15 = ((global::Gtk.Table.TableChild)(this.table1[this.GtkScrolledWindow4])); 148 global::Gtk.Table.TableChild w14 = ((global::Gtk.Table.TableChild)(this.table1[this.GtkScrolledWindow4]));
157 w15.TopAttach = ((uint)(1)); 149 w14.TopAttach = ((uint)(1));
158 w15.BottomAttach = ((uint)(2)); 150 w14.BottomAttach = ((uint)(2));
159 w15.LeftAttach = ((uint)(1)); 151 w14.LeftAttach = ((uint)(1));
160 w15.RightAttach = ((uint)(2)); 152 w14.RightAttach = ((uint)(2));
161 w15.YOptions = ((global::Gtk.AttachOptions)(4)); 153 w14.YOptions = ((global::Gtk.AttachOptions)(4));
162 // Container child table1.Gtk.Table+TableChild 154 // Container child table1.Gtk.Table+TableChild
163 this.lblAbilities = new global::IBBoard.GtkSharp.Translatable.TranslatableLabel(); 155 this.lblAbilities = new global::IBBoard.GtkSharp.Translatable.TranslatableLabel();
164 this.lblAbilities.Name = "lblAbilities"; 156 this.lblAbilities.Name = "lblAbilities";
165 this.lblAbilities.LabelProp = global::Mono.Unix.Catalog.GetString("abilities:"); 157 this.lblAbilities.LabelProp = global::Mono.Unix.Catalog.GetString("abilities:");
166 this.table1.Add(this.lblAbilities); 158 this.table1.Add(this.lblAbilities);
167 global::Gtk.Table.TableChild w16 = ((global::Gtk.Table.TableChild)(this.table1[this.lblAbilities])); 159 global::Gtk.Table.TableChild w15 = ((global::Gtk.Table.TableChild)(this.table1[this.lblAbilities]));
168 w16.TopAttach = ((uint)(1)); 160 w15.TopAttach = ((uint)(1));
169 w16.BottomAttach = ((uint)(2)); 161 w15.BottomAttach = ((uint)(2));
162 w15.XOptions = ((global::Gtk.AttachOptions)(4));
163 w15.YOptions = ((global::Gtk.AttachOptions)(4));
164 // Container child table1.Gtk.Table+TableChild
165 this.lblEquip = new global::IBBoard.GtkSharp.Translatable.TranslatableLabel();
166 this.lblEquip.Name = "lblEquip";
167 this.lblEquip.LabelProp = global::Mono.Unix.Catalog.GetString("equipment:");
168 this.table1.Add(this.lblEquip);
169 global::Gtk.Table.TableChild w16 = ((global::Gtk.Table.TableChild)(this.table1[this.lblEquip]));
170 w16.XOptions = ((global::Gtk.AttachOptions)(4)); 170 w16.XOptions = ((global::Gtk.AttachOptions)(4));
171 w16.YOptions = ((global::Gtk.AttachOptions)(4)); 171 w16.YOptions = ((global::Gtk.AttachOptions)(4));
172 // Container child table1.Gtk.Table+TableChild 172 // Container child table1.Gtk.Table+TableChild
173 this.lblNotes = new global::IBBoard.GtkSharp.Translatable.TranslatableLabel(); 173 this.lblNotes = new global::IBBoard.GtkSharp.Translatable.TranslatableLabel();
174 this.lblNotes.Name = "lblNotes"; 174 this.lblNotes.Name = "lblNotes";
185 // Container child hbox2.Gtk.Box+BoxChild 185 // Container child hbox2.Gtk.Box+BoxChild
186 this.vbox3 = new global::Gtk.VBox(); 186 this.vbox3 = new global::Gtk.VBox();
187 this.vbox3.Name = "vbox3"; 187 this.vbox3.Name = "vbox3";
188 this.vbox3.Spacing = 6; 188 this.vbox3.Spacing = 6;
189 // Container child vbox3.Gtk.Box+BoxChild 189 // Container child vbox3.Gtk.Box+BoxChild
190 this.bttnAddEquipment = new global::IBBoard.GtkSharp.Translatable.TranslatableButton(); 190 this.bttnAddWeapon = new global::IBBoard.GtkSharp.Translatable.TranslatableButton();
191 this.bttnAddEquipment.CanFocus = true; 191 this.bttnAddWeapon.CanFocus = true;
192 this.bttnAddEquipment.Name = "bttnAddEquipment"; 192 this.bttnAddWeapon.Name = "bttnAddWeapon";
193 this.bttnAddEquipment.UseUnderline = true; 193 this.bttnAddWeapon.UseUnderline = true;
194 this.bttnAddEquipment.Label = global::Mono.Unix.Catalog.GetString("add"); 194 this.bttnAddWeapon.Label = global::Mono.Unix.Catalog.GetString("add");
195 this.vbox3.Add(this.bttnAddEquipment); 195 this.vbox3.Add(this.bttnAddWeapon);
196 global::Gtk.Box.BoxChild w19 = ((global::Gtk.Box.BoxChild)(this.vbox3[this.bttnAddEquipment])); 196 global::Gtk.Box.BoxChild w19 = ((global::Gtk.Box.BoxChild)(this.vbox3[this.bttnAddWeapon]));
197 w19.Position = 0; 197 w19.Position = 0;
198 w19.Expand = false; 198 w19.Expand = false;
199 w19.Fill = false; 199 w19.Fill = false;
200 // Container child vbox3.Gtk.Box+BoxChild 200 // Container child vbox3.Gtk.Box+BoxChild
201 this.bttnEditEquipment = new global::IBBoard.GtkSharp.Translatable.TranslatableButton(); 201 this.bttnEditWeapon = new global::IBBoard.GtkSharp.Translatable.TranslatableButton();
202 this.bttnEditEquipment.Sensitive = false; 202 this.bttnEditWeapon.Sensitive = false;
203 this.bttnEditEquipment.CanFocus = true; 203 this.bttnEditWeapon.CanFocus = true;
204 this.bttnEditEquipment.Name = "bttnEditEquipment"; 204 this.bttnEditWeapon.Name = "bttnEditWeapon";
205 this.bttnEditEquipment.UseUnderline = true; 205 this.bttnEditWeapon.UseUnderline = true;
206 this.bttnEditEquipment.Label = global::Mono.Unix.Catalog.GetString("edit"); 206 this.bttnEditWeapon.Label = global::Mono.Unix.Catalog.GetString("edit");
207 this.vbox3.Add(this.bttnEditEquipment); 207 this.vbox3.Add(this.bttnEditWeapon);
208 global::Gtk.Box.BoxChild w20 = ((global::Gtk.Box.BoxChild)(this.vbox3[this.bttnEditEquipment])); 208 global::Gtk.Box.BoxChild w20 = ((global::Gtk.Box.BoxChild)(this.vbox3[this.bttnEditWeapon]));
209 w20.Position = 1; 209 w20.Position = 1;
210 w20.Expand = false; 210 w20.Expand = false;
211 w20.Fill = false; 211 w20.Fill = false;
212 // Container child vbox3.Gtk.Box+BoxChild 212 // Container child vbox3.Gtk.Box+BoxChild
213 this.bttnReplaceEquipment = new global::IBBoard.GtkSharp.Translatable.TranslatableButton(); 213 this.bttnReplaceWeapon = new global::IBBoard.GtkSharp.Translatable.TranslatableButton();
214 this.bttnReplaceEquipment.Sensitive = false; 214 this.bttnReplaceWeapon.Sensitive = false;
215 this.bttnReplaceEquipment.CanFocus = true; 215 this.bttnReplaceWeapon.CanFocus = true;
216 this.bttnReplaceEquipment.Name = "bttnReplaceEquipment"; 216 this.bttnReplaceWeapon.Name = "bttnReplaceWeapon";
217 this.bttnReplaceEquipment.UseUnderline = true; 217 this.bttnReplaceWeapon.UseUnderline = true;
218 this.bttnReplaceEquipment.Label = global::Mono.Unix.Catalog.GetString("replace"); 218 this.bttnReplaceWeapon.Label = global::Mono.Unix.Catalog.GetString("replace");
219 this.vbox3.Add(this.bttnReplaceEquipment); 219 this.vbox3.Add(this.bttnReplaceWeapon);
220 global::Gtk.Box.BoxChild w21 = ((global::Gtk.Box.BoxChild)(this.vbox3[this.bttnReplaceEquipment])); 220 global::Gtk.Box.BoxChild w21 = ((global::Gtk.Box.BoxChild)(this.vbox3[this.bttnReplaceWeapon]));
221 w21.Position = 2; 221 w21.Position = 2;
222 w21.Expand = false; 222 w21.Expand = false;
223 w21.Fill = false; 223 w21.Fill = false;
224 // Container child vbox3.Gtk.Box+BoxChild 224 // Container child vbox3.Gtk.Box+BoxChild
225 this.bttnRemoveEquipment = new global::IBBoard.GtkSharp.Translatable.TranslatableButton(); 225 this.bttnRemoveWeapon = new global::IBBoard.GtkSharp.Translatable.TranslatableButton();
226 this.bttnRemoveEquipment.Sensitive = false; 226 this.bttnRemoveWeapon.Sensitive = false;
227 this.bttnRemoveEquipment.CanFocus = true; 227 this.bttnRemoveWeapon.CanFocus = true;
228 this.bttnRemoveEquipment.Name = "bttnRemoveEquipment"; 228 this.bttnRemoveWeapon.Name = "bttnRemoveWeapon";
229 this.bttnRemoveEquipment.UseUnderline = true; 229 this.bttnRemoveWeapon.UseUnderline = true;
230 this.bttnRemoveEquipment.Label = global::Mono.Unix.Catalog.GetString("remove"); 230 this.bttnRemoveWeapon.Label = global::Mono.Unix.Catalog.GetString("remove");
231 this.vbox3.Add(this.bttnRemoveEquipment); 231 this.vbox3.Add(this.bttnRemoveWeapon);
232 global::Gtk.Box.BoxChild w22 = ((global::Gtk.Box.BoxChild)(this.vbox3[this.bttnRemoveEquipment])); 232 global::Gtk.Box.BoxChild w22 = ((global::Gtk.Box.BoxChild)(this.vbox3[this.bttnRemoveWeapon]));
233 w22.Position = 3; 233 w22.Position = 3;
234 w22.Expand = false; 234 w22.Expand = false;
235 w22.Fill = false; 235 w22.Fill = false;
236 this.hbox2.Add(this.vbox3); 236 this.hbox2.Add(this.vbox3);
237 global::Gtk.Box.BoxChild w23 = ((global::Gtk.Box.BoxChild)(this.hbox2[this.vbox3])); 237 global::Gtk.Box.BoxChild w23 = ((global::Gtk.Box.BoxChild)(this.hbox2[this.vbox3]));
251 this.Show(); 251 this.Show();
252 this.unitName.FocusOutEvent += new global::Gtk.FocusOutEventHandler(this.OnUnitNameFocusOut); 252 this.unitName.FocusOutEvent += new global::Gtk.FocusOutEventHandler(this.OnUnitNameFocusOut);
253 this.unitName.KeyPressEvent += new global::Gtk.KeyPressEventHandler(this.OnUnitNameKeyPress); 253 this.unitName.KeyPressEvent += new global::Gtk.KeyPressEventHandler(this.OnUnitNameKeyPress);
254 this.unitSize.FocusOutEvent += new global::Gtk.FocusOutEventHandler(this.OnUnitSizeFocusOut); 254 this.unitSize.FocusOutEvent += new global::Gtk.FocusOutEventHandler(this.OnUnitSizeFocusOut);
255 this.unitSize.KeyPressEvent += new global::Gtk.KeyPressEventHandler(this.OnUnitSizeKeyPress); 255 this.unitSize.KeyPressEvent += new global::Gtk.KeyPressEventHandler(this.OnUnitSizeKeyPress);
256 this.bttnAddEquipment.Clicked += new global::System.EventHandler(this.OnBttnAddEquipmentClicked); 256 this.bttnAddWeapon.Clicked += new global::System.EventHandler(this.OnBttnAddEquipmentClicked);
257 this.bttnEditEquipment.Clicked += new global::System.EventHandler(this.HandleEditButtonClicked); 257 this.bttnEditWeapon.Clicked += new global::System.EventHandler(this.HandleEditButtonClicked);
258 this.bttnReplaceEquipment.Clicked += new global::System.EventHandler(this.HandleReplaceButtonClicked); 258 this.bttnReplaceWeapon.Clicked += new global::System.EventHandler(this.HandleReplaceButtonClicked);
259 this.bttnRemoveEquipment.Clicked += new global::System.EventHandler(this.HandleRemoveButtonActivated); 259 this.bttnRemoveWeapon.Clicked += new global::System.EventHandler(this.HandleRemoveButtonActivated);
260 } 260 }
261 } 261 }
262 } 262 }