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