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