Mercurial > repos > IBBoard.WarFoundry.GUI.WinForms
annotate FrmMain.cs @ 199:f9ef9b2db496
Re #343: Show unit requirement failures
* Add missing translation for dialog
* Add first pass of showing messages when adding units (needs reworking due to space limitations)
author | IBBoard <dev@ibboard.co.uk> |
---|---|
date | Sun, 01 May 2011 19:31:26 +0000 |
parents | 10ba2c5340b2 |
children | ac5f87626abd 53d79e1be712 |
rev | line source |
---|---|
142 | 1 // This file (FrmMain.cs) is a part of the IBBoard.WarFoundry.GUI.WinForms project and is copyright 2007, 2008, 2009 IBBoard. |
2 // | |
3 // The file and the library/program it is in are licensed and distributed, without warranty, under the GNU Affero GPL license, either version 3 of the License or (at your option) any later version. Please see COPYING for more information and the full license. | |
4 | |
5 using System; | |
6 using System.Collections.Generic; | |
7 using System.Drawing; | |
8 using System.Drawing.Drawing2D; | |
9 using System.ComponentModel; | |
10 using System.Windows.Forms; | |
11 using System.Data; | |
12 using System.IO; | |
13 using System.Threading; | |
14 using log4net; | |
15 using IBBoard; | |
16 using IBBoard.CustomMath; | |
17 using IBBoard.Commands; | |
18 using IBBoard.IO; | |
19 using IBBoard.Lang; | |
20 using IBBoard.Windows.Forms; | |
21 using IBBoard.Windows.Forms.I18N; | |
22 using IBBoard.Xml; | |
23 using IBBoard.WarFoundry.API; | |
24 using IBBoard.WarFoundry.API.Commands; | |
25 using IBBoard.WarFoundry.API.Exporters; | |
26 using IBBoard.WarFoundry.API.Objects; | |
196
15148d255e50
* First stab at displaying new unit requirements
IBBoard <dev@ibboard.co.uk>
parents:
195
diff
changeset
|
27 using IBBoard.WarFoundry.API.Objects.Requirement; |
190 | 28 using IBBoard.WarFoundry.API.Util; |
142 | 29 using IBBoard.WarFoundry.API.Savers; |
193 | 30 using IBBoard.WarFoundry.API.Savers.Xml; |
142 | 31 using IBBoard.WarFoundry.API.Factories; |
32 using IBBoard.WarFoundry.API.Factories.Xml; | |
33 | |
34 namespace IBBoard.WarFoundry.GUI.WinForms | |
35 { | |
36 /// <summary> | |
37 /// Summary description for Form1. | |
38 /// </summary> | |
39 public class FrmMain : System.Windows.Forms.Form | |
40 { | |
41 private static readonly string AppTitle = "WarFoundry"; | |
183
75afd724a825
* Increase WarFoundry WinForms version numbers to 0.1 in preparation for first WinForms release
IBBoard <dev@ibboard.co.uk>
parents:
181
diff
changeset
|
42 internal static readonly string VERSION = "0.1"; |
142 | 43 const string DefaultDataDir = "data"; |
190 | 44 /* public static string pointsAbbrevSingle; |
45 public static string pointsAbbrevPlural; | |
46 public static string pointsAbbreviation; | |
47 public static string pointsNameSingle; | |
48 public static string pointsNamePlural; | |
49 public static string pointsName;*/ | |
142 | 50 |
51 private Preferences preferences; | |
52 private readonly ILog log = LogManager.GetLogger(typeof(FrmMain)); | |
53 | |
54 private CommandStack commandStack; | |
55 | |
56 public ObjectAddDelegate UnitAddedMethod; | |
57 public ObjectRemoveDelegate UnitRemovedMethod; | |
58 public DoubleValChangedDelegate PointsValueChangedMethod; | |
59 //public FailedUnitRequirementDelegate FailedUnitRequirementMethod; | |
60 | |
61 private FrmArmyTree armyTree; | |
62 private string loadedFilePath; | |
63 private Dictionary<string, FrmUnit> unitWindows; | |
64 | |
65 private System.ComponentModel.IContainer components; | |
66 private System.Windows.Forms.OpenFileDialog openArmyDialog; | |
67 private System.Windows.Forms.SaveFileDialog saveArmyDialog; | |
68 private System.Windows.Forms.MainMenu mainMenu; | |
69 private IBBoard.Windows.Forms.ColorableStatusBarPanel sbMainPanel; | |
70 private IBBoard.Windows.Forms.ColorableStatusBarPanel sbErrorPanel; | |
71 private IBBoard.Windows.Forms.ColorableStatusBarPanel sbPointsPanel; | |
72 private System.Windows.Forms.ContextMenu undoMenu; | |
73 private System.Windows.Forms.ContextMenu redoMenu; | |
196
15148d255e50
* First stab at displaying new unit requirements
IBBoard <dev@ibboard.co.uk>
parents:
195
diff
changeset
|
74 private IBBoard.Windows.Forms.ColorableStatusBar statusBar; |
142 | 75 private MenuStrip menuStrip; |
76 private IBBToolStripMenuItem menuFile; | |
77 private IBBToolStripMenuItem miNewArmy; | |
78 private IBBToolStripMenuItem miOpenArmy; | |
79 private IBBToolStripMenuItem miSaveArmy; | |
80 private IBBToolStripMenuItem miSaveArmyAs; | |
81 private IBBToolStripMenuItem miExportArmyAs; | |
82 private IBBToolStripMenuItem miExportArmyAsBasicHTML; | |
83 private IBBToolStripMenuItem miCloseArmy; | |
84 private ToolStripSeparator toolStripSeparator1; | |
85 private IBBToolStripMenuItem miReloadFiles; | |
86 private ToolStripSeparator toolStripSeparator2; | |
87 private IBBToolStripMenuItem miExit; | |
88 private IBBToolStripMenuItem menuEdit; | |
89 private IBBToolStripMenuItem miUndo; | |
90 private IBBToolStripMenuItem miRedo; | |
91 private IBBToolStripMenuItem menuHelp; | |
92 private ToolStrip mainToolStrip; | |
93 private IBBToolStripButton bttnNewArmy; | |
94 private IBBToolStripButton bttnOpenArmy; | |
95 private IBBToolStripButton bttnSaveArmy; | |
96 private ToolStripSeparator toolStripSeparator3; | |
97 private IBBToolStripSplitButton bttnUndo; | |
98 private IBBToolStripSplitButton bttnRedo; | |
99 private ToolStrip catToolStrip; | |
140
60c795eca8de
Re #265: Add language preference UI
IBBoard <dev@ibboard.co.uk>
parents:
137
diff
changeset
|
100 private ToolStripPanel toolStripPanel; |
60c795eca8de
Re #265: Add language preference UI
IBBoard <dev@ibboard.co.uk>
parents:
137
diff
changeset
|
101 private ToolStripSeparator toolStripSeparator4; |
142 | 102 private IBBToolStripMenuItem miPreferences; |
103 private IBBToolStripMenuItem miAbout; | |
104 | |
190 | 105 |
142 | 106 /// <summary> |
107 /// The main entry point for the application. | |
108 /// </summary> | |
109 [STAThread] | |
110 static void Main(string[] args) | |
111 { | |
112 try | |
113 { | |
114 LogManager.GetLogger(typeof(FrmMain)).Info("Starting WarFoundry WinForms"); | |
115 Application.EnableVisualStyles(); | |
116 Application.Run(new FrmMain(args)); | |
117 LogManager.GetLogger(typeof(FrmMain)).Info("Closing WarFoundry WinForms"); | |
118 } | |
119 catch (Exception ex) | |
120 { | |
121 LogManager.GetLogger(typeof(FrmMain)).Fatal(ex); | |
122 MessageBox.Show(null, "A major, unexpected and fatal error ocurred while starting the application: \r\n\r\n" + ex.Message + "\r\n\r\n" + ex.StackTrace, "Fatal error", MessageBoxButtons.OK, MessageBoxIcon.Error); | |
123 } | |
124 } | |
125 | |
126 public FrmMain(string[] args) | |
127 { | |
128 this.Closing+=new CancelEventHandler(FrmMain_Closing); | |
129 CommandStack.CommandStackUpdated += new MethodInvoker(commandStack_CommandStackUpdated); | |
130 | |
131 InitializeComponent(); | |
132 toolStripPanel.Join(mainToolStrip, 0, 0); | |
133 toolStripPanel.Join(catToolStrip, mainToolStrip.Right, 0); | |
134 | |
135 Preferences = new Preferences("WarFoundry"); | |
136 try | |
137 { | |
138 Translation.InitialiseTranslations(Constants.ExecutablePath, Preferences["language"].ToString()); | |
139 } | |
140 catch (TranslationLoadException ex) | |
141 { | |
142 log.Error("Translation loading failed for language " + Preferences["language"].ToString(), ex); | |
143 MessageBox.Show(this, "Translation loading failed for language " + Preferences["language"].ToString(), "Translation failure", MessageBoxButtons.OK, MessageBoxIcon.Error); | |
140
60c795eca8de
Re #265: Add language preference UI
IBBoard <dev@ibboard.co.uk>
parents:
137
diff
changeset
|
144 } |
60c795eca8de
Re #265: Add language preference UI
IBBoard <dev@ibboard.co.uk>
parents:
137
diff
changeset
|
145 |
60c795eca8de
Re #265: Add language preference UI
IBBoard <dev@ibboard.co.uk>
parents:
137
diff
changeset
|
146 Translation.TranslationChanged += new MethodInvoker(TranslationChanged); |
60c795eca8de
Re #265: Add language preference UI
IBBoard <dev@ibboard.co.uk>
parents:
137
diff
changeset
|
147 |
142 | 148 TranslateControls(); |
149 unitWindows = new Dictionary<string, FrmUnit>(); | |
150 | |
151 WarFoundryCore.GameSystemChanged+= new GameSystemChangedDelegate(FrmMain_GameSystemChanged); | |
152 WarFoundryCore.ArmyChanged += new ArmyChangedDelegate(FrmMain_ArmyChanged); | |
153 UnitAddedMethod = new ObjectAddDelegate(FrmMain_UnitAddedMethod); | |
154 UnitRemovedMethod = new ObjectRemoveDelegate(FrmMain_UnitRemovedMethod); | |
155 PointsValueChangedMethod = new DoubleValChangedDelegate(FrmMain_PointsValueChangedMethod); | |
156 //FailedUnitRequirementMethod = new FailedUnitRequirementDelegate(FrmMain_FailedUnitRequirement); | |
157 | |
190 | 158 |
142 | 159 sbErrorPanel.Color = Color.Red; |
190 | 160 SetPointsPanelToolTipText(); |
142 | 161 |
144
4023a9bdcb8b
Re #265: Add language preference UI
IBBoard <dev@ibboard.co.uk>
parents:
142
diff
changeset
|
162 // hack to load default files |
4023a9bdcb8b
Re #265: Add language preference UI
IBBoard <dev@ibboard.co.uk>
parents:
142
diff
changeset
|
163 WarFoundryLoader.GetDefault().AddLoadDirectory(new DirectoryInfo(Constants.ExecutablePath + Constants.DirectoryString + DefaultDataDir)); |
4023a9bdcb8b
Re #265: Add language preference UI
IBBoard <dev@ibboard.co.uk>
parents:
142
diff
changeset
|
164 WarFoundryLoader.GetDefault().RegisterFactory(WarFoundryXmlFactory.GetFactory()); |
142 | 165 WarFoundryLoader.GetDefault().FileLoadingFinished += FileLoadingFinished; |
193 | 166 WarFoundrySaver.SetFileSaver(new WarFoundryXmlFileSaver()); |
140
60c795eca8de
Re #265: Add language preference UI
IBBoard <dev@ibboard.co.uk>
parents:
137
diff
changeset
|
167 } |
60c795eca8de
Re #265: Add language preference UI
IBBoard <dev@ibboard.co.uk>
parents:
137
diff
changeset
|
168 |
159
964f946d3cac
Fixes #288: WarFoundry WinForms assumes that army tree will be open
IBBoard <dev@ibboard.co.uk>
parents:
158
diff
changeset
|
169 private FrmArmyTree GetArmyTree() |
964f946d3cac
Fixes #288: WarFoundry WinForms assumes that army tree will be open
IBBoard <dev@ibboard.co.uk>
parents:
158
diff
changeset
|
170 { |
964f946d3cac
Fixes #288: WarFoundry WinForms assumes that army tree will be open
IBBoard <dev@ibboard.co.uk>
parents:
158
diff
changeset
|
171 if (armyTree == null || armyTree.IsDisposed) |
964f946d3cac
Fixes #288: WarFoundry WinForms assumes that army tree will be open
IBBoard <dev@ibboard.co.uk>
parents:
158
diff
changeset
|
172 { |
964f946d3cac
Fixes #288: WarFoundry WinForms assumes that army tree will be open
IBBoard <dev@ibboard.co.uk>
parents:
158
diff
changeset
|
173 CreateArmyTree(); |
964f946d3cac
Fixes #288: WarFoundry WinForms assumes that army tree will be open
IBBoard <dev@ibboard.co.uk>
parents:
158
diff
changeset
|
174 } |
964f946d3cac
Fixes #288: WarFoundry WinForms assumes that army tree will be open
IBBoard <dev@ibboard.co.uk>
parents:
158
diff
changeset
|
175 |
964f946d3cac
Fixes #288: WarFoundry WinForms assumes that army tree will be open
IBBoard <dev@ibboard.co.uk>
parents:
158
diff
changeset
|
176 return armyTree; |
964f946d3cac
Fixes #288: WarFoundry WinForms assumes that army tree will be open
IBBoard <dev@ibboard.co.uk>
parents:
158
diff
changeset
|
177 } |
964f946d3cac
Fixes #288: WarFoundry WinForms assumes that army tree will be open
IBBoard <dev@ibboard.co.uk>
parents:
158
diff
changeset
|
178 |
964f946d3cac
Fixes #288: WarFoundry WinForms assumes that army tree will be open
IBBoard <dev@ibboard.co.uk>
parents:
158
diff
changeset
|
179 private void CreateArmyTree() |
964f946d3cac
Fixes #288: WarFoundry WinForms assumes that army tree will be open
IBBoard <dev@ibboard.co.uk>
parents:
158
diff
changeset
|
180 { |
964f946d3cac
Fixes #288: WarFoundry WinForms assumes that army tree will be open
IBBoard <dev@ibboard.co.uk>
parents:
158
diff
changeset
|
181 armyTree = new FrmArmyTree(CommandStack); |
964f946d3cac
Fixes #288: WarFoundry WinForms assumes that army tree will be open
IBBoard <dev@ibboard.co.uk>
parents:
158
diff
changeset
|
182 armyTree.MdiParent = this; |
964f946d3cac
Fixes #288: WarFoundry WinForms assumes that army tree will be open
IBBoard <dev@ibboard.co.uk>
parents:
158
diff
changeset
|
183 armyTree.StartPosition = FormStartPosition.Manual; |
964f946d3cac
Fixes #288: WarFoundry WinForms assumes that army tree will be open
IBBoard <dev@ibboard.co.uk>
parents:
158
diff
changeset
|
184 armyTree.Location = new Point(this.DisplayRectangle.Width - armyTree.Width - 10, 10); |
964f946d3cac
Fixes #288: WarFoundry WinForms assumes that army tree will be open
IBBoard <dev@ibboard.co.uk>
parents:
158
diff
changeset
|
185 } |
964f946d3cac
Fixes #288: WarFoundry WinForms assumes that army tree will be open
IBBoard <dev@ibboard.co.uk>
parents:
158
diff
changeset
|
186 |
140
60c795eca8de
Re #265: Add language preference UI
IBBoard <dev@ibboard.co.uk>
parents:
137
diff
changeset
|
187 private void TranslateControls() |
60c795eca8de
Re #265: Add language preference UI
IBBoard <dev@ibboard.co.uk>
parents:
137
diff
changeset
|
188 { |
60c795eca8de
Re #265: Add language preference UI
IBBoard <dev@ibboard.co.uk>
parents:
137
diff
changeset
|
189 ControlTranslator.TranslateControls(Controls); |
60c795eca8de
Re #265: Add language preference UI
IBBoard <dev@ibboard.co.uk>
parents:
137
diff
changeset
|
190 ControlTranslator.TranslateComponents(components.Components); |
60c795eca8de
Re #265: Add language preference UI
IBBoard <dev@ibboard.co.uk>
parents:
137
diff
changeset
|
191 ControlTranslator.TranslateComponent(openArmyDialog); |
60c795eca8de
Re #265: Add language preference UI
IBBoard <dev@ibboard.co.uk>
parents:
137
diff
changeset
|
192 ControlTranslator.TranslateComponent(saveArmyDialog); |
190 | 193 //translate pointspanel and tooltip |
194 SetPointsPanelToolTipText(); | |
195 SetPointsPanelText(); | |
196 } | |
140
60c795eca8de
Re #265: Add language preference UI
IBBoard <dev@ibboard.co.uk>
parents:
137
diff
changeset
|
197 |
60c795eca8de
Re #265: Add language preference UI
IBBoard <dev@ibboard.co.uk>
parents:
137
diff
changeset
|
198 void TranslationChanged() |
60c795eca8de
Re #265: Add language preference UI
IBBoard <dev@ibboard.co.uk>
parents:
137
diff
changeset
|
199 { |
60c795eca8de
Re #265: Add language preference UI
IBBoard <dev@ibboard.co.uk>
parents:
137
diff
changeset
|
200 TranslateControls(); |
142 | 201 } |
202 | |
203 public static string DataPath | |
204 { | |
205 get { return Constants.ExecutablePath+Constants.DirectoryChar+"data"; } | |
206 } | |
207 | |
208 public static String ArmiesPath | |
209 { | |
210 get { return Environment.GetFolderPath(Environment.SpecialFolder.Personal); } | |
211 } | |
212 | |
213 public Preferences Preferences | |
214 { | |
215 get { return preferences; } | |
216 set { preferences = value; } | |
217 } | |
218 | |
219 public CommandStack CommandStack | |
220 { | |
221 get | |
222 { | |
223 if (commandStack == null) | |
224 { | |
225 commandStack = new CommandStack(); | |
226 } | |
227 | |
228 return commandStack; | |
229 } | |
230 } | |
231 | |
232 /// <summary> | |
233 /// Clean up any resources being used. | |
234 /// </summary> | |
235 protected override void Dispose( bool disposing ) | |
236 { | |
237 if( disposing ) | |
238 { | |
239 if (components != null) | |
240 { | |
241 components.Dispose(); | |
242 } | |
243 } | |
244 base.Dispose( disposing ); | |
245 } | |
246 | |
247 #region Windows Form Designer generated code | |
248 /// <summary> | |
249 /// Required method for Designer support - do not modify | |
250 /// the contents of this method with the code editor. | |
251 /// </summary> | |
252 private void InitializeComponent() | |
140
60c795eca8de
Re #265: Add language preference UI
IBBoard <dev@ibboard.co.uk>
parents:
137
diff
changeset
|
253 { |
196
15148d255e50
* First stab at displaying new unit requirements
IBBoard <dev@ibboard.co.uk>
parents:
195
diff
changeset
|
254 this.components = new System.ComponentModel.Container(); |
15148d255e50
* First stab at displaying new unit requirements
IBBoard <dev@ibboard.co.uk>
parents:
195
diff
changeset
|
255 System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(FrmMain)); |
15148d255e50
* First stab at displaying new unit requirements
IBBoard <dev@ibboard.co.uk>
parents:
195
diff
changeset
|
256 this.undoMenu = new System.Windows.Forms.ContextMenu(); |
15148d255e50
* First stab at displaying new unit requirements
IBBoard <dev@ibboard.co.uk>
parents:
195
diff
changeset
|
257 this.redoMenu = new System.Windows.Forms.ContextMenu(); |
15148d255e50
* First stab at displaying new unit requirements
IBBoard <dev@ibboard.co.uk>
parents:
195
diff
changeset
|
258 this.mainMenu = new System.Windows.Forms.MainMenu(this.components); |
15148d255e50
* First stab at displaying new unit requirements
IBBoard <dev@ibboard.co.uk>
parents:
195
diff
changeset
|
259 this.openArmyDialog = new System.Windows.Forms.OpenFileDialog(); |
15148d255e50
* First stab at displaying new unit requirements
IBBoard <dev@ibboard.co.uk>
parents:
195
diff
changeset
|
260 this.saveArmyDialog = new System.Windows.Forms.SaveFileDialog(); |
15148d255e50
* First stab at displaying new unit requirements
IBBoard <dev@ibboard.co.uk>
parents:
195
diff
changeset
|
261 this.menuStrip = new System.Windows.Forms.MenuStrip(); |
15148d255e50
* First stab at displaying new unit requirements
IBBoard <dev@ibboard.co.uk>
parents:
195
diff
changeset
|
262 this.menuFile = new IBBoard.Windows.Forms.IBBToolStripMenuItem(); |
15148d255e50
* First stab at displaying new unit requirements
IBBoard <dev@ibboard.co.uk>
parents:
195
diff
changeset
|
263 this.miNewArmy = new IBBoard.Windows.Forms.IBBToolStripMenuItem(); |
15148d255e50
* First stab at displaying new unit requirements
IBBoard <dev@ibboard.co.uk>
parents:
195
diff
changeset
|
264 this.miOpenArmy = new IBBoard.Windows.Forms.IBBToolStripMenuItem(); |
15148d255e50
* First stab at displaying new unit requirements
IBBoard <dev@ibboard.co.uk>
parents:
195
diff
changeset
|
265 this.miSaveArmy = new IBBoard.Windows.Forms.IBBToolStripMenuItem(); |
15148d255e50
* First stab at displaying new unit requirements
IBBoard <dev@ibboard.co.uk>
parents:
195
diff
changeset
|
266 this.miSaveArmyAs = new IBBoard.Windows.Forms.IBBToolStripMenuItem(); |
15148d255e50
* First stab at displaying new unit requirements
IBBoard <dev@ibboard.co.uk>
parents:
195
diff
changeset
|
267 this.miExportArmyAs = new IBBoard.Windows.Forms.IBBToolStripMenuItem(); |
15148d255e50
* First stab at displaying new unit requirements
IBBoard <dev@ibboard.co.uk>
parents:
195
diff
changeset
|
268 this.miExportArmyAsBasicHTML = new IBBoard.Windows.Forms.IBBToolStripMenuItem(); |
15148d255e50
* First stab at displaying new unit requirements
IBBoard <dev@ibboard.co.uk>
parents:
195
diff
changeset
|
269 this.miCloseArmy = new IBBoard.Windows.Forms.IBBToolStripMenuItem(); |
15148d255e50
* First stab at displaying new unit requirements
IBBoard <dev@ibboard.co.uk>
parents:
195
diff
changeset
|
270 this.toolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator(); |
15148d255e50
* First stab at displaying new unit requirements
IBBoard <dev@ibboard.co.uk>
parents:
195
diff
changeset
|
271 this.miReloadFiles = new IBBoard.Windows.Forms.IBBToolStripMenuItem(); |
15148d255e50
* First stab at displaying new unit requirements
IBBoard <dev@ibboard.co.uk>
parents:
195
diff
changeset
|
272 this.toolStripSeparator2 = new System.Windows.Forms.ToolStripSeparator(); |
15148d255e50
* First stab at displaying new unit requirements
IBBoard <dev@ibboard.co.uk>
parents:
195
diff
changeset
|
273 this.miExit = new IBBoard.Windows.Forms.IBBToolStripMenuItem(); |
15148d255e50
* First stab at displaying new unit requirements
IBBoard <dev@ibboard.co.uk>
parents:
195
diff
changeset
|
274 this.menuEdit = new IBBoard.Windows.Forms.IBBToolStripMenuItem(); |
15148d255e50
* First stab at displaying new unit requirements
IBBoard <dev@ibboard.co.uk>
parents:
195
diff
changeset
|
275 this.miUndo = new IBBoard.Windows.Forms.IBBToolStripMenuItem(); |
15148d255e50
* First stab at displaying new unit requirements
IBBoard <dev@ibboard.co.uk>
parents:
195
diff
changeset
|
276 this.miRedo = new IBBoard.Windows.Forms.IBBToolStripMenuItem(); |
15148d255e50
* First stab at displaying new unit requirements
IBBoard <dev@ibboard.co.uk>
parents:
195
diff
changeset
|
277 this.toolStripSeparator4 = new System.Windows.Forms.ToolStripSeparator(); |
15148d255e50
* First stab at displaying new unit requirements
IBBoard <dev@ibboard.co.uk>
parents:
195
diff
changeset
|
278 this.miPreferences = new IBBoard.Windows.Forms.IBBToolStripMenuItem(); |
15148d255e50
* First stab at displaying new unit requirements
IBBoard <dev@ibboard.co.uk>
parents:
195
diff
changeset
|
279 this.menuHelp = new IBBoard.Windows.Forms.IBBToolStripMenuItem(); |
15148d255e50
* First stab at displaying new unit requirements
IBBoard <dev@ibboard.co.uk>
parents:
195
diff
changeset
|
280 this.miAbout = new IBBoard.Windows.Forms.IBBToolStripMenuItem(); |
15148d255e50
* First stab at displaying new unit requirements
IBBoard <dev@ibboard.co.uk>
parents:
195
diff
changeset
|
281 this.mainToolStrip = new System.Windows.Forms.ToolStrip(); |
15148d255e50
* First stab at displaying new unit requirements
IBBoard <dev@ibboard.co.uk>
parents:
195
diff
changeset
|
282 this.bttnNewArmy = new IBBoard.Windows.Forms.IBBToolStripButton(); |
15148d255e50
* First stab at displaying new unit requirements
IBBoard <dev@ibboard.co.uk>
parents:
195
diff
changeset
|
283 this.bttnOpenArmy = new IBBoard.Windows.Forms.IBBToolStripButton(); |
15148d255e50
* First stab at displaying new unit requirements
IBBoard <dev@ibboard.co.uk>
parents:
195
diff
changeset
|
284 this.bttnSaveArmy = new IBBoard.Windows.Forms.IBBToolStripButton(); |
15148d255e50
* First stab at displaying new unit requirements
IBBoard <dev@ibboard.co.uk>
parents:
195
diff
changeset
|
285 this.toolStripSeparator3 = new System.Windows.Forms.ToolStripSeparator(); |
15148d255e50
* First stab at displaying new unit requirements
IBBoard <dev@ibboard.co.uk>
parents:
195
diff
changeset
|
286 this.bttnUndo = new IBBoard.Windows.Forms.IBBToolStripSplitButton(); |
15148d255e50
* First stab at displaying new unit requirements
IBBoard <dev@ibboard.co.uk>
parents:
195
diff
changeset
|
287 this.bttnRedo = new IBBoard.Windows.Forms.IBBToolStripSplitButton(); |
15148d255e50
* First stab at displaying new unit requirements
IBBoard <dev@ibboard.co.uk>
parents:
195
diff
changeset
|
288 this.catToolStrip = new System.Windows.Forms.ToolStrip(); |
15148d255e50
* First stab at displaying new unit requirements
IBBoard <dev@ibboard.co.uk>
parents:
195
diff
changeset
|
289 this.statusBar = new IBBoard.Windows.Forms.ColorableStatusBar(); |
15148d255e50
* First stab at displaying new unit requirements
IBBoard <dev@ibboard.co.uk>
parents:
195
diff
changeset
|
290 this.sbMainPanel = new IBBoard.Windows.Forms.ColorableStatusBarPanel(); |
15148d255e50
* First stab at displaying new unit requirements
IBBoard <dev@ibboard.co.uk>
parents:
195
diff
changeset
|
291 this.sbErrorPanel = new IBBoard.Windows.Forms.ColorableStatusBarPanel(); |
15148d255e50
* First stab at displaying new unit requirements
IBBoard <dev@ibboard.co.uk>
parents:
195
diff
changeset
|
292 this.sbPointsPanel = new IBBoard.Windows.Forms.ColorableStatusBarPanel(); |
15148d255e50
* First stab at displaying new unit requirements
IBBoard <dev@ibboard.co.uk>
parents:
195
diff
changeset
|
293 this.toolStripPanel = new System.Windows.Forms.ToolStripPanel(); |
15148d255e50
* First stab at displaying new unit requirements
IBBoard <dev@ibboard.co.uk>
parents:
195
diff
changeset
|
294 this.menuStrip.SuspendLayout(); |
15148d255e50
* First stab at displaying new unit requirements
IBBoard <dev@ibboard.co.uk>
parents:
195
diff
changeset
|
295 this.mainToolStrip.SuspendLayout(); |
15148d255e50
* First stab at displaying new unit requirements
IBBoard <dev@ibboard.co.uk>
parents:
195
diff
changeset
|
296 ((System.ComponentModel.ISupportInitialize)(this.sbMainPanel)).BeginInit(); |
15148d255e50
* First stab at displaying new unit requirements
IBBoard <dev@ibboard.co.uk>
parents:
195
diff
changeset
|
297 ((System.ComponentModel.ISupportInitialize)(this.sbErrorPanel)).BeginInit(); |
15148d255e50
* First stab at displaying new unit requirements
IBBoard <dev@ibboard.co.uk>
parents:
195
diff
changeset
|
298 ((System.ComponentModel.ISupportInitialize)(this.sbPointsPanel)).BeginInit(); |
15148d255e50
* First stab at displaying new unit requirements
IBBoard <dev@ibboard.co.uk>
parents:
195
diff
changeset
|
299 this.SuspendLayout(); |
15148d255e50
* First stab at displaying new unit requirements
IBBoard <dev@ibboard.co.uk>
parents:
195
diff
changeset
|
300 // |
15148d255e50
* First stab at displaying new unit requirements
IBBoard <dev@ibboard.co.uk>
parents:
195
diff
changeset
|
301 // saveArmyDialog |
15148d255e50
* First stab at displaying new unit requirements
IBBoard <dev@ibboard.co.uk>
parents:
195
diff
changeset
|
302 // |
15148d255e50
* First stab at displaying new unit requirements
IBBoard <dev@ibboard.co.uk>
parents:
195
diff
changeset
|
303 this.saveArmyDialog.Title = "Translatable:saveArmyDialog"; |
15148d255e50
* First stab at displaying new unit requirements
IBBoard <dev@ibboard.co.uk>
parents:
195
diff
changeset
|
304 // |
15148d255e50
* First stab at displaying new unit requirements
IBBoard <dev@ibboard.co.uk>
parents:
195
diff
changeset
|
305 // menuStrip |
15148d255e50
* First stab at displaying new unit requirements
IBBoard <dev@ibboard.co.uk>
parents:
195
diff
changeset
|
306 // |
15148d255e50
* First stab at displaying new unit requirements
IBBoard <dev@ibboard.co.uk>
parents:
195
diff
changeset
|
307 this.menuStrip.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { |
140
60c795eca8de
Re #265: Add language preference UI
IBBoard <dev@ibboard.co.uk>
parents:
137
diff
changeset
|
308 this.menuFile, |
60c795eca8de
Re #265: Add language preference UI
IBBoard <dev@ibboard.co.uk>
parents:
137
diff
changeset
|
309 this.menuEdit, |
60c795eca8de
Re #265: Add language preference UI
IBBoard <dev@ibboard.co.uk>
parents:
137
diff
changeset
|
310 this.menuHelp}); |
196
15148d255e50
* First stab at displaying new unit requirements
IBBoard <dev@ibboard.co.uk>
parents:
195
diff
changeset
|
311 this.menuStrip.Location = new System.Drawing.Point(0, 0); |
15148d255e50
* First stab at displaying new unit requirements
IBBoard <dev@ibboard.co.uk>
parents:
195
diff
changeset
|
312 this.menuStrip.Name = "menuStrip"; |
15148d255e50
* First stab at displaying new unit requirements
IBBoard <dev@ibboard.co.uk>
parents:
195
diff
changeset
|
313 this.menuStrip.Size = new System.Drawing.Size(790, 24); |
15148d255e50
* First stab at displaying new unit requirements
IBBoard <dev@ibboard.co.uk>
parents:
195
diff
changeset
|
314 this.menuStrip.TabIndex = 6; |
15148d255e50
* First stab at displaying new unit requirements
IBBoard <dev@ibboard.co.uk>
parents:
195
diff
changeset
|
315 this.menuStrip.Text = "menuStrip1"; |
15148d255e50
* First stab at displaying new unit requirements
IBBoard <dev@ibboard.co.uk>
parents:
195
diff
changeset
|
316 // |
15148d255e50
* First stab at displaying new unit requirements
IBBoard <dev@ibboard.co.uk>
parents:
195
diff
changeset
|
317 // menuFile |
15148d255e50
* First stab at displaying new unit requirements
IBBoard <dev@ibboard.co.uk>
parents:
195
diff
changeset
|
318 // |
15148d255e50
* First stab at displaying new unit requirements
IBBoard <dev@ibboard.co.uk>
parents:
195
diff
changeset
|
319 this.menuFile.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { |
140
60c795eca8de
Re #265: Add language preference UI
IBBoard <dev@ibboard.co.uk>
parents:
137
diff
changeset
|
320 this.miNewArmy, |
60c795eca8de
Re #265: Add language preference UI
IBBoard <dev@ibboard.co.uk>
parents:
137
diff
changeset
|
321 this.miOpenArmy, |
60c795eca8de
Re #265: Add language preference UI
IBBoard <dev@ibboard.co.uk>
parents:
137
diff
changeset
|
322 this.miSaveArmy, |
60c795eca8de
Re #265: Add language preference UI
IBBoard <dev@ibboard.co.uk>
parents:
137
diff
changeset
|
323 this.miSaveArmyAs, |
60c795eca8de
Re #265: Add language preference UI
IBBoard <dev@ibboard.co.uk>
parents:
137
diff
changeset
|
324 this.miExportArmyAs, |
60c795eca8de
Re #265: Add language preference UI
IBBoard <dev@ibboard.co.uk>
parents:
137
diff
changeset
|
325 this.miCloseArmy, |
60c795eca8de
Re #265: Add language preference UI
IBBoard <dev@ibboard.co.uk>
parents:
137
diff
changeset
|
326 this.toolStripSeparator1, |
60c795eca8de
Re #265: Add language preference UI
IBBoard <dev@ibboard.co.uk>
parents:
137
diff
changeset
|
327 this.miReloadFiles, |
60c795eca8de
Re #265: Add language preference UI
IBBoard <dev@ibboard.co.uk>
parents:
137
diff
changeset
|
328 this.toolStripSeparator2, |
60c795eca8de
Re #265: Add language preference UI
IBBoard <dev@ibboard.co.uk>
parents:
137
diff
changeset
|
329 this.miExit}); |
196
15148d255e50
* First stab at displaying new unit requirements
IBBoard <dev@ibboard.co.uk>
parents:
195
diff
changeset
|
330 this.menuFile.Name = "menuFile"; |
15148d255e50
* First stab at displaying new unit requirements
IBBoard <dev@ibboard.co.uk>
parents:
195
diff
changeset
|
331 this.menuFile.Size = new System.Drawing.Size(33, 20); |
15148d255e50
* First stab at displaying new unit requirements
IBBoard <dev@ibboard.co.uk>
parents:
195
diff
changeset
|
332 this.menuFile.Text = "&file"; |
15148d255e50
* First stab at displaying new unit requirements
IBBoard <dev@ibboard.co.uk>
parents:
195
diff
changeset
|
333 // |
15148d255e50
* First stab at displaying new unit requirements
IBBoard <dev@ibboard.co.uk>
parents:
195
diff
changeset
|
334 // miNewArmy |
15148d255e50
* First stab at displaying new unit requirements
IBBoard <dev@ibboard.co.uk>
parents:
195
diff
changeset
|
335 // |
15148d255e50
* First stab at displaying new unit requirements
IBBoard <dev@ibboard.co.uk>
parents:
195
diff
changeset
|
336 this.miNewArmy.Name = "miNewArmy"; |
15148d255e50
* First stab at displaying new unit requirements
IBBoard <dev@ibboard.co.uk>
parents:
195
diff
changeset
|
337 this.miNewArmy.Size = new System.Drawing.Size(164, 22); |
15148d255e50
* First stab at displaying new unit requirements
IBBoard <dev@ibboard.co.uk>
parents:
195
diff
changeset
|
338 this.miNewArmy.Text = "&new army"; |
15148d255e50
* First stab at displaying new unit requirements
IBBoard <dev@ibboard.co.uk>
parents:
195
diff
changeset
|
339 this.miNewArmy.Click += new System.EventHandler(this.miNewArmy_Click); |
15148d255e50
* First stab at displaying new unit requirements
IBBoard <dev@ibboard.co.uk>
parents:
195
diff
changeset
|
340 // |
15148d255e50
* First stab at displaying new unit requirements
IBBoard <dev@ibboard.co.uk>
parents:
195
diff
changeset
|
341 // miOpenArmy |
15148d255e50
* First stab at displaying new unit requirements
IBBoard <dev@ibboard.co.uk>
parents:
195
diff
changeset
|
342 // |
15148d255e50
* First stab at displaying new unit requirements
IBBoard <dev@ibboard.co.uk>
parents:
195
diff
changeset
|
343 this.miOpenArmy.Name = "miOpenArmy"; |
15148d255e50
* First stab at displaying new unit requirements
IBBoard <dev@ibboard.co.uk>
parents:
195
diff
changeset
|
344 this.miOpenArmy.Size = new System.Drawing.Size(164, 22); |
15148d255e50
* First stab at displaying new unit requirements
IBBoard <dev@ibboard.co.uk>
parents:
195
diff
changeset
|
345 this.miOpenArmy.Text = "&open army"; |
15148d255e50
* First stab at displaying new unit requirements
IBBoard <dev@ibboard.co.uk>
parents:
195
diff
changeset
|
346 this.miOpenArmy.Click += new System.EventHandler(this.miOpenArmy_Click); |
15148d255e50
* First stab at displaying new unit requirements
IBBoard <dev@ibboard.co.uk>
parents:
195
diff
changeset
|
347 // |
15148d255e50
* First stab at displaying new unit requirements
IBBoard <dev@ibboard.co.uk>
parents:
195
diff
changeset
|
348 // miSaveArmy |
15148d255e50
* First stab at displaying new unit requirements
IBBoard <dev@ibboard.co.uk>
parents:
195
diff
changeset
|
349 // |
15148d255e50
* First stab at displaying new unit requirements
IBBoard <dev@ibboard.co.uk>
parents:
195
diff
changeset
|
350 this.miSaveArmy.Enabled = false; |
15148d255e50
* First stab at displaying new unit requirements
IBBoard <dev@ibboard.co.uk>
parents:
195
diff
changeset
|
351 this.miSaveArmy.Name = "miSaveArmy"; |
15148d255e50
* First stab at displaying new unit requirements
IBBoard <dev@ibboard.co.uk>
parents:
195
diff
changeset
|
352 this.miSaveArmy.Size = new System.Drawing.Size(164, 22); |
15148d255e50
* First stab at displaying new unit requirements
IBBoard <dev@ibboard.co.uk>
parents:
195
diff
changeset
|
353 this.miSaveArmy.Text = "&save army"; |
15148d255e50
* First stab at displaying new unit requirements
IBBoard <dev@ibboard.co.uk>
parents:
195
diff
changeset
|
354 this.miSaveArmy.Click += new System.EventHandler(this.miSaveArmy_Click); |
15148d255e50
* First stab at displaying new unit requirements
IBBoard <dev@ibboard.co.uk>
parents:
195
diff
changeset
|
355 // |
15148d255e50
* First stab at displaying new unit requirements
IBBoard <dev@ibboard.co.uk>
parents:
195
diff
changeset
|
356 // miSaveArmyAs |
15148d255e50
* First stab at displaying new unit requirements
IBBoard <dev@ibboard.co.uk>
parents:
195
diff
changeset
|
357 // |
15148d255e50
* First stab at displaying new unit requirements
IBBoard <dev@ibboard.co.uk>
parents:
195
diff
changeset
|
358 this.miSaveArmyAs.Enabled = false; |
15148d255e50
* First stab at displaying new unit requirements
IBBoard <dev@ibboard.co.uk>
parents:
195
diff
changeset
|
359 this.miSaveArmyAs.Name = "miSaveArmyAs"; |
15148d255e50
* First stab at displaying new unit requirements
IBBoard <dev@ibboard.co.uk>
parents:
195
diff
changeset
|
360 this.miSaveArmyAs.Size = new System.Drawing.Size(164, 22); |
15148d255e50
* First stab at displaying new unit requirements
IBBoard <dev@ibboard.co.uk>
parents:
195
diff
changeset
|
361 this.miSaveArmyAs.Text = "save army &as..."; |
15148d255e50
* First stab at displaying new unit requirements
IBBoard <dev@ibboard.co.uk>
parents:
195
diff
changeset
|
362 this.miSaveArmyAs.Click += new System.EventHandler(this.miSaveArmyAs_Click); |
15148d255e50
* First stab at displaying new unit requirements
IBBoard <dev@ibboard.co.uk>
parents:
195
diff
changeset
|
363 // |
15148d255e50
* First stab at displaying new unit requirements
IBBoard <dev@ibboard.co.uk>
parents:
195
diff
changeset
|
364 // miExportArmyAs |
15148d255e50
* First stab at displaying new unit requirements
IBBoard <dev@ibboard.co.uk>
parents:
195
diff
changeset
|
365 // |
15148d255e50
* First stab at displaying new unit requirements
IBBoard <dev@ibboard.co.uk>
parents:
195
diff
changeset
|
366 this.miExportArmyAs.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { |
140
60c795eca8de
Re #265: Add language preference UI
IBBoard <dev@ibboard.co.uk>
parents:
137
diff
changeset
|
367 this.miExportArmyAsBasicHTML}); |
196
15148d255e50
* First stab at displaying new unit requirements
IBBoard <dev@ibboard.co.uk>
parents:
195
diff
changeset
|
368 this.miExportArmyAs.Enabled = false; |
15148d255e50
* First stab at displaying new unit requirements
IBBoard <dev@ibboard.co.uk>
parents:
195
diff
changeset
|
369 this.miExportArmyAs.Name = "miExportArmyAs"; |
15148d255e50
* First stab at displaying new unit requirements
IBBoard <dev@ibboard.co.uk>
parents:
195
diff
changeset
|
370 this.miExportArmyAs.Size = new System.Drawing.Size(164, 22); |
15148d255e50
* First stab at displaying new unit requirements
IBBoard <dev@ibboard.co.uk>
parents:
195
diff
changeset
|
371 this.miExportArmyAs.Text = "export army as..."; |
15148d255e50
* First stab at displaying new unit requirements
IBBoard <dev@ibboard.co.uk>
parents:
195
diff
changeset
|
372 // |
15148d255e50
* First stab at displaying new unit requirements
IBBoard <dev@ibboard.co.uk>
parents:
195
diff
changeset
|
373 // miExportArmyAsBasicHTML |
15148d255e50
* First stab at displaying new unit requirements
IBBoard <dev@ibboard.co.uk>
parents:
195
diff
changeset
|
374 // |
15148d255e50
* First stab at displaying new unit requirements
IBBoard <dev@ibboard.co.uk>
parents:
195
diff
changeset
|
375 this.miExportArmyAsBasicHTML.Name = "miExportArmyAsBasicHTML"; |
15148d255e50
* First stab at displaying new unit requirements
IBBoard <dev@ibboard.co.uk>
parents:
195
diff
changeset
|
376 this.miExportArmyAsBasicHTML.Size = new System.Drawing.Size(130, 22); |
15148d255e50
* First stab at displaying new unit requirements
IBBoard <dev@ibboard.co.uk>
parents:
195
diff
changeset
|
377 this.miExportArmyAsBasicHTML.Text = "&basic html"; |
15148d255e50
* First stab at displaying new unit requirements
IBBoard <dev@ibboard.co.uk>
parents:
195
diff
changeset
|
378 this.miExportArmyAsBasicHTML.Click += new System.EventHandler(this.miExportArmyAsBasicHTML_Click); |
15148d255e50
* First stab at displaying new unit requirements
IBBoard <dev@ibboard.co.uk>
parents:
195
diff
changeset
|
379 // |
15148d255e50
* First stab at displaying new unit requirements
IBBoard <dev@ibboard.co.uk>
parents:
195
diff
changeset
|
380 // miCloseArmy |
15148d255e50
* First stab at displaying new unit requirements
IBBoard <dev@ibboard.co.uk>
parents:
195
diff
changeset
|
381 // |
15148d255e50
* First stab at displaying new unit requirements
IBBoard <dev@ibboard.co.uk>
parents:
195
diff
changeset
|
382 this.miCloseArmy.Enabled = false; |
15148d255e50
* First stab at displaying new unit requirements
IBBoard <dev@ibboard.co.uk>
parents:
195
diff
changeset
|
383 this.miCloseArmy.Name = "miCloseArmy"; |
15148d255e50
* First stab at displaying new unit requirements
IBBoard <dev@ibboard.co.uk>
parents:
195
diff
changeset
|
384 this.miCloseArmy.Size = new System.Drawing.Size(164, 22); |
15148d255e50
* First stab at displaying new unit requirements
IBBoard <dev@ibboard.co.uk>
parents:
195
diff
changeset
|
385 this.miCloseArmy.Text = "&close army"; |
15148d255e50
* First stab at displaying new unit requirements
IBBoard <dev@ibboard.co.uk>
parents:
195
diff
changeset
|
386 this.miCloseArmy.Click += new System.EventHandler(this.miCloseArmy_Click); |
15148d255e50
* First stab at displaying new unit requirements
IBBoard <dev@ibboard.co.uk>
parents:
195
diff
changeset
|
387 // |
15148d255e50
* First stab at displaying new unit requirements
IBBoard <dev@ibboard.co.uk>
parents:
195
diff
changeset
|
388 // toolStripSeparator1 |
15148d255e50
* First stab at displaying new unit requirements
IBBoard <dev@ibboard.co.uk>
parents:
195
diff
changeset
|
389 // |
15148d255e50
* First stab at displaying new unit requirements
IBBoard <dev@ibboard.co.uk>
parents:
195
diff
changeset
|
390 this.toolStripSeparator1.Name = "toolStripSeparator1"; |
15148d255e50
* First stab at displaying new unit requirements
IBBoard <dev@ibboard.co.uk>
parents:
195
diff
changeset
|
391 this.toolStripSeparator1.Size = new System.Drawing.Size(161, 6); |
15148d255e50
* First stab at displaying new unit requirements
IBBoard <dev@ibboard.co.uk>
parents:
195
diff
changeset
|
392 // |
15148d255e50
* First stab at displaying new unit requirements
IBBoard <dev@ibboard.co.uk>
parents:
195
diff
changeset
|
393 // miReloadFiles |
15148d255e50
* First stab at displaying new unit requirements
IBBoard <dev@ibboard.co.uk>
parents:
195
diff
changeset
|
394 // |
15148d255e50
* First stab at displaying new unit requirements
IBBoard <dev@ibboard.co.uk>
parents:
195
diff
changeset
|
395 this.miReloadFiles.Name = "miReloadFiles"; |
15148d255e50
* First stab at displaying new unit requirements
IBBoard <dev@ibboard.co.uk>
parents:
195
diff
changeset
|
396 this.miReloadFiles.Size = new System.Drawing.Size(164, 22); |
15148d255e50
* First stab at displaying new unit requirements
IBBoard <dev@ibboard.co.uk>
parents:
195
diff
changeset
|
397 this.miReloadFiles.Text = "&reload files"; |
15148d255e50
* First stab at displaying new unit requirements
IBBoard <dev@ibboard.co.uk>
parents:
195
diff
changeset
|
398 this.miReloadFiles.Click += new System.EventHandler(this.miReloadFiles_Click); |
15148d255e50
* First stab at displaying new unit requirements
IBBoard <dev@ibboard.co.uk>
parents:
195
diff
changeset
|
399 // |
15148d255e50
* First stab at displaying new unit requirements
IBBoard <dev@ibboard.co.uk>
parents:
195
diff
changeset
|
400 // toolStripSeparator2 |
15148d255e50
* First stab at displaying new unit requirements
IBBoard <dev@ibboard.co.uk>
parents:
195
diff
changeset
|
401 // |
15148d255e50
* First stab at displaying new unit requirements
IBBoard <dev@ibboard.co.uk>
parents:
195
diff
changeset
|
402 this.toolStripSeparator2.Name = "toolStripSeparator2"; |
15148d255e50
* First stab at displaying new unit requirements
IBBoard <dev@ibboard.co.uk>
parents:
195
diff
changeset
|
403 this.toolStripSeparator2.Size = new System.Drawing.Size(161, 6); |
15148d255e50
* First stab at displaying new unit requirements
IBBoard <dev@ibboard.co.uk>
parents:
195
diff
changeset
|
404 // |
15148d255e50
* First stab at displaying new unit requirements
IBBoard <dev@ibboard.co.uk>
parents:
195
diff
changeset
|
405 // miExit |
15148d255e50
* First stab at displaying new unit requirements
IBBoard <dev@ibboard.co.uk>
parents:
195
diff
changeset
|
406 // |
15148d255e50
* First stab at displaying new unit requirements
IBBoard <dev@ibboard.co.uk>
parents:
195
diff
changeset
|
407 this.miExit.Name = "miExit"; |
15148d255e50
* First stab at displaying new unit requirements
IBBoard <dev@ibboard.co.uk>
parents:
195
diff
changeset
|
408 this.miExit.Size = new System.Drawing.Size(164, 22); |
15148d255e50
* First stab at displaying new unit requirements
IBBoard <dev@ibboard.co.uk>
parents:
195
diff
changeset
|
409 this.miExit.Text = "e&xit"; |
15148d255e50
* First stab at displaying new unit requirements
IBBoard <dev@ibboard.co.uk>
parents:
195
diff
changeset
|
410 this.miExit.Click += new System.EventHandler(this.miExit_Click); |
15148d255e50
* First stab at displaying new unit requirements
IBBoard <dev@ibboard.co.uk>
parents:
195
diff
changeset
|
411 // |
15148d255e50
* First stab at displaying new unit requirements
IBBoard <dev@ibboard.co.uk>
parents:
195
diff
changeset
|
412 // menuEdit |
15148d255e50
* First stab at displaying new unit requirements
IBBoard <dev@ibboard.co.uk>
parents:
195
diff
changeset
|
413 // |
15148d255e50
* First stab at displaying new unit requirements
IBBoard <dev@ibboard.co.uk>
parents:
195
diff
changeset
|
414 this.menuEdit.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { |
140
60c795eca8de
Re #265: Add language preference UI
IBBoard <dev@ibboard.co.uk>
parents:
137
diff
changeset
|
415 this.miUndo, |
60c795eca8de
Re #265: Add language preference UI
IBBoard <dev@ibboard.co.uk>
parents:
137
diff
changeset
|
416 this.miRedo, |
60c795eca8de
Re #265: Add language preference UI
IBBoard <dev@ibboard.co.uk>
parents:
137
diff
changeset
|
417 this.toolStripSeparator4, |
60c795eca8de
Re #265: Add language preference UI
IBBoard <dev@ibboard.co.uk>
parents:
137
diff
changeset
|
418 this.miPreferences}); |
196
15148d255e50
* First stab at displaying new unit requirements
IBBoard <dev@ibboard.co.uk>
parents:
195
diff
changeset
|
419 this.menuEdit.Name = "menuEdit"; |
15148d255e50
* First stab at displaying new unit requirements
IBBoard <dev@ibboard.co.uk>
parents:
195
diff
changeset
|
420 this.menuEdit.Size = new System.Drawing.Size(36, 20); |
15148d255e50
* First stab at displaying new unit requirements
IBBoard <dev@ibboard.co.uk>
parents:
195
diff
changeset
|
421 this.menuEdit.Text = "&edit"; |
15148d255e50
* First stab at displaying new unit requirements
IBBoard <dev@ibboard.co.uk>
parents:
195
diff
changeset
|
422 // |
15148d255e50
* First stab at displaying new unit requirements
IBBoard <dev@ibboard.co.uk>
parents:
195
diff
changeset
|
423 // miUndo |
15148d255e50
* First stab at displaying new unit requirements
IBBoard <dev@ibboard.co.uk>
parents:
195
diff
changeset
|
424 // |
15148d255e50
* First stab at displaying new unit requirements
IBBoard <dev@ibboard.co.uk>
parents:
195
diff
changeset
|
425 this.miUndo.Enabled = false; |
15148d255e50
* First stab at displaying new unit requirements
IBBoard <dev@ibboard.co.uk>
parents:
195
diff
changeset
|
426 this.miUndo.Name = "miUndo"; |
15148d255e50
* First stab at displaying new unit requirements
IBBoard <dev@ibboard.co.uk>
parents:
195
diff
changeset
|
427 this.miUndo.Size = new System.Drawing.Size(142, 22); |
15148d255e50
* First stab at displaying new unit requirements
IBBoard <dev@ibboard.co.uk>
parents:
195
diff
changeset
|
428 this.miUndo.Text = "&undo"; |
15148d255e50
* First stab at displaying new unit requirements
IBBoard <dev@ibboard.co.uk>
parents:
195
diff
changeset
|
429 this.miUndo.Click += new System.EventHandler(this.miUndo_Click); |
15148d255e50
* First stab at displaying new unit requirements
IBBoard <dev@ibboard.co.uk>
parents:
195
diff
changeset
|
430 // |
15148d255e50
* First stab at displaying new unit requirements
IBBoard <dev@ibboard.co.uk>
parents:
195
diff
changeset
|
431 // miRedo |
15148d255e50
* First stab at displaying new unit requirements
IBBoard <dev@ibboard.co.uk>
parents:
195
diff
changeset
|
432 // |
15148d255e50
* First stab at displaying new unit requirements
IBBoard <dev@ibboard.co.uk>
parents:
195
diff
changeset
|
433 this.miRedo.Enabled = false; |
15148d255e50
* First stab at displaying new unit requirements
IBBoard <dev@ibboard.co.uk>
parents:
195
diff
changeset
|
434 this.miRedo.Name = "miRedo"; |
15148d255e50
* First stab at displaying new unit requirements
IBBoard <dev@ibboard.co.uk>
parents:
195
diff
changeset
|
435 this.miRedo.Size = new System.Drawing.Size(142, 22); |
15148d255e50
* First stab at displaying new unit requirements
IBBoard <dev@ibboard.co.uk>
parents:
195
diff
changeset
|
436 this.miRedo.Text = "&redo"; |
15148d255e50
* First stab at displaying new unit requirements
IBBoard <dev@ibboard.co.uk>
parents:
195
diff
changeset
|
437 this.miRedo.Click += new System.EventHandler(this.miRedo_Click); |
15148d255e50
* First stab at displaying new unit requirements
IBBoard <dev@ibboard.co.uk>
parents:
195
diff
changeset
|
438 // |
15148d255e50
* First stab at displaying new unit requirements
IBBoard <dev@ibboard.co.uk>
parents:
195
diff
changeset
|
439 // toolStripSeparator4 |
15148d255e50
* First stab at displaying new unit requirements
IBBoard <dev@ibboard.co.uk>
parents:
195
diff
changeset
|
440 // |
15148d255e50
* First stab at displaying new unit requirements
IBBoard <dev@ibboard.co.uk>
parents:
195
diff
changeset
|
441 this.toolStripSeparator4.Name = "toolStripSeparator4"; |
15148d255e50
* First stab at displaying new unit requirements
IBBoard <dev@ibboard.co.uk>
parents:
195
diff
changeset
|
442 this.toolStripSeparator4.Size = new System.Drawing.Size(139, 6); |
15148d255e50
* First stab at displaying new unit requirements
IBBoard <dev@ibboard.co.uk>
parents:
195
diff
changeset
|
443 // |
15148d255e50
* First stab at displaying new unit requirements
IBBoard <dev@ibboard.co.uk>
parents:
195
diff
changeset
|
444 // miPreferences |
15148d255e50
* First stab at displaying new unit requirements
IBBoard <dev@ibboard.co.uk>
parents:
195
diff
changeset
|
445 // |
15148d255e50
* First stab at displaying new unit requirements
IBBoard <dev@ibboard.co.uk>
parents:
195
diff
changeset
|
446 this.miPreferences.Name = "miPreferences"; |
15148d255e50
* First stab at displaying new unit requirements
IBBoard <dev@ibboard.co.uk>
parents:
195
diff
changeset
|
447 this.miPreferences.Size = new System.Drawing.Size(142, 22); |
15148d255e50
* First stab at displaying new unit requirements
IBBoard <dev@ibboard.co.uk>
parents:
195
diff
changeset
|
448 this.miPreferences.Text = "&preferences"; |
15148d255e50
* First stab at displaying new unit requirements
IBBoard <dev@ibboard.co.uk>
parents:
195
diff
changeset
|
449 this.miPreferences.Click += new System.EventHandler(this.miPreferences_Click); |
15148d255e50
* First stab at displaying new unit requirements
IBBoard <dev@ibboard.co.uk>
parents:
195
diff
changeset
|
450 // |
15148d255e50
* First stab at displaying new unit requirements
IBBoard <dev@ibboard.co.uk>
parents:
195
diff
changeset
|
451 // menuHelp |
15148d255e50
* First stab at displaying new unit requirements
IBBoard <dev@ibboard.co.uk>
parents:
195
diff
changeset
|
452 // |
15148d255e50
* First stab at displaying new unit requirements
IBBoard <dev@ibboard.co.uk>
parents:
195
diff
changeset
|
453 this.menuHelp.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { |
140
60c795eca8de
Re #265: Add language preference UI
IBBoard <dev@ibboard.co.uk>
parents:
137
diff
changeset
|
454 this.miAbout}); |
196
15148d255e50
* First stab at displaying new unit requirements
IBBoard <dev@ibboard.co.uk>
parents:
195
diff
changeset
|
455 this.menuHelp.Name = "menuHelp"; |
15148d255e50
* First stab at displaying new unit requirements
IBBoard <dev@ibboard.co.uk>
parents:
195
diff
changeset
|
456 this.menuHelp.Size = new System.Drawing.Size(39, 20); |
15148d255e50
* First stab at displaying new unit requirements
IBBoard <dev@ibboard.co.uk>
parents:
195
diff
changeset
|
457 this.menuHelp.Text = "&help"; |
15148d255e50
* First stab at displaying new unit requirements
IBBoard <dev@ibboard.co.uk>
parents:
195
diff
changeset
|
458 // |
15148d255e50
* First stab at displaying new unit requirements
IBBoard <dev@ibboard.co.uk>
parents:
195
diff
changeset
|
459 // miAbout |
15148d255e50
* First stab at displaying new unit requirements
IBBoard <dev@ibboard.co.uk>
parents:
195
diff
changeset
|
460 // |
15148d255e50
* First stab at displaying new unit requirements
IBBoard <dev@ibboard.co.uk>
parents:
195
diff
changeset
|
461 this.miAbout.Name = "miAbout"; |
15148d255e50
* First stab at displaying new unit requirements
IBBoard <dev@ibboard.co.uk>
parents:
195
diff
changeset
|
462 this.miAbout.Size = new System.Drawing.Size(109, 22); |
15148d255e50
* First stab at displaying new unit requirements
IBBoard <dev@ibboard.co.uk>
parents:
195
diff
changeset
|
463 this.miAbout.Text = "&about"; |
15148d255e50
* First stab at displaying new unit requirements
IBBoard <dev@ibboard.co.uk>
parents:
195
diff
changeset
|
464 this.miAbout.Click += new System.EventHandler(this.miAbout_Click); |
15148d255e50
* First stab at displaying new unit requirements
IBBoard <dev@ibboard.co.uk>
parents:
195
diff
changeset
|
465 // |
15148d255e50
* First stab at displaying new unit requirements
IBBoard <dev@ibboard.co.uk>
parents:
195
diff
changeset
|
466 // mainToolStrip |
15148d255e50
* First stab at displaying new unit requirements
IBBoard <dev@ibboard.co.uk>
parents:
195
diff
changeset
|
467 // |
15148d255e50
* First stab at displaying new unit requirements
IBBoard <dev@ibboard.co.uk>
parents:
195
diff
changeset
|
468 this.mainToolStrip.Dock = System.Windows.Forms.DockStyle.None; |
15148d255e50
* First stab at displaying new unit requirements
IBBoard <dev@ibboard.co.uk>
parents:
195
diff
changeset
|
469 this.mainToolStrip.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { |
140
60c795eca8de
Re #265: Add language preference UI
IBBoard <dev@ibboard.co.uk>
parents:
137
diff
changeset
|
470 this.bttnNewArmy, |
60c795eca8de
Re #265: Add language preference UI
IBBoard <dev@ibboard.co.uk>
parents:
137
diff
changeset
|
471 this.bttnOpenArmy, |
60c795eca8de
Re #265: Add language preference UI
IBBoard <dev@ibboard.co.uk>
parents:
137
diff
changeset
|
472 this.bttnSaveArmy, |
60c795eca8de
Re #265: Add language preference UI
IBBoard <dev@ibboard.co.uk>
parents:
137
diff
changeset
|
473 this.toolStripSeparator3, |
60c795eca8de
Re #265: Add language preference UI
IBBoard <dev@ibboard.co.uk>
parents:
137
diff
changeset
|
474 this.bttnUndo, |
60c795eca8de
Re #265: Add language preference UI
IBBoard <dev@ibboard.co.uk>
parents:
137
diff
changeset
|
475 this.bttnRedo}); |
196
15148d255e50
* First stab at displaying new unit requirements
IBBoard <dev@ibboard.co.uk>
parents:
195
diff
changeset
|
476 this.mainToolStrip.Location = new System.Drawing.Point(0, 24); |
15148d255e50
* First stab at displaying new unit requirements
IBBoard <dev@ibboard.co.uk>
parents:
195
diff
changeset
|
477 this.mainToolStrip.Name = "mainToolStrip"; |
15148d255e50
* First stab at displaying new unit requirements
IBBoard <dev@ibboard.co.uk>
parents:
195
diff
changeset
|
478 this.mainToolStrip.Size = new System.Drawing.Size(182, 25); |
15148d255e50
* First stab at displaying new unit requirements
IBBoard <dev@ibboard.co.uk>
parents:
195
diff
changeset
|
479 this.mainToolStrip.TabIndex = 8; |
15148d255e50
* First stab at displaying new unit requirements
IBBoard <dev@ibboard.co.uk>
parents:
195
diff
changeset
|
480 // |
15148d255e50
* First stab at displaying new unit requirements
IBBoard <dev@ibboard.co.uk>
parents:
195
diff
changeset
|
481 // bttnNewArmy |
15148d255e50
* First stab at displaying new unit requirements
IBBoard <dev@ibboard.co.uk>
parents:
195
diff
changeset
|
482 // |
15148d255e50
* First stab at displaying new unit requirements
IBBoard <dev@ibboard.co.uk>
parents:
195
diff
changeset
|
483 this.bttnNewArmy.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; |
15148d255e50
* First stab at displaying new unit requirements
IBBoard <dev@ibboard.co.uk>
parents:
195
diff
changeset
|
484 this.bttnNewArmy.Image = global::IBBoard.WarFoundry.GUI.WinForms.Properties.Resources.document_new; |
15148d255e50
* First stab at displaying new unit requirements
IBBoard <dev@ibboard.co.uk>
parents:
195
diff
changeset
|
485 this.bttnNewArmy.ImageTransparentColor = System.Drawing.Color.Magenta; |
15148d255e50
* First stab at displaying new unit requirements
IBBoard <dev@ibboard.co.uk>
parents:
195
diff
changeset
|
486 this.bttnNewArmy.Name = "bttnNewArmy"; |
15148d255e50
* First stab at displaying new unit requirements
IBBoard <dev@ibboard.co.uk>
parents:
195
diff
changeset
|
487 this.bttnNewArmy.Size = new System.Drawing.Size(23, 22); |
15148d255e50
* First stab at displaying new unit requirements
IBBoard <dev@ibboard.co.uk>
parents:
195
diff
changeset
|
488 this.bttnNewArmy.Text = "new army"; |
15148d255e50
* First stab at displaying new unit requirements
IBBoard <dev@ibboard.co.uk>
parents:
195
diff
changeset
|
489 this.bttnNewArmy.Click += new System.EventHandler(this.miNewArmy_Click); |
15148d255e50
* First stab at displaying new unit requirements
IBBoard <dev@ibboard.co.uk>
parents:
195
diff
changeset
|
490 // |
15148d255e50
* First stab at displaying new unit requirements
IBBoard <dev@ibboard.co.uk>
parents:
195
diff
changeset
|
491 // bttnOpenArmy |
15148d255e50
* First stab at displaying new unit requirements
IBBoard <dev@ibboard.co.uk>
parents:
195
diff
changeset
|
492 // |
15148d255e50
* First stab at displaying new unit requirements
IBBoard <dev@ibboard.co.uk>
parents:
195
diff
changeset
|
493 this.bttnOpenArmy.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; |
15148d255e50
* First stab at displaying new unit requirements
IBBoard <dev@ibboard.co.uk>
parents:
195
diff
changeset
|
494 this.bttnOpenArmy.Image = global::IBBoard.WarFoundry.GUI.WinForms.Properties.Resources.document_open; |
15148d255e50
* First stab at displaying new unit requirements
IBBoard <dev@ibboard.co.uk>
parents:
195
diff
changeset
|
495 this.bttnOpenArmy.ImageTransparentColor = System.Drawing.Color.Magenta; |
15148d255e50
* First stab at displaying new unit requirements
IBBoard <dev@ibboard.co.uk>
parents:
195
diff
changeset
|
496 this.bttnOpenArmy.Name = "bttnOpenArmy"; |
15148d255e50
* First stab at displaying new unit requirements
IBBoard <dev@ibboard.co.uk>
parents:
195
diff
changeset
|
497 this.bttnOpenArmy.Size = new System.Drawing.Size(23, 22); |
15148d255e50
* First stab at displaying new unit requirements
IBBoard <dev@ibboard.co.uk>
parents:
195
diff
changeset
|
498 this.bttnOpenArmy.Text = "open army"; |
15148d255e50
* First stab at displaying new unit requirements
IBBoard <dev@ibboard.co.uk>
parents:
195
diff
changeset
|
499 this.bttnOpenArmy.Click += new System.EventHandler(this.miOpenArmy_Click); |
15148d255e50
* First stab at displaying new unit requirements
IBBoard <dev@ibboard.co.uk>
parents:
195
diff
changeset
|
500 // |
15148d255e50
* First stab at displaying new unit requirements
IBBoard <dev@ibboard.co.uk>
parents:
195
diff
changeset
|
501 // bttnSaveArmy |
15148d255e50
* First stab at displaying new unit requirements
IBBoard <dev@ibboard.co.uk>
parents:
195
diff
changeset
|
502 // |
15148d255e50
* First stab at displaying new unit requirements
IBBoard <dev@ibboard.co.uk>
parents:
195
diff
changeset
|
503 this.bttnSaveArmy.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; |
15148d255e50
* First stab at displaying new unit requirements
IBBoard <dev@ibboard.co.uk>
parents:
195
diff
changeset
|
504 this.bttnSaveArmy.Enabled = false; |
15148d255e50
* First stab at displaying new unit requirements
IBBoard <dev@ibboard.co.uk>
parents:
195
diff
changeset
|
505 this.bttnSaveArmy.Image = global::IBBoard.WarFoundry.GUI.WinForms.Properties.Resources.document_save; |
15148d255e50
* First stab at displaying new unit requirements
IBBoard <dev@ibboard.co.uk>
parents:
195
diff
changeset
|
506 this.bttnSaveArmy.ImageTransparentColor = System.Drawing.Color.Magenta; |
15148d255e50
* First stab at displaying new unit requirements
IBBoard <dev@ibboard.co.uk>
parents:
195
diff
changeset
|
507 this.bttnSaveArmy.Name = "bttnSaveArmy"; |
15148d255e50
* First stab at displaying new unit requirements
IBBoard <dev@ibboard.co.uk>
parents:
195
diff
changeset
|
508 this.bttnSaveArmy.Size = new System.Drawing.Size(23, 22); |
15148d255e50
* First stab at displaying new unit requirements
IBBoard <dev@ibboard.co.uk>
parents:
195
diff
changeset
|
509 this.bttnSaveArmy.Text = "save army"; |
15148d255e50
* First stab at displaying new unit requirements
IBBoard <dev@ibboard.co.uk>
parents:
195
diff
changeset
|
510 this.bttnSaveArmy.Click += new System.EventHandler(this.miSaveArmy_Click); |
15148d255e50
* First stab at displaying new unit requirements
IBBoard <dev@ibboard.co.uk>
parents:
195
diff
changeset
|
511 // |
15148d255e50
* First stab at displaying new unit requirements
IBBoard <dev@ibboard.co.uk>
parents:
195
diff
changeset
|
512 // toolStripSeparator3 |
15148d255e50
* First stab at displaying new unit requirements
IBBoard <dev@ibboard.co.uk>
parents:
195
diff
changeset
|
513 // |
15148d255e50
* First stab at displaying new unit requirements
IBBoard <dev@ibboard.co.uk>
parents:
195
diff
changeset
|
514 this.toolStripSeparator3.Name = "toolStripSeparator3"; |
15148d255e50
* First stab at displaying new unit requirements
IBBoard <dev@ibboard.co.uk>
parents:
195
diff
changeset
|
515 this.toolStripSeparator3.Size = new System.Drawing.Size(6, 25); |
15148d255e50
* First stab at displaying new unit requirements
IBBoard <dev@ibboard.co.uk>
parents:
195
diff
changeset
|
516 // |
15148d255e50
* First stab at displaying new unit requirements
IBBoard <dev@ibboard.co.uk>
parents:
195
diff
changeset
|
517 // bttnUndo |
15148d255e50
* First stab at displaying new unit requirements
IBBoard <dev@ibboard.co.uk>
parents:
195
diff
changeset
|
518 // |
15148d255e50
* First stab at displaying new unit requirements
IBBoard <dev@ibboard.co.uk>
parents:
195
diff
changeset
|
519 this.bttnUndo.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; |
15148d255e50
* First stab at displaying new unit requirements
IBBoard <dev@ibboard.co.uk>
parents:
195
diff
changeset
|
520 this.bttnUndo.Enabled = false; |
15148d255e50
* First stab at displaying new unit requirements
IBBoard <dev@ibboard.co.uk>
parents:
195
diff
changeset
|
521 this.bttnUndo.Image = global::IBBoard.WarFoundry.GUI.WinForms.Properties.Resources.edit_undo; |
15148d255e50
* First stab at displaying new unit requirements
IBBoard <dev@ibboard.co.uk>
parents:
195
diff
changeset
|
522 this.bttnUndo.ImageTransparentColor = System.Drawing.Color.Magenta; |
15148d255e50
* First stab at displaying new unit requirements
IBBoard <dev@ibboard.co.uk>
parents:
195
diff
changeset
|
523 this.bttnUndo.Name = "bttnUndo"; |
15148d255e50
* First stab at displaying new unit requirements
IBBoard <dev@ibboard.co.uk>
parents:
195
diff
changeset
|
524 this.bttnUndo.Size = new System.Drawing.Size(32, 22); |
15148d255e50
* First stab at displaying new unit requirements
IBBoard <dev@ibboard.co.uk>
parents:
195
diff
changeset
|
525 this.bttnUndo.Text = "undo"; |
15148d255e50
* First stab at displaying new unit requirements
IBBoard <dev@ibboard.co.uk>
parents:
195
diff
changeset
|
526 this.bttnUndo.ButtonClick += new System.EventHandler(this.miUndo_Click); |
15148d255e50
* First stab at displaying new unit requirements
IBBoard <dev@ibboard.co.uk>
parents:
195
diff
changeset
|
527 // |
15148d255e50
* First stab at displaying new unit requirements
IBBoard <dev@ibboard.co.uk>
parents:
195
diff
changeset
|
528 // bttnRedo |
15148d255e50
* First stab at displaying new unit requirements
IBBoard <dev@ibboard.co.uk>
parents:
195
diff
changeset
|
529 // |
15148d255e50
* First stab at displaying new unit requirements
IBBoard <dev@ibboard.co.uk>
parents:
195
diff
changeset
|
530 this.bttnRedo.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; |
15148d255e50
* First stab at displaying new unit requirements
IBBoard <dev@ibboard.co.uk>
parents:
195
diff
changeset
|
531 this.bttnRedo.Enabled = false; |
15148d255e50
* First stab at displaying new unit requirements
IBBoard <dev@ibboard.co.uk>
parents:
195
diff
changeset
|
532 this.bttnRedo.Image = global::IBBoard.WarFoundry.GUI.WinForms.Properties.Resources.edit_redo; |
15148d255e50
* First stab at displaying new unit requirements
IBBoard <dev@ibboard.co.uk>
parents:
195
diff
changeset
|
533 this.bttnRedo.ImageTransparentColor = System.Drawing.Color.Magenta; |
15148d255e50
* First stab at displaying new unit requirements
IBBoard <dev@ibboard.co.uk>
parents:
195
diff
changeset
|
534 this.bttnRedo.Name = "bttnRedo"; |
15148d255e50
* First stab at displaying new unit requirements
IBBoard <dev@ibboard.co.uk>
parents:
195
diff
changeset
|
535 this.bttnRedo.Size = new System.Drawing.Size(32, 22); |
15148d255e50
* First stab at displaying new unit requirements
IBBoard <dev@ibboard.co.uk>
parents:
195
diff
changeset
|
536 this.bttnRedo.Text = "redo"; |
15148d255e50
* First stab at displaying new unit requirements
IBBoard <dev@ibboard.co.uk>
parents:
195
diff
changeset
|
537 this.bttnRedo.ButtonClick += new System.EventHandler(this.miRedo_Click); |
15148d255e50
* First stab at displaying new unit requirements
IBBoard <dev@ibboard.co.uk>
parents:
195
diff
changeset
|
538 // |
15148d255e50
* First stab at displaying new unit requirements
IBBoard <dev@ibboard.co.uk>
parents:
195
diff
changeset
|
539 // catToolStrip |
15148d255e50
* First stab at displaying new unit requirements
IBBoard <dev@ibboard.co.uk>
parents:
195
diff
changeset
|
540 // |
15148d255e50
* First stab at displaying new unit requirements
IBBoard <dev@ibboard.co.uk>
parents:
195
diff
changeset
|
541 this.catToolStrip.Dock = System.Windows.Forms.DockStyle.None; |
15148d255e50
* First stab at displaying new unit requirements
IBBoard <dev@ibboard.co.uk>
parents:
195
diff
changeset
|
542 this.catToolStrip.Location = new System.Drawing.Point(161, 24); |
15148d255e50
* First stab at displaying new unit requirements
IBBoard <dev@ibboard.co.uk>
parents:
195
diff
changeset
|
543 this.catToolStrip.Name = "catToolStrip"; |
15148d255e50
* First stab at displaying new unit requirements
IBBoard <dev@ibboard.co.uk>
parents:
195
diff
changeset
|
544 this.catToolStrip.Size = new System.Drawing.Size(111, 25); |
15148d255e50
* First stab at displaying new unit requirements
IBBoard <dev@ibboard.co.uk>
parents:
195
diff
changeset
|
545 this.catToolStrip.TabIndex = 9; |
15148d255e50
* First stab at displaying new unit requirements
IBBoard <dev@ibboard.co.uk>
parents:
195
diff
changeset
|
546 this.catToolStrip.Visible = false; |
15148d255e50
* First stab at displaying new unit requirements
IBBoard <dev@ibboard.co.uk>
parents:
195
diff
changeset
|
547 // |
15148d255e50
* First stab at displaying new unit requirements
IBBoard <dev@ibboard.co.uk>
parents:
195
diff
changeset
|
548 // statusBar |
15148d255e50
* First stab at displaying new unit requirements
IBBoard <dev@ibboard.co.uk>
parents:
195
diff
changeset
|
549 // |
15148d255e50
* First stab at displaying new unit requirements
IBBoard <dev@ibboard.co.uk>
parents:
195
diff
changeset
|
550 this.statusBar.Location = new System.Drawing.Point(0, 586); |
15148d255e50
* First stab at displaying new unit requirements
IBBoard <dev@ibboard.co.uk>
parents:
195
diff
changeset
|
551 this.statusBar.Name = "statusBar"; |
15148d255e50
* First stab at displaying new unit requirements
IBBoard <dev@ibboard.co.uk>
parents:
195
diff
changeset
|
552 this.statusBar.Panels.AddRange(new System.Windows.Forms.StatusBarPanel[] { |
140
60c795eca8de
Re #265: Add language preference UI
IBBoard <dev@ibboard.co.uk>
parents:
137
diff
changeset
|
553 this.sbMainPanel, |
60c795eca8de
Re #265: Add language preference UI
IBBoard <dev@ibboard.co.uk>
parents:
137
diff
changeset
|
554 this.sbErrorPanel, |
60c795eca8de
Re #265: Add language preference UI
IBBoard <dev@ibboard.co.uk>
parents:
137
diff
changeset
|
555 this.sbPointsPanel}); |
196
15148d255e50
* First stab at displaying new unit requirements
IBBoard <dev@ibboard.co.uk>
parents:
195
diff
changeset
|
556 this.statusBar.ShowPanels = true; |
15148d255e50
* First stab at displaying new unit requirements
IBBoard <dev@ibboard.co.uk>
parents:
195
diff
changeset
|
557 this.statusBar.Size = new System.Drawing.Size(790, 22); |
15148d255e50
* First stab at displaying new unit requirements
IBBoard <dev@ibboard.co.uk>
parents:
195
diff
changeset
|
558 this.statusBar.TabIndex = 1; |
15148d255e50
* First stab at displaying new unit requirements
IBBoard <dev@ibboard.co.uk>
parents:
195
diff
changeset
|
559 this.statusBar.PanelClick += new System.Windows.Forms.StatusBarPanelClickEventHandler(this.statusBar_PanelClick); |
15148d255e50
* First stab at displaying new unit requirements
IBBoard <dev@ibboard.co.uk>
parents:
195
diff
changeset
|
560 this.statusBar.DrawItem += new System.Windows.Forms.StatusBarDrawItemEventHandler(this.statusBar_DrawItem); |
15148d255e50
* First stab at displaying new unit requirements
IBBoard <dev@ibboard.co.uk>
parents:
195
diff
changeset
|
561 // |
15148d255e50
* First stab at displaying new unit requirements
IBBoard <dev@ibboard.co.uk>
parents:
195
diff
changeset
|
562 // sbMainPanel |
15148d255e50
* First stab at displaying new unit requirements
IBBoard <dev@ibboard.co.uk>
parents:
195
diff
changeset
|
563 // |
15148d255e50
* First stab at displaying new unit requirements
IBBoard <dev@ibboard.co.uk>
parents:
195
diff
changeset
|
564 this.sbMainPanel.AutoSize = System.Windows.Forms.StatusBarPanelAutoSize.Spring; |
15148d255e50
* First stab at displaying new unit requirements
IBBoard <dev@ibboard.co.uk>
parents:
195
diff
changeset
|
565 this.sbMainPanel.Color = System.Drawing.SystemColors.WindowText; |
15148d255e50
* First stab at displaying new unit requirements
IBBoard <dev@ibboard.co.uk>
parents:
195
diff
changeset
|
566 this.sbMainPanel.Name = "sbMainPanel"; |
15148d255e50
* First stab at displaying new unit requirements
IBBoard <dev@ibboard.co.uk>
parents:
195
diff
changeset
|
567 this.sbMainPanel.Style = System.Windows.Forms.StatusBarPanelStyle.OwnerDraw; |
15148d255e50
* First stab at displaying new unit requirements
IBBoard <dev@ibboard.co.uk>
parents:
195
diff
changeset
|
568 this.sbMainPanel.Width = 473; |
15148d255e50
* First stab at displaying new unit requirements
IBBoard <dev@ibboard.co.uk>
parents:
195
diff
changeset
|
569 // |
15148d255e50
* First stab at displaying new unit requirements
IBBoard <dev@ibboard.co.uk>
parents:
195
diff
changeset
|
570 // sbErrorPanel |
15148d255e50
* First stab at displaying new unit requirements
IBBoard <dev@ibboard.co.uk>
parents:
195
diff
changeset
|
571 // |
15148d255e50
* First stab at displaying new unit requirements
IBBoard <dev@ibboard.co.uk>
parents:
195
diff
changeset
|
572 this.sbErrorPanel.Color = System.Drawing.SystemColors.WindowText; |
15148d255e50
* First stab at displaying new unit requirements
IBBoard <dev@ibboard.co.uk>
parents:
195
diff
changeset
|
573 this.sbErrorPanel.Name = "sbErrorPanel"; |
15148d255e50
* First stab at displaying new unit requirements
IBBoard <dev@ibboard.co.uk>
parents:
195
diff
changeset
|
574 this.sbErrorPanel.Style = System.Windows.Forms.StatusBarPanelStyle.OwnerDraw; |
15148d255e50
* First stab at displaying new unit requirements
IBBoard <dev@ibboard.co.uk>
parents:
195
diff
changeset
|
575 this.sbErrorPanel.Width = 150; |
15148d255e50
* First stab at displaying new unit requirements
IBBoard <dev@ibboard.co.uk>
parents:
195
diff
changeset
|
576 // |
15148d255e50
* First stab at displaying new unit requirements
IBBoard <dev@ibboard.co.uk>
parents:
195
diff
changeset
|
577 // sbPointsPanel |
15148d255e50
* First stab at displaying new unit requirements
IBBoard <dev@ibboard.co.uk>
parents:
195
diff
changeset
|
578 // |
15148d255e50
* First stab at displaying new unit requirements
IBBoard <dev@ibboard.co.uk>
parents:
195
diff
changeset
|
579 this.sbPointsPanel.Color = System.Drawing.SystemColors.WindowText; |
15148d255e50
* First stab at displaying new unit requirements
IBBoard <dev@ibboard.co.uk>
parents:
195
diff
changeset
|
580 this.sbPointsPanel.Name = "sbPointsPanel"; |
15148d255e50
* First stab at displaying new unit requirements
IBBoard <dev@ibboard.co.uk>
parents:
195
diff
changeset
|
581 this.sbPointsPanel.Style = System.Windows.Forms.StatusBarPanelStyle.OwnerDraw; |
15148d255e50
* First stab at displaying new unit requirements
IBBoard <dev@ibboard.co.uk>
parents:
195
diff
changeset
|
582 this.sbPointsPanel.ToolTipText = "current points total"; |
15148d255e50
* First stab at displaying new unit requirements
IBBoard <dev@ibboard.co.uk>
parents:
195
diff
changeset
|
583 this.sbPointsPanel.Width = 150; |
15148d255e50
* First stab at displaying new unit requirements
IBBoard <dev@ibboard.co.uk>
parents:
195
diff
changeset
|
584 // |
15148d255e50
* First stab at displaying new unit requirements
IBBoard <dev@ibboard.co.uk>
parents:
195
diff
changeset
|
585 // toolStripPanel |
15148d255e50
* First stab at displaying new unit requirements
IBBoard <dev@ibboard.co.uk>
parents:
195
diff
changeset
|
586 // |
15148d255e50
* First stab at displaying new unit requirements
IBBoard <dev@ibboard.co.uk>
parents:
195
diff
changeset
|
587 this.toolStripPanel.Dock = System.Windows.Forms.DockStyle.Top; |
15148d255e50
* First stab at displaying new unit requirements
IBBoard <dev@ibboard.co.uk>
parents:
195
diff
changeset
|
588 this.toolStripPanel.Location = new System.Drawing.Point(0, 24); |
15148d255e50
* First stab at displaying new unit requirements
IBBoard <dev@ibboard.co.uk>
parents:
195
diff
changeset
|
589 this.toolStripPanel.Name = "toolStripPanel"; |
15148d255e50
* First stab at displaying new unit requirements
IBBoard <dev@ibboard.co.uk>
parents:
195
diff
changeset
|
590 this.toolStripPanel.Orientation = System.Windows.Forms.Orientation.Horizontal; |
15148d255e50
* First stab at displaying new unit requirements
IBBoard <dev@ibboard.co.uk>
parents:
195
diff
changeset
|
591 this.toolStripPanel.RowMargin = new System.Windows.Forms.Padding(3, 0, 0, 0); |
15148d255e50
* First stab at displaying new unit requirements
IBBoard <dev@ibboard.co.uk>
parents:
195
diff
changeset
|
592 this.toolStripPanel.Size = new System.Drawing.Size(790, 0); |
15148d255e50
* First stab at displaying new unit requirements
IBBoard <dev@ibboard.co.uk>
parents:
195
diff
changeset
|
593 // |
15148d255e50
* First stab at displaying new unit requirements
IBBoard <dev@ibboard.co.uk>
parents:
195
diff
changeset
|
594 // FrmMain |
15148d255e50
* First stab at displaying new unit requirements
IBBoard <dev@ibboard.co.uk>
parents:
195
diff
changeset
|
595 // |
15148d255e50
* First stab at displaying new unit requirements
IBBoard <dev@ibboard.co.uk>
parents:
195
diff
changeset
|
596 this.AutoScaleBaseSize = new System.Drawing.Size(5, 13); |
15148d255e50
* First stab at displaying new unit requirements
IBBoard <dev@ibboard.co.uk>
parents:
195
diff
changeset
|
597 this.ClientSize = new System.Drawing.Size(790, 608); |
15148d255e50
* First stab at displaying new unit requirements
IBBoard <dev@ibboard.co.uk>
parents:
195
diff
changeset
|
598 this.Controls.Add(this.mainToolStrip); |
15148d255e50
* First stab at displaying new unit requirements
IBBoard <dev@ibboard.co.uk>
parents:
195
diff
changeset
|
599 this.Controls.Add(this.toolStripPanel); |
15148d255e50
* First stab at displaying new unit requirements
IBBoard <dev@ibboard.co.uk>
parents:
195
diff
changeset
|
600 this.Controls.Add(this.statusBar); |
15148d255e50
* First stab at displaying new unit requirements
IBBoard <dev@ibboard.co.uk>
parents:
195
diff
changeset
|
601 this.Controls.Add(this.catToolStrip); |
15148d255e50
* First stab at displaying new unit requirements
IBBoard <dev@ibboard.co.uk>
parents:
195
diff
changeset
|
602 this.Controls.Add(this.menuStrip); |
15148d255e50
* First stab at displaying new unit requirements
IBBoard <dev@ibboard.co.uk>
parents:
195
diff
changeset
|
603 this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); |
15148d255e50
* First stab at displaying new unit requirements
IBBoard <dev@ibboard.co.uk>
parents:
195
diff
changeset
|
604 this.IsMdiContainer = true; |
15148d255e50
* First stab at displaying new unit requirements
IBBoard <dev@ibboard.co.uk>
parents:
195
diff
changeset
|
605 this.MainMenuStrip = this.menuStrip; |
15148d255e50
* First stab at displaying new unit requirements
IBBoard <dev@ibboard.co.uk>
parents:
195
diff
changeset
|
606 this.Menu = this.mainMenu; |
15148d255e50
* First stab at displaying new unit requirements
IBBoard <dev@ibboard.co.uk>
parents:
195
diff
changeset
|
607 this.Name = "FrmMain"; |
15148d255e50
* First stab at displaying new unit requirements
IBBoard <dev@ibboard.co.uk>
parents:
195
diff
changeset
|
608 this.Text = "WarFoundry"; |
15148d255e50
* First stab at displaying new unit requirements
IBBoard <dev@ibboard.co.uk>
parents:
195
diff
changeset
|
609 this.Load += new System.EventHandler(this.FrmMain_Load); |
15148d255e50
* First stab at displaying new unit requirements
IBBoard <dev@ibboard.co.uk>
parents:
195
diff
changeset
|
610 this.menuStrip.ResumeLayout(false); |
15148d255e50
* First stab at displaying new unit requirements
IBBoard <dev@ibboard.co.uk>
parents:
195
diff
changeset
|
611 this.menuStrip.PerformLayout(); |
15148d255e50
* First stab at displaying new unit requirements
IBBoard <dev@ibboard.co.uk>
parents:
195
diff
changeset
|
612 this.mainToolStrip.ResumeLayout(false); |
15148d255e50
* First stab at displaying new unit requirements
IBBoard <dev@ibboard.co.uk>
parents:
195
diff
changeset
|
613 this.mainToolStrip.PerformLayout(); |
15148d255e50
* First stab at displaying new unit requirements
IBBoard <dev@ibboard.co.uk>
parents:
195
diff
changeset
|
614 ((System.ComponentModel.ISupportInitialize)(this.sbMainPanel)).EndInit(); |
15148d255e50
* First stab at displaying new unit requirements
IBBoard <dev@ibboard.co.uk>
parents:
195
diff
changeset
|
615 ((System.ComponentModel.ISupportInitialize)(this.sbErrorPanel)).EndInit(); |
15148d255e50
* First stab at displaying new unit requirements
IBBoard <dev@ibboard.co.uk>
parents:
195
diff
changeset
|
616 ((System.ComponentModel.ISupportInitialize)(this.sbPointsPanel)).EndInit(); |
15148d255e50
* First stab at displaying new unit requirements
IBBoard <dev@ibboard.co.uk>
parents:
195
diff
changeset
|
617 this.ResumeLayout(false); |
15148d255e50
* First stab at displaying new unit requirements
IBBoard <dev@ibboard.co.uk>
parents:
195
diff
changeset
|
618 this.PerformLayout(); |
140
60c795eca8de
Re #265: Add language preference UI
IBBoard <dev@ibboard.co.uk>
parents:
137
diff
changeset
|
619 |
142 | 620 } |
621 #endregion | |
622 | |
623 private void FileLoadingFinished(List<FileLoadFailure> failures) | |
624 { | |
625 foreach (FileLoadFailure failure in failures) | |
626 { | |
627 log.Warn("Failed to load " + failure.FailedFile.FullName + ": " + failure.Message); | |
628 } | |
629 } | |
630 | |
631 private void miExit_Click(object sender, System.EventArgs e) | |
632 { | |
633 Application.Exit(); | |
634 } | |
635 | |
636 private void miNewArmy_Click(object sender, System.EventArgs e) | |
637 { | |
638 CreateNewArmy(); | |
639 } | |
640 | |
641 private void CreateNewArmy() | |
642 { | |
643 if (CloseCurrentArmy()) | |
644 { | |
645 FrmNewArmy newArmy = new FrmNewArmy(CurrentGameSystem); | |
646 DialogResult dr = newArmy.ShowDialog(); | |
647 | |
648 if (dr == DialogResult.OK) | |
649 { | |
650 try | |
651 { | |
652 CurrentArmy = new Army(newArmy.SelectedRace, newArmy.ArmyName, newArmy.ArmySize); | |
653 } | |
654 catch (RequiredDataMissingException ex) | |
655 { | |
656 log.Error("Required data missing from race file", ex); | |
657 MessageBox.Show(this, ex.Message, Translation.GetTranslation("InvalidRaceFileBoxTitle", "invalid race file"), MessageBoxButtons.OK, MessageBoxIcon.Error); | |
658 } | |
659 catch (InvalidFileException ex) | |
660 { | |
661 log.Error("Race file was invalid", ex); | |
662 MessageBox.Show(this, ex.Message, Translation.GetTranslation("InvalidRaceFileBoxTitle", "invalid race file"), MessageBoxButtons.OK, MessageBoxIcon.Error); | |
663 } | |
664 } | |
665 } | |
666 } | |
667 | |
668 private bool OpenArmy() | |
669 { | |
670 if (openArmyDialog.Filter=="") | |
671 { | |
672 string savePath = ArmiesPath; | |
673 | |
674 if (!Directory.Exists(savePath)) | |
675 { | |
676 Directory.CreateDirectory(savePath); | |
677 } | |
678 | |
679 openArmyDialog.InitialDirectory = savePath; | |
680 openArmyDialog.Filter = Translation.GetTranslation("armyFileFilter")+"|*.army"; | |
681 openArmyDialog.Title = Translation.GetTranslation("openArmyDialog"); | |
682 | |
683 } | |
684 | |
685 DialogResult dr = openArmyDialog.ShowDialog(this); | |
686 | |
687 if (dr == DialogResult.OK) | |
688 { | |
689 if (CloseCurrentArmy()) | |
690 { | |
691 try | |
692 { | |
693 string newFilePath = openArmyDialog.FileName; | |
694 CurrentArmy = WarFoundryLoader.GetDefault().LoadArmy(new FileInfo(newFilePath)); | |
695 loadedFilePath = newFilePath; | |
696 return true; | |
697 } | |
698 catch (RequiredDataMissingException ex) | |
699 { | |
700 log.Error(ex); | |
701 MessageBox.Show(this, ex.Message, Translation.GetTranslation("InvalidArmyFileBoxTitle", "invalid army file"), MessageBoxButtons.OK, MessageBoxIcon.Error); | |
702 return false; | |
703 } | |
704 catch (InvalidFileException ex) | |
705 { | |
706 log.Error(ex); | |
707 MessageBox.Show(this, ex.Message, Translation.GetTranslation("InvalidArmyFileBoxTitle", "invalid army file"), MessageBoxButtons.OK, MessageBoxIcon.Error); | |
708 return false; | |
709 } | |
710 } | |
711 else | |
712 { | |
713 return false; | |
714 } | |
715 } | |
716 else | |
717 { | |
718 return false; | |
719 } | |
720 } | |
721 | |
722 private bool CloseCurrentArmy() | |
723 { | |
724 if (CurrentArmy!=null) | |
725 { | |
726 bool canClose = false; | |
727 | |
728 if (CommandStack.IsDirty()) | |
729 { | |
730 string saveChanges = Translation.GetTranslation("SaveChangesQuestion", "the army \"{0}\" has been modified\r\nsave changes before closing army?", CurrentArmy.Name); | |
731 string saveChangesTitle = Translation.GetTranslation("SaveChangesTitle", "unsaved changes"); | |
732 DialogResult dr = MessageBox.Show(this, saveChanges, saveChangesTitle, MessageBoxButtons.YesNoCancel, MessageBoxIcon.Warning, MessageBoxDefaultButton.Button3); | |
733 | |
734 if (dr == DialogResult.Yes) | |
735 { | |
736 canClose = SaveCurrentArmy(); | |
737 } | |
738 else if (dr == DialogResult.No) | |
739 { | |
740 canClose = true; | |
741 } | |
742 //else they said cancel and we default to "canClose = false" so do nothing | |
743 } | |
744 else | |
745 { | |
746 canClose = true; | |
747 } | |
748 | |
749 if (canClose) | |
750 { | |
751 //do close | |
752 DisableCategoryButtons(); | |
753 CurrentArmy = null; | |
754 return true; | |
755 } | |
756 else | |
757 { | |
758 return false; | |
759 } | |
760 } | |
761 else | |
762 { | |
763 DisableCategoryButtons(); | |
764 //pretend we succeeded | |
765 return true; | |
766 } | |
767 } | |
768 | |
769 private void UndoLastAction() | |
770 { | |
771 if (commandStack.CanUndo()) | |
772 { | |
773 commandStack.Undo(); | |
774 } | |
775 } | |
776 | |
777 private void RedoAction() | |
778 { | |
779 if (commandStack.CanRedo()) | |
780 { | |
781 commandStack.Redo(); | |
782 } | |
783 } | |
784 | |
785 private bool SaveCurrentArmy() | |
786 { | |
787 bool saved = false; | |
788 | |
789 string filePath = loadedFilePath; | |
790 | |
791 if (filePath == null) | |
792 { | |
793 filePath = PromptForArmyFilePath(); | |
794 } | |
795 | |
796 if (filePath != null) | |
797 { | |
798 saved = SaveCurrentArmyToFile(filePath); | |
799 } | |
800 | |
801 return saved; | |
802 } | |
803 | |
804 private bool SaveCurrentArmyAs() | |
805 { | |
806 bool saved = false; | |
807 string filePath = PromptForArmyFilePath(); | |
808 | |
809 if (filePath != null) | |
810 { | |
811 saved = SaveCurrentArmyToFile(filePath); | |
812 } | |
813 | |
814 return saved; | |
815 } | |
816 | |
817 private bool SaveCurrentArmyToFile(string filePath) | |
818 { | |
193 | 819 if (WarFoundrySaver.GetSaver().Save(filePath, CurrentArmy)) |
142 | 820 { |
821 loadedFilePath = filePath; | |
822 miSaveArmy.Enabled = false; | |
823 bttnSaveArmy.Enabled = false; | |
824 CommandStack.setCleanMark(); | |
825 return true; | |
826 } | |
827 else | |
828 { | |
829 MessageBox.Show(this, Translation.GetTranslation("SaveFailed", "file save failed - check log for details"), Translation.GetTranslation("SaveFailedTitle", "file save failed"), MessageBoxButtons.OK, MessageBoxIcon.Error); | |
830 return false; | |
831 } | |
832 } | |
833 | |
834 private string PromptForArmyFilePath() | |
835 { | |
836 if (saveArmyDialog.Filter == "") | |
837 { | |
838 string savePath = ArmiesPath; | |
839 | |
840 if (!Directory.Exists(savePath)) | |
841 { | |
842 Directory.CreateDirectory(savePath); | |
843 } | |
844 | |
845 saveArmyDialog.InitialDirectory = savePath; | |
846 saveArmyDialog.Filter = Translation.GetTranslation("armyFileFilter")+"|*.army"; | |
847 saveArmyDialog.Title = Translation.GetTranslation("saveArmyDialog"); | |
848 } | |
849 | |
850 DialogResult dr = saveArmyDialog.ShowDialog(this); | |
851 | |
852 if (dr == DialogResult.OK) | |
853 { | |
854 return saveArmyDialog.FileName; | |
855 } | |
856 else | |
857 { | |
858 return null; | |
859 } | |
860 } | |
861 | |
862 public GameSystem CurrentGameSystem | |
863 { | |
864 get { return WarFoundryCore.CurrentGameSystem; } | |
865 set { WarFoundryCore.CurrentGameSystem = value; } | |
866 } | |
867 | |
868 public Army CurrentArmy | |
869 { | |
870 get { return WarFoundryCore.CurrentArmy; } | |
871 set { SetArmy(value); } | |
872 } | |
873 | |
874 private void FrmMain_GameSystemChanged(GameSystem oldSystem, GameSystem newSystem) | |
875 { | |
876 SetAppTitle(); | |
195
983d96be91f5
Fixes #161: Re-implement "load last used game system by default" in WinForms
IBBoard <dev@ibboard.co.uk>
parents:
193
diff
changeset
|
877 |
983d96be91f5
Fixes #161: Re-implement "load last used game system by default" in WinForms
IBBoard <dev@ibboard.co.uk>
parents:
193
diff
changeset
|
878 if (newSystem == null) |
983d96be91f5
Fixes #161: Re-implement "load last used game system by default" in WinForms
IBBoard <dev@ibboard.co.uk>
parents:
193
diff
changeset
|
879 { |
983d96be91f5
Fixes #161: Re-implement "load last used game system by default" in WinForms
IBBoard <dev@ibboard.co.uk>
parents:
193
diff
changeset
|
880 Preferences["currSystem"] = ""; |
983d96be91f5
Fixes #161: Re-implement "load last used game system by default" in WinForms
IBBoard <dev@ibboard.co.uk>
parents:
193
diff
changeset
|
881 } |
983d96be91f5
Fixes #161: Re-implement "load last used game system by default" in WinForms
IBBoard <dev@ibboard.co.uk>
parents:
193
diff
changeset
|
882 else |
983d96be91f5
Fixes #161: Re-implement "load last used game system by default" in WinForms
IBBoard <dev@ibboard.co.uk>
parents:
193
diff
changeset
|
883 { |
983d96be91f5
Fixes #161: Re-implement "load last used game system by default" in WinForms
IBBoard <dev@ibboard.co.uk>
parents:
193
diff
changeset
|
884 Preferences["currSystem"] = newSystem.ID; |
983d96be91f5
Fixes #161: Re-implement "load last used game system by default" in WinForms
IBBoard <dev@ibboard.co.uk>
parents:
193
diff
changeset
|
885 } |
983d96be91f5
Fixes #161: Re-implement "load last used game system by default" in WinForms
IBBoard <dev@ibboard.co.uk>
parents:
193
diff
changeset
|
886 |
983d96be91f5
Fixes #161: Re-implement "load last used game system by default" in WinForms
IBBoard <dev@ibboard.co.uk>
parents:
193
diff
changeset
|
887 Preferences.Save(); |
142 | 888 RemoveCategoryButtons(); |
889 } | |
890 | |
891 private void FrmMain_ArmyChanged(Army oldArmy, Army newArmy) | |
892 { | |
893 CommandStack.Reset(); | |
894 loadedFilePath = null; | |
895 miSaveArmy.Enabled = false; | |
896 bttnSaveArmy.Enabled = false; | |
196
15148d255e50
* First stab at displaying new unit requirements
IBBoard <dev@ibboard.co.uk>
parents:
195
diff
changeset
|
897 //TODO: Subscribe to an "army changed" event here |
142 | 898 SetPointsPanelText(); |
899 SetAppTitle(); | |
900 } | |
901 | |
902 private void SetArmy(Army newArmy) | |
903 { | |
904 IgnoreArmy(CurrentArmy); | |
905 CloseAllUnitWindows(); | |
906 | |
907 if (newArmy == null) | |
908 { | |
909 SetNullArmyState(); | |
910 } | |
911 else | |
912 { | |
913 WarFoundryCore.CurrentGameSystem = newArmy.GameSystem; | |
914 ListenToArmy(newArmy); | |
915 SetNonNullArmyState(newArmy); | |
916 } | |
917 | |
918 WarFoundryCore.CurrentArmy = newArmy; | |
919 } | |
920 | |
921 private void IgnoreArmy(Army oldArmy) | |
922 { | |
923 if (oldArmy != null) | |
924 { | |
925 oldArmy.UnitAdded -= UnitAddedMethod; | |
926 oldArmy.UnitRemoved -= UnitRemovedMethod; | |
927 oldArmy.PointsValueChanged -= PointsValueChangedMethod; | |
928 } | |
929 } | |
930 | |
931 private void CloseAllUnitWindows() | |
932 { | |
933 FrmUnit[] unitForms = DictionaryUtils.ToArray(unitWindows); | |
934 | |
935 foreach (FrmUnit window in unitForms) | |
936 { | |
937 window.Close(); | |
938 } | |
939 | |
940 unitWindows.Clear(); | |
941 } | |
942 | |
943 private void ListenToArmy(Army newArmy) | |
944 { | |
945 if (newArmy != null) | |
946 { | |
947 newArmy.UnitAdded += UnitAddedMethod; | |
948 newArmy.UnitRemoved += UnitRemovedMethod; | |
949 newArmy.PointsValueChanged += PointsValueChangedMethod; | |
950 } | |
951 } | |
952 | |
953 private void SetNullArmyState() | |
954 { | |
955 miSaveArmyAs.Enabled = false; | |
956 miCloseArmy.Enabled = false; | |
957 miExportArmyAs.Enabled = false; | |
958 DisableCategoryButtons(); | |
159
964f946d3cac
Fixes #288: WarFoundry WinForms assumes that army tree will be open
IBBoard <dev@ibboard.co.uk>
parents:
158
diff
changeset
|
959 GetArmyTree().Hide(); |
142 | 960 } |
961 | |
962 private void SetNonNullArmyState(Army newArmy) | |
963 { | |
964 SetCategoryButtons(newArmy.Race.Categories); | |
965 EnableCategoryButtons(); | |
966 miSaveArmyAs.Enabled = true; | |
967 miCloseArmy.Enabled = true; | |
968 miExportArmyAs.Enabled = true; | |
159
964f946d3cac
Fixes #288: WarFoundry WinForms assumes that army tree will be open
IBBoard <dev@ibboard.co.uk>
parents:
158
diff
changeset
|
969 GetArmyTree().Show(); |
142 | 970 } |
971 | |
972 private void SetCategoryButtons(Category[] cats) | |
973 { | |
974 if (CategoryButtonsHaveChanged(cats)) | |
975 { | |
976 RemoveCategoryButtons(); | |
977 AddCategoryButtons(cats); | |
978 } | |
979 } | |
980 | |
981 private bool CategoryButtonsHaveChanged(Category[] cats) | |
982 { | |
983 int catCount = cats.Length; | |
984 ToolStripItemCollection items = catToolStrip.Items; | |
985 bool haveChanged = (!catToolStrip.Visible || catCount != items.Count); | |
986 | |
987 if (!haveChanged) | |
988 { | |
989 for (int i = 0; i < catCount; i++) | |
990 { | |
991 if (cats[i].Equals(items[i+1].Tag)) | |
992 { | |
993 haveChanged = true; | |
994 break; | |
995 } | |
996 } | |
997 } | |
998 | |
999 return haveChanged; | |
1000 } | |
1001 | |
1002 private void RemoveCategoryButtons() | |
1003 { | |
1004 this.Invoke(new MethodInvoker(catToolStrip.Items.Clear)); | |
1005 } | |
1006 | |
1007 private void AddCategoryButtons(Category[] cats) | |
1008 { | |
1009 int catCount = cats.Length; | |
1010 Category cat; | |
1011 IBBToolStripButton[] categoryButtons = new IBBToolStripButton[catCount]; | |
1012 | |
1013 for (int i = 0; i < catCount; i++) | |
1014 { | |
1015 cat = cats[i]; | |
1016 IBBToolStripButton button = new IBBToolStripButton(); | |
1017 button.Text = cat.Name; | |
1018 button.Tag = cat; | |
1019 button.Image = global::IBBoard.WarFoundry.GUI.WinForms.Properties.Resources.list_add; | |
1020 button.Enabled = false; | |
1021 button.Click += new EventHandler(CreateUnitForCategoryButtonClick); | |
1022 categoryButtons[i] = button; | |
1023 } | |
1024 | |
146
5d9d4c75305f
Fixes #250: New panels don't work perfectly in Linux through Mono
IBBoard <dev@ibboard.co.uk>
parents:
144
diff
changeset
|
1025 this.Invoke(new ArrayMethodInvoker<IBBToolStripButton>(AddCatToolStripButtons), new object[] { categoryButtons }); |
5d9d4c75305f
Fixes #250: New panels don't work perfectly in Linux through Mono
IBBoard <dev@ibboard.co.uk>
parents:
144
diff
changeset
|
1026 } |
5d9d4c75305f
Fixes #250: New panels don't work perfectly in Linux through Mono
IBBoard <dev@ibboard.co.uk>
parents:
144
diff
changeset
|
1027 |
5d9d4c75305f
Fixes #250: New panels don't work perfectly in Linux through Mono
IBBoard <dev@ibboard.co.uk>
parents:
144
diff
changeset
|
1028 private void AddCatToolStripButtons(IBBToolStripButton[] buttons) |
5d9d4c75305f
Fixes #250: New panels don't work perfectly in Linux through Mono
IBBoard <dev@ibboard.co.uk>
parents:
144
diff
changeset
|
1029 { |
142 | 1030 log.Debug("Toolstrip width: " + catToolStrip.Width); |
146
5d9d4c75305f
Fixes #250: New panels don't work perfectly in Linux through Mono
IBBoard <dev@ibboard.co.uk>
parents:
144
diff
changeset
|
1031 catToolStrip.Items.AddRange(buttons); |
5d9d4c75305f
Fixes #250: New panels don't work perfectly in Linux through Mono
IBBoard <dev@ibboard.co.uk>
parents:
144
diff
changeset
|
1032 catToolStrip.Refresh(); |
5d9d4c75305f
Fixes #250: New panels don't work perfectly in Linux through Mono
IBBoard <dev@ibboard.co.uk>
parents:
144
diff
changeset
|
1033 int buttonWidths = 0; |
5d9d4c75305f
Fixes #250: New panels don't work perfectly in Linux through Mono
IBBoard <dev@ibboard.co.uk>
parents:
144
diff
changeset
|
1034 |
5d9d4c75305f
Fixes #250: New panels don't work perfectly in Linux through Mono
IBBoard <dev@ibboard.co.uk>
parents:
144
diff
changeset
|
1035 foreach (IBBToolStripButton button in buttons) |
5d9d4c75305f
Fixes #250: New panels don't work perfectly in Linux through Mono
IBBoard <dev@ibboard.co.uk>
parents:
144
diff
changeset
|
1036 { |
5d9d4c75305f
Fixes #250: New panels don't work perfectly in Linux through Mono
IBBoard <dev@ibboard.co.uk>
parents:
144
diff
changeset
|
1037 buttonWidths += button.Width; |
5d9d4c75305f
Fixes #250: New panels don't work perfectly in Linux through Mono
IBBoard <dev@ibboard.co.uk>
parents:
144
diff
changeset
|
1038 } |
5d9d4c75305f
Fixes #250: New panels don't work perfectly in Linux through Mono
IBBoard <dev@ibboard.co.uk>
parents:
144
diff
changeset
|
1039 catToolStrip.Width = buttonWidths; |
142 | 1040 log.Debug("Button widths: " + buttonWidths); |
146
5d9d4c75305f
Fixes #250: New panels don't work perfectly in Linux through Mono
IBBoard <dev@ibboard.co.uk>
parents:
144
diff
changeset
|
1041 log.Debug("Toolstrip width: " + catToolStrip.Width); |
142 | 1042 } |
1043 | |
1044 private void CreateUnitForCategoryButtonClick(object sender, EventArgs e) | |
1045 { | |
1046 if (sender is IBBToolStripButton) | |
1047 { | |
1048 IBBToolStripButton button = (IBBToolStripButton)sender; | |
1049 object tag = button.Tag; | |
1050 | |
1051 if (tag is Category) | |
1052 { | |
1053 AddUnitFromCategory((Category)tag); | |
1054 } | |
1055 } | |
1056 } | |
1057 | |
1058 private void EnableCategoryButtons() | |
1059 { | |
1060 catToolStrip.Visible = true; | |
1061 SetCategoryButtonState(true); | |
1062 } | |
1063 | |
1064 private void DisableCategoryButtons() | |
1065 { | |
1066 catToolStrip.Visible = false; | |
1067 SetCategoryButtonState(false); | |
1068 } | |
1069 | |
1070 private void SetCategoryButtonState(bool state) | |
1071 { | |
1072 foreach (IBBToolStripButton button in catToolStrip.Items) | |
1073 { | |
1074 button.Enabled = state; | |
1075 } | |
1076 } | |
1077 | |
1078 private void miSaveArmyAs_Click(object sender, System.EventArgs e) | |
1079 { | |
1080 SaveCurrentArmyAs(); | |
1081 } | |
1082 | |
1083 private void commandStack_CommandStackUpdated() | |
1084 { | |
1085 bttnUndo.Enabled = commandStack.CanUndo(); | |
1086 miUndo.Enabled = bttnUndo.Enabled; | |
1087 bttnRedo.Enabled = commandStack.CanRedo(); | |
1088 miRedo.Enabled = bttnRedo.Enabled; | |
1089 | |
1090 PopulateRedoMenu(); | |
1091 PopulateUndoMenu(); | |
1092 | |
1093 bttnSaveArmy.Enabled = commandStack.IsDirty() && CurrentArmy!=null; | |
1094 miSaveArmy.Enabled = commandStack.IsDirty() && CurrentArmy!=null; | |
1095 } | |
1096 | |
1097 private void PopulateRedoMenu() | |
1098 { | |
1099 int redoLength = commandStack.RedoLength; | |
1100 int maxRedo = Math.Min(10, redoLength); | |
1101 ToolStripItemCollection dropDownItems = bttnRedo.DropDownItems; | |
1102 dropDownItems.Clear(); | |
1103 | |
1104 for (int i = 1; i <= maxRedo; i++) | |
1105 { | |
1106 Command cmd = commandStack.PeekRedoCommand(i); | |
1107 | |
1108 if (cmd == null) | |
1109 { | |
1110 break; | |
1111 } | |
1112 | |
1113 dropDownItems.Add(cmd.Description, null, redoMenu_Click); | |
1114 } | |
1115 | |
1116 if (redoLength > 0) | |
1117 { | |
1118 bttnRedo.Text = commandStack.PeekRedoCommand(1).Description; | |
1119 } | |
1120 else | |
1121 { | |
1122 bttnRedo.Text = Translation.GetTranslation("bttnRedo"); | |
1123 } | |
1124 } | |
1125 | |
1126 private void PopulateUndoMenu() | |
1127 { | |
1128 int undoLength = commandStack.UndoLength; | |
1129 int maxUndo = Math.Min(10, undoLength); | |
1130 ToolStripItemCollection dropDownItems = bttnUndo.DropDownItems; | |
1131 dropDownItems.Clear(); | |
1132 | |
1133 for (int i = 1; i <= maxUndo; i++) | |
1134 { | |
1135 Command cmd = commandStack.PeekUndoCommand(i); | |
1136 | |
1137 if (cmd == null) | |
1138 { | |
1139 break; | |
1140 } | |
1141 | |
1142 dropDownItems.Add(cmd.UndoDescription, null, undoMenu_Click); | |
1143 } | |
1144 | |
1145 if (undoLength > 0) | |
1146 { | |
1147 bttnUndo.Text = commandStack.PeekUndoCommand(1).UndoDescription; | |
1148 } | |
1149 else | |
1150 { | |
1151 bttnUndo.Text = Translation.GetTranslation("bttnUndo"); | |
1152 } | |
1153 } | |
1154 | |
1155 private void miSaveArmy_Click(object sender, System.EventArgs e) | |
1156 { | |
1157 SaveCurrentArmy(); | |
1158 } | |
1159 | |
1160 private void SetAppTitle() | |
1161 { | |
1162 string str = AppTitle; | |
1163 | |
1164 if (CurrentGameSystem!=null) | |
1165 { | |
1166 str+= " - "+CurrentGameSystem.Name; | |
1167 } | |
1168 | |
1169 if (CurrentArmy!=null) | |
1170 { | |
1171 str+= " - "+CurrentArmy.Name; | |
1172 } | |
1173 | |
1174 this.Text = str; | |
1175 } | |
1176 | |
1177 private void AddUnitFromCategory(Category cat) | |
1178 { | |
1179 FrmNewUnit newUnit = new FrmNewUnit(CurrentArmy.Race, cat, CurrentArmy); | |
1180 DialogResult dr = newUnit.ShowDialog(this); | |
1181 | |
1182 if (dr == DialogResult.OK) | |
1183 { | |
1184 CreateAndAddUnitCommand cmd = new CreateAndAddUnitCommand(newUnit.SelectedUnit, CurrentArmy.GetCategory(cat)); | |
1185 commandStack.Execute(cmd); | |
1186 OpenUnitDialog(cmd.Unit); | |
1187 } | |
1188 } | |
1189 | |
1190 internal void OpenUnitDialog(Unit unit) | |
1191 { | |
1192 string unitID = unit.ID; | |
1193 | |
1194 if (unitWindows.ContainsKey(unitID)) | |
1195 { | |
1196 unitWindows[unitID].Focus(); | |
1197 } | |
1198 else | |
1199 { | |
1200 FrmUnit unitForm = new FrmUnit(unit, commandStack); | |
1201 unitWindows.Add(unitID, unitForm); | |
1202 unitForm.MdiParent = this; | |
1203 unitForm.Closing += new CancelEventHandler(unitForm_Closing); | |
1204 unitForm.Show(); | |
1205 } | |
1206 } | |
1207 | |
1208 private void unitForm_Closing(object sender, CancelEventArgs e) | |
1209 { | |
1210 if (sender is FrmUnit) | |
1211 { | |
1212 FrmUnit unitForm = (FrmUnit) sender; | |
1213 unitWindows.Remove(unitForm.Unit.ID); | |
1214 } | |
1215 } | |
1216 | |
1217 private void FrmMain_UnitAddedMethod(object unitObj) | |
1218 { | |
196
15148d255e50
* First stab at displaying new unit requirements
IBBoard <dev@ibboard.co.uk>
parents:
195
diff
changeset
|
1219 ValidateArmy(); |
15148d255e50
* First stab at displaying new unit requirements
IBBoard <dev@ibboard.co.uk>
parents:
195
diff
changeset
|
1220 } |
15148d255e50
* First stab at displaying new unit requirements
IBBoard <dev@ibboard.co.uk>
parents:
195
diff
changeset
|
1221 |
15148d255e50
* First stab at displaying new unit requirements
IBBoard <dev@ibboard.co.uk>
parents:
195
diff
changeset
|
1222 private void ValidateArmy() |
15148d255e50
* First stab at displaying new unit requirements
IBBoard <dev@ibboard.co.uk>
parents:
195
diff
changeset
|
1223 { |
197
10ba2c5340b2
Re #343: Show unit requirement failures
IBBoard <dev@ibboard.co.uk>
parents:
196
diff
changeset
|
1224 ICollection<string> failureMessages; |
10ba2c5340b2
Re #343: Show unit requirement failures
IBBoard <dev@ibboard.co.uk>
parents:
196
diff
changeset
|
1225 if (Validates.AsOkay(RequirementHandler.ValidateArmy(CurrentArmy, out failureMessages))) |
196
15148d255e50
* First stab at displaying new unit requirements
IBBoard <dev@ibboard.co.uk>
parents:
195
diff
changeset
|
1226 { |
15148d255e50
* First stab at displaying new unit requirements
IBBoard <dev@ibboard.co.uk>
parents:
195
diff
changeset
|
1227 sbErrorPanel.Text = ""; |
15148d255e50
* First stab at displaying new unit requirements
IBBoard <dev@ibboard.co.uk>
parents:
195
diff
changeset
|
1228 sbErrorPanel.Tag = ""; |
15148d255e50
* First stab at displaying new unit requirements
IBBoard <dev@ibboard.co.uk>
parents:
195
diff
changeset
|
1229 } |
15148d255e50
* First stab at displaying new unit requirements
IBBoard <dev@ibboard.co.uk>
parents:
195
diff
changeset
|
1230 else |
15148d255e50
* First stab at displaying new unit requirements
IBBoard <dev@ibboard.co.uk>
parents:
195
diff
changeset
|
1231 { |
197
10ba2c5340b2
Re #343: Show unit requirement failures
IBBoard <dev@ibboard.co.uk>
parents:
196
diff
changeset
|
1232 sbErrorPanel.Text = failureMessages.Count + " validation errors"; |
10ba2c5340b2
Re #343: Show unit requirement failures
IBBoard <dev@ibboard.co.uk>
parents:
196
diff
changeset
|
1233 sbErrorPanel.Tag = String.Join("\n", new List<string>(failureMessages).ToArray()); |
196
15148d255e50
* First stab at displaying new unit requirements
IBBoard <dev@ibboard.co.uk>
parents:
195
diff
changeset
|
1234 } |
15148d255e50
* First stab at displaying new unit requirements
IBBoard <dev@ibboard.co.uk>
parents:
195
diff
changeset
|
1235 } |
15148d255e50
* First stab at displaying new unit requirements
IBBoard <dev@ibboard.co.uk>
parents:
195
diff
changeset
|
1236 |
15148d255e50
* First stab at displaying new unit requirements
IBBoard <dev@ibboard.co.uk>
parents:
195
diff
changeset
|
1237 private void FrmMain_UnitRemovedMethod(object unitObj) |
15148d255e50
* First stab at displaying new unit requirements
IBBoard <dev@ibboard.co.uk>
parents:
195
diff
changeset
|
1238 { |
15148d255e50
* First stab at displaying new unit requirements
IBBoard <dev@ibboard.co.uk>
parents:
195
diff
changeset
|
1239 ValidateArmy(); |
15148d255e50
* First stab at displaying new unit requirements
IBBoard <dev@ibboard.co.uk>
parents:
195
diff
changeset
|
1240 |
142 | 1241 if (unitObj is Unit) |
1242 { | |
1243 Unit unit = (Unit)unitObj; | |
1244 | |
1245 //check if window is open, and close it if it is | |
1246 foreach (Form frm in this.MdiChildren) | |
1247 { | |
1248 if (frm is FrmUnit) | |
1249 { | |
1250 if (((FrmUnit)frm).Unit == unit) | |
1251 { | |
1252 frm.Close(); | |
1253 break; | |
1254 } | |
1255 } | |
1256 } | |
1257 } | |
1258 } | |
1259 | |
1260 private void miUndo_Click(object sender, System.EventArgs e) | |
1261 { | |
1262 UndoLastAction(); | |
1263 } | |
1264 | |
1265 private void miRedo_Click(object sender, System.EventArgs e) | |
1266 { | |
1267 RedoAction(); | |
1268 } | |
1269 | |
1270 private void miCloseArmy_Click(object sender, EventArgs e) | |
1271 { | |
1272 CloseCurrentArmy(); | |
1273 } | |
1274 | |
1275 private void miOpenArmy_Click(object sender, EventArgs e) | |
1276 { | |
1277 OpenArmy(); | |
1278 } | |
1279 | |
1280 private void FrmMain_PointsValueChangedMethod(WarFoundryObject obj, double oldVal, double newVal) | |
1281 { | |
1282 if (obj is Army) | |
1283 { | |
1284 SetPointsPanelText(); | |
1285 } | |
1286 } | |
1287 | |
190 | 1288 private void SetPointsPanelText() |
142 | 1289 { |
1290 if (CurrentArmy==null) | |
1291 { | |
1292 sbPointsPanel.Text = ""; | |
1293 sbPointsPanel.ResetColor(); | |
1294 } | |
1295 else | |
1296 { | |
193 | 1297 string pointsPanelText = String.Format(Translation.GetTranslation("statusPanelPoints"), CurrentArmy.Points, CurrentGameSystem.GetPointsName(CurrentArmy.Points), CurrentArmy.MaxPoints, CurrentGameSystem.GetPointsName(CurrentArmy.MaxPoints)); |
190 | 1298 sbPointsPanel.Text = pointsPanelText; |
142 | 1299 |
1300 if (CurrentArmy.Points>CurrentArmy.MaxPoints) | |
1301 { | |
1302 sbPointsPanel.Color = Color.Red; | |
1303 } | |
1304 else | |
1305 { | |
1306 sbPointsPanel.ResetColor(); | |
1307 } | |
1308 } | |
1309 } | |
1310 | |
190 | 1311 private void SetPointsPanelToolTipText() |
1312 { | |
1313 sbPointsPanel.ToolTipText = Translation.GetTranslation("statusPanelPointsToolTip", "total points value"); | |
1314 } | |
1315 | |
142 | 1316 private void redoMenu_Click(object sender, EventArgs e) |
1317 { | |
1318 if (sender is ToolStripDropDownItem) | |
1319 { | |
1320 ToolStripDropDownItem item = (ToolStripDropDownItem)sender; | |
1321 //we know it's an redo menu item so find it's index and redo everything | |
1322 int max = bttnRedo.DropDownItems.IndexOf(item); | |
1323 | |
1324 if (max >= 0) | |
1325 { | |
1326 for (int i = 0; i <= max; i++) | |
1327 { | |
1328 commandStack.Redo(); | |
1329 } | |
1330 } | |
1331 } | |
1332 } | |
1333 | |
1334 private void undoMenu_Click(object sender, EventArgs e) | |
1335 { | |
1336 if (sender is ToolStripDropDownItem) | |
1337 { | |
1338 ToolStripDropDownItem item = (ToolStripDropDownItem)sender; | |
1339 //we know it's an redo menu item so find it's index and redo everything | |
1340 int max = bttnUndo.DropDownItems.IndexOf(item); | |
1341 | |
1342 if (max >= 0) | |
1343 { | |
1344 for (int i = 0; i <= max; i++) | |
1345 { | |
1346 commandStack.Undo(); | |
1347 } | |
1348 } | |
1349 } | |
1350 } | |
1351 | |
1352 private void statusBar_DrawItem(object sender, System.Windows.Forms.StatusBarDrawItemEventArgs sbdevent) | |
1353 { | |
1354 statusBar.ColorableStatusBarDrawItem(sender, sbdevent); | |
1355 } | |
1356 | |
1357 private void FrmMain_Closing(object sender, CancelEventArgs e) | |
1358 { | |
1359 if (!CloseCurrentArmy()) | |
1360 { | |
1361 e.Cancel = true; | |
1362 } | |
1363 } | |
1364 | |
1365 private void miReloadFiles_Click(object sender, System.EventArgs e) | |
1366 { | |
1367 WarFoundryLoader.GetDefault().LoadFiles(); | |
1368 sbMainPanel.Text = Translation.GetTranslation("GameSystemFilesReloaded", "Game system and race files reloaded"); | |
1369 } | |
1370 | |
1371 private void statusBar_PanelClick(object sender, StatusBarPanelClickEventArgs e) | |
1372 { | |
1373 if (e.StatusBarPanel == sbErrorPanel && sbErrorPanel.Text!="") | |
1374 { | |
1375 MessageBox.Show(this, sbErrorPanel.TagString, Translation.GetTranslation("FailedRequirementMessage"), MessageBoxButtons.OK, MessageBoxIcon.Warning); | |
1376 } | |
1377 } | |
1378 | |
1379 private void miExportArmyAsBasicHTML_Click(object sender, EventArgs e) | |
1380 { | |
1381 SaveFileDialog dialog = new SaveFileDialog(); | |
1382 dialog.Filter = Translation.GetTranslation("armyExportBasicHtmlFilter", "HTML pages") + "|*.html"; | |
1383 dialog.Title = Translation.GetTranslation("exportArmyDialog", "Export army"); | |
1384 | |
1385 DialogResult dr = dialog.ShowDialog(this); | |
1386 | |
1387 if (dr == DialogResult.OK) | |
1388 { | |
1389 Army army = CurrentArmy; | |
1390 string filePath = dialog.FileName; | |
1391 log.DebugFormat("Exporting {0} to {1} as basic HTML", army.Name, filePath); | |
1392 WarFoundryHtmlExporter.GetDefault().ExportArmy(army, filePath); | |
1393 } | |
1394 } | |
1395 | |
1396 private void FrmMain_Load(object sender, EventArgs e) | |
1397 { | |
1398 string gameSystemID = Preferences.GetStringProperty("currSystem"); | |
1399 | |
1400 if (gameSystemID != null && !"".Equals(gameSystemID)) | |
1401 { | |
1402 log.Debug("Attempting to load current game system from properties"); | |
1403 GameSystem sys = WarFoundryLoader.GetDefault().GetGameSystem(gameSystemID); | |
1404 | |
1405 if (sys != null) | |
1406 { | |
1407 WarFoundryCore.CurrentGameSystem = sys; | |
1408 log.InfoFormat("Loaded game system {0} from properties", gameSystemID); | |
1409 } | |
1410 } | |
1411 } | |
1412 | |
1413 private void miAbout_Click(object sender, EventArgs e) | |
1414 { | |
1415 FrmAbout about = new FrmAbout(); | |
1416 about.ShowDialog(this); | |
140
60c795eca8de
Re #265: Add language preference UI
IBBoard <dev@ibboard.co.uk>
parents:
137
diff
changeset
|
1417 } |
60c795eca8de
Re #265: Add language preference UI
IBBoard <dev@ibboard.co.uk>
parents:
137
diff
changeset
|
1418 |
60c795eca8de
Re #265: Add language preference UI
IBBoard <dev@ibboard.co.uk>
parents:
137
diff
changeset
|
1419 private void miPreferences_Click(object sender, EventArgs e) |
60c795eca8de
Re #265: Add language preference UI
IBBoard <dev@ibboard.co.uk>
parents:
137
diff
changeset
|
1420 { |
60c795eca8de
Re #265: Add language preference UI
IBBoard <dev@ibboard.co.uk>
parents:
137
diff
changeset
|
1421 FrmPreferences prefsForm = new FrmPreferences(Preferences); |
60c795eca8de
Re #265: Add language preference UI
IBBoard <dev@ibboard.co.uk>
parents:
137
diff
changeset
|
1422 prefsForm.Show(this); |
142 | 1423 } |
1424 } | |
1425 } |