annotate FrmMain.cs @ 130:9d5d885965f9

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