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