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