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