Mercurial > repos > IBBoard.WarFoundry.GUI.GTK
annotate gtk-gui/IBBoard.WarFoundry.GTK.FrmMainWindow.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 |
rev | line source |
---|---|
5 | 1 // ------------------------------------------------------------------------------ |
2 // <autogenerated> | |
3 // This code was generated by a tool. | |
7 | 4 // |
5 | 5 // |
6 // Changes to this file may cause incorrect behavior and will be lost if | |
7 // the code is regenerated. | |
8 // </autogenerated> | |
9 // ------------------------------------------------------------------------------ | |
10 | |
6
cfc7683e73f9
Fix breakage from r33 by completing update of move to IBBoard.WarFoundry.GTK sub-packages
IBBoard <dev@ibboard.co.uk>
parents:
5
diff
changeset
|
11 namespace IBBoard.WarFoundry.GTK { |
5 | 12 |
13 | |
14 public partial class FrmMainWindow { | |
15 | |
16 private Gtk.UIManager UIManager; | |
17 | |
18 private Gtk.Action menuFile; | |
19 | |
20 private Gtk.Action miCreateArmy; | |
21 | |
22 private Gtk.Action miOpenArmy; | |
23 | |
24 private Gtk.Action miSaveArmy; | |
25 | |
26 private Gtk.Action miSaveArmyAs; | |
27 | |
28 private Gtk.Action miCloseArmy; | |
29 | |
30 private Gtk.Action miReloadFiles; | |
31 | |
32 private Gtk.Action miExit; | |
33 | |
34 private Gtk.Action menuEdit; | |
35 | |
36 private Gtk.Action miUndo; | |
37 | |
38 private Gtk.Action miRedo; | |
39 | |
40 private Gtk.Action menuHelp; | |
41 | |
42 private Gtk.Action miAbout; | |
43 | |
44 private Gtk.Action miDebugInformation; | |
45 | |
46 private Gtk.Action newArmyButton; | |
47 | |
48 private Gtk.Action openArmyButton; | |
49 | |
50 private Gtk.Action saveArmyButton; | |
51 | |
52 private Gtk.Action undoActionButton; | |
53 | |
54 private Gtk.Action redoActionButton; | |
55 | |
56 private Gtk.Action goDown; | |
57 | |
58 private Gtk.Action add; | |
59 | |
28 | 60 private Gtk.Action miExportArmy; |
61 | |
62 private Gtk.Action miExportAsBasicHtml; | |
63 | |
5 | 64 private Gtk.VBox vbox1; |
65 | |
66 private Gtk.MenuBar menubar1; | |
67 | |
68 private Gtk.Toolbar toolbar; | |
69 | |
70 private Gtk.HPaned hpaned2; | |
71 | |
72 private Gtk.TreeView treeUnits; | |
73 | |
74 private Gtk.Notebook unitsNotebook; | |
75 | |
76 private Gtk.Statusbar statusbar1; | |
77 | |
78 protected virtual void Build() { | |
79 Stetic.Gui.Initialize(this); | |
6
cfc7683e73f9
Fix breakage from r33 by completing update of move to IBBoard.WarFoundry.GTK sub-packages
IBBoard <dev@ibboard.co.uk>
parents:
5
diff
changeset
|
80 // Widget IBBoard.WarFoundry.GTK.FrmMainWindow |
5 | 81 this.UIManager = new Gtk.UIManager(); |
82 Gtk.ActionGroup w1 = new Gtk.ActionGroup("Default"); | |
7 | 83 this.menuFile = new Gtk.Action("menuFile", Mono.Unix.Catalog.GetString("File"), null, null); |
84 this.menuFile.ShortLabel = Mono.Unix.Catalog.GetString("File"); | |
5 | 85 w1.Add(this.menuFile, null); |
23
d661cb257511
Re #86: Initial GTK# GUI (because of Re #53)
IBBoard <dev@ibboard.co.uk>
parents:
12
diff
changeset
|
86 this.miCreateArmy = new Gtk.Action("miCreateArmy", Mono.Unix.Catalog.GetString("Create army"), null, "gtk-new"); |
7 | 87 this.miCreateArmy.ShortLabel = Mono.Unix.Catalog.GetString("Create army"); |
5 | 88 w1.Add(this.miCreateArmy, null); |
23
d661cb257511
Re #86: Initial GTK# GUI (because of Re #53)
IBBoard <dev@ibboard.co.uk>
parents:
12
diff
changeset
|
89 this.miOpenArmy = new Gtk.Action("miOpenArmy", Mono.Unix.Catalog.GetString("Open army"), null, "gtk-open"); |
7 | 90 this.miOpenArmy.ShortLabel = Mono.Unix.Catalog.GetString("Open army"); |
5 | 91 w1.Add(this.miOpenArmy, null); |
23
d661cb257511
Re #86: Initial GTK# GUI (because of Re #53)
IBBoard <dev@ibboard.co.uk>
parents:
12
diff
changeset
|
92 this.miSaveArmy = new Gtk.Action("miSaveArmy", Mono.Unix.Catalog.GetString("Save army"), null, "gtk-save"); |
5 | 93 this.miSaveArmy.Sensitive = false; |
7 | 94 this.miSaveArmy.ShortLabel = Mono.Unix.Catalog.GetString("Save army"); |
5 | 95 w1.Add(this.miSaveArmy, null); |
23
d661cb257511
Re #86: Initial GTK# GUI (because of Re #53)
IBBoard <dev@ibboard.co.uk>
parents:
12
diff
changeset
|
96 this.miSaveArmyAs = new Gtk.Action("miSaveArmyAs", Mono.Unix.Catalog.GetString("Save army as"), null, "gtk-save-as"); |
5 | 97 this.miSaveArmyAs.Sensitive = false; |
7 | 98 this.miSaveArmyAs.ShortLabel = Mono.Unix.Catalog.GetString("Save army as"); |
5 | 99 w1.Add(this.miSaveArmyAs, null); |
23
d661cb257511
Re #86: Initial GTK# GUI (because of Re #53)
IBBoard <dev@ibboard.co.uk>
parents:
12
diff
changeset
|
100 this.miCloseArmy = new Gtk.Action("miCloseArmy", Mono.Unix.Catalog.GetString("Close army"), null, "gtk-close"); |
5 | 101 this.miCloseArmy.Sensitive = false; |
7 | 102 this.miCloseArmy.ShortLabel = Mono.Unix.Catalog.GetString("Close army"); |
5 | 103 w1.Add(this.miCloseArmy, null); |
23
d661cb257511
Re #86: Initial GTK# GUI (because of Re #53)
IBBoard <dev@ibboard.co.uk>
parents:
12
diff
changeset
|
104 this.miReloadFiles = new Gtk.Action("miReloadFiles", Mono.Unix.Catalog.GetString("Reload files"), null, "gtk-refresh"); |
5 | 105 this.miReloadFiles.Sensitive = false; |
7 | 106 this.miReloadFiles.ShortLabel = Mono.Unix.Catalog.GetString("Reload files"); |
5 | 107 w1.Add(this.miReloadFiles, null); |
23
d661cb257511
Re #86: Initial GTK# GUI (because of Re #53)
IBBoard <dev@ibboard.co.uk>
parents:
12
diff
changeset
|
108 this.miExit = new Gtk.Action("miExit", Mono.Unix.Catalog.GetString("Exit"), null, "gtk-quit"); |
7 | 109 this.miExit.ShortLabel = Mono.Unix.Catalog.GetString("Exit"); |
5 | 110 w1.Add(this.miExit, null); |
7 | 111 this.menuEdit = new Gtk.Action("menuEdit", Mono.Unix.Catalog.GetString("Edit"), null, null); |
112 this.menuEdit.ShortLabel = Mono.Unix.Catalog.GetString("Edit"); | |
5 | 113 w1.Add(this.menuEdit, null); |
23
d661cb257511
Re #86: Initial GTK# GUI (because of Re #53)
IBBoard <dev@ibboard.co.uk>
parents:
12
diff
changeset
|
114 this.miUndo = new Gtk.Action("miUndo", Mono.Unix.Catalog.GetString("Undo"), null, "gtk-undo"); |
5 | 115 this.miUndo.Sensitive = false; |
7 | 116 this.miUndo.ShortLabel = Mono.Unix.Catalog.GetString("Undo"); |
5 | 117 w1.Add(this.miUndo, null); |
23
d661cb257511
Re #86: Initial GTK# GUI (because of Re #53)
IBBoard <dev@ibboard.co.uk>
parents:
12
diff
changeset
|
118 this.miRedo = new Gtk.Action("miRedo", Mono.Unix.Catalog.GetString("Redo"), null, "gtk-redo"); |
5 | 119 this.miRedo.Sensitive = false; |
7 | 120 this.miRedo.ShortLabel = Mono.Unix.Catalog.GetString("Redo"); |
5 | 121 w1.Add(this.miRedo, null); |
7 | 122 this.menuHelp = new Gtk.Action("menuHelp", Mono.Unix.Catalog.GetString("Help"), null, null); |
123 this.menuHelp.ShortLabel = Mono.Unix.Catalog.GetString("Help"); | |
5 | 124 w1.Add(this.menuHelp, null); |
23
d661cb257511
Re #86: Initial GTK# GUI (because of Re #53)
IBBoard <dev@ibboard.co.uk>
parents:
12
diff
changeset
|
125 this.miAbout = new Gtk.Action("miAbout", Mono.Unix.Catalog.GetString("About"), null, "gtk-about"); |
7 | 126 this.miAbout.ShortLabel = Mono.Unix.Catalog.GetString("About"); |
5 | 127 w1.Add(this.miAbout, null); |
7 | 128 this.miDebugInformation = new Gtk.Action("miDebugInformation", Mono.Unix.Catalog.GetString("Debug Information"), null, null); |
129 this.miDebugInformation.ShortLabel = Mono.Unix.Catalog.GetString("Debug Information"); | |
5 | 130 w1.Add(this.miDebugInformation, null); |
131 this.newArmyButton = new Gtk.Action("newArmyButton", null, null, "gtk-new"); | |
132 w1.Add(this.newArmyButton, null); | |
133 this.openArmyButton = new Gtk.Action("openArmyButton", null, null, "gtk-open"); | |
134 w1.Add(this.openArmyButton, null); | |
135 this.saveArmyButton = new Gtk.Action("saveArmyButton", null, null, "gtk-save"); | |
136 this.saveArmyButton.Sensitive = false; | |
137 w1.Add(this.saveArmyButton, null); | |
138 this.undoActionButton = new Gtk.Action("undoActionButton", null, null, "gtk-undo"); | |
139 this.undoActionButton.Sensitive = false; | |
140 w1.Add(this.undoActionButton, null); | |
141 this.redoActionButton = new Gtk.Action("redoActionButton", null, null, "gtk-redo"); | |
142 this.redoActionButton.Sensitive = false; | |
143 w1.Add(this.redoActionButton, null); | |
144 this.goDown = new Gtk.Action("goDown", null, null, null); | |
145 w1.Add(this.goDown, null); | |
146 this.add = new Gtk.Action("add", null, null, "gtk-add"); | |
147 w1.Add(this.add, null); | |
28 | 148 this.miExportArmy = new Gtk.Action("miExportArmy", Mono.Unix.Catalog.GetString("Export army as..."), null, "gtk-convert"); |
29 | 149 this.miExportArmy.Sensitive = false; |
28 | 150 this.miExportArmy.ShortLabel = Mono.Unix.Catalog.GetString("Export army"); |
151 w1.Add(this.miExportArmy, null); | |
152 this.miExportAsBasicHtml = new Gtk.Action("miExportAsBasicHtml", Mono.Unix.Catalog.GetString("Basic HTML"), null, null); | |
153 this.miExportAsBasicHtml.ShortLabel = Mono.Unix.Catalog.GetString("Basic HTML"); | |
154 w1.Add(this.miExportAsBasicHtml, null); | |
5 | 155 this.UIManager.InsertActionGroup(w1, 0); |
156 this.AddAccelGroup(this.UIManager.AccelGroup); | |
6
cfc7683e73f9
Fix breakage from r33 by completing update of move to IBBoard.WarFoundry.GTK sub-packages
IBBoard <dev@ibboard.co.uk>
parents:
5
diff
changeset
|
157 this.Name = "IBBoard.WarFoundry.GTK.FrmMainWindow"; |
7 | 158 this.Title = Mono.Unix.Catalog.GetString("MainWindow"); |
5 | 159 this.Icon = Gdk.Pixbuf.LoadFromResource("App.ico"); |
6
cfc7683e73f9
Fix breakage from r33 by completing update of move to IBBoard.WarFoundry.GTK sub-packages
IBBoard <dev@ibboard.co.uk>
parents:
5
diff
changeset
|
160 // Container child IBBoard.WarFoundry.GTK.FrmMainWindow.Gtk.Container+ContainerChild |
5 | 161 this.vbox1 = new Gtk.VBox(); |
162 this.vbox1.Name = "vbox1"; | |
163 // Container child vbox1.Gtk.Box+BoxChild | |
36
d68992a831df
Fixes #182: Make GTK# more like WinForms UI
IBBoard <dev@ibboard.co.uk>
parents:
35
diff
changeset
|
164 this.UIManager.AddUiFromString("<ui><menubar name='menubar1'><menu name='menuFile' action='menuFile'><menuitem name='miCreateArmy' action='miCreateArmy'/><menuitem name='miOpenArmy' action='miOpenArmy'/><menuitem name='miSaveArmy' action='miSaveArmy'/><menuitem name='miSaveArmyAs' action='miSaveArmyAs'/><menu name='miExportArmy' action='miExportArmy'><menuitem name='miExportAsBasicHtml' action='miExportAsBasicHtml'/></menu><menuitem name='miCloseArmy' action='miCloseArmy'/><separator/><menuitem name='miReloadFiles' action='miReloadFiles'/><separator/><menuitem name='miExit' action='miExit'/></menu><menu name='menuEdit' action='menuEdit'><menuitem name='miUndo' action='miUndo'/><menuitem name='miRedo' action='miRedo'/></menu><menu name='menuHelp' action='menuHelp'><menuitem name='miAbout' action='miAbout'/><menuitem name='miDebugInformation' action='miDebugInformation'/></menu></menubar></ui>"); |
5 | 165 this.menubar1 = ((Gtk.MenuBar)(this.UIManager.GetWidget("/menubar1"))); |
166 this.menubar1.Name = "menubar1"; | |
167 this.vbox1.Add(this.menubar1); | |
168 Gtk.Box.BoxChild w2 = ((Gtk.Box.BoxChild)(this.vbox1[this.menubar1])); | |
169 w2.Position = 0; | |
170 w2.Expand = false; | |
171 w2.Fill = false; | |
172 // Container child vbox1.Gtk.Box+BoxChild | |
173 this.UIManager.AddUiFromString("<ui><toolbar name='toolbar'><toolitem name='newArmyButton' action='newArmyButton'/><toolitem name='openArmyButton' action='openArmyButton'/><toolitem name='saveArmyButton' action='saveArmyButton'/><separator/><toolitem name='undoActionButton' action='undoActionButton'/><toolitem name='redoActionButton' action='redoActionButton'/><separator/></toolbar></ui>"); | |
174 this.toolbar = ((Gtk.Toolbar)(this.UIManager.GetWidget("/toolbar"))); | |
175 this.toolbar.HeightRequest = 36; | |
176 this.toolbar.Name = "toolbar"; | |
177 this.toolbar.ShowArrow = false; | |
178 this.toolbar.ToolbarStyle = ((Gtk.ToolbarStyle)(0)); | |
35
1b603f97e7de
Re #86: Complete initial GTK# UI
IBBoard <dev@ibboard.co.uk>
parents:
30
diff
changeset
|
179 this.toolbar.IconSize = ((Gtk.IconSize)(3)); |
5 | 180 this.vbox1.Add(this.toolbar); |
181 Gtk.Box.BoxChild w3 = ((Gtk.Box.BoxChild)(this.vbox1[this.toolbar])); | |
182 w3.Position = 1; | |
183 w3.Expand = false; | |
184 w3.Fill = false; | |
185 // Container child vbox1.Gtk.Box+BoxChild | |
186 this.hpaned2 = new Gtk.HPaned(); | |
187 this.hpaned2.CanFocus = true; | |
188 this.hpaned2.Name = "hpaned2"; | |
189 this.hpaned2.Position = 178; | |
190 // Container child hpaned2.Gtk.Paned+PanedChild | |
191 this.treeUnits = new Gtk.TreeView(); | |
192 this.treeUnits.CanFocus = true; | |
193 this.treeUnits.Name = "treeUnits"; | |
194 this.hpaned2.Add(this.treeUnits); | |
195 Gtk.Paned.PanedChild w4 = ((Gtk.Paned.PanedChild)(this.hpaned2[this.treeUnits])); | |
196 w4.Resize = false; | |
197 // Container child hpaned2.Gtk.Paned+PanedChild | |
198 this.unitsNotebook = new Gtk.Notebook(); | |
199 this.unitsNotebook.CanFocus = true; | |
200 this.unitsNotebook.Name = "unitsNotebook"; | |
201 this.unitsNotebook.CurrentPage = -1; | |
202 this.hpaned2.Add(this.unitsNotebook); | |
203 this.vbox1.Add(this.hpaned2); | |
204 Gtk.Box.BoxChild w6 = ((Gtk.Box.BoxChild)(this.vbox1[this.hpaned2])); | |
205 w6.Position = 2; | |
206 // Container child vbox1.Gtk.Box+BoxChild | |
207 this.statusbar1 = new Gtk.Statusbar(); | |
208 this.statusbar1.Name = "statusbar1"; | |
209 this.statusbar1.Spacing = 2; | |
210 this.vbox1.Add(this.statusbar1); | |
211 Gtk.Box.BoxChild w7 = ((Gtk.Box.BoxChild)(this.vbox1[this.statusbar1])); | |
212 w7.Position = 3; | |
213 w7.Expand = false; | |
214 w7.Fill = false; | |
215 this.Add(this.vbox1); | |
216 if ((this.Child != null)) { | |
217 this.Child.ShowAll(); | |
218 } | |
219 this.DefaultWidth = 832; | |
220 this.DefaultHeight = 659; | |
221 this.Show(); | |
222 this.miCreateArmy.Activated += new System.EventHandler(this.OnCreateArmyActivated); | |
223 this.miOpenArmy.Activated += new System.EventHandler(this.OnOpenArmyActivated); | |
224 this.miSaveArmy.Activated += new System.EventHandler(this.OnSaveArmyActivated); | |
225 this.miSaveArmyAs.Activated += new System.EventHandler(this.OnSaveArmyAsActivated); | |
226 this.miCloseArmy.Activated += new System.EventHandler(this.OnCloseArmyActivated); | |
227 this.miReloadFiles.Activated += new System.EventHandler(this.OnReloadFilesActivated); | |
228 this.miExit.Activated += new System.EventHandler(this.OnExitActivated); | |
229 this.newArmyButton.Activated += new System.EventHandler(this.newTBButtonActivated); | |
230 this.openArmyButton.Activated += new System.EventHandler(this.openTBButtonActivated); | |
231 this.saveArmyButton.Activated += new System.EventHandler(this.saveTBButtonActivated); | |
232 this.undoActionButton.Activated += new System.EventHandler(this.undoTBButtonActivated); | |
233 this.redoActionButton.Activated += new System.EventHandler(this.redoTBButtonActivated); | |
28 | 234 this.miExportAsBasicHtml.Activated += new System.EventHandler(this.OnMiExportAsBasicHtmlActivated); |
5 | 235 this.treeUnits.RowActivated += new Gtk.RowActivatedHandler(this.ArmyRowActivated); |
30
5fafbb1b4592
Re #145: Add UI to remove units from army
IBBoard <dev@ibboard.co.uk>
parents:
29
diff
changeset
|
236 this.treeUnits.PopupMenu += new Gtk.PopupMenuHandler(this.OnTreeUnitsPopupMenu); |
5fafbb1b4592
Re #145: Add UI to remove units from army
IBBoard <dev@ibboard.co.uk>
parents:
29
diff
changeset
|
237 this.treeUnits.ButtonPressEvent += new Gtk.ButtonPressEventHandler(this.UnitTreeButtonPressed); |
5 | 238 } |
239 } | |
240 } |