Mercurial > repos > IBDev-IBBoard.WarFoundry.GUI.GTK
comparison 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 |
comparison
equal
deleted
inserted
replaced
35:1b603f97e7de | 36:d68992a831df |
---|---|
26 private Gtk.Label label1; | 26 private Gtk.Label label1; |
27 | 27 |
28 private Gtk.Label label2; | 28 private Gtk.Label label2; |
29 | 29 |
30 private Gtk.Label label3; | 30 private Gtk.Label label3; |
31 | |
32 private Gtk.Label label4; | |
33 | |
34 private Gtk.ComboBoxEntry systemCombo; | |
31 | 35 |
32 private Gtk.Entry txtArmyName; | 36 private Gtk.Entry txtArmyName; |
33 | 37 |
34 private Gtk.Button bttnCancel; | 38 private Gtk.Button bttnCancel; |
35 | 39 |
50 w1.CanFocus = true; | 54 w1.CanFocus = true; |
51 w1.Events = ((Gdk.EventMask)(256)); | 55 w1.Events = ((Gdk.EventMask)(256)); |
52 w1.Name = "dialog_VBox"; | 56 w1.Name = "dialog_VBox"; |
53 w1.BorderWidth = ((uint)(2)); | 57 w1.BorderWidth = ((uint)(2)); |
54 // Container child dialog_VBox.Gtk.Box+BoxChild | 58 // Container child dialog_VBox.Gtk.Box+BoxChild |
55 this.table1 = new Gtk.Table(((uint)(3)), ((uint)(2)), false); | 59 this.table1 = new Gtk.Table(((uint)(4)), ((uint)(2)), false); |
56 this.table1.Name = "table1"; | 60 this.table1.Name = "table1"; |
57 this.table1.RowSpacing = ((uint)(6)); | 61 this.table1.RowSpacing = ((uint)(6)); |
58 this.table1.ColumnSpacing = ((uint)(6)); | 62 this.table1.ColumnSpacing = ((uint)(6)); |
59 // Container child table1.Gtk.Table+TableChild | 63 // Container child table1.Gtk.Table+TableChild |
60 this.GtkScrolledWindow = new Gtk.ScrolledWindow(); | 64 this.GtkScrolledWindow = new Gtk.ScrolledWindow(); |
68 this.lstRaces.HeadersVisible = false; | 72 this.lstRaces.HeadersVisible = false; |
69 this.lstRaces.RulesHint = true; | 73 this.lstRaces.RulesHint = true; |
70 this.GtkScrolledWindow.Add(this.lstRaces); | 74 this.GtkScrolledWindow.Add(this.lstRaces); |
71 this.table1.Add(this.GtkScrolledWindow); | 75 this.table1.Add(this.GtkScrolledWindow); |
72 Gtk.Table.TableChild w3 = ((Gtk.Table.TableChild)(this.table1[this.GtkScrolledWindow])); | 76 Gtk.Table.TableChild w3 = ((Gtk.Table.TableChild)(this.table1[this.GtkScrolledWindow])); |
77 w3.TopAttach = ((uint)(1)); | |
78 w3.BottomAttach = ((uint)(2)); | |
73 w3.LeftAttach = ((uint)(1)); | 79 w3.LeftAttach = ((uint)(1)); |
74 w3.RightAttach = ((uint)(2)); | 80 w3.RightAttach = ((uint)(2)); |
81 w3.XOptions = ((Gtk.AttachOptions)(4)); | |
75 w3.YOptions = ((Gtk.AttachOptions)(4)); | 82 w3.YOptions = ((Gtk.AttachOptions)(4)); |
76 // Container child table1.Gtk.Table+TableChild | 83 // Container child table1.Gtk.Table+TableChild |
77 this.hbox2 = new Gtk.HBox(); | 84 this.hbox2 = new Gtk.HBox(); |
78 this.hbox2.Name = "hbox2"; | 85 this.hbox2.Name = "hbox2"; |
79 // Container child hbox2.Gtk.Box+BoxChild | 86 // Container child hbox2.Gtk.Box+BoxChild |
90 w4.Position = 0; | 97 w4.Position = 0; |
91 w4.Expand = false; | 98 w4.Expand = false; |
92 w4.Fill = false; | 99 w4.Fill = false; |
93 this.table1.Add(this.hbox2); | 100 this.table1.Add(this.hbox2); |
94 Gtk.Table.TableChild w5 = ((Gtk.Table.TableChild)(this.table1[this.hbox2])); | 101 Gtk.Table.TableChild w5 = ((Gtk.Table.TableChild)(this.table1[this.hbox2])); |
95 w5.TopAttach = ((uint)(2)); | 102 w5.TopAttach = ((uint)(3)); |
96 w5.BottomAttach = ((uint)(3)); | 103 w5.BottomAttach = ((uint)(4)); |
97 w5.LeftAttach = ((uint)(1)); | 104 w5.LeftAttach = ((uint)(1)); |
98 w5.RightAttach = ((uint)(2)); | 105 w5.RightAttach = ((uint)(2)); |
106 w5.XOptions = ((Gtk.AttachOptions)(4)); | |
99 w5.YOptions = ((Gtk.AttachOptions)(4)); | 107 w5.YOptions = ((Gtk.AttachOptions)(4)); |
100 // Container child table1.Gtk.Table+TableChild | 108 // Container child table1.Gtk.Table+TableChild |
101 this.label1 = new Gtk.Label(); | 109 this.label1 = new Gtk.Label(); |
102 this.label1.Name = "label1"; | 110 this.label1.Name = "label1"; |
103 this.label1.LabelProp = Mono.Unix.Catalog.GetString("Race"); | 111 this.label1.LabelProp = Mono.Unix.Catalog.GetString("Race"); |
104 this.table1.Add(this.label1); | 112 this.table1.Add(this.label1); |
105 Gtk.Table.TableChild w6 = ((Gtk.Table.TableChild)(this.table1[this.label1])); | 113 Gtk.Table.TableChild w6 = ((Gtk.Table.TableChild)(this.table1[this.label1])); |
114 w6.TopAttach = ((uint)(1)); | |
115 w6.BottomAttach = ((uint)(2)); | |
106 w6.XOptions = ((Gtk.AttachOptions)(4)); | 116 w6.XOptions = ((Gtk.AttachOptions)(4)); |
107 w6.YOptions = ((Gtk.AttachOptions)(4)); | 117 w6.YOptions = ((Gtk.AttachOptions)(4)); |
108 // Container child table1.Gtk.Table+TableChild | 118 // Container child table1.Gtk.Table+TableChild |
109 this.label2 = new Gtk.Label(); | 119 this.label2 = new Gtk.Label(); |
110 this.label2.Name = "label2"; | 120 this.label2.Name = "label2"; |
111 this.label2.LabelProp = Mono.Unix.Catalog.GetString("Army name"); | 121 this.label2.LabelProp = Mono.Unix.Catalog.GetString("Army name"); |
112 this.table1.Add(this.label2); | 122 this.table1.Add(this.label2); |
113 Gtk.Table.TableChild w7 = ((Gtk.Table.TableChild)(this.table1[this.label2])); | 123 Gtk.Table.TableChild w7 = ((Gtk.Table.TableChild)(this.table1[this.label2])); |
114 w7.TopAttach = ((uint)(1)); | 124 w7.TopAttach = ((uint)(2)); |
115 w7.BottomAttach = ((uint)(2)); | 125 w7.BottomAttach = ((uint)(3)); |
116 w7.XOptions = ((Gtk.AttachOptions)(4)); | 126 w7.XOptions = ((Gtk.AttachOptions)(4)); |
117 w7.YOptions = ((Gtk.AttachOptions)(4)); | 127 w7.YOptions = ((Gtk.AttachOptions)(4)); |
118 // Container child table1.Gtk.Table+TableChild | 128 // Container child table1.Gtk.Table+TableChild |
119 this.label3 = new Gtk.Label(); | 129 this.label3 = new Gtk.Label(); |
120 this.label3.Name = "label3"; | 130 this.label3.Name = "label3"; |
121 this.label3.LabelProp = Mono.Unix.Catalog.GetString("Points value"); | 131 this.label3.LabelProp = Mono.Unix.Catalog.GetString("Points value"); |
122 this.table1.Add(this.label3); | 132 this.table1.Add(this.label3); |
123 Gtk.Table.TableChild w8 = ((Gtk.Table.TableChild)(this.table1[this.label3])); | 133 Gtk.Table.TableChild w8 = ((Gtk.Table.TableChild)(this.table1[this.label3])); |
124 w8.TopAttach = ((uint)(2)); | 134 w8.TopAttach = ((uint)(3)); |
125 w8.BottomAttach = ((uint)(3)); | 135 w8.BottomAttach = ((uint)(4)); |
126 w8.XOptions = ((Gtk.AttachOptions)(4)); | 136 w8.XOptions = ((Gtk.AttachOptions)(4)); |
127 w8.YOptions = ((Gtk.AttachOptions)(4)); | 137 w8.YOptions = ((Gtk.AttachOptions)(4)); |
138 // Container child table1.Gtk.Table+TableChild | |
139 this.label4 = new Gtk.Label(); | |
140 this.label4.Name = "label4"; | |
141 this.label4.LabelProp = Mono.Unix.Catalog.GetString("game system"); | |
142 this.table1.Add(this.label4); | |
143 Gtk.Table.TableChild w9 = ((Gtk.Table.TableChild)(this.table1[this.label4])); | |
144 w9.XOptions = ((Gtk.AttachOptions)(4)); | |
145 w9.YOptions = ((Gtk.AttachOptions)(4)); | |
146 // Container child table1.Gtk.Table+TableChild | |
147 this.systemCombo = Gtk.ComboBoxEntry.NewText(); | |
148 this.systemCombo.Name = "systemCombo"; | |
149 this.table1.Add(this.systemCombo); | |
150 Gtk.Table.TableChild w10 = ((Gtk.Table.TableChild)(this.table1[this.systemCombo])); | |
151 w10.LeftAttach = ((uint)(1)); | |
152 w10.RightAttach = ((uint)(2)); | |
153 w10.YOptions = ((Gtk.AttachOptions)(4)); | |
128 // Container child table1.Gtk.Table+TableChild | 154 // Container child table1.Gtk.Table+TableChild |
129 this.txtArmyName = new Gtk.Entry(); | 155 this.txtArmyName = new Gtk.Entry(); |
130 this.txtArmyName.CanFocus = true; | 156 this.txtArmyName.CanFocus = true; |
131 this.txtArmyName.Name = "txtArmyName"; | 157 this.txtArmyName.Name = "txtArmyName"; |
132 this.txtArmyName.IsEditable = true; | 158 this.txtArmyName.IsEditable = true; |
133 this.txtArmyName.InvisibleChar = '•'; | 159 this.txtArmyName.InvisibleChar = '•'; |
134 this.table1.Add(this.txtArmyName); | 160 this.table1.Add(this.txtArmyName); |
135 Gtk.Table.TableChild w9 = ((Gtk.Table.TableChild)(this.table1[this.txtArmyName])); | 161 Gtk.Table.TableChild w11 = ((Gtk.Table.TableChild)(this.table1[this.txtArmyName])); |
136 w9.TopAttach = ((uint)(1)); | 162 w11.TopAttach = ((uint)(2)); |
137 w9.BottomAttach = ((uint)(2)); | 163 w11.BottomAttach = ((uint)(3)); |
138 w9.LeftAttach = ((uint)(1)); | 164 w11.LeftAttach = ((uint)(1)); |
139 w9.RightAttach = ((uint)(2)); | 165 w11.RightAttach = ((uint)(2)); |
140 w9.YOptions = ((Gtk.AttachOptions)(4)); | 166 w11.XOptions = ((Gtk.AttachOptions)(4)); |
167 w11.YOptions = ((Gtk.AttachOptions)(4)); | |
141 w1.Add(this.table1); | 168 w1.Add(this.table1); |
142 Gtk.Box.BoxChild w10 = ((Gtk.Box.BoxChild)(w1[this.table1])); | 169 Gtk.Box.BoxChild w12 = ((Gtk.Box.BoxChild)(w1[this.table1])); |
143 w10.Position = 0; | 170 w12.Position = 0; |
144 w10.Expand = false; | 171 w12.Expand = false; |
145 w10.Fill = false; | 172 w12.Fill = false; |
146 w10.Padding = ((uint)(6)); | 173 w12.Padding = ((uint)(6)); |
147 // Internal child IBBoard.WarFoundry.GTK.FrmNewArmy.ActionArea | 174 // Internal child IBBoard.WarFoundry.GTK.FrmNewArmy.ActionArea |
148 Gtk.HButtonBox w11 = this.ActionArea; | 175 Gtk.HButtonBox w13 = this.ActionArea; |
149 w11.CanFocus = true; | 176 w13.CanFocus = true; |
150 w11.Events = ((Gdk.EventMask)(256)); | 177 w13.Events = ((Gdk.EventMask)(256)); |
151 w11.Name = "WarFoundrySharp.FrmNewArmy_ActionArea"; | 178 w13.Name = "WarFoundrySharp.FrmNewArmy_ActionArea"; |
152 w11.Spacing = 6; | 179 w13.Spacing = 6; |
153 w11.BorderWidth = ((uint)(5)); | 180 w13.BorderWidth = ((uint)(5)); |
154 w11.LayoutStyle = ((Gtk.ButtonBoxStyle)(4)); | 181 w13.LayoutStyle = ((Gtk.ButtonBoxStyle)(4)); |
155 // Container child WarFoundrySharp.FrmNewArmy_ActionArea.Gtk.ButtonBox+ButtonBoxChild | 182 // Container child WarFoundrySharp.FrmNewArmy_ActionArea.Gtk.ButtonBox+ButtonBoxChild |
156 this.bttnCancel = new Gtk.Button(); | 183 this.bttnCancel = new Gtk.Button(); |
157 this.bttnCancel.CanFocus = true; | 184 this.bttnCancel.CanFocus = true; |
158 this.bttnCancel.Name = "bttnCancel"; | 185 this.bttnCancel.Name = "bttnCancel"; |
159 this.bttnCancel.UseStock = true; | 186 this.bttnCancel.UseStock = true; |
160 this.bttnCancel.UseUnderline = true; | 187 this.bttnCancel.UseUnderline = true; |
161 this.bttnCancel.Label = "gtk-cancel"; | 188 this.bttnCancel.Label = "gtk-cancel"; |
162 this.AddActionWidget(this.bttnCancel, -6); | 189 this.AddActionWidget(this.bttnCancel, -6); |
163 Gtk.ButtonBox.ButtonBoxChild w12 = ((Gtk.ButtonBox.ButtonBoxChild)(w11[this.bttnCancel])); | 190 Gtk.ButtonBox.ButtonBoxChild w14 = ((Gtk.ButtonBox.ButtonBoxChild)(w13[this.bttnCancel])); |
164 w12.Expand = false; | 191 w14.Expand = false; |
165 w12.Fill = false; | 192 w14.Fill = false; |
166 // Container child WarFoundrySharp.FrmNewArmy_ActionArea.Gtk.ButtonBox+ButtonBoxChild | 193 // Container child WarFoundrySharp.FrmNewArmy_ActionArea.Gtk.ButtonBox+ButtonBoxChild |
167 this.bttnCreate = new Gtk.Button(); | 194 this.bttnCreate = new Gtk.Button(); |
168 this.bttnCreate.Sensitive = false; | 195 this.bttnCreate.Sensitive = false; |
169 this.bttnCreate.CanDefault = true; | 196 this.bttnCreate.CanDefault = true; |
170 this.bttnCreate.CanFocus = true; | 197 this.bttnCreate.CanFocus = true; |
171 this.bttnCreate.Name = "bttnCreate"; | 198 this.bttnCreate.Name = "bttnCreate"; |
172 this.bttnCreate.UseUnderline = true; | 199 this.bttnCreate.UseUnderline = true; |
173 // Container child bttnCreate.Gtk.Container+ContainerChild | 200 // Container child bttnCreate.Gtk.Container+ContainerChild |
174 Gtk.Alignment w13 = new Gtk.Alignment(0.5F, 0.5F, 0F, 0F); | 201 Gtk.Alignment w15 = new Gtk.Alignment(0.5F, 0.5F, 0F, 0F); |
175 // Container child GtkAlignment.Gtk.Container+ContainerChild | 202 // Container child GtkAlignment.Gtk.Container+ContainerChild |
176 Gtk.HBox w14 = new Gtk.HBox(); | 203 Gtk.HBox w16 = new Gtk.HBox(); |
177 w14.Spacing = 2; | 204 w16.Spacing = 2; |
178 // Container child GtkHBox.Gtk.Container+ContainerChild | 205 // Container child GtkHBox.Gtk.Container+ContainerChild |
179 Gtk.Image w15 = new Gtk.Image(); | 206 Gtk.Image w17 = new Gtk.Image(); |
180 w15.Pixbuf = Stetic.IconLoader.LoadIcon(this, "gtk-ok", Gtk.IconSize.Menu, 16); | 207 w17.Pixbuf = Stetic.IconLoader.LoadIcon(this, "gtk-ok", Gtk.IconSize.Menu, 16); |
181 w14.Add(w15); | 208 w16.Add(w17); |
182 // Container child GtkHBox.Gtk.Container+ContainerChild | 209 // Container child GtkHBox.Gtk.Container+ContainerChild |
183 Gtk.Label w17 = new Gtk.Label(); | 210 Gtk.Label w19 = new Gtk.Label(); |
184 w17.LabelProp = Mono.Unix.Catalog.GetString("C_reate"); | 211 w19.LabelProp = Mono.Unix.Catalog.GetString("C_reate"); |
185 w17.UseUnderline = true; | 212 w19.UseUnderline = true; |
186 w14.Add(w17); | 213 w16.Add(w19); |
187 w13.Add(w14); | 214 w15.Add(w16); |
188 this.bttnCreate.Add(w13); | 215 this.bttnCreate.Add(w15); |
189 this.AddActionWidget(this.bttnCreate, -5); | 216 this.AddActionWidget(this.bttnCreate, -5); |
190 Gtk.ButtonBox.ButtonBoxChild w21 = ((Gtk.ButtonBox.ButtonBoxChild)(w11[this.bttnCreate])); | 217 Gtk.ButtonBox.ButtonBoxChild w23 = ((Gtk.ButtonBox.ButtonBoxChild)(w13[this.bttnCreate])); |
191 w21.Position = 1; | 218 w23.Position = 1; |
192 w21.Expand = false; | 219 w23.Expand = false; |
193 w21.Fill = false; | 220 w23.Fill = false; |
194 if ((this.Child != null)) { | 221 if ((this.Child != null)) { |
195 this.Child.ShowAll(); | 222 this.Child.ShowAll(); |
196 } | 223 } |
197 this.DefaultWidth = 400; | 224 this.DefaultWidth = 370; |
198 this.DefaultHeight = 322; | 225 this.DefaultHeight = 348; |
199 this.Show(); | 226 this.Show(); |
200 this.txtArmyName.Changed += new System.EventHandler(this.OnTextChanged); | 227 this.txtArmyName.Changed += new System.EventHandler(this.OnTextChanged); |
228 this.systemCombo.Changed += new System.EventHandler(this.OnSystemComboChanged); | |
201 this.sbPointsValue.ChangeValue += new Gtk.ChangeValueHandler(this.OnSpinChangeValue); | 229 this.sbPointsValue.ChangeValue += new Gtk.ChangeValueHandler(this.OnSpinChangeValue); |
202 this.sbPointsValue.ValueChanged += new System.EventHandler(this.OnSpinValueChanged); | 230 this.sbPointsValue.ValueChanged += new System.EventHandler(this.OnSpinValueChanged); |
203 this.sbPointsValue.Changed += new System.EventHandler(this.OnSpinValueChanged); | 231 this.sbPointsValue.Changed += new System.EventHandler(this.OnSpinValueChanged); |
204 this.bttnCancel.Clicked += new System.EventHandler(this.OnCancelClicked); | 232 this.bttnCancel.Clicked += new System.EventHandler(this.OnCancelClicked); |
205 this.bttnCreate.Clicked += new System.EventHandler(this.OnCreateClicked); | 233 this.bttnCreate.Clicked += new System.EventHandler(this.OnCreateClicked); |