diff --git a/BizHawk.Client.EmuHawk/MainForm.Events.cs b/BizHawk.Client.EmuHawk/MainForm.Events.cs index 65decb7aeb..a0c8618b96 100644 --- a/BizHawk.Client.EmuHawk/MainForm.Events.cs +++ b/BizHawk.Client.EmuHawk/MainForm.Events.cs @@ -1874,7 +1874,7 @@ namespace BizHawk.Client.EmuHawk sub = new Subtitle { Frame = Global.Emulator.Frame }; } - subForm.sub = sub; + subForm.Sub = sub; if (subForm.ShowDialog() == DialogResult.OK) { @@ -1883,7 +1883,7 @@ namespace BizHawk.Client.EmuHawk Global.MovieSession.Movie.Subtitles.RemoveAt(index); } - Global.MovieSession.Movie.Subtitles.Add(subForm.sub); + Global.MovieSession.Movie.Subtitles.Add(subForm.Sub); } } diff --git a/BizHawk.Client.EmuHawk/config/AutofireConfig.cs b/BizHawk.Client.EmuHawk/config/AutofireConfig.cs index eb644d4ff9..7d23c15ead 100644 --- a/BizHawk.Client.EmuHawk/config/AutofireConfig.cs +++ b/BizHawk.Client.EmuHawk/config/AutofireConfig.cs @@ -1,10 +1,4 @@ using System; -using System.Collections.Generic; -using System.ComponentModel; -using System.Data; -using System.Drawing; -using System.Linq; -using System.Text; using System.Windows.Forms; using BizHawk.Client.Common; @@ -21,20 +15,32 @@ namespace BizHawk.Client.EmuHawk private void AutofireConfig_Load(object sender, EventArgs e) { if (Global.Config.AutofireOn < OnNumeric.Minimum) + { OnNumeric.Value = OnNumeric.Minimum; + } else if (Global.Config.AutofireOn > OnNumeric.Maximum) + { OnNumeric.Value = OnNumeric.Maximum; + } else + { OnNumeric.Value = Global.Config.AutofireOn; + } if (Global.Config.AutofireOff < OffNumeric.Minimum) + { OffNumeric.Value = OffNumeric.Minimum; + } else if (Global.Config.AutofireOff > OffNumeric.Maximum) + { OffNumeric.Value = OffNumeric.Maximum; + } else + { OffNumeric.Value = Global.Config.AutofireOff; + } - LagFrameCheck.Checked = Global.Config.AutofireLagFrames; + LagFrameCheck.Checked = Global.Config.AutofireLagFrames; } private void Ok_Click(object sender, EventArgs e) @@ -45,13 +51,13 @@ namespace BizHawk.Client.EmuHawk Global.AutofireStickyXORAdapter.SetOnOffPatternFromConfig(); GlobalWin.OSD.AddMessage("Autofire settings saved"); - this.Close(); + Close(); } private void Cancel_Click(object sender, EventArgs e) { GlobalWin.OSD.AddMessage("Autofire config aborted"); - this.Close(); + Close(); } } } diff --git a/BizHawk.Client.EmuHawk/config/ControllerConfig.cs b/BizHawk.Client.EmuHawk/config/ControllerConfig.cs index e370d98b4b..3cca646bd8 100644 --- a/BizHawk.Client.EmuHawk/config/ControllerConfig.cs +++ b/BizHawk.Client.EmuHawk/config/ControllerConfig.cs @@ -54,36 +54,39 @@ namespace BizHawk.Client.EmuHawk return cp; } - private Control CreateAnalogPanel(Dictionary settings, List buttons, Size size) + private static Control CreateAnalogPanel(Dictionary settings, List buttons, Size size) { - var acp = new AnalogBindPanel(settings, buttons) { Dock = DockStyle.Fill }; - return acp; + return new AnalogBindPanel(settings, buttons) { Dock = DockStyle.Fill }; } - static void LoadToPanel(Control dest, string ControllerName, IEnumerable ControllerButtons, Dictionary> settingsblock, T defaultvalue, PanelCreator createpanel) + static void LoadToPanel(Control dest, string controllerName, IEnumerable controllerButtons, IDictionary> settingsblock, T defaultvalue, PanelCreator createpanel) { Dictionary settings; - if (!settingsblock.TryGetValue(ControllerName, out settings)) + if (!settingsblock.TryGetValue(controllerName, out settings)) { settings = new Dictionary(); - settingsblock[ControllerName] = settings; + settingsblock[controllerName] = settings; } // check to make sure that the settings object has all of the appropriate boolbuttons - foreach (string button in ControllerButtons) + foreach (var button in controllerButtons) { if (!settings.Keys.Contains(button)) settings[button] = defaultvalue; } if (settings.Keys.Count == 0) + { return; + } // split the list of all settings into buckets by player number - List[] buckets = new List[MAXPLAYERS + 1]; + var buckets = new List[MAXPLAYERS + 1]; for (int i = 0; i < buckets.Length; i++) + { buckets[i] = new List(); + } - foreach (string button in settings.Keys) + foreach (var button in settings.Keys) { int i; for (i = 1; i <= MAXPLAYERS; i++) @@ -118,29 +121,21 @@ namespace BizHawk.Client.EmuHawk } if (buckets[0].Count > 0) { - if (Global.Emulator.SystemId == "C64") //This is a kludge, if there starts to be more exceptions to this pattern, we will need a more robust solution - { - tt.TabPages.Add("Keyboard"); - } - else - { - tt.TabPages.Add("Console"); - } + tt.TabPages.Add(Global.Emulator.SystemId == "C64" ? "Keyboard" : "Console"); tt.TabPages[pageidx].Controls.Add(createpanel(settings, buckets[0], tt.Size)); } } } - private readonly ControllerDefinition the_definition; + private readonly ControllerDefinition _theDefinition; public ControllerConfig(ControllerDefinition def) : this() { - the_definition = def; + _theDefinition = def; SuspendLayout(); LoadPanels(Global.Config); - Text = def.Name + " Configuration"; checkBoxUDLR.Checked = Global.Config.AllowUD_LR; checkBoxAutoTab.Checked = Global.Config.InputConfigAutoTab; @@ -154,13 +149,13 @@ namespace BizHawk.Client.EmuHawk ResumeLayout(); } - private void LoadPanels(Dictionary> normal, - Dictionary> autofire, - Dictionary> analog) + private void LoadPanels(IDictionary> normal, + IDictionary> autofire, + IDictionary> analog) { - LoadToPanel(tabPage1, the_definition.Name, the_definition.BoolButtons, normal, "", CreateNormalPanel); - LoadToPanel(tabPage2, the_definition.Name, the_definition.BoolButtons, autofire, "", CreateNormalPanel); - LoadToPanel(tabPage3, the_definition.Name, the_definition.FloatControls, analog, new Config.AnalogBind("", 1.0f, 0.1f), CreateAnalogPanel); + LoadToPanel(tabPage1, _theDefinition.Name, _theDefinition.BoolButtons, normal, "", CreateNormalPanel); + LoadToPanel(tabPage2, _theDefinition.Name, _theDefinition.BoolButtons, autofire, "", CreateNormalPanel); + LoadToPanel(tabPage3, _theDefinition.Name, _theDefinition.FloatControls, analog, new Config.AnalogBind("", 1.0f, 0.1f), CreateAnalogPanel); if (tabPage3.Controls.Count == 0) { @@ -178,20 +173,22 @@ namespace BizHawk.Client.EmuHawk LoadPanels(c.AllTrollers, c.AllTrollersAutoFire, c.AllTrollersAnalog); } - void SetControllerPicture(string ControlName) + void SetControllerPicture(string controlName) { Bitmap bmp; - if (!ControllerImages.TryGetValue(ControlName, out bmp)) + if (!ControllerImages.TryGetValue(controlName, out bmp)) + { bmp = Properties.Resources.Help; + } pictureBox1.Image = bmp; pictureBox1.Size = bmp.Size; tableLayoutPanel1.ColumnStyles[1].Width = bmp.Width; //Uberhack - if (ControlName == "Commodore 64 Controller") + if (controlName == "Commodore 64 Controller") { - PictureBox pictureBox2 = new PictureBox + var pictureBox2 = new PictureBox { Image = Properties.Resources.C64Keyboard, Size = Properties.Resources.C64Keyboard.Size @@ -213,27 +210,33 @@ namespace BizHawk.Client.EmuHawk static void SetAutoTab(Control c, bool value) { if (c is ControllerConfigPanel) + { (c as ControllerConfigPanel).SetAutoTab(value); + } else if (c is AnalogBindPanel) { // TODO } else if (c.HasChildren) + { foreach (Control cc in c.Controls) + { SetAutoTab(cc, value); + } + } } void Save() { - ActOnControlCollection(tabPage1, c => c.Save(Global.Config.AllTrollers[the_definition.Name])); - ActOnControlCollection(tabPage2, c => c.Save(Global.Config.AllTrollersAutoFire[the_definition.Name])); - ActOnControlCollection(tabPage3, c => c.Save(Global.Config.AllTrollersAnalog[the_definition.Name])); + ActOnControlCollection(tabPage1, c => c.Save(Global.Config.AllTrollers[_theDefinition.Name])); + ActOnControlCollection(tabPage2, c => c.Save(Global.Config.AllTrollersAutoFire[_theDefinition.Name])); + ActOnControlCollection(tabPage3, c => c.Save(Global.Config.AllTrollersAnalog[_theDefinition.Name])); } void SaveToDefaults(ControlDefaults cd) { - ActOnControlCollection(tabPage1, c => c.Save(cd.AllTrollers[the_definition.Name])); - ActOnControlCollection(tabPage2, c => c.Save(cd.AllTrollersAutoFire[the_definition.Name])); - ActOnControlCollection(tabPage3, c => c.Save(cd.AllTrollersAnalog[the_definition.Name])); + ActOnControlCollection(tabPage1, c => c.Save(cd.AllTrollers[_theDefinition.Name])); + ActOnControlCollection(tabPage2, c => c.Save(cd.AllTrollersAutoFire[_theDefinition.Name])); + ActOnControlCollection(tabPage3, c => c.Save(cd.AllTrollersAnalog[_theDefinition.Name])); } static void ActOnControlCollection(Control c, Action proc) @@ -275,10 +278,10 @@ namespace BizHawk.Client.EmuHawk private void NewControllerConfig_Load(object sender, EventArgs e) { - + Text = _theDefinition.Name + " Configuration"; } - private TabControl GetTabControl(IEnumerable controls) + private static TabControl GetTabControl(IEnumerable controls) { if (controls != null) { @@ -294,10 +297,10 @@ namespace BizHawk.Client.EmuHawk { tabControl1.SuspendLayout(); - string wasTabbedMain = tabControl1.SelectedTab.Name; - TabControl tb1 = GetTabControl(tabPage1.Controls); - TabControl tb2 = GetTabControl(tabPage2.Controls); - TabControl tb3 = GetTabControl(tabPage3.Controls); + var wasTabbedMain = tabControl1.SelectedTab.Name; + var tb1 = GetTabControl(tabPage1.Controls); + var tb2 = GetTabControl(tabPage2.Controls); + var tb3 = GetTabControl(tabPage3.Controls); int? wasTabbedPage1 = null; int? wasTabbedPage2 = null; int? wasTabbedPage3 = null; @@ -313,7 +316,7 @@ namespace BizHawk.Client.EmuHawk // load panels directly from the default config. // this means that the changes are NOT committed. so "Cancel" works right and you // still have to hit OK at the end. - ControlDefaults cd = new ControlDefaults(); + var cd = new ControlDefaults(); cd = ConfigService.Load(Config.ControlDefaultPath, cd); LoadPanels(cd); @@ -321,7 +324,7 @@ namespace BizHawk.Client.EmuHawk if (wasTabbedPage1.HasValue) { - TabControl newTb1 = GetTabControl(tabPage1.Controls); + var newTb1 = GetTabControl(tabPage1.Controls); if (newTb1 != null) { newTb1.SelectTab(wasTabbedPage1.Value); @@ -330,7 +333,7 @@ namespace BizHawk.Client.EmuHawk if (wasTabbedPage2.HasValue) { - TabControl newTb2 = GetTabControl(tabPage2.Controls); + var newTb2 = GetTabControl(tabPage2.Controls); if (newTb2 != null) { newTb2.SelectTab(wasTabbedPage2.Value); @@ -339,7 +342,7 @@ namespace BizHawk.Client.EmuHawk if (wasTabbedPage3.HasValue) { - TabControl newTb3 = GetTabControl(tabPage3.Controls); + var newTb3 = GetTabControl(tabPage3.Controls); if (newTb3 != null) { newTb3.SelectTab(wasTabbedPage3.Value); @@ -354,11 +357,11 @@ namespace BizHawk.Client.EmuHawk var result = MessageBox.Show(this, "OK to overwrite defaults for current control scheme?", "Save Defaults", MessageBoxButtons.YesNo); if (result == DialogResult.Yes) { - ControlDefaults cd = new ControlDefaults(); + var cd = new ControlDefaults(); cd = ConfigService.Load(Config.ControlDefaultPath, cd); - cd.AllTrollers[the_definition.Name] = new Dictionary(); - cd.AllTrollersAutoFire[the_definition.Name] = new Dictionary(); - cd.AllTrollersAnalog[the_definition.Name] = new Dictionary(); + cd.AllTrollers[_theDefinition.Name] = new Dictionary(); + cd.AllTrollersAutoFire[_theDefinition.Name] = new Dictionary(); + cd.AllTrollersAnalog[_theDefinition.Name] = new Dictionary(); SaveToDefaults(cd); diff --git a/BizHawk.Client.EmuHawk/config/HotkeyConfig.cs b/BizHawk.Client.EmuHawk/config/HotkeyConfig.cs index 9b8b70b628..810549c08a 100644 --- a/BizHawk.Client.EmuHawk/config/HotkeyConfig.cs +++ b/BizHawk.Client.EmuHawk/config/HotkeyConfig.cs @@ -1,10 +1,7 @@ using System; using System.Collections.Generic; -using System.ComponentModel; -using System.Data; using System.Drawing; using System.Linq; -using System.Text; using System.Windows.Forms; using BizHawk.Client.Common; @@ -20,7 +17,7 @@ namespace BizHawk.Client.EmuHawk private void NewHotkeyWindow_Load(object sender, EventArgs e) { - AutoCompleteStringCollection source = new AutoCompleteStringCollection(); + var source = new AutoCompleteStringCollection(); source.AddRange(Global.Config.HotkeyBindings.Select(x => x.DisplayName).ToArray()); SearchBox.AutoCompleteCustomSource = source; @@ -59,21 +56,21 @@ namespace BizHawk.Client.EmuHawk { Global.Config.HotkeyConfigAutoTab = AutoTabCheckBox.Checked; - foreach (InputWidget w in _inputWidgets) + foreach (var w in InputWidgets) { var b = Global.Config.HotkeyBindings.FirstOrDefault(x => x.DisplayName == w.WidgetName); b.Bindings = w.Text; } } - private List _inputWidgets + private IEnumerable InputWidgets { get { - List widgets = new List(); - for (int x = 0; x < HotkeyTabControl.TabPages.Count; x++) + var widgets = new List(); + for (var x = 0; x < HotkeyTabControl.TabPages.Count; x++) { - for (int y = 0; y < HotkeyTabControl.TabPages[x].Controls.Count; y++) + for (var y = 0; y < HotkeyTabControl.TabPages[x].Controls.Count; y++) { if (HotkeyTabControl.TabPages[x].Controls[y] is InputWidget) { @@ -90,35 +87,33 @@ namespace BizHawk.Client.EmuHawk HotkeyTabControl.TabPages.Clear(); //Buckets - List Tabs = Global.Config.HotkeyBindings.Select(x => x.TabGroup).Distinct().ToList(); - foreach (string tab in Tabs) + var Tabs = Global.Config.HotkeyBindings.Select(x => x.TabGroup).Distinct().ToList(); + var _y = 14; + var _x = 6; + foreach (var tab in Tabs) { - TabPage tb = new TabPage(); - tb.Name = tab; - tb.Text = tab; + var tb = new TabPage {Name = tab, Text = tab}; var bindings = Global.Config.HotkeyBindings.Where(x => x.TabGroup == tab).OrderBy(x => x.Ordinal).ThenBy(x => x.DisplayName).ToList(); - int _x = 6; - int _y = 14; - int iw_offset_x = 110; - int iw_offset_y = -4; - int iw_width = 120; + const int iwOffsetX = 110; + const int iwOffsetY = -4; + const int iwWidth = 120; foreach (var b in bindings) { - Label l = new Label() - { + var l = new Label + { Text = b.DisplayName, Location = new Point(_x, _y), - Width = iw_offset_x - 2, + Width = iwOffsetX - 2, }; - InputWidget w = new InputWidget() - { + var w = new InputWidget + { Bindings = b.Bindings, - Location = new Point(_x + iw_offset_x, _y + iw_offset_y), + Location = new Point(_x + iwOffsetX, _y + iwOffsetY), AutoTab = AutoTabCheckBox.Checked, - Width = iw_width, + Width = iwWidth, WidgetName = b.DisplayName, }; @@ -128,7 +123,7 @@ namespace BizHawk.Client.EmuHawk _y += 24; if (_y > HotkeyTabControl.Height - 35) { - _x += iw_offset_x + iw_width + 10; + _x += iwOffsetX + iwWidth + 10; _y = 14; } } @@ -139,16 +134,16 @@ namespace BizHawk.Client.EmuHawk private void Defaults() { - foreach (InputWidget w in _inputWidgets) + foreach (var w in InputWidgets) { var b = Global.Config.HotkeyBindings.FirstOrDefault(x => x.DisplayName == w.WidgetName); - w.Text = b.DefaultBinding; + if (b != null) w.Text = b.DefaultBinding; } } private void SetAutoTab() { - foreach (InputWidget w in _inputWidgets) + foreach (var w in InputWidgets) { w.AutoTab = AutoTabCheckBox.Checked; } @@ -163,13 +158,10 @@ namespace BizHawk.Client.EmuHawk { if (HotkeyTabControl.SelectedTab != null) { - foreach (Control c in HotkeyTabControl.SelectedTab.Controls) + foreach (var c in HotkeyTabControl.SelectedTab.Controls.OfType()) { - if (c is InputWidget) - { - (c as InputWidget).Focus(); - return; - } + c.Focus(); + return; } } } @@ -180,14 +172,12 @@ namespace BizHawk.Client.EmuHawk if (!e.Control && !e.Alt && !e.Shift && (e.KeyCode == Keys.Enter || e.KeyCode == Keys.Tab)) { - string user_selection = SearchBox.Text; - var b = Global.Config.HotkeyBindings.FirstOrDefault(x => x.DisplayName == SearchBox.Text); //Found if (b != null) { - InputWidget w = _inputWidgets.FirstOrDefault(x => x.WidgetName == b.DisplayName); + var w = InputWidgets.FirstOrDefault(x => x.WidgetName == b.DisplayName); if (w != null) { HotkeyTabControl.SelectTab((w.Parent as TabPage)); diff --git a/BizHawk.Client.EmuHawk/config/MessageConfig.Designer.cs b/BizHawk.Client.EmuHawk/config/MessageConfig.Designer.cs index fcb09de3d2..325b3a135b 100644 --- a/BizHawk.Client.EmuHawk/config/MessageConfig.Designer.cs +++ b/BizHawk.Client.EmuHawk/config/MessageConfig.Designer.cs @@ -28,665 +28,665 @@ /// private void InitializeComponent() { - this.OK = new System.Windows.Forms.Button(); - this.MessageTypeBox = new System.Windows.Forms.GroupBox(); - this.AutoholdLabel = new System.Windows.Forms.Label(); - this.AutoholdRadio = new System.Windows.Forms.RadioButton(); - this.MultitrackLabel = new System.Windows.Forms.Label(); - this.MultitrackRadio = new System.Windows.Forms.RadioButton(); - this.RerecLabel = new System.Windows.Forms.Label(); - this.RerecordsRadio = new System.Windows.Forms.RadioButton(); - this.MessLabel = new System.Windows.Forms.Label(); - this.InpLabel = new System.Windows.Forms.Label(); - this.LagLabel = new System.Windows.Forms.Label(); - this.FCLabel = new System.Windows.Forms.Label(); - this.FpsPosLabel = new System.Windows.Forms.Label(); - this.MessagesRadio = new System.Windows.Forms.RadioButton(); - this.InputDisplayRadio = new System.Windows.Forms.RadioButton(); - this.LagCounterRadio = new System.Windows.Forms.RadioButton(); - this.FrameCounterRadio = new System.Windows.Forms.RadioButton(); - this.FPSRadio = new System.Windows.Forms.RadioButton(); - this.groupBox2 = new System.Windows.Forms.GroupBox(); - this.label12 = new System.Windows.Forms.Label(); - this.MovieInputText = new System.Windows.Forms.TextBox(); - this.label11 = new System.Windows.Forms.Label(); - this.MovieInputColor = new System.Windows.Forms.Panel(); - this.LInputColorPanel = new System.Windows.Forms.Panel(); - this.AlertColorPanel = new System.Windows.Forms.Panel(); - this.ColorPanel = new System.Windows.Forms.Panel(); - this.label7 = new System.Windows.Forms.Label(); - this.label8 = new System.Windows.Forms.Label(); - this.LInputText = new System.Windows.Forms.TextBox(); - this.label6 = new System.Windows.Forms.Label(); - this.label5 = new System.Windows.Forms.Label(); - this.AlertColorText = new System.Windows.Forms.TextBox(); - this.label4 = new System.Windows.Forms.Label(); - this.label3 = new System.Windows.Forms.Label(); - this.ColorText = new System.Windows.Forms.TextBox(); - this.MessageColorDialog = new System.Windows.Forms.ColorDialog(); - this.Cancel = new System.Windows.Forms.Button(); - this.ResetDefaultsButton = new System.Windows.Forms.Button(); - this.PositionPanel = new System.Windows.Forms.Panel(); - this.XNumeric = new System.Windows.Forms.NumericUpDown(); - this.YNumeric = new System.Windows.Forms.NumericUpDown(); - this.label1 = new System.Windows.Forms.Label(); - this.label2 = new System.Windows.Forms.Label(); - this.PositionGroupBox = new System.Windows.Forms.GroupBox(); - this.BR = new System.Windows.Forms.RadioButton(); - this.BL = new System.Windows.Forms.RadioButton(); - this.TR = new System.Windows.Forms.RadioButton(); - this.TL = new System.Windows.Forms.RadioButton(); - this.AlertColorDialog = new System.Windows.Forms.ColorDialog(); - this.LInputColorDialog = new System.Windows.Forms.ColorDialog(); - this.MovieInputColorDialog = new System.Windows.Forms.ColorDialog(); - this.StackMessagesCheckbox = new System.Windows.Forms.CheckBox(); - this.MessageTypeBox.SuspendLayout(); - this.groupBox2.SuspendLayout(); - ((System.ComponentModel.ISupportInitialize)(this.XNumeric)).BeginInit(); - ((System.ComponentModel.ISupportInitialize)(this.YNumeric)).BeginInit(); - this.PositionGroupBox.SuspendLayout(); - this.SuspendLayout(); - // - // OK - // - this.OK.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); - this.OK.Location = new System.Drawing.Point(418, 434); - this.OK.Name = "OK"; - this.OK.Size = new System.Drawing.Size(75, 23); - this.OK.TabIndex = 1; - this.OK.Text = "&OK"; - this.OK.UseVisualStyleBackColor = true; - this.OK.Click += new System.EventHandler(this.OK_Click); - // - // MessageTypeBox - // - this.MessageTypeBox.Controls.Add(this.AutoholdLabel); - this.MessageTypeBox.Controls.Add(this.AutoholdRadio); - this.MessageTypeBox.Controls.Add(this.MultitrackLabel); - this.MessageTypeBox.Controls.Add(this.MultitrackRadio); - this.MessageTypeBox.Controls.Add(this.RerecLabel); - this.MessageTypeBox.Controls.Add(this.RerecordsRadio); - this.MessageTypeBox.Controls.Add(this.MessLabel); - this.MessageTypeBox.Controls.Add(this.InpLabel); - this.MessageTypeBox.Controls.Add(this.LagLabel); - this.MessageTypeBox.Controls.Add(this.FCLabel); - this.MessageTypeBox.Controls.Add(this.FpsPosLabel); - this.MessageTypeBox.Controls.Add(this.MessagesRadio); - this.MessageTypeBox.Controls.Add(this.InputDisplayRadio); - this.MessageTypeBox.Controls.Add(this.LagCounterRadio); - this.MessageTypeBox.Controls.Add(this.FrameCounterRadio); - this.MessageTypeBox.Controls.Add(this.FPSRadio); - this.MessageTypeBox.Location = new System.Drawing.Point(12, 12); - this.MessageTypeBox.Name = "MessageTypeBox"; - this.MessageTypeBox.Size = new System.Drawing.Size(177, 216); - this.MessageTypeBox.TabIndex = 2; - this.MessageTypeBox.TabStop = false; - this.MessageTypeBox.Text = "Message Type"; - // - // AutoholdLabel - // - this.AutoholdLabel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); - this.AutoholdLabel.AutoSize = true; - this.AutoholdLabel.Location = new System.Drawing.Point(126, 188); - this.AutoholdLabel.Name = "AutoholdLabel"; - this.AutoholdLabel.Size = new System.Drawing.Size(49, 13); - this.AutoholdLabel.TabIndex = 15; - this.AutoholdLabel.Text = "255, 255"; - // - // AutoholdRadio - // - this.AutoholdRadio.AutoSize = true; - this.AutoholdRadio.Location = new System.Drawing.Point(6, 186); - this.AutoholdRadio.Name = "AutoholdRadio"; - this.AutoholdRadio.Size = new System.Drawing.Size(67, 17); - this.AutoholdRadio.TabIndex = 14; - this.AutoholdRadio.TabStop = true; - this.AutoholdRadio.Text = "Autohold"; - this.AutoholdRadio.UseVisualStyleBackColor = true; - this.AutoholdRadio.CheckedChanged += new System.EventHandler(this.AutoholdRadio_CheckedChanged); - // - // MultitrackLabel - // - this.MultitrackLabel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); - this.MultitrackLabel.AutoSize = true; - this.MultitrackLabel.Location = new System.Drawing.Point(126, 164); - this.MultitrackLabel.Name = "MultitrackLabel"; - this.MultitrackLabel.Size = new System.Drawing.Size(49, 13); - this.MultitrackLabel.TabIndex = 13; - this.MultitrackLabel.Text = "255, 255"; - // - // MultitrackRadio - // - this.MultitrackRadio.AutoSize = true; - this.MultitrackRadio.Location = new System.Drawing.Point(6, 162); - this.MultitrackRadio.Name = "MultitrackRadio"; - this.MultitrackRadio.Size = new System.Drawing.Size(71, 17); - this.MultitrackRadio.TabIndex = 12; - this.MultitrackRadio.TabStop = true; - this.MultitrackRadio.Text = "Multitrack"; - this.MultitrackRadio.UseVisualStyleBackColor = true; - this.MultitrackRadio.CheckedChanged += new System.EventHandler(this.MultitrackRadio_CheckedChanged); - // - // RerecLabel - // - this.RerecLabel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); - this.RerecLabel.AutoSize = true; - this.RerecLabel.Location = new System.Drawing.Point(126, 140); - this.RerecLabel.Name = "RerecLabel"; - this.RerecLabel.Size = new System.Drawing.Size(49, 13); - this.RerecLabel.TabIndex = 11; - this.RerecLabel.Text = "255, 255"; - // - // RerecordsRadio - // - this.RerecordsRadio.AutoSize = true; - this.RerecordsRadio.Location = new System.Drawing.Point(6, 138); - this.RerecordsRadio.Name = "RerecordsRadio"; - this.RerecordsRadio.Size = new System.Drawing.Size(74, 17); - this.RerecordsRadio.TabIndex = 10; - this.RerecordsRadio.Text = "Rerecords"; - this.RerecordsRadio.UseVisualStyleBackColor = true; - this.RerecordsRadio.CheckedChanged += new System.EventHandler(this.MessagesRadio_CheckedChanged); - // - // MessLabel - // - this.MessLabel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); - this.MessLabel.AutoSize = true; - this.MessLabel.Location = new System.Drawing.Point(126, 116); - this.MessLabel.Name = "MessLabel"; - this.MessLabel.Size = new System.Drawing.Size(49, 13); - this.MessLabel.TabIndex = 9; - this.MessLabel.Text = "255, 255"; - // - // InpLabel - // - this.InpLabel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); - this.InpLabel.AutoSize = true; - this.InpLabel.Location = new System.Drawing.Point(126, 92); - this.InpLabel.Name = "InpLabel"; - this.InpLabel.Size = new System.Drawing.Size(49, 13); - this.InpLabel.TabIndex = 8; - this.InpLabel.Text = "255, 255"; - // - // LagLabel - // - this.LagLabel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); - this.LagLabel.AutoSize = true; - this.LagLabel.Location = new System.Drawing.Point(126, 68); - this.LagLabel.Name = "LagLabel"; - this.LagLabel.Size = new System.Drawing.Size(49, 13); - this.LagLabel.TabIndex = 7; - this.LagLabel.Text = "255, 255"; - // - // FCLabel - // - this.FCLabel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); - this.FCLabel.AutoSize = true; - this.FCLabel.Location = new System.Drawing.Point(126, 44); - this.FCLabel.Name = "FCLabel"; - this.FCLabel.Size = new System.Drawing.Size(49, 13); - this.FCLabel.TabIndex = 6; - this.FCLabel.Text = "255, 255"; - // - // FpsPosLabel - // - this.FpsPosLabel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); - this.FpsPosLabel.AutoSize = true; - this.FpsPosLabel.Location = new System.Drawing.Point(126, 20); - this.FpsPosLabel.Name = "FpsPosLabel"; - this.FpsPosLabel.Size = new System.Drawing.Size(49, 13); - this.FpsPosLabel.TabIndex = 5; - this.FpsPosLabel.Text = "255, 255"; - // - // MessagesRadio - // - this.MessagesRadio.AutoSize = true; - this.MessagesRadio.Location = new System.Drawing.Point(6, 114); - this.MessagesRadio.Name = "MessagesRadio"; - this.MessagesRadio.Size = new System.Drawing.Size(73, 17); - this.MessagesRadio.TabIndex = 4; - this.MessagesRadio.Text = "Messages"; - this.MessagesRadio.UseVisualStyleBackColor = true; - this.MessagesRadio.CheckedChanged += new System.EventHandler(this.MessagesRadio_CheckedChanged); - // - // InputDisplayRadio - // - this.InputDisplayRadio.AutoSize = true; - this.InputDisplayRadio.Location = new System.Drawing.Point(6, 90); - this.InputDisplayRadio.Name = "InputDisplayRadio"; - this.InputDisplayRadio.Size = new System.Drawing.Size(86, 17); - this.InputDisplayRadio.TabIndex = 3; - this.InputDisplayRadio.Text = "Input Display"; - this.InputDisplayRadio.UseVisualStyleBackColor = true; - this.InputDisplayRadio.CheckedChanged += new System.EventHandler(this.InputDisplayRadio_CheckedChanged); - // - // LagCounterRadio - // - this.LagCounterRadio.AutoSize = true; - this.LagCounterRadio.Location = new System.Drawing.Point(6, 66); - this.LagCounterRadio.Name = "LagCounterRadio"; - this.LagCounterRadio.Size = new System.Drawing.Size(83, 17); - this.LagCounterRadio.TabIndex = 2; - this.LagCounterRadio.Text = "Lag Counter"; - this.LagCounterRadio.UseVisualStyleBackColor = true; - this.LagCounterRadio.CheckedChanged += new System.EventHandler(this.LagCounterRadio_CheckedChanged); - // - // FrameCounterRadio - // - this.FrameCounterRadio.AutoSize = true; - this.FrameCounterRadio.Location = new System.Drawing.Point(6, 42); - this.FrameCounterRadio.Name = "FrameCounterRadio"; - this.FrameCounterRadio.Size = new System.Drawing.Size(93, 17); - this.FrameCounterRadio.TabIndex = 1; - this.FrameCounterRadio.Text = "Frame counter"; - this.FrameCounterRadio.UseVisualStyleBackColor = true; - this.FrameCounterRadio.CheckedChanged += new System.EventHandler(this.FrameCounterRadio_CheckedChanged); - // - // FPSRadio - // - this.FPSRadio.AutoSize = true; - this.FPSRadio.Checked = true; - this.FPSRadio.Location = new System.Drawing.Point(6, 18); - this.FPSRadio.Name = "FPSRadio"; - this.FPSRadio.Size = new System.Drawing.Size(42, 17); - this.FPSRadio.TabIndex = 0; - this.FPSRadio.TabStop = true; - this.FPSRadio.Text = "Fps"; - this.FPSRadio.UseVisualStyleBackColor = true; - this.FPSRadio.CheckedChanged += new System.EventHandler(this.FPSRadio_CheckedChanged); - // - // groupBox2 - // - this.groupBox2.Controls.Add(this.label12); - this.groupBox2.Controls.Add(this.MovieInputText); - this.groupBox2.Controls.Add(this.label11); - this.groupBox2.Controls.Add(this.MovieInputColor); - this.groupBox2.Controls.Add(this.LInputColorPanel); - this.groupBox2.Controls.Add(this.AlertColorPanel); - this.groupBox2.Controls.Add(this.ColorPanel); - this.groupBox2.Controls.Add(this.label7); - this.groupBox2.Controls.Add(this.label8); - this.groupBox2.Controls.Add(this.LInputText); - this.groupBox2.Controls.Add(this.label6); - this.groupBox2.Controls.Add(this.label5); - this.groupBox2.Controls.Add(this.AlertColorText); - this.groupBox2.Controls.Add(this.label4); - this.groupBox2.Controls.Add(this.label3); - this.groupBox2.Controls.Add(this.ColorText); - this.groupBox2.Location = new System.Drawing.Point(12, 234); - this.groupBox2.Name = "groupBox2"; - this.groupBox2.Size = new System.Drawing.Size(177, 223); - this.groupBox2.TabIndex = 4; - this.groupBox2.TabStop = false; - this.groupBox2.Text = "Message Colors"; - // - // label12 - // - this.label12.AutoSize = true; - this.label12.Location = new System.Drawing.Point(1, 170); - this.label12.Name = "label12"; - this.label12.Size = new System.Drawing.Size(63, 13); - this.label12.TabIndex = 24; - this.label12.Text = "Movie Input"; - // - // MovieInputText - // - this.MovieInputText.CharacterCasing = System.Windows.Forms.CharacterCasing.Upper; - this.MovieInputText.Location = new System.Drawing.Point(45, 187); - this.MovieInputText.MaxLength = 8; - this.MovieInputText.Name = "MovieInputText"; - this.MovieInputText.ReadOnly = true; - this.MovieInputText.Size = new System.Drawing.Size(59, 20); - this.MovieInputText.TabIndex = 23; - // - // label11 - // - this.label11.AutoSize = true; - this.label11.Location = new System.Drawing.Point(28, 190); - this.label11.Name = "label11"; - this.label11.Size = new System.Drawing.Size(18, 13); - this.label11.TabIndex = 22; - this.label11.Text = "0x"; - // - // MovieInputColor - // - this.MovieInputColor.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D; - this.MovieInputColor.Location = new System.Drawing.Point(4, 187); - this.MovieInputColor.Name = "MovieInputColor"; - this.MovieInputColor.Size = new System.Drawing.Size(20, 20); - this.MovieInputColor.TabIndex = 9; - this.MovieInputColor.Click += new System.EventHandler(this.MovieInputColor_Click); - // - // LInputColorPanel - // - this.LInputColorPanel.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D; - this.LInputColorPanel.Location = new System.Drawing.Point(6, 139); - this.LInputColorPanel.Name = "LInputColorPanel"; - this.LInputColorPanel.Size = new System.Drawing.Size(20, 20); - this.LInputColorPanel.TabIndex = 7; - this.LInputColorPanel.Click += new System.EventHandler(this.LInputColorPanel_Click); - // - // AlertColorPanel - // - this.AlertColorPanel.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D; - this.AlertColorPanel.Location = new System.Drawing.Point(6, 90); - this.AlertColorPanel.Name = "AlertColorPanel"; - this.AlertColorPanel.Size = new System.Drawing.Size(20, 20); - this.AlertColorPanel.TabIndex = 7; - this.AlertColorPanel.Click += new System.EventHandler(this.AlertColorPanel_Click); - // - // ColorPanel - // - this.ColorPanel.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D; - this.ColorPanel.Location = new System.Drawing.Point(6, 43); - this.ColorPanel.Name = "ColorPanel"; - this.ColorPanel.Size = new System.Drawing.Size(20, 20); - this.ColorPanel.TabIndex = 7; - this.ColorPanel.Click += new System.EventHandler(this.ColorPanel_Click); - // - // label7 - // - this.label7.AutoSize = true; - this.label7.Location = new System.Drawing.Point(1, 120); - this.label7.Name = "label7"; - this.label7.Size = new System.Drawing.Size(86, 13); - this.label7.TabIndex = 18; - this.label7.Text = "Last Frame Input"; - // - // label8 - // - this.label8.AutoSize = true; - this.label8.Location = new System.Drawing.Point(28, 142); - this.label8.Name = "label8"; - this.label8.Size = new System.Drawing.Size(18, 13); - this.label8.TabIndex = 17; - this.label8.Text = "0x"; - // - // LInputText - // - this.LInputText.CharacterCasing = System.Windows.Forms.CharacterCasing.Upper; - this.LInputText.Location = new System.Drawing.Point(45, 139); - this.LInputText.MaxLength = 8; - this.LInputText.Name = "LInputText"; - this.LInputText.ReadOnly = true; - this.LInputText.Size = new System.Drawing.Size(59, 20); - this.LInputText.TabIndex = 16; - // - // label6 - // - this.label6.AutoSize = true; - this.label6.Location = new System.Drawing.Point(1, 71); - this.label6.Name = "label6"; - this.label6.Size = new System.Drawing.Size(78, 13); - this.label6.TabIndex = 13; - this.label6.Text = "Alert messages"; - // - // label5 - // - this.label5.AutoSize = true; - this.label5.Location = new System.Drawing.Point(28, 93); - this.label5.Name = "label5"; - this.label5.Size = new System.Drawing.Size(18, 13); - this.label5.TabIndex = 12; - this.label5.Text = "0x"; - // - // AlertColorText - // - this.AlertColorText.CharacterCasing = System.Windows.Forms.CharacterCasing.Upper; - this.AlertColorText.Location = new System.Drawing.Point(45, 90); - this.AlertColorText.MaxLength = 8; - this.AlertColorText.Name = "AlertColorText"; - this.AlertColorText.ReadOnly = true; - this.AlertColorText.Size = new System.Drawing.Size(59, 20); - this.AlertColorText.TabIndex = 11; - // - // label4 - // - this.label4.AutoSize = true; - this.label4.Location = new System.Drawing.Point(6, 27); - this.label4.Name = "label4"; - this.label4.Size = new System.Drawing.Size(80, 13); - this.label4.TabIndex = 8; - this.label4.Text = "Main messages"; - // - // label3 - // - this.label3.AutoSize = true; - this.label3.Location = new System.Drawing.Point(28, 46); - this.label3.Name = "label3"; - this.label3.Size = new System.Drawing.Size(18, 13); - this.label3.TabIndex = 7; - this.label3.Text = "0x"; - // - // ColorText - // - this.ColorText.CharacterCasing = System.Windows.Forms.CharacterCasing.Upper; - this.ColorText.Location = new System.Drawing.Point(45, 43); - this.ColorText.MaxLength = 8; - this.ColorText.Name = "ColorText"; - this.ColorText.ReadOnly = true; - this.ColorText.Size = new System.Drawing.Size(59, 20); - this.ColorText.TabIndex = 2; - // - // MessageColorDialog - // - this.MessageColorDialog.FullOpen = true; - // - // Cancel - // - this.Cancel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); - this.Cancel.DialogResult = System.Windows.Forms.DialogResult.Cancel; - this.Cancel.Location = new System.Drawing.Point(499, 434); - this.Cancel.Name = "Cancel"; - this.Cancel.Size = new System.Drawing.Size(75, 23); - this.Cancel.TabIndex = 5; - this.Cancel.Text = "&Cancel"; - this.Cancel.UseVisualStyleBackColor = true; - this.Cancel.Click += new System.EventHandler(this.Cancel_Click); - // - // ResetDefaultsButton - // - this.ResetDefaultsButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); - this.ResetDefaultsButton.Location = new System.Drawing.Point(195, 434); - this.ResetDefaultsButton.Name = "ResetDefaultsButton"; - this.ResetDefaultsButton.Size = new System.Drawing.Size(96, 23); - this.ResetDefaultsButton.TabIndex = 6; - this.ResetDefaultsButton.Text = "Restore Defaults"; - this.ResetDefaultsButton.UseVisualStyleBackColor = true; - this.ResetDefaultsButton.Click += new System.EventHandler(this.ResetDefaultsButton_Click); - // - // PositionPanel - // - this.PositionPanel.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D; - this.PositionPanel.Location = new System.Drawing.Point(22, 18); - this.PositionPanel.Name = "PositionPanel"; - this.PositionPanel.Size = new System.Drawing.Size(264, 248); - this.PositionPanel.TabIndex = 0; - this.PositionPanel.Paint += new System.Windows.Forms.PaintEventHandler(this.PositionPanel_Paint); - this.PositionPanel.MouseDown += new System.Windows.Forms.MouseEventHandler(this.PositionPanel_MouseDown); - this.PositionPanel.MouseEnter += new System.EventHandler(this.PositionPanel_MouseEnter); - this.PositionPanel.MouseLeave += new System.EventHandler(this.PositionPanel_MouseLeave); - this.PositionPanel.MouseMove += new System.Windows.Forms.MouseEventHandler(this.PositionPanel_MouseMove); - this.PositionPanel.MouseUp += new System.Windows.Forms.MouseEventHandler(this.PositionPanel_MouseUp); - // - // XNumeric - // - this.XNumeric.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); - this.XNumeric.Location = new System.Drawing.Point(43, 271); - this.XNumeric.Maximum = new decimal(new int[] { + this.OK = new System.Windows.Forms.Button(); + this.MessageTypeBox = new System.Windows.Forms.GroupBox(); + this.AutoholdLabel = new System.Windows.Forms.Label(); + this.AutoholdRadio = new System.Windows.Forms.RadioButton(); + this.MultitrackLabel = new System.Windows.Forms.Label(); + this.MultitrackRadio = new System.Windows.Forms.RadioButton(); + this.RerecLabel = new System.Windows.Forms.Label(); + this.RerecordsRadio = new System.Windows.Forms.RadioButton(); + this.MessLabel = new System.Windows.Forms.Label(); + this.InpLabel = new System.Windows.Forms.Label(); + this.LagLabel = new System.Windows.Forms.Label(); + this.FCLabel = new System.Windows.Forms.Label(); + this.FpsPosLabel = new System.Windows.Forms.Label(); + this.MessagesRadio = new System.Windows.Forms.RadioButton(); + this.InputDisplayRadio = new System.Windows.Forms.RadioButton(); + this.LagCounterRadio = new System.Windows.Forms.RadioButton(); + this.FrameCounterRadio = new System.Windows.Forms.RadioButton(); + this.FPSRadio = new System.Windows.Forms.RadioButton(); + this.groupBox2 = new System.Windows.Forms.GroupBox(); + this.label12 = new System.Windows.Forms.Label(); + this.MovieInputText = new System.Windows.Forms.TextBox(); + this.label11 = new System.Windows.Forms.Label(); + this.MovieInputColor = new System.Windows.Forms.Panel(); + this.LInputColorPanel = new System.Windows.Forms.Panel(); + this.AlertColorPanel = new System.Windows.Forms.Panel(); + this.ColorPanel = new System.Windows.Forms.Panel(); + this.label7 = new System.Windows.Forms.Label(); + this.label8 = new System.Windows.Forms.Label(); + this.LInputText = new System.Windows.Forms.TextBox(); + this.label6 = new System.Windows.Forms.Label(); + this.label5 = new System.Windows.Forms.Label(); + this.AlertColorText = new System.Windows.Forms.TextBox(); + this.label4 = new System.Windows.Forms.Label(); + this.label3 = new System.Windows.Forms.Label(); + this.ColorText = new System.Windows.Forms.TextBox(); + this.MessageColorDialog = new System.Windows.Forms.ColorDialog(); + this.Cancel = new System.Windows.Forms.Button(); + this.ResetDefaultsButton = new System.Windows.Forms.Button(); + this.PositionPanel = new System.Windows.Forms.Panel(); + this.XNumeric = new System.Windows.Forms.NumericUpDown(); + this.YNumeric = new System.Windows.Forms.NumericUpDown(); + this.label1 = new System.Windows.Forms.Label(); + this.label2 = new System.Windows.Forms.Label(); + this.PositionGroupBox = new System.Windows.Forms.GroupBox(); + this.BR = new System.Windows.Forms.RadioButton(); + this.BL = new System.Windows.Forms.RadioButton(); + this.TR = new System.Windows.Forms.RadioButton(); + this.TL = new System.Windows.Forms.RadioButton(); + this.AlertColorDialog = new System.Windows.Forms.ColorDialog(); + this.LInputColorDialog = new System.Windows.Forms.ColorDialog(); + this.MovieInputColorDialog = new System.Windows.Forms.ColorDialog(); + this.StackMessagesCheckbox = new System.Windows.Forms.CheckBox(); + this.MessageTypeBox.SuspendLayout(); + this.groupBox2.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.XNumeric)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.YNumeric)).BeginInit(); + this.PositionGroupBox.SuspendLayout(); + this.SuspendLayout(); + // + // OK + // + this.OK.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); + this.OK.Location = new System.Drawing.Point(418, 434); + this.OK.Name = "OK"; + this.OK.Size = new System.Drawing.Size(75, 23); + this.OK.TabIndex = 1; + this.OK.Text = "&OK"; + this.OK.UseVisualStyleBackColor = true; + this.OK.Click += new System.EventHandler(this.OK_Click); + // + // MessageTypeBox + // + this.MessageTypeBox.Controls.Add(this.AutoholdLabel); + this.MessageTypeBox.Controls.Add(this.AutoholdRadio); + this.MessageTypeBox.Controls.Add(this.MultitrackLabel); + this.MessageTypeBox.Controls.Add(this.MultitrackRadio); + this.MessageTypeBox.Controls.Add(this.RerecLabel); + this.MessageTypeBox.Controls.Add(this.RerecordsRadio); + this.MessageTypeBox.Controls.Add(this.MessLabel); + this.MessageTypeBox.Controls.Add(this.InpLabel); + this.MessageTypeBox.Controls.Add(this.LagLabel); + this.MessageTypeBox.Controls.Add(this.FCLabel); + this.MessageTypeBox.Controls.Add(this.FpsPosLabel); + this.MessageTypeBox.Controls.Add(this.MessagesRadio); + this.MessageTypeBox.Controls.Add(this.InputDisplayRadio); + this.MessageTypeBox.Controls.Add(this.LagCounterRadio); + this.MessageTypeBox.Controls.Add(this.FrameCounterRadio); + this.MessageTypeBox.Controls.Add(this.FPSRadio); + this.MessageTypeBox.Location = new System.Drawing.Point(12, 12); + this.MessageTypeBox.Name = "MessageTypeBox"; + this.MessageTypeBox.Size = new System.Drawing.Size(177, 216); + this.MessageTypeBox.TabIndex = 2; + this.MessageTypeBox.TabStop = false; + this.MessageTypeBox.Text = "Message Type"; + // + // AutoholdLabel + // + this.AutoholdLabel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + this.AutoholdLabel.AutoSize = true; + this.AutoholdLabel.Location = new System.Drawing.Point(126, 188); + this.AutoholdLabel.Name = "AutoholdLabel"; + this.AutoholdLabel.Size = new System.Drawing.Size(49, 13); + this.AutoholdLabel.TabIndex = 15; + this.AutoholdLabel.Text = "255, 255"; + // + // AutoholdRadio + // + this.AutoholdRadio.AutoSize = true; + this.AutoholdRadio.Location = new System.Drawing.Point(6, 186); + this.AutoholdRadio.Name = "AutoholdRadio"; + this.AutoholdRadio.Size = new System.Drawing.Size(67, 17); + this.AutoholdRadio.TabIndex = 14; + this.AutoholdRadio.TabStop = true; + this.AutoholdRadio.Text = "Autohold"; + this.AutoholdRadio.UseVisualStyleBackColor = true; + this.AutoholdRadio.CheckedChanged += new System.EventHandler(this.MessageTypeRadio_CheckedChanged); + // + // MultitrackLabel + // + this.MultitrackLabel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + this.MultitrackLabel.AutoSize = true; + this.MultitrackLabel.Location = new System.Drawing.Point(126, 164); + this.MultitrackLabel.Name = "MultitrackLabel"; + this.MultitrackLabel.Size = new System.Drawing.Size(49, 13); + this.MultitrackLabel.TabIndex = 13; + this.MultitrackLabel.Text = "255, 255"; + // + // MultitrackRadio + // + this.MultitrackRadio.AutoSize = true; + this.MultitrackRadio.Location = new System.Drawing.Point(6, 162); + this.MultitrackRadio.Name = "MultitrackRadio"; + this.MultitrackRadio.Size = new System.Drawing.Size(71, 17); + this.MultitrackRadio.TabIndex = 12; + this.MultitrackRadio.TabStop = true; + this.MultitrackRadio.Text = "Multitrack"; + this.MultitrackRadio.UseVisualStyleBackColor = true; + this.MultitrackRadio.CheckedChanged += new System.EventHandler(this.MessageTypeRadio_CheckedChanged); + // + // RerecLabel + // + this.RerecLabel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + this.RerecLabel.AutoSize = true; + this.RerecLabel.Location = new System.Drawing.Point(126, 140); + this.RerecLabel.Name = "RerecLabel"; + this.RerecLabel.Size = new System.Drawing.Size(49, 13); + this.RerecLabel.TabIndex = 11; + this.RerecLabel.Text = "255, 255"; + // + // RerecordsRadio + // + this.RerecordsRadio.AutoSize = true; + this.RerecordsRadio.Location = new System.Drawing.Point(6, 138); + this.RerecordsRadio.Name = "RerecordsRadio"; + this.RerecordsRadio.Size = new System.Drawing.Size(74, 17); + this.RerecordsRadio.TabIndex = 10; + this.RerecordsRadio.Text = "Rerecords"; + this.RerecordsRadio.UseVisualStyleBackColor = true; + this.RerecordsRadio.CheckedChanged += new System.EventHandler(this.MessageTypeRadio_CheckedChanged); + // + // MessLabel + // + this.MessLabel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + this.MessLabel.AutoSize = true; + this.MessLabel.Location = new System.Drawing.Point(126, 116); + this.MessLabel.Name = "MessLabel"; + this.MessLabel.Size = new System.Drawing.Size(49, 13); + this.MessLabel.TabIndex = 9; + this.MessLabel.Text = "255, 255"; + // + // InpLabel + // + this.InpLabel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + this.InpLabel.AutoSize = true; + this.InpLabel.Location = new System.Drawing.Point(126, 92); + this.InpLabel.Name = "InpLabel"; + this.InpLabel.Size = new System.Drawing.Size(49, 13); + this.InpLabel.TabIndex = 8; + this.InpLabel.Text = "255, 255"; + // + // LagLabel + // + this.LagLabel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + this.LagLabel.AutoSize = true; + this.LagLabel.Location = new System.Drawing.Point(126, 68); + this.LagLabel.Name = "LagLabel"; + this.LagLabel.Size = new System.Drawing.Size(49, 13); + this.LagLabel.TabIndex = 7; + this.LagLabel.Text = "255, 255"; + // + // FCLabel + // + this.FCLabel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + this.FCLabel.AutoSize = true; + this.FCLabel.Location = new System.Drawing.Point(126, 44); + this.FCLabel.Name = "FCLabel"; + this.FCLabel.Size = new System.Drawing.Size(49, 13); + this.FCLabel.TabIndex = 6; + this.FCLabel.Text = "255, 255"; + // + // FpsPosLabel + // + this.FpsPosLabel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + this.FpsPosLabel.AutoSize = true; + this.FpsPosLabel.Location = new System.Drawing.Point(126, 20); + this.FpsPosLabel.Name = "FpsPosLabel"; + this.FpsPosLabel.Size = new System.Drawing.Size(49, 13); + this.FpsPosLabel.TabIndex = 5; + this.FpsPosLabel.Text = "255, 255"; + // + // MessagesRadio + // + this.MessagesRadio.AutoSize = true; + this.MessagesRadio.Location = new System.Drawing.Point(6, 114); + this.MessagesRadio.Name = "MessagesRadio"; + this.MessagesRadio.Size = new System.Drawing.Size(73, 17); + this.MessagesRadio.TabIndex = 4; + this.MessagesRadio.Text = "Messages"; + this.MessagesRadio.UseVisualStyleBackColor = true; + this.MessagesRadio.CheckedChanged += new System.EventHandler(this.MessageTypeRadio_CheckedChanged); + // + // InputDisplayRadio + // + this.InputDisplayRadio.AutoSize = true; + this.InputDisplayRadio.Location = new System.Drawing.Point(6, 90); + this.InputDisplayRadio.Name = "InputDisplayRadio"; + this.InputDisplayRadio.Size = new System.Drawing.Size(86, 17); + this.InputDisplayRadio.TabIndex = 3; + this.InputDisplayRadio.Text = "Input Display"; + this.InputDisplayRadio.UseVisualStyleBackColor = true; + this.InputDisplayRadio.CheckedChanged += new System.EventHandler(this.MessageTypeRadio_CheckedChanged); + // + // LagCounterRadio + // + this.LagCounterRadio.AutoSize = true; + this.LagCounterRadio.Location = new System.Drawing.Point(6, 66); + this.LagCounterRadio.Name = "LagCounterRadio"; + this.LagCounterRadio.Size = new System.Drawing.Size(83, 17); + this.LagCounterRadio.TabIndex = 2; + this.LagCounterRadio.Text = "Lag Counter"; + this.LagCounterRadio.UseVisualStyleBackColor = true; + this.LagCounterRadio.CheckedChanged += new System.EventHandler(this.MessageTypeRadio_CheckedChanged); + // + // FrameCounterRadio + // + this.FrameCounterRadio.AutoSize = true; + this.FrameCounterRadio.Location = new System.Drawing.Point(6, 42); + this.FrameCounterRadio.Name = "FrameCounterRadio"; + this.FrameCounterRadio.Size = new System.Drawing.Size(93, 17); + this.FrameCounterRadio.TabIndex = 1; + this.FrameCounterRadio.Text = "Frame counter"; + this.FrameCounterRadio.UseVisualStyleBackColor = true; + this.FrameCounterRadio.CheckedChanged += new System.EventHandler(this.MessageTypeRadio_CheckedChanged); + // + // FPSRadio + // + this.FPSRadio.AutoSize = true; + this.FPSRadio.Checked = true; + this.FPSRadio.Location = new System.Drawing.Point(6, 18); + this.FPSRadio.Name = "FPSRadio"; + this.FPSRadio.Size = new System.Drawing.Size(42, 17); + this.FPSRadio.TabIndex = 0; + this.FPSRadio.TabStop = true; + this.FPSRadio.Text = "Fps"; + this.FPSRadio.UseVisualStyleBackColor = true; + this.FPSRadio.CheckedChanged += new System.EventHandler(this.MessageTypeRadio_CheckedChanged); + // + // groupBox2 + // + this.groupBox2.Controls.Add(this.label12); + this.groupBox2.Controls.Add(this.MovieInputText); + this.groupBox2.Controls.Add(this.label11); + this.groupBox2.Controls.Add(this.MovieInputColor); + this.groupBox2.Controls.Add(this.LInputColorPanel); + this.groupBox2.Controls.Add(this.AlertColorPanel); + this.groupBox2.Controls.Add(this.ColorPanel); + this.groupBox2.Controls.Add(this.label7); + this.groupBox2.Controls.Add(this.label8); + this.groupBox2.Controls.Add(this.LInputText); + this.groupBox2.Controls.Add(this.label6); + this.groupBox2.Controls.Add(this.label5); + this.groupBox2.Controls.Add(this.AlertColorText); + this.groupBox2.Controls.Add(this.label4); + this.groupBox2.Controls.Add(this.label3); + this.groupBox2.Controls.Add(this.ColorText); + this.groupBox2.Location = new System.Drawing.Point(12, 234); + this.groupBox2.Name = "groupBox2"; + this.groupBox2.Size = new System.Drawing.Size(177, 223); + this.groupBox2.TabIndex = 4; + this.groupBox2.TabStop = false; + this.groupBox2.Text = "Message Colors"; + // + // label12 + // + this.label12.AutoSize = true; + this.label12.Location = new System.Drawing.Point(1, 170); + this.label12.Name = "label12"; + this.label12.Size = new System.Drawing.Size(63, 13); + this.label12.TabIndex = 24; + this.label12.Text = "Movie Input"; + // + // MovieInputText + // + this.MovieInputText.CharacterCasing = System.Windows.Forms.CharacterCasing.Upper; + this.MovieInputText.Location = new System.Drawing.Point(45, 187); + this.MovieInputText.MaxLength = 8; + this.MovieInputText.Name = "MovieInputText"; + this.MovieInputText.ReadOnly = true; + this.MovieInputText.Size = new System.Drawing.Size(59, 20); + this.MovieInputText.TabIndex = 23; + // + // label11 + // + this.label11.AutoSize = true; + this.label11.Location = new System.Drawing.Point(28, 190); + this.label11.Name = "label11"; + this.label11.Size = new System.Drawing.Size(18, 13); + this.label11.TabIndex = 22; + this.label11.Text = "0x"; + // + // MovieInputColor + // + this.MovieInputColor.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D; + this.MovieInputColor.Location = new System.Drawing.Point(4, 187); + this.MovieInputColor.Name = "MovieInputColor"; + this.MovieInputColor.Size = new System.Drawing.Size(20, 20); + this.MovieInputColor.TabIndex = 9; + this.MovieInputColor.Click += new System.EventHandler(this.MovieInputColor_Click); + // + // LInputColorPanel + // + this.LInputColorPanel.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D; + this.LInputColorPanel.Location = new System.Drawing.Point(6, 139); + this.LInputColorPanel.Name = "LInputColorPanel"; + this.LInputColorPanel.Size = new System.Drawing.Size(20, 20); + this.LInputColorPanel.TabIndex = 7; + this.LInputColorPanel.Click += new System.EventHandler(this.LInputColorPanel_Click); + // + // AlertColorPanel + // + this.AlertColorPanel.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D; + this.AlertColorPanel.Location = new System.Drawing.Point(6, 90); + this.AlertColorPanel.Name = "AlertColorPanel"; + this.AlertColorPanel.Size = new System.Drawing.Size(20, 20); + this.AlertColorPanel.TabIndex = 7; + this.AlertColorPanel.Click += new System.EventHandler(this.AlertColorPanel_Click); + // + // ColorPanel + // + this.ColorPanel.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D; + this.ColorPanel.Location = new System.Drawing.Point(6, 43); + this.ColorPanel.Name = "ColorPanel"; + this.ColorPanel.Size = new System.Drawing.Size(20, 20); + this.ColorPanel.TabIndex = 7; + this.ColorPanel.Click += new System.EventHandler(this.ColorPanel_Click); + // + // label7 + // + this.label7.AutoSize = true; + this.label7.Location = new System.Drawing.Point(1, 120); + this.label7.Name = "label7"; + this.label7.Size = new System.Drawing.Size(86, 13); + this.label7.TabIndex = 18; + this.label7.Text = "Last Frame Input"; + // + // label8 + // + this.label8.AutoSize = true; + this.label8.Location = new System.Drawing.Point(28, 142); + this.label8.Name = "label8"; + this.label8.Size = new System.Drawing.Size(18, 13); + this.label8.TabIndex = 17; + this.label8.Text = "0x"; + // + // LInputText + // + this.LInputText.CharacterCasing = System.Windows.Forms.CharacterCasing.Upper; + this.LInputText.Location = new System.Drawing.Point(45, 139); + this.LInputText.MaxLength = 8; + this.LInputText.Name = "LInputText"; + this.LInputText.ReadOnly = true; + this.LInputText.Size = new System.Drawing.Size(59, 20); + this.LInputText.TabIndex = 16; + // + // label6 + // + this.label6.AutoSize = true; + this.label6.Location = new System.Drawing.Point(1, 71); + this.label6.Name = "label6"; + this.label6.Size = new System.Drawing.Size(78, 13); + this.label6.TabIndex = 13; + this.label6.Text = "Alert messages"; + // + // label5 + // + this.label5.AutoSize = true; + this.label5.Location = new System.Drawing.Point(28, 93); + this.label5.Name = "label5"; + this.label5.Size = new System.Drawing.Size(18, 13); + this.label5.TabIndex = 12; + this.label5.Text = "0x"; + // + // AlertColorText + // + this.AlertColorText.CharacterCasing = System.Windows.Forms.CharacterCasing.Upper; + this.AlertColorText.Location = new System.Drawing.Point(45, 90); + this.AlertColorText.MaxLength = 8; + this.AlertColorText.Name = "AlertColorText"; + this.AlertColorText.ReadOnly = true; + this.AlertColorText.Size = new System.Drawing.Size(59, 20); + this.AlertColorText.TabIndex = 11; + // + // label4 + // + this.label4.AutoSize = true; + this.label4.Location = new System.Drawing.Point(6, 27); + this.label4.Name = "label4"; + this.label4.Size = new System.Drawing.Size(80, 13); + this.label4.TabIndex = 8; + this.label4.Text = "Main messages"; + // + // label3 + // + this.label3.AutoSize = true; + this.label3.Location = new System.Drawing.Point(28, 46); + this.label3.Name = "label3"; + this.label3.Size = new System.Drawing.Size(18, 13); + this.label3.TabIndex = 7; + this.label3.Text = "0x"; + // + // ColorText + // + this.ColorText.CharacterCasing = System.Windows.Forms.CharacterCasing.Upper; + this.ColorText.Location = new System.Drawing.Point(45, 43); + this.ColorText.MaxLength = 8; + this.ColorText.Name = "ColorText"; + this.ColorText.ReadOnly = true; + this.ColorText.Size = new System.Drawing.Size(59, 20); + this.ColorText.TabIndex = 2; + // + // MessageColorDialog + // + this.MessageColorDialog.FullOpen = true; + // + // Cancel + // + this.Cancel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); + this.Cancel.DialogResult = System.Windows.Forms.DialogResult.Cancel; + this.Cancel.Location = new System.Drawing.Point(499, 434); + this.Cancel.Name = "Cancel"; + this.Cancel.Size = new System.Drawing.Size(75, 23); + this.Cancel.TabIndex = 5; + this.Cancel.Text = "&Cancel"; + this.Cancel.UseVisualStyleBackColor = true; + this.Cancel.Click += new System.EventHandler(this.Cancel_Click); + // + // ResetDefaultsButton + // + this.ResetDefaultsButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); + this.ResetDefaultsButton.Location = new System.Drawing.Point(195, 434); + this.ResetDefaultsButton.Name = "ResetDefaultsButton"; + this.ResetDefaultsButton.Size = new System.Drawing.Size(96, 23); + this.ResetDefaultsButton.TabIndex = 6; + this.ResetDefaultsButton.Text = "Restore Defaults"; + this.ResetDefaultsButton.UseVisualStyleBackColor = true; + this.ResetDefaultsButton.Click += new System.EventHandler(this.ResetDefaultsButton_Click); + // + // PositionPanel + // + this.PositionPanel.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D; + this.PositionPanel.Location = new System.Drawing.Point(22, 18); + this.PositionPanel.Name = "PositionPanel"; + this.PositionPanel.Size = new System.Drawing.Size(264, 248); + this.PositionPanel.TabIndex = 0; + this.PositionPanel.Paint += new System.Windows.Forms.PaintEventHandler(this.PositionPanel_Paint); + this.PositionPanel.MouseDown += new System.Windows.Forms.MouseEventHandler(this.PositionPanel_MouseDown); + this.PositionPanel.MouseEnter += new System.EventHandler(this.PositionPanel_MouseEnter); + this.PositionPanel.MouseLeave += new System.EventHandler(this.PositionPanel_MouseLeave); + this.PositionPanel.MouseMove += new System.Windows.Forms.MouseEventHandler(this.PositionPanel_MouseMove); + this.PositionPanel.MouseUp += new System.Windows.Forms.MouseEventHandler(this.PositionPanel_MouseUp); + // + // XNumeric + // + this.XNumeric.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); + this.XNumeric.Location = new System.Drawing.Point(43, 271); + this.XNumeric.Maximum = new decimal(new int[] { 256, 0, 0, 0}); - this.XNumeric.Name = "XNumeric"; - this.XNumeric.Size = new System.Drawing.Size(44, 20); - this.XNumeric.TabIndex = 1; - this.XNumeric.Value = new decimal(new int[] { + this.XNumeric.Name = "XNumeric"; + this.XNumeric.Size = new System.Drawing.Size(44, 20); + this.XNumeric.TabIndex = 1; + this.XNumeric.Value = new decimal(new int[] { 255, 0, 0, 0}); - this.XNumeric.Click += new System.EventHandler(this.XNumeric_Click); - this.XNumeric.KeyUp += new System.Windows.Forms.KeyEventHandler(this.XNumeric_KeyUp); - // - // YNumeric - // - this.YNumeric.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); - this.YNumeric.Location = new System.Drawing.Point(106, 271); - this.YNumeric.Maximum = new decimal(new int[] { + this.XNumeric.Click += new System.EventHandler(this.XNumeric_Click); + this.XNumeric.KeyUp += new System.Windows.Forms.KeyEventHandler(this.XNumeric_KeyUp); + // + // YNumeric + // + this.YNumeric.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); + this.YNumeric.Location = new System.Drawing.Point(106, 271); + this.YNumeric.Maximum = new decimal(new int[] { 256, 0, 0, 0}); - this.YNumeric.Name = "YNumeric"; - this.YNumeric.Size = new System.Drawing.Size(44, 20); - this.YNumeric.TabIndex = 2; - this.YNumeric.Value = new decimal(new int[] { + this.YNumeric.Name = "YNumeric"; + this.YNumeric.Size = new System.Drawing.Size(44, 20); + this.YNumeric.TabIndex = 2; + this.YNumeric.Value = new decimal(new int[] { 255, 0, 0, 0}); - this.YNumeric.Click += new System.EventHandler(this.YNumeric_Click); - this.YNumeric.KeyUp += new System.Windows.Forms.KeyEventHandler(this.YNumeric_KeyUp); - // - // label1 - // - this.label1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); - this.label1.AutoSize = true; - this.label1.Location = new System.Drawing.Point(27, 274); - this.label1.Name = "label1"; - this.label1.Size = new System.Drawing.Size(12, 13); - this.label1.TabIndex = 3; - this.label1.Text = "x"; - // - // label2 - // - this.label2.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); - this.label2.AutoSize = true; - this.label2.Location = new System.Drawing.Point(92, 273); - this.label2.Name = "label2"; - this.label2.Size = new System.Drawing.Size(12, 13); - this.label2.TabIndex = 4; - this.label2.Text = "y"; - // - // PositionGroupBox - // - this.PositionGroupBox.Controls.Add(this.BR); - this.PositionGroupBox.Controls.Add(this.BL); - this.PositionGroupBox.Controls.Add(this.TR); - this.PositionGroupBox.Controls.Add(this.TL); - this.PositionGroupBox.Controls.Add(this.label2); - this.PositionGroupBox.Controls.Add(this.label1); - this.PositionGroupBox.Controls.Add(this.YNumeric); - this.PositionGroupBox.Controls.Add(this.XNumeric); - this.PositionGroupBox.Controls.Add(this.PositionPanel); - this.PositionGroupBox.Location = new System.Drawing.Point(195, 12); - this.PositionGroupBox.Name = "PositionGroupBox"; - this.PositionGroupBox.Size = new System.Drawing.Size(307, 299); - this.PositionGroupBox.TabIndex = 3; - this.PositionGroupBox.TabStop = false; - this.PositionGroupBox.Text = "Position"; - // - // BR - // - this.BR.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); - this.BR.AutoSize = true; - this.BR.Location = new System.Drawing.Point(289, 253); - this.BR.Name = "BR"; - this.BR.Size = new System.Drawing.Size(14, 13); - this.BR.TabIndex = 8; - this.BR.TabStop = true; - this.BR.UseVisualStyleBackColor = true; - this.BR.Click += new System.EventHandler(this.BR_CheckedChanged); - // - // BL - // - this.BL.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); - this.BL.AutoSize = true; - this.BL.Location = new System.Drawing.Point(6, 253); - this.BL.Name = "BL"; - this.BL.Size = new System.Drawing.Size(14, 13); - this.BL.TabIndex = 7; - this.BL.TabStop = true; - this.BL.UseVisualStyleBackColor = true; - this.BL.Click += new System.EventHandler(this.BL_CheckedChanged); - // - // TR - // - this.TR.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); - this.TR.AutoSize = true; - this.TR.Location = new System.Drawing.Point(288, 18); - this.TR.Name = "TR"; - this.TR.Size = new System.Drawing.Size(14, 13); - this.TR.TabIndex = 6; - this.TR.TabStop = true; - this.TR.UseVisualStyleBackColor = true; - this.TR.Click += new System.EventHandler(this.TR_CheckedChanged); - // - // TL - // - this.TL.AutoSize = true; - this.TL.Location = new System.Drawing.Point(6, 18); - this.TL.Name = "TL"; - this.TL.Size = new System.Drawing.Size(14, 13); - this.TL.TabIndex = 5; - this.TL.TabStop = true; - this.TL.UseVisualStyleBackColor = true; - this.TL.Click += new System.EventHandler(this.TL_CheckedChanged); - // - // AlertColorDialog - // - this.AlertColorDialog.FullOpen = true; - // - // LInputColorDialog - // - this.LInputColorDialog.FullOpen = true; - // - // MovieInputColorDialog - // - this.MovieInputColorDialog.FullOpen = true; - // - // StackMessagesCheckbox - // - this.StackMessagesCheckbox.AutoSize = true; - this.StackMessagesCheckbox.Location = new System.Drawing.Point(195, 411); - this.StackMessagesCheckbox.Name = "StackMessagesCheckbox"; - this.StackMessagesCheckbox.Size = new System.Drawing.Size(105, 17); - this.StackMessagesCheckbox.TabIndex = 7; - this.StackMessagesCheckbox.Text = "Stack Messages"; - this.StackMessagesCheckbox.UseVisualStyleBackColor = true; - // - // MessageConfig - // - this.AcceptButton = this.OK; - this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.CancelButton = this.Cancel; - this.ClientSize = new System.Drawing.Size(612, 469); - this.Controls.Add(this.StackMessagesCheckbox); - this.Controls.Add(this.ResetDefaultsButton); - this.Controls.Add(this.Cancel); - this.Controls.Add(this.groupBox2); - this.Controls.Add(this.PositionGroupBox); - this.Controls.Add(this.MessageTypeBox); - this.Controls.Add(this.OK); - this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.SizableToolWindow; - this.MinimumSize = new System.Drawing.Size(404, 375); - this.Name = "MessageConfig"; - this.ShowIcon = false; - this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; - this.Text = "Configure On Screen Messages"; - this.Load += new System.EventHandler(this.MessageConfig_Load); - this.MessageTypeBox.ResumeLayout(false); - this.MessageTypeBox.PerformLayout(); - this.groupBox2.ResumeLayout(false); - this.groupBox2.PerformLayout(); - ((System.ComponentModel.ISupportInitialize)(this.XNumeric)).EndInit(); - ((System.ComponentModel.ISupportInitialize)(this.YNumeric)).EndInit(); - this.PositionGroupBox.ResumeLayout(false); - this.PositionGroupBox.PerformLayout(); - this.ResumeLayout(false); - this.PerformLayout(); + this.YNumeric.Click += new System.EventHandler(this.YNumeric_Click); + this.YNumeric.KeyUp += new System.Windows.Forms.KeyEventHandler(this.YNumeric_KeyUp); + // + // label1 + // + this.label1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); + this.label1.AutoSize = true; + this.label1.Location = new System.Drawing.Point(27, 274); + this.label1.Name = "label1"; + this.label1.Size = new System.Drawing.Size(12, 13); + this.label1.TabIndex = 3; + this.label1.Text = "x"; + // + // label2 + // + this.label2.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); + this.label2.AutoSize = true; + this.label2.Location = new System.Drawing.Point(92, 273); + this.label2.Name = "label2"; + this.label2.Size = new System.Drawing.Size(12, 13); + this.label2.TabIndex = 4; + this.label2.Text = "y"; + // + // PositionGroupBox + // + this.PositionGroupBox.Controls.Add(this.BR); + this.PositionGroupBox.Controls.Add(this.BL); + this.PositionGroupBox.Controls.Add(this.TR); + this.PositionGroupBox.Controls.Add(this.TL); + this.PositionGroupBox.Controls.Add(this.label2); + this.PositionGroupBox.Controls.Add(this.label1); + this.PositionGroupBox.Controls.Add(this.YNumeric); + this.PositionGroupBox.Controls.Add(this.XNumeric); + this.PositionGroupBox.Controls.Add(this.PositionPanel); + this.PositionGroupBox.Location = new System.Drawing.Point(195, 12); + this.PositionGroupBox.Name = "PositionGroupBox"; + this.PositionGroupBox.Size = new System.Drawing.Size(307, 299); + this.PositionGroupBox.TabIndex = 3; + this.PositionGroupBox.TabStop = false; + this.PositionGroupBox.Text = "Position"; + // + // BR + // + this.BR.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); + this.BR.AutoSize = true; + this.BR.Location = new System.Drawing.Point(289, 253); + this.BR.Name = "BR"; + this.BR.Size = new System.Drawing.Size(14, 13); + this.BR.TabIndex = 8; + this.BR.TabStop = true; + this.BR.UseVisualStyleBackColor = true; + this.BR.Click += new System.EventHandler(this.BR_CheckedChanged); + // + // BL + // + this.BL.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); + this.BL.AutoSize = true; + this.BL.Location = new System.Drawing.Point(6, 253); + this.BL.Name = "BL"; + this.BL.Size = new System.Drawing.Size(14, 13); + this.BL.TabIndex = 7; + this.BL.TabStop = true; + this.BL.UseVisualStyleBackColor = true; + this.BL.Click += new System.EventHandler(this.BL_CheckedChanged); + // + // TR + // + this.TR.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + this.TR.AutoSize = true; + this.TR.Location = new System.Drawing.Point(288, 18); + this.TR.Name = "TR"; + this.TR.Size = new System.Drawing.Size(14, 13); + this.TR.TabIndex = 6; + this.TR.TabStop = true; + this.TR.UseVisualStyleBackColor = true; + this.TR.Click += new System.EventHandler(this.TR_CheckedChanged); + // + // TL + // + this.TL.AutoSize = true; + this.TL.Location = new System.Drawing.Point(6, 18); + this.TL.Name = "TL"; + this.TL.Size = new System.Drawing.Size(14, 13); + this.TL.TabIndex = 5; + this.TL.TabStop = true; + this.TL.UseVisualStyleBackColor = true; + this.TL.Click += new System.EventHandler(this.TL_CheckedChanged); + // + // AlertColorDialog + // + this.AlertColorDialog.FullOpen = true; + // + // LInputColorDialog + // + this.LInputColorDialog.FullOpen = true; + // + // MovieInputColorDialog + // + this.MovieInputColorDialog.FullOpen = true; + // + // StackMessagesCheckbox + // + this.StackMessagesCheckbox.AutoSize = true; + this.StackMessagesCheckbox.Location = new System.Drawing.Point(195, 411); + this.StackMessagesCheckbox.Name = "StackMessagesCheckbox"; + this.StackMessagesCheckbox.Size = new System.Drawing.Size(105, 17); + this.StackMessagesCheckbox.TabIndex = 7; + this.StackMessagesCheckbox.Text = "Stack Messages"; + this.StackMessagesCheckbox.UseVisualStyleBackColor = true; + // + // MessageConfig + // + this.AcceptButton = this.OK; + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.CancelButton = this.Cancel; + this.ClientSize = new System.Drawing.Size(612, 469); + this.Controls.Add(this.StackMessagesCheckbox); + this.Controls.Add(this.ResetDefaultsButton); + this.Controls.Add(this.Cancel); + this.Controls.Add(this.groupBox2); + this.Controls.Add(this.PositionGroupBox); + this.Controls.Add(this.MessageTypeBox); + this.Controls.Add(this.OK); + this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.SizableToolWindow; + this.MinimumSize = new System.Drawing.Size(404, 375); + this.Name = "MessageConfig"; + this.ShowIcon = false; + this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; + this.Text = "Configure On Screen Messages"; + this.Load += new System.EventHandler(this.MessageConfig_Load); + this.MessageTypeBox.ResumeLayout(false); + this.MessageTypeBox.PerformLayout(); + this.groupBox2.ResumeLayout(false); + this.groupBox2.PerformLayout(); + ((System.ComponentModel.ISupportInitialize)(this.XNumeric)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.YNumeric)).EndInit(); + this.PositionGroupBox.ResumeLayout(false); + this.PositionGroupBox.PerformLayout(); + this.ResumeLayout(false); + this.PerformLayout(); } diff --git a/BizHawk.Client.EmuHawk/config/MessageConfig.cs b/BizHawk.Client.EmuHawk/config/MessageConfig.cs index e7e8eceb23..dcbec28ac0 100644 --- a/BizHawk.Client.EmuHawk/config/MessageConfig.cs +++ b/BizHawk.Client.EmuHawk/config/MessageConfig.cs @@ -1,10 +1,5 @@ using System; -using System.Collections.Generic; -using System.ComponentModel; -using System.Data; using System.Drawing; -using System.Linq; -using System.Text; using System.Windows.Forms; using BizHawk.Client.Common; @@ -13,43 +8,41 @@ namespace BizHawk.Client.EmuHawk { public partial class MessageConfig : Form { - int DispFPSx = Global.Config.DispFPSx; - int DispFPSy = Global.Config.DispFPSy; - int DispFrameCx = Global.Config.DispFrameCx; - int DispFrameCy = Global.Config.DispFrameCy; - int DispLagx = Global.Config.DispLagx; - int DispLagy = Global.Config.DispLagy; - int DispInpx = Global.Config.DispInpx; - int DispInpy = Global.Config.DispInpy; - int DispRerecx = Global.Config.DispRecx; - int DispRerecy = Global.Config.DispRecy; - int LastInputColor = Global.Config.LastInputColor; - int DispRecx = Global.Config.DispRecx; - int DispRecy = Global.Config.DispRecy; - int DispMultix = Global.Config.DispMultix; - int DispMultiy = Global.Config.DispMultiy; - int DispMessagex = Global.Config.DispMessagex; - int DispMessagey = Global.Config.DispMessagey; - int DispAutoholdx = Global.Config.DispAutoholdx; - int DispAutoholdy = Global.Config.DispAutoholdy; + private int _dispFpSx = Global.Config.DispFPSx; + private int _dispFpSy = Global.Config.DispFPSy; + private int _dispFrameCx = Global.Config.DispFrameCx; + private int _dispFrameCy = Global.Config.DispFrameCy; + private int _dispLagx = Global.Config.DispLagx; + private int _dispLagy = Global.Config.DispLagy; + private int _dispInpx = Global.Config.DispInpx; + private int _dispInpy = Global.Config.DispInpy; + private int _lastInputColor = Global.Config.LastInputColor; + private int _dispRecx = Global.Config.DispRecx; + private int _dispRecy = Global.Config.DispRecy; + private int _dispMultix = Global.Config.DispMultix; + private int _dispMultiy = Global.Config.DispMultiy; + private int _dispMessagex = Global.Config.DispMessagex; + private int _dispMessagey = Global.Config.DispMessagey; + private int _dispAutoholdx = Global.Config.DispAutoholdx; + private int _dispAutoholdy = Global.Config.DispAutoholdy; - int MessageColor = Global.Config.MessagesColor; - int AlertColor = Global.Config.AlertMessageColor; - int MovieInput = Global.Config.MovieInput; + private int _messageColor = Global.Config.MessagesColor; + private int _alertColor = Global.Config.AlertMessageColor; + private int _movieInput = Global.Config.MovieInput; - int DispFPSanchor = Global.Config.DispFPSanchor; - int DispFrameanchor = Global.Config.DispFrameanchor; - int DispLaganchor = Global.Config.DispLaganchor; - int DispInputanchor = Global.Config.DispInpanchor; - int DispRecanchor = Global.Config.DispRecanchor; - int DispMultiAnchor = Global.Config.DispMultianchor; - int DispMessageAnchor = Global.Config.DispMessageanchor; - int DispAutoholdAnchor = Global.Config.DispAutoholdanchor; + private int _dispFpSanchor = Global.Config.DispFPSanchor; + private int _dispFrameanchor = Global.Config.DispFrameanchor; + private int _dispLaganchor = Global.Config.DispLaganchor; + private int _dispInputanchor = Global.Config.DispInpanchor; + private int _dispRecanchor = Global.Config.DispRecanchor; + private int _dispMultiAnchor = Global.Config.DispMultianchor; + private int _dispMessageAnchor = Global.Config.DispMessageanchor; + private int _dispAutoholdAnchor = Global.Config.DispAutoholdanchor; - public Brush brush = Brushes.Black; - int px = 0; - int py = 0; - bool mousedown = false; + private readonly Brush _brush = Brushes.Black; + private int _px; + private int _py; + private bool _mousedown; public MessageConfig() { @@ -59,10 +52,10 @@ namespace BizHawk.Client.EmuHawk private void MessageConfig_Load(object sender, EventArgs e) { SetMaxXY(); - MessageColorDialog.Color = Color.FromArgb(MessageColor); - AlertColorDialog.Color = Color.FromArgb(AlertColor); - LInputColorDialog.Color = Color.FromArgb(LastInputColor); - MovieInputColorDialog.Color = Color.FromArgb(MovieInput); + MessageColorDialog.Color = Color.FromArgb(_messageColor); + AlertColorDialog.Color = Color.FromArgb(_alertColor); + LInputColorDialog.Color = Color.FromArgb(_lastInputColor); + MovieInputColorDialog.Color = Color.FromArgb(_movieInput); SetColorBox(); SetPositionInfo(); StackMessagesCheckbox.Checked = Global.Config.StackOSDMessages; @@ -76,30 +69,34 @@ namespace BizHawk.Client.EmuHawk int width; if (Global.Emulator.VideoProvider.BufferWidth > 128) + { width = Global.Emulator.VideoProvider.BufferWidth + 44; + } else + { width = 128 + 44; + } PositionGroupBox.Size = new Size(width, Global.Emulator.VideoProvider.BufferHeight + 52); } private void SetColorBox() { - MessageColor = MessageColorDialog.Color.ToArgb(); + _messageColor = MessageColorDialog.Color.ToArgb(); ColorPanel.BackColor = MessageColorDialog.Color; - ColorText.Text = String.Format("{0:X8}", MessageColor); + ColorText.Text = String.Format("{0:X8}", _messageColor); - AlertColor = AlertColorDialog.Color.ToArgb(); + _alertColor = AlertColorDialog.Color.ToArgb(); AlertColorPanel.BackColor = AlertColorDialog.Color; - AlertColorText.Text = String.Format("{0:X8}", AlertColor); + AlertColorText.Text = String.Format("{0:X8}", _alertColor); - LastInputColor = LInputColorDialog.Color.ToArgb(); + _lastInputColor = LInputColorDialog.Color.ToArgb(); LInputColorPanel.BackColor = LInputColorDialog.Color; - LInputText.Text = String.Format("{0:X8}", LastInputColor); + LInputText.Text = String.Format("{0:X8}", _lastInputColor); - MovieInput = MovieInputColorDialog.Color.ToArgb(); + _movieInput = MovieInputColorDialog.Color.ToArgb(); MovieInputColor.BackColor = MovieInputColorDialog.Color; - MovieInputText.Text = String.Format("{0:X8}", MovieInput); + MovieInputText.Text = String.Format("{0:X8}", _movieInput); } private void SetAnchorRadio(int anchor) @@ -122,67 +119,67 @@ namespace BizHawk.Client.EmuHawk { if (FPSRadio.Checked) { - XNumeric.Value = DispFPSx; - YNumeric.Value = DispFPSy; - px = DispFPSx; - py = DispFPSy; - SetAnchorRadio(DispFPSanchor); + XNumeric.Value = _dispFpSx; + YNumeric.Value = _dispFpSy; + _px = _dispFpSx; + _py = _dispFpSy; + SetAnchorRadio(_dispFpSanchor); } else if (FrameCounterRadio.Checked) { - XNumeric.Value = DispFrameCx; - YNumeric.Value = DispFrameCy; - px = DispFrameCx; - py = DispFrameCy; - SetAnchorRadio(DispFrameanchor); + XNumeric.Value = _dispFrameCx; + YNumeric.Value = _dispFrameCy; + _px = _dispFrameCx; + _py = _dispFrameCy; + SetAnchorRadio(_dispFrameanchor); } else if (LagCounterRadio.Checked) { - XNumeric.Value = DispLagx; - YNumeric.Value = DispLagy; - px = DispLagx; - py = DispLagy; - SetAnchorRadio(DispLaganchor); + XNumeric.Value = _dispLagx; + YNumeric.Value = _dispLagy; + _px = _dispLagx; + _py = _dispLagy; + SetAnchorRadio(_dispLaganchor); } else if (InputDisplayRadio.Checked) { - XNumeric.Value = DispInpx; - XNumeric.Value = DispInpy; - px = DispInpx; - py = DispInpy; - SetAnchorRadio(DispInputanchor); + XNumeric.Value = _dispInpx; + XNumeric.Value = _dispInpy; + _px = _dispInpx; + _py = _dispInpy; + SetAnchorRadio(_dispInputanchor); } else if (MessagesRadio.Checked) { - XNumeric.Value = DispMessagex; - YNumeric.Value = DispMessagey; - px = DispMessagex; - py = DispMessagey; - SetAnchorRadio(DispMessageAnchor); + XNumeric.Value = _dispMessagex; + YNumeric.Value = _dispMessagey; + _px = _dispMessagex; + _py = _dispMessagey; + SetAnchorRadio(_dispMessageAnchor); } else if (RerecordsRadio.Checked) { - XNumeric.Value = DispRecx; - YNumeric.Value = DispRecy; - px = DispRecx; - py = DispRecy; - SetAnchorRadio(DispRecanchor); + XNumeric.Value = _dispRecx; + YNumeric.Value = _dispRecy; + _px = _dispRecx; + _py = _dispRecy; + SetAnchorRadio(_dispRecanchor); } else if (MultitrackRadio.Checked) { - XNumeric.Value = DispMultix; - YNumeric.Value = DispMultiy; - px = DispMultix; - py = DispMultiy; - SetAnchorRadio(DispMultiAnchor); + XNumeric.Value = _dispMultix; + YNumeric.Value = _dispMultiy; + _px = _dispMultix; + _py = _dispMultiy; + SetAnchorRadio(_dispMultiAnchor); } else if (AutoholdRadio.Checked) { - XNumeric.Value = DispAutoholdx; - YNumeric.Value = DispAutoholdy; - px = DispAutoholdx; - py = DispAutoholdy; - SetAnchorRadio(DispAutoholdAnchor); + XNumeric.Value = _dispAutoholdx; + YNumeric.Value = _dispAutoholdy; + _px = _dispAutoholdx; + _py = _dispAutoholdy; + SetAnchorRadio(_dispAutoholdAnchor); } PositionPanel.Refresh(); @@ -193,35 +190,35 @@ namespace BizHawk.Client.EmuHawk private void SaveSettings() { - Global.Config.DispFPSx = DispFPSx; - Global.Config.DispFPSy = DispFPSy; - Global.Config.DispFrameCx = DispFrameCx; - Global.Config.DispFrameCy = DispFrameCy; - Global.Config.DispLagx = DispLagx; - Global.Config.DispLagy = DispLagy; - Global.Config.DispInpx = DispInpx; - Global.Config.DispInpy = DispInpy; - Global.Config.DispRecx = DispRecx; - Global.Config.DispRecy = DispRecy; - Global.Config.DispMultix = DispMultix; - Global.Config.DispMultiy = DispMultiy; - Global.Config.DispMessagex = DispMessagex; - Global.Config.DispMessagey = DispMessagey; - Global.Config.DispAutoholdx = DispAutoholdx; - Global.Config.DispAutoholdy = DispAutoholdy; + Global.Config.DispFPSx = _dispFpSx; + Global.Config.DispFPSy = _dispFpSy; + Global.Config.DispFrameCx = _dispFrameCx; + Global.Config.DispFrameCy = _dispFrameCy; + Global.Config.DispLagx = _dispLagx; + Global.Config.DispLagy = _dispLagy; + Global.Config.DispInpx = _dispInpx; + Global.Config.DispInpy = _dispInpy; + Global.Config.DispRecx = _dispRecx; + Global.Config.DispRecy = _dispRecy; + Global.Config.DispMultix = _dispMultix; + Global.Config.DispMultiy = _dispMultiy; + Global.Config.DispMessagex = _dispMessagex; + Global.Config.DispMessagey = _dispMessagey; + Global.Config.DispAutoholdx = _dispAutoholdx; + Global.Config.DispAutoholdy = _dispAutoholdy; - Global.Config.MessagesColor = MessageColor; - Global.Config.AlertMessageColor = AlertColor; - Global.Config.LastInputColor = LastInputColor; - Global.Config.MovieInput = MovieInput; - Global.Config.DispFPSanchor = DispFPSanchor; - Global.Config.DispFrameanchor = DispFrameanchor; - Global.Config.DispLaganchor = DispLaganchor; - Global.Config.DispInpanchor = DispInputanchor; - Global.Config.DispRecanchor = DispRecanchor; - Global.Config.DispMultianchor = DispMultiAnchor; - Global.Config.DispMessageanchor = DispMessageAnchor; - Global.Config.DispAutoholdanchor = DispAutoholdAnchor; + Global.Config.MessagesColor = _messageColor; + Global.Config.AlertMessageColor = _alertColor; + Global.Config.LastInputColor = _lastInputColor; + Global.Config.MovieInput = _movieInput; + Global.Config.DispFPSanchor = _dispFpSanchor; + Global.Config.DispFrameanchor = _dispFrameanchor; + Global.Config.DispLaganchor = _dispLaganchor; + Global.Config.DispInpanchor = _dispInputanchor; + Global.Config.DispRecanchor = _dispRecanchor; + Global.Config.DispMultianchor = _dispMultiAnchor; + Global.Config.DispMessageanchor = _dispMessageAnchor; + Global.Config.DispAutoholdanchor = _dispAutoholdAnchor; Global.Config.StackOSDMessages = StackMessagesCheckbox.Checked; } @@ -230,59 +227,24 @@ namespace BizHawk.Client.EmuHawk { SaveSettings(); GlobalWin.OSD.AddMessage("Message settings saved"); - this.Close(); + Close(); } - private void FPSRadio_CheckedChanged(object sender, EventArgs e) - { - SetPositionInfo(); - } - - private void FrameCounterRadio_CheckedChanged(object sender, EventArgs e) - { - SetPositionInfo(); - } - - private void LagCounterRadio_CheckedChanged(object sender, EventArgs e) - { - SetPositionInfo(); - } - - private void InputDisplayRadio_CheckedChanged(object sender, EventArgs e) - { - SetPositionInfo(); - } - - private void MessagesRadio_CheckedChanged(object sender, EventArgs e) - { - SetPositionInfo(); - } - - private void RerecordsRadio_CheckedChanged(object sender, EventArgs e) - { - SetPositionInfo(); - } - - private void MultitrackRadio_CheckedChanged(object sender, EventArgs e) - { - SetPositionInfo(); - } - - private void AutoholdRadio_CheckedChanged(object sender, EventArgs e) + private void MessageTypeRadio_CheckedChanged(object sender, EventArgs e) { SetPositionInfo(); } private void XNumericChange() { - px = (int)XNumeric.Value; + _px = (int)XNumeric.Value; SetPositionLabels(); PositionPanel.Refresh(); } private void YNumericChange() { - py = (int)YNumeric.Value; + _py = (int)YNumeric.Value; SetPositionLabels(); PositionPanel.Refresh(); } @@ -290,17 +252,17 @@ namespace BizHawk.Client.EmuHawk private void Cancel_Click(object sender, EventArgs e) { GlobalWin.OSD.AddMessage("Message config aborted"); - this.Close(); + Close(); } private void PositionPanel_MouseEnter(object sender, EventArgs e) { - this.Cursor = Cursors.Hand; + Cursor = Cursors.Hand; } private void PositionPanel_MouseLeave(object sender, EventArgs e) { - this.Cursor = Cursors.Default; + Cursor = Cursors.Default; } private void PositionPanel_Paint(object sender, PaintEventArgs e) @@ -310,43 +272,42 @@ namespace BizHawk.Client.EmuHawk if (TL.Checked) { - x = px; - y = py; + x = _px; + y = _py; } else if (TR.Checked) { - x = (int)XNumeric.Maximum - px; - y = py; + x = (int)XNumeric.Maximum - _px; + y = _py; } else if (BL.Checked) { - x = px; - y = (int)YNumeric.Maximum - py; + x = _px; + y = (int)YNumeric.Maximum - _py; } else if (BR.Checked) { - x = (int)XNumeric.Maximum - px; - y = (int)YNumeric.Maximum - py; + x = (int)XNumeric.Maximum - _px; + y = (int)YNumeric.Maximum - _py; } - Pen p = new Pen(brush); + var p = new Pen(_brush); e.Graphics.DrawLine(p, new Point(x, y), new Point(x + 8, y + 8)); e.Graphics.DrawLine(p, new Point(x + 8, y), new Point(x, y + 8)); - Rectangle rect = new Rectangle(x, y, 8, 8); - e.Graphics.DrawRectangle(p, rect); + e.Graphics.DrawRectangle(p, new Rectangle(x, y, 8, 8)); } private void PositionPanel_MouseDown(object sender, MouseEventArgs e) { - this.Cursor = Cursors.Arrow; - mousedown = true; + Cursor = Cursors.Arrow; + _mousedown = true; SetNewPosition(e.X, e.Y); } private void PositionPanel_MouseUp(object sender, MouseEventArgs e) { - this.Cursor = Cursors.Hand; - mousedown = false; + Cursor = Cursors.Hand; + _mousedown = false; } private void SetNewPosition(int mx, int my) @@ -377,18 +338,16 @@ namespace BizHawk.Client.EmuHawk XNumeric.Value = mx; YNumeric.Value = my; - px = mx; - py = my; - - - + _px = mx; + _py = my; + PositionPanel.Refresh(); SetPositionLabels(); } private void PositionPanel_MouseMove(object sender, MouseEventArgs e) { - if (mousedown) + if (_mousedown) { SetNewPosition(e.X, e.Y); } @@ -398,53 +357,53 @@ namespace BizHawk.Client.EmuHawk { if (FPSRadio.Checked) { - DispFPSx = px; - DispFPSy = py; + _dispFpSx = _px; + _dispFpSy = _py; } else if (FrameCounterRadio.Checked) { - DispFrameCx = px; - DispFrameCy = py; + _dispFrameCx = _px; + _dispFrameCy = _py; } else if (LagCounterRadio.Checked) { - DispLagx = px; - DispLagy = py; + _dispLagx = _px; + _dispLagy = _py; } else if (InputDisplayRadio.Checked) { - DispInpx = px; - DispInpy = py; + _dispInpx = _px; + _dispInpy = _py; } else if (RerecordsRadio.Checked) { - DispRecx = px; - DispRecy = py; + _dispRecx = _px; + _dispRecy = _py; } else if (MultitrackRadio.Checked) { - DispMultix = px; - DispMultiy = py; + _dispMultix = _px; + _dispMultiy = _py; } else if (MessagesRadio.Checked) { - DispMessagex = px; - DispMessagey = py; + _dispMessagex = _px; + _dispMessagey = _py; } else if (AutoholdRadio.Checked) { - DispAutoholdx = px; - DispAutoholdy = py; + _dispAutoholdx = _px; + _dispAutoholdy = _py; } - FpsPosLabel.Text = DispFPSx.ToString() + ", " + DispFPSy.ToString(); - FCLabel.Text = DispFrameCx.ToString() + ", " + DispFrameCy.ToString(); - LagLabel.Text = DispLagx.ToString() + ", " + DispLagy.ToString(); - InpLabel.Text = DispInpx.ToString() + ", " + DispInpy.ToString(); - RerecLabel.Text = DispRecx.ToString() + ", " + DispRecy.ToString(); - MultitrackLabel.Text = DispMultix.ToString() + ", " + DispMultiy.ToString(); - MessLabel.Text = DispMessagex.ToString() + ", " + DispMessagey.ToString(); - AutoholdLabel.Text = DispAutoholdx.ToString() + ", " + DispAutoholdy.ToString(); + FpsPosLabel.Text = _dispFpSx + ", " + _dispFpSy; + FCLabel.Text = _dispFrameCx + ", " + _dispFrameCy; + LagLabel.Text = _dispLagx + ", " + _dispLagy; + InpLabel.Text = _dispInpx + ", " + _dispInpy; + RerecLabel.Text = _dispRecx + ", " + _dispRecy; + MultitrackLabel.Text = _dispMultix + ", " + _dispMultiy; + MessLabel.Text = _dispMessagex + ", " + _dispMessagey; + AutoholdLabel.Text = _dispAutoholdx + ", " + _dispAutoholdy; } private void ResetDefaultsButton_Click(object sender, EventArgs e) @@ -471,15 +430,15 @@ namespace BizHawk.Client.EmuHawk Global.Config.LastInputColor = -23296; Global.Config.MovieInput = -8355712; - MessageColor = Global.Config.MessagesColor; - AlertColor = Global.Config.AlertMessageColor; - LastInputColor = Global.Config.LastInputColor; - MovieInput = Global.Config.MovieInput; + _messageColor = Global.Config.MessagesColor; + _alertColor = Global.Config.AlertMessageColor; + _lastInputColor = Global.Config.LastInputColor; + _movieInput = Global.Config.MovieInput; - MessageColorDialog.Color = Color.FromArgb(MessageColor); - AlertColorDialog.Color = Color.FromArgb(AlertColor); - LInputColorDialog.Color = Color.FromArgb(LastInputColor); - MovieInputColorDialog.Color = Color.FromArgb(MovieInput); + MessageColorDialog.Color = Color.FromArgb(_messageColor); + AlertColorDialog.Color = Color.FromArgb(_alertColor); + LInputColorDialog.Color = Color.FromArgb(_lastInputColor); + MovieInputColorDialog.Color = Color.FromArgb(_movieInput); Global.Config.DispFPSanchor = 0; Global.Config.DispFrameanchor = 0; @@ -490,31 +449,31 @@ namespace BizHawk.Client.EmuHawk Global.Config.DispMessageanchor = 2; Global.Config.DispAutoholdanchor = 1; - DispFPSx = Global.Config.DispFPSx; - DispFPSy = Global.Config.DispFPSy; - DispFrameCx = Global.Config.DispFrameCx; - DispFrameCy = Global.Config.DispFrameCy; - DispLagx = Global.Config.DispLagx; - DispLagy = Global.Config.DispLagy; - DispInpx = Global.Config.DispInpx; - DispInpy = Global.Config.DispInpy; - DispRecx = Global.Config.DispRecx; - DispRecy = Global.Config.DispRecy; - DispMultix = Global.Config.DispMultix; - DispMultiy = Global.Config.DispMultiy; - DispMessagex = Global.Config.DispMessagex; - DispMessagey = Global.Config.DispMessagey; - DispAutoholdx = Global.Config.DispAutoholdx; - DispAutoholdy = Global.Config.DispAutoholdy; + _dispFpSx = Global.Config.DispFPSx; + _dispFpSy = Global.Config.DispFPSy; + _dispFrameCx = Global.Config.DispFrameCx; + _dispFrameCy = Global.Config.DispFrameCy; + _dispLagx = Global.Config.DispLagx; + _dispLagy = Global.Config.DispLagy; + _dispInpx = Global.Config.DispInpx; + _dispInpy = Global.Config.DispInpy; + _dispRecx = Global.Config.DispRecx; + _dispRecy = Global.Config.DispRecy; + _dispMultix = Global.Config.DispMultix; + _dispMultiy = Global.Config.DispMultiy; + _dispMessagex = Global.Config.DispMessagex; + _dispMessagey = Global.Config.DispMessagey; + _dispAutoholdx = Global.Config.DispAutoholdx; + _dispAutoholdy = Global.Config.DispAutoholdy; - DispFPSanchor = Global.Config.DispFPSanchor; - DispFrameanchor = Global.Config.DispFrameanchor; - DispLaganchor = Global.Config.DispLaganchor; - DispInputanchor = Global.Config.DispInpanchor; - DispRecanchor = Global.Config.DispRecanchor; - DispMultiAnchor = Global.Config.DispMultianchor; - DispMessageAnchor = Global.Config.DispMessageanchor; - DispAutoholdAnchor = Global.Config.DispAutoholdanchor; + _dispFpSanchor = Global.Config.DispFPSanchor; + _dispFrameanchor = Global.Config.DispFrameanchor; + _dispLaganchor = Global.Config.DispLaganchor; + _dispInputanchor = Global.Config.DispInpanchor; + _dispRecanchor = Global.Config.DispRecanchor; + _dispMultiAnchor = Global.Config.DispMultianchor; + _dispMessageAnchor = Global.Config.DispMessageanchor; + _dispAutoholdAnchor = Global.Config.DispAutoholdanchor; SetMaxXY(); SetColorBox(); @@ -527,35 +486,35 @@ namespace BizHawk.Client.EmuHawk { if (FPSRadio.Checked) { - DispFPSanchor = value; + _dispFpSanchor = value; } else if (FrameCounterRadio.Checked) { - DispFrameanchor = value; + _dispFrameanchor = value; } else if (LagCounterRadio.Checked) { - DispLaganchor = value; + _dispLaganchor = value; } else if (InputDisplayRadio.Checked) { - DispInputanchor = value; + _dispInputanchor = value; } else if (MessagesRadio.Checked) { - DispMessageAnchor = value; + _dispMessageAnchor = value; } else if (RerecordsRadio.Checked) { - DispRecanchor = value; + _dispRecanchor = value; } else if (MultitrackRadio.Checked) { - DispMultiAnchor = value; + _dispMultiAnchor = value; } else if (AutoholdRadio.Checked) { - DispAutoholdAnchor = value; + _dispAutoholdAnchor = value; } } diff --git a/BizHawk.Client.EmuHawk/config/PathConfig.cs b/BizHawk.Client.EmuHawk/config/PathConfig.cs index 9e8b67dbac..2557d0915a 100644 --- a/BizHawk.Client.EmuHawk/config/PathConfig.cs +++ b/BizHawk.Client.EmuHawk/config/PathConfig.cs @@ -15,20 +15,18 @@ namespace BizHawk.Client.EmuHawk private void LockDownCores() { - if (!VersionInfo.INTERIM) - { - string[] coresToHide = { "PSX", "GBA", "INTV", "C64", "GEN" }; + if (VersionInfo.INTERIM) return; + string[] coresToHide = { "PSX", "GBA", "INTV", "C64", "GEN" }; - foreach (string core in coresToHide) - { - PathTabControl.TabPages.Remove( - AllTabPages.FirstOrDefault(x => x.Name == core) ?? new TabPage() + foreach (var core in coresToHide) + { + PathTabControl.TabPages.Remove( + AllTabPages.FirstOrDefault(x => x.Name == core) ?? new TabPage() ); - } } } - private AutoCompleteStringCollection AutoCompleteOptions + private static AutoCompleteStringCollection AutoCompleteOptions { get { @@ -88,25 +86,18 @@ namespace BizHawk.Client.EmuHawk private TabPage FindTabByName(string name) { - IEnumerable query = from p in PathTabControl.TabPages.OfType() select p; - var tab = query.FirstOrDefault(x => x.Name.ToUpper().Contains(name.ToUpper())); - if (tab == null) - { - return new TabPage(); - } - else - { - return tab; - } + return PathTabControl.TabPages + .OfType() + .FirstOrDefault(x => x.Name.ToUpper().Contains(name.ToUpper())) + ?? new TabPage(); } private void StartTabPages() { PathTabControl.TabPages.Clear(); - //Separate by system - List systems = Global.Config.PathEntries.Select(x => x.SystemDisplayName).Distinct().ToList(); + var systems = Global.Config.PathEntries.Select(x => x.SystemDisplayName).Distinct().ToList(); systems.Sort(); - foreach (string systemDisplayName in systems) + foreach (var systemDisplayName in systems) { PathTabControl.TabPages.Add(new TabPage { @@ -124,13 +115,13 @@ namespace BizHawk.Client.EmuHawk const int buttonWidth = 26; int widgetOffset = textboxWidth + 15; const int rowHeight = 30; - List paths = Global.Config.PathEntries.Where(x => x.System == tabPage.Name).OrderBy(x => x.Ordinal).ThenBy(x => x.Type).ToList(); + var paths = Global.Config.PathEntries.Where(x => x.System == tabPage.Name).OrderBy(x => x.Ordinal).ThenBy(x => x.Type).ToList(); int ypos = 14; foreach (var path in paths) { - TextBox box = new TextBox + var box = new TextBox { Text = path.Path, Location = new Point(xpos, ypos), @@ -143,7 +134,7 @@ namespace BizHawk.Client.EmuHawk AutoCompleteSource = AutoCompleteSource.CustomSource, }; - Button btn = new Button + var btn = new Button { Text = String.Empty, Image = Properties.Resources.OpenFile, @@ -153,15 +144,15 @@ namespace BizHawk.Client.EmuHawk Anchor = AnchorStyles.Top | AnchorStyles.Right, }; - TextBox tempBox = box; - string tempPath = path.Type; - string tempSystem = path.System; + var tempBox = box; + var tempPath = path.Type; + var tempSystem = path.System; btn.Click += delegate { BrowseFolder(tempBox, tempPath, tempSystem); }; - Label label = new Label + var label = new Label { Text = path.Type, Location = new Point(widgetOffset + buttonWidth + padding, ypos + 4), @@ -177,17 +168,17 @@ namespace BizHawk.Client.EmuHawk ypos += rowHeight; } - string sys = tabPage.Name; + var sys = tabPage.Name; if (tabPage.Name == "PCE") //Hack { sys = "PCECD"; } - bool hasFirmwares = FirmwaresConfig.SystemGroupNames.Any(x => x.Key == sys); + var hasFirmwares = FirmwaresConfig.SystemGroupNames.Any(x => x.Key == sys); if (hasFirmwares) { - Button firmwareButton = new Button + var firmwareButton = new Button { Name = sys, Text = "&Firmware", @@ -196,7 +187,7 @@ namespace BizHawk.Client.EmuHawk }; firmwareButton.Click += delegate { - FirmwaresConfig f = new FirmwaresConfig { TargetSystem = sys }; + var f = new FirmwaresConfig { TargetSystem = sys }; f.ShowDialog(); }; @@ -211,15 +202,15 @@ namespace BizHawk.Client.EmuHawk PathTabControl.TabPages.Clear(); //Separate by system - List systems = Global.Config.PathEntries.Select(x => x.SystemDisplayName).Distinct().ToList(); + var systems = Global.Config.PathEntries.Select(x => x.SystemDisplayName).Distinct().ToList(); systems.Sort(); //Hacky way to put global first - string global = systems.FirstOrDefault(x => x == "Global"); + var global = systems.FirstOrDefault(x => x == "Global"); systems.Remove(global); systems.Insert(0, global); - List tabPages = new List(systems.Count); + var tabPages = new List(systems.Count); const int _x = 6; const int textboxWidth = 70; @@ -228,20 +219,20 @@ namespace BizHawk.Client.EmuHawk const int widgetOffset = 85; const int rowHeight = 30; - foreach (string systemDisplayName in systems) + foreach (var systemDisplayName in systems) { - string systemId = Global.Config.PathEntries.FirstOrDefault(x => x.SystemDisplayName == systemDisplayName).System; - TabPage t = new TabPage + var systemId = Global.Config.PathEntries.FirstOrDefault(x => x.SystemDisplayName == systemDisplayName).System; + var t = new TabPage { Text = systemDisplayName, Name = systemId, }; - List paths = pathCollection.Where(x => x.System == systemId).OrderBy(x => x.Ordinal).ThenBy(x => x.Type).ToList(); + var paths = pathCollection.Where(x => x.System == systemId).OrderBy(x => x.Ordinal).ThenBy(x => x.Type).ToList(); - int _y = 14; + var _y = 14; foreach (var path in paths) { - TextBox box = new TextBox + var box = new TextBox { Text = path.Path, Location = new Point(_x, _y), @@ -254,7 +245,7 @@ namespace BizHawk.Client.EmuHawk AutoCompleteSource = AutoCompleteSource.CustomSource, }; - Button btn = new Button + var btn = new Button { Text = String.Empty, Image = Properties.Resources.OpenFile, @@ -264,15 +255,15 @@ namespace BizHawk.Client.EmuHawk Anchor = AnchorStyles.Top | AnchorStyles.Right, }; - TextBox tempBox = box; - string tempPath = path.Type; - string tempSystem = path.System; + var tempBox = box; + var tempPath = path.Type; + var tempSystem = path.System; btn.Click += delegate { BrowseFolder(tempBox, tempPath, tempSystem); }; - Label label = new Label + var label = new Label { Text = path.Type, Location = new Point(widgetOffset + buttonWidth + padding, _y + 4), @@ -288,17 +279,17 @@ namespace BizHawk.Client.EmuHawk _y += rowHeight; } - string sys = systemDisplayName; + var sys = systemDisplayName; if (systemDisplayName == "PCE") //Hack { sys = "PCECD"; } - bool hasFirmwares = FirmwaresConfig.SystemGroupNames.Any(x => x.Key == sys); + var hasFirmwares = FirmwaresConfig.SystemGroupNames.Any(x => x.Key == sys); if (hasFirmwares) { - Button firmwareButton = new Button + var firmwareButton = new Button { Name = sys, Text = "&Firmware", @@ -307,7 +298,7 @@ namespace BizHawk.Client.EmuHawk }; firmwareButton.Click += delegate { - FirmwaresConfig f = new FirmwaresConfig {TargetSystem = sys}; + var f = new FirmwaresConfig {TargetSystem = sys}; f.ShowDialog(); }; @@ -333,7 +324,7 @@ namespace BizHawk.Client.EmuHawk Description = "Set the directory for " + name, SelectedPath = PathManager.MakeAbsolutePath(box.Text, system) }; - DialogResult result = f.ShowDialog(); + var result = f.ShowDialog(); if (result == DialogResult.OK) { box.Text = PathManager.TryMakeRelative(f.SelectedPath, system); @@ -345,9 +336,9 @@ namespace BizHawk.Client.EmuHawk Global.Config.UseRecentForROMs = RecentForROMs.Checked; Global.Config.PathEntries["Global", "Base"].Path = BasePathBox.Text; - foreach (TextBox t in AllPathBoxes) + foreach (var t in AllPathBoxes) { - PathEntry path_entry = Global.Config.PathEntries.FirstOrDefault(x => x.System == t.Parent.Name && x.Type == t.Name); + var path_entry = Global.Config.PathEntries.FirstOrDefault(x => x.System == t.Parent.Name && x.Type == t.Name); path_entry.Path = t.Text; } } @@ -359,7 +350,7 @@ namespace BizHawk.Client.EmuHawk Description = "Set the directory for the base global path", SelectedPath = PathManager.MakeAbsolutePath(BasePathBox.Text, null) }; - DialogResult result = f.ShowDialog(); + var result = f.ShowDialog(); if (result == DialogResult.OK) { BasePathBox.Text = f.SelectedPath; @@ -378,8 +369,8 @@ namespace BizHawk.Client.EmuHawk private void DoRomToggle() { - List pcontrols = AllPathControls.Where(x => x.Name == "ROM").ToList(); - foreach (Control c in pcontrols) + var pcontrols = AllPathControls.Where(x => x.Name == "ROM").ToList(); + foreach (var c in pcontrols) { c.Enabled = !RecentForROMs.Checked; } @@ -389,10 +380,10 @@ namespace BizHawk.Client.EmuHawk { get { - List _AllPathBoxes = new List(); + var _AllPathBoxes = new List(); foreach (TabPage tp in PathTabControl.TabPages) { - IEnumerable boxes = from b in tp.Controls.OfType() select b; + var boxes = tp.Controls.OfType(); _AllPathBoxes.AddRange(boxes); } return _AllPathBoxes; @@ -403,10 +394,10 @@ namespace BizHawk.Client.EmuHawk { get { - List _AllPathControls = new List(); + var _AllPathControls = new List(); foreach (TabPage tp in PathTabControl.TabPages) { - IEnumerable control = from c in tp.Controls.OfType() select c; + var control = tp.Controls.OfType(); _AllPathControls.AddRange(control); } return _AllPathControls; @@ -415,10 +406,7 @@ namespace BizHawk.Client.EmuHawk private IEnumerable AllTabPages { - get - { - return PathTabControl.TabPages.Cast().ToList(); - } + get { return PathTabControl.TabPages.Cast(); } } private void DefaultsBtn_Click(object sender, EventArgs e) diff --git a/BizHawk.Client.EmuHawk/config/PathInfo.cs b/BizHawk.Client.EmuHawk/config/PathInfo.cs index e607f76af3..a09e5987ea 100644 --- a/BizHawk.Client.EmuHawk/config/PathInfo.cs +++ b/BizHawk.Client.EmuHawk/config/PathInfo.cs @@ -1,10 +1,4 @@ using System; -using System.Collections.Generic; -using System.ComponentModel; -using System.Data; -using System.Drawing; -using System.Linq; -using System.Text; using System.Windows.Forms; namespace BizHawk.Client.EmuHawk diff --git a/BizHawk.Client.EmuHawk/config/SoundConfig.cs b/BizHawk.Client.EmuHawk/config/SoundConfig.cs index d3c3afa90a..33a54ff2ef 100644 --- a/BizHawk.Client.EmuHawk/config/SoundConfig.cs +++ b/BizHawk.Client.EmuHawk/config/SoundConfig.cs @@ -1,10 +1,4 @@ using System; -using System.Collections.Generic; -using System.ComponentModel; -using System.Data; -using System.Drawing; -using System.Linq; -using System.Text; using System.Windows.Forms; using BizHawk.Client.Common; @@ -38,7 +32,9 @@ namespace BizHawk.Client.EmuHawk { listBoxSoundDevices.Items.Add(d); if (d == Global.Config.SoundDevice) + { listBoxSoundDevices.SelectedItem = d; + } } } @@ -53,13 +49,13 @@ namespace BizHawk.Client.EmuHawk GlobalWin.Sound.UpdateSoundSettings(); GlobalWin.Sound.StartSound(); GlobalWin.OSD.AddMessage("Sound settings saved"); - this.Close(); + Close(); } private void Cancel_Click(object sender, EventArgs e) { GlobalWin.OSD.AddMessage("Sound config aborted"); - this.Close(); + Close(); } private void trackBar1_Scroll(object sender, EventArgs e) @@ -79,18 +75,10 @@ namespace BizHawk.Client.EmuHawk private void UpdateSoundDialog() { - if (SoundOnCheckBox.Checked) - { - SoundVolGroup.Enabled = true; - MuteFrameAdvance.Enabled = true; - ThrottlecheckBox.Enabled = true; - } - else - { - SoundVolGroup.Enabled = false; - MuteFrameAdvance.Enabled = false; - ThrottlecheckBox.Enabled = false; - } + SoundVolGroup.Enabled = + MuteFrameAdvance.Enabled = + ThrottlecheckBox.Enabled = + SoundOnCheckBox.Checked; } } } diff --git a/BizHawk.Client.EmuHawk/movie/EditCommentsForm.cs b/BizHawk.Client.EmuHawk/movie/EditCommentsForm.cs index bb788c0bfd..7b5bd8e8f3 100644 --- a/BizHawk.Client.EmuHawk/movie/EditCommentsForm.cs +++ b/BizHawk.Client.EmuHawk/movie/EditCommentsForm.cs @@ -7,7 +7,7 @@ namespace BizHawk.Client.EmuHawk { public partial class EditCommentsForm : Form { - private IMovie selectedMovie; + private IMovie _selectedMovie; public EditCommentsForm() { @@ -24,11 +24,8 @@ namespace BizHawk.Client.EmuHawk if (CommentGrid.Rows.Count > 8) { - int x = Height + ((CommentGrid.Rows.Count - 8) * 21); - if (x < 600) - Height = x; - else - Height = 600; + var x = Height + ((CommentGrid.Rows.Count - 8) * 21); + Height = x < 600 ? x : 600; } } @@ -41,30 +38,31 @@ namespace BizHawk.Client.EmuHawk { if (!Global.ReadOnly) { - selectedMovie.Header.Comments.Clear(); - for (int x = 0; x < CommentGrid.Rows.Count - 1; x++) + _selectedMovie.Header.Comments.Clear(); + for (int i = 0; i < CommentGrid.Rows.Count - 1; i++) { - DataGridViewCell c = CommentGrid.Rows[x].Cells[0]; - selectedMovie.Header.Comments.Add("comment " + c.Value); + var c = CommentGrid.Rows[i].Cells[0]; + _selectedMovie.Header.Comments.Add("comment " + c.Value); } - selectedMovie.Save(); + _selectedMovie.Save(); } Close(); } public void GetMovie(IMovie m) { - selectedMovie = m; + _selectedMovie = m; if (m.Header.Comments.Count == 0) return; - for (int x = 0; x < m.Header.Comments.Count; x++) + for (int i = 0; i < m.Header.Comments.Count; i++) { - string str = m.Header.Comments[x]; + var str = m.Header.Comments[i]; if (str.Length >= 7 && str.Substring(0, 7) == "comment") + { str = str.Remove(0, 7); + } CommentGrid.Rows.Add(); - DataGridViewCell c = CommentGrid.Rows[x].Cells[0]; - + var c = CommentGrid.Rows[i].Cells[0]; c.Value = str; } } diff --git a/BizHawk.Client.EmuHawk/movie/EditSubtitlesForm.cs b/BizHawk.Client.EmuHawk/movie/EditSubtitlesForm.cs index b4de681195..0954a83b1d 100644 --- a/BizHawk.Client.EmuHawk/movie/EditSubtitlesForm.cs +++ b/BizHawk.Client.EmuHawk/movie/EditSubtitlesForm.cs @@ -10,7 +10,7 @@ namespace BizHawk.Client.EmuHawk public partial class EditSubtitlesForm : Form { public bool ReadOnly; - private IMovie selectedMovie; + private IMovie _selectedMovie; public EditSubtitlesForm() { @@ -29,11 +29,8 @@ namespace BizHawk.Client.EmuHawk if (SubGrid.Rows.Count > 8) { - int x = Height + ((SubGrid.Rows.Count - 8) * 21); - if (x < 600) - Height = x; - else - Height = 600; + var x = Height + ((SubGrid.Rows.Count - 8) * 21); + Height = x < 600 ? x : 600; } } @@ -44,9 +41,9 @@ namespace BizHawk.Client.EmuHawk private void ShowError(int row, int column) { - DataGridViewCell c = SubGrid.Rows[row].Cells[column]; - string error = "Unable to parse value: " + c.Value; - string caption = "Parse Error Row " + row.ToString() + " Column " + column.ToString(); + var c = SubGrid.Rows[row].Cells[column]; + var error = "Unable to parse value: " + c.Value; + var caption = "Parse Error Row " + row + " Column " + column; MessageBox.Show(error, caption, MessageBoxButtons.OK, MessageBoxIcon.Error); } @@ -54,12 +51,12 @@ namespace BizHawk.Client.EmuHawk { if (!ReadOnly) { - selectedMovie.Subtitles.Clear(); + _selectedMovie.Subtitles.Clear(); for (int x = 0; x < SubGrid.Rows.Count - 1; x++) { - Subtitle s = new Subtitle(); + var s = new Subtitle(); - DataGridViewCell c = SubGrid.Rows[x].Cells[0]; + var c = SubGrid.Rows[x].Cells[0]; try { s.Frame = int.Parse(c.Value.ToString()); } catch { ShowError(x, 0); return; } c = SubGrid.Rows[x].Cells[1]; @@ -77,24 +74,24 @@ namespace BizHawk.Client.EmuHawk try { c = SubGrid.Rows[x].Cells[5]; } catch { ShowError(x, 5); return; } s.Message = c.Value.ToString(); - selectedMovie.Subtitles.Add(s); + _selectedMovie.Subtitles.Add(s); } - selectedMovie.Save(); + _selectedMovie.Save(); } Close(); } public void GetMovie(IMovie m) { - selectedMovie = m; - SubtitleList subs = new SubtitleList(); + _selectedMovie = m; + var subs = new SubtitleList(); subs.AddRange(m.Subtitles); for (int x = 0; x < subs.Count; x++) { - Subtitle s = subs[x]; + var s = subs[x]; SubGrid.Rows.Add(); - DataGridViewCell c = SubGrid.Rows[x].Cells[0]; + var c = SubGrid.Rows[x].Cells[0]; c.Value = s.Frame; c = SubGrid.Rows[x].Cells[1]; c.Value = s.X; @@ -113,7 +110,7 @@ namespace BizHawk.Client.EmuHawk private void ChangeRow(Subtitle s, int index) { if (index >= SubGrid.Rows.Count) return; - DataGridViewCell c = SubGrid.Rows[index].Cells[0]; + var c = SubGrid.Rows[index].Cells[0]; c.Value = s.Frame; c = SubGrid.Rows[index].Cells[1]; c.Value = s.X; @@ -132,8 +129,8 @@ namespace BizHawk.Client.EmuHawk { if (index >= SubGrid.Rows.Count) return new Subtitle(); - Subtitle s = new Subtitle(); - DataGridViewCell c = SubGrid.Rows[index].Cells[0]; + var s = new Subtitle(); + var c = SubGrid.Rows[index].Cells[0]; //Empty catch because it should default to subtitle default value try { s.Frame = int.Parse(c.Value.ToString()); } @@ -153,7 +150,7 @@ namespace BizHawk.Client.EmuHawk c = SubGrid.Rows[index].Cells[5]; try { s.Message = c.Value.ToString(); } catch { } - selectedMovie.Subtitles.Add(s); + _selectedMovie.Subtitles.Add(s); return s; } @@ -161,15 +158,12 @@ namespace BizHawk.Client.EmuHawk private void SubGrid_MouseDoubleClick(object sender, MouseEventArgs e) { if (ReadOnly) return; - DataGridViewSelectedRowCollection c = SubGrid.SelectedRows; + var c = SubGrid.SelectedRows; if (c.Count == 0) return; - SubtitleMaker s = new SubtitleMaker(); - s.sub = GetRow(c[0].Index); + var s = new SubtitleMaker {Sub = GetRow(c[0].Index)}; if (s.ShowDialog() == DialogResult.OK) { - ChangeRow(s.sub, SubGrid.SelectedRows[0].Index); - //if (SubGrid.Rows.Count == SubGrid.SelectedRows[0].Index + 1) - // SubGrid.Rows.Add(); //Why does this case ChangeRow to edit the new changed row? + ChangeRow(s.Sub, SubGrid.SelectedRows[0].Index); } } } diff --git a/BizHawk.Client.EmuHawk/movie/PlayMovie.cs b/BizHawk.Client.EmuHawk/movie/PlayMovie.cs index cf5ffdbbd9..c747dff479 100644 --- a/BizHawk.Client.EmuHawk/movie/PlayMovie.cs +++ b/BizHawk.Client.EmuHawk/movie/PlayMovie.cs @@ -21,7 +21,6 @@ namespace BizHawk.Client.EmuHawk { InitializeComponent(); MovieView.QueryItemText += MovieView_QueryItemText; - MovieView.QueryItemBkColor += MovieView_QueryItemBkColor; MovieView.VirtualMode = true; _sortReverse = false; _sortedCol = String.Empty; @@ -48,11 +47,6 @@ namespace BizHawk.Client.EmuHawk } } - private void MovieView_QueryItemBkColor(int index, int column, ref Color color) - { - - } - private void Cancel_Click(object sender, EventArgs e) { Close(); @@ -60,8 +54,8 @@ namespace BizHawk.Client.EmuHawk private void Run() { - ListView.SelectedIndexCollection indexes = MovieView.SelectedIndices; - if (indexes.Count > 0) //Import file if necessary + var indices = MovieView.SelectedIndices; + if (indices.Count > 0) //Import file if necessary { GlobalWin.MainForm.StartNewMovie(_movieList[MovieView.SelectedIndices[0]], false); } @@ -76,8 +70,8 @@ namespace BizHawk.Client.EmuHawk private void BrowseMovies_Click(object sender, EventArgs e) { - OpenFileDialog ofd = new OpenFileDialog { InitialDirectory = PathManager.MakeAbsolutePath(Global.Config.PathEntries.MoviesPath, null) }; - string filter = "Movie Files (*." + Global.Config.MovieExtension + ")|*." + Global.Config.MovieExtension + "|Savestates|*.state|All Files|*.*"; + var ofd = new OpenFileDialog { InitialDirectory = PathManager.MakeAbsolutePath(Global.Config.PathEntries.MoviesPath, null) }; + var filter = "Movie Files (*." + Global.Config.MovieExtension + ")|*." + Global.Config.MovieExtension + "|Savestates|*.state|All Files|*.*"; ofd.Filter = filter; GlobalWin.Sound.StopSound(); @@ -87,26 +81,29 @@ namespace BizHawk.Client.EmuHawk { var file = new FileInfo(ofd.FileName); if (!file.Exists) + { return; + } else { if (file.Extension.ToUpper() == "STATE") { - Movie movie = new Movie(file.FullName); + var movie = new Movie(file.FullName); movie.Load(); //State files will have to load everything unfortunately if (movie.Frames == 0) { - MessageBox.Show("No input log detected in this savestate, aborting", "Can not load file", MessageBoxButtons.OK, MessageBoxIcon.Hand); + MessageBox.Show("No input log detected in this savestate, aborting", "Can not load file", MessageBoxButtons.OK, + MessageBoxIcon.Hand); return; } } - int x = AddMovieToList(ofd.FileName, true); - if (x > 0) + int? index = AddMovieToList(ofd.FileName, true); + if (index.HasValue) { MovieView.SelectedIndices.Clear(); - MovieView.setSelection(x); - MovieView.SelectItem(x, true); + MovieView.setSelection(index.Value); + MovieView.SelectItem(index.Value, true); } } } @@ -118,10 +115,9 @@ namespace BizHawk.Client.EmuHawk { if (file.Exists) { - int x = IsDuplicate(filename); - if (x == 0) + if (!IsDuplicateOf(filename).HasValue) { - Movie movie = new Movie(file.CanonicalFullPath); + var movie = new Movie(file.CanonicalFullPath); movie.Load(); //State files will have to load everything unfortunately if (movie.Frames > 0) { @@ -134,16 +130,18 @@ namespace BizHawk.Client.EmuHawk } } - private int AddMovieToList(string filename, bool force) + private int? AddMovieToList(string filename, bool force) { using (var file = new HawkFile(filename)) { if (!file.Exists) - return 0; + { + return null; + } else { - int x = IsDuplicate(filename); - if (x == 0) + int? index = IsDuplicateOf(filename); + if (!index.HasValue) { PreLoadMovieFile(file, force); MovieView.ItemCount = _movieList.Count; @@ -151,29 +149,29 @@ namespace BizHawk.Client.EmuHawk _sortReverse = false; _sortedCol = String.Empty; - x = _movieList.Count - 1; + index = _movieList.Count - 1; } - return x; + return index; } } } - private int IsDuplicate(string filename) + private int? IsDuplicateOf(string filename) { - for (int x = 0; x < _movieList.Count; x++) + for (int i = 0; i < _movieList.Count; i++) { - if (_movieList[x].Filename == filename) + if (_movieList[i].Filename == filename) { - return x; + return i; } } - return 0; + return null; } private void PreLoadMovieFile(HawkFile hf, bool force) { - Movie movie = new Movie(hf.CanonicalFullPath); + var movie = new Movie(hf.CanonicalFullPath); movie.PreLoadText(hf); if (hf.Extension == ".FM2") { @@ -199,42 +197,37 @@ namespace BizHawk.Client.EmuHawk private void UpdateMovieCount() { - int x = _movieList.Count; - if (x == 1) - { - MovieCount.Text = x.ToString() + " movie"; - } - else - { - MovieCount.Text = x.ToString() + " movies"; - } + MovieCount.Text = _movieList.Count + " movie" + + (_movieList.Count != 1 ? "s" : String.Empty); } private void PreHighlightMovie() { if (Global.Game == null) return; - List Indexes = new List(); + var Indices = new List(); //Pull out matching names - for (int x = 0; x < _movieList.Count; x++) + for (int i = 0; i < _movieList.Count; i++) { - if (PathManager.FilesystemSafeName(Global.Game) == _movieList[x].GameName) - Indexes.Add(x); + if (PathManager.FilesystemSafeName(Global.Game) == _movieList[i].GameName) + { + Indices.Add(i); + } } - if (Indexes.Count == 0) return; - if (Indexes.Count == 1) + if (Indices.Count == 0) return; + if (Indices.Count == 1) { - HighlightMovie(Indexes[0]); + HighlightMovie(Indices[0]); return; } //Prefer tas files - List TAS = new List(); - for (int x = 0; x < Indexes.Count; x++) + var TAS = new List(); + for (int i = 0; i < Indices.Count; i++) { - if (Path.GetExtension(_movieList[Indexes[x]].Filename).ToUpper() == "." + Global.Config.MovieExtension) + if (Path.GetExtension(_movieList[Indices[i]].Filename).ToUpper() == "." + Global.Config.MovieExtension) { - TAS.Add(x); + TAS.Add(i); } } @@ -245,20 +238,20 @@ namespace BizHawk.Client.EmuHawk } else if (TAS.Count > 1) { - Indexes = new List(TAS); + Indices = new List(TAS); } //Final tie breaker - Last used file - FileInfo f = new FileInfo(_movieList[Indexes[0]].Filename); - DateTime t = f.LastAccessTime; - int mostRecent = Indexes[0]; - for (int x = 1; x < Indexes.Count; x++) + var file = new FileInfo(_movieList[Indices[0]].Filename); + var time = file.LastAccessTime; + int mostRecent = Indices.First(); + for (int i = 1; i < Indices.Count; i++) { - f = new FileInfo(_movieList[Indexes[0]].Filename); - if (f.LastAccessTime > t) + file = new FileInfo(_movieList[Indices[0]].Filename); + if (file.LastAccessTime > time) { - t = f.LastAccessTime; - mostRecent = Indexes[x]; + time = file.LastAccessTime; + mostRecent = Indices[i]; } } @@ -285,57 +278,35 @@ namespace BizHawk.Client.EmuHawk { ClearList(); - string d = PathManager.MakeAbsolutePath(Global.Config.PathEntries.MoviesPath, null); - if (!Directory.Exists(d)) + var directory = PathManager.MakeAbsolutePath(Global.Config.PathEntries.MoviesPath, null); + if (!Directory.Exists(directory)) { - Directory.CreateDirectory(d); + Directory.CreateDirectory(directory); } - foreach (string f in Directory.GetFiles(d, "*." + Global.Config.MovieExtension)) - { - AddMovieToList(f, false); - } - - if (Global.Config.MovieExtension != "*.tas") - { - foreach (string f in Directory.GetFiles(d, "*.tas")) - { - AddMovieToList(f, false); - } - } - else if (Global.Config.MovieExtension != "*.bkm") - { - foreach (string f in Directory.GetFiles(d, "*.bkm")) - { - AddMovieToList(f, false); - } - } + Directory.GetFiles(directory, "*." + Global.Config.MovieExtension) + .ToList() + .ForEach(file => AddMovieToList(file, force: false)); if (Global.Config.PlayMovie_ShowStateFiles) { - foreach (string f in Directory.GetFiles(d, "*.state")) - { - AddStateToList(f); - } + Directory.GetFiles(directory, "*.state") + .ToList() + .ForEach(file => AddStateToList(file)); } if (Global.Config.PlayMovie_IncludeSubdir) { - string[] subs = Directory.GetDirectories(d); - foreach (string dir in subs) + var subs = Directory.GetDirectories(directory); + foreach (var dir in subs) { - foreach (string f in Directory.GetFiles(dir, "*." + Global.Config.MovieExtension)) - { - AddMovieToList(f, false); - } + Directory.GetFiles(dir, "*." + Global.Config.MovieExtension) + .ToList() + .ForEach(file => AddMovieToList(file, force: false)); - if (Global.Config.PlayMovie_ShowStateFiles) - { - foreach (string f in Directory.GetFiles(d, "*.state")) - { - AddStateToList(f); - } - } + Directory.GetFiles(dir, "*.state") + .ToList() + .ForEach(file => AddStateToList(file)); } } } @@ -363,13 +334,13 @@ namespace BizHawk.Client.EmuHawk OK.Enabled = true; } - int x = MovieView.SelectedIndices[0]; - MovieView.ensureVisible(x); - Dictionary h = _movieList[x].Header.HeaderParams; + int firstIndex = MovieView.SelectedIndices[0]; + MovieView.ensureVisible(firstIndex); + var headers = _movieList[firstIndex].Header.HeaderParams; - foreach (var kvp in h) + foreach (var kvp in headers) { - ListViewItem item = new ListViewItem(kvp.Key); + var item = new ListViewItem(kvp.Key); item.SubItems.Add(kvp.Value); switch (kvp.Key) @@ -405,23 +376,23 @@ namespace BizHawk.Client.EmuHawk } var FpsItem = new ListViewItem("Fps"); - FpsItem.SubItems.Add(String.Format("{0:0.#######}", _movieList[x].Fps)); + FpsItem.SubItems.Add(String.Format("{0:0.#######}", _movieList[firstIndex].Fps)); DetailsView.Items.Add(FpsItem); var FramesItem = new ListViewItem("Frames"); - FramesItem.SubItems.Add(_movieList[x].RawFrames.ToString()); + FramesItem.SubItems.Add(_movieList[firstIndex].RawFrames.ToString()); DetailsView.Items.Add(FramesItem); - CommentsBtn.Enabled = _movieList[x].Header.Comments.Count > 0; - SubtitlesBtn.Enabled = _movieList[x].Subtitles.Count > 0; + CommentsBtn.Enabled = _movieList[firstIndex].Header.Comments.Any(); + SubtitlesBtn.Enabled = _movieList[firstIndex].Subtitles.Any(); } private void button1_Click(object sender, EventArgs e) { - ListView.SelectedIndexCollection indexes = MovieView.SelectedIndices; - if (indexes.Count > 0) + var indices = MovieView.SelectedIndices; + if (indices.Count > 0) { - EditCommentsForm form = new EditCommentsForm(); + var form = new EditCommentsForm(); form.GetMovie(_movieList[MovieView.SelectedIndices[0]]); form.Show(); } @@ -429,10 +400,10 @@ namespace BizHawk.Client.EmuHawk private void button2_Click(object sender, EventArgs e) { - ListView.SelectedIndexCollection indexes = MovieView.SelectedIndices; - if (indexes.Count > 0) + var indices = MovieView.SelectedIndices; + if (indices.Count > 0) { - EditSubtitlesForm s = new EditSubtitlesForm { ReadOnly = true }; + var s = new EditSubtitlesForm { ReadOnly = true }; s.GetMovie(_movieList[MovieView.SelectedIndices[0]]); s.Show(); } @@ -451,14 +422,12 @@ namespace BizHawk.Client.EmuHawk private void MovieView_DragDrop(object sender, DragEventArgs e) { - string[] filePaths = (string[])e.Data.GetData(DataFormats.FileDrop); - foreach (string path in filePaths) - { - if (Path.GetExtension(path) == "." + Global.Config.MovieExtension) - { - AddMovieToList(path, true); - } - } + var filePaths = (string[])e.Data.GetData(DataFormats.FileDrop); + + filePaths + .Where(path => Path.GetExtension(path) == "." + Global.Config.MovieExtension) + .ToList() + .ForEach(path => AddMovieToList(path, force: true)); } private void MovieView_ColumnClick(object sender, ColumnClickEventArgs e) @@ -468,7 +437,7 @@ namespace BizHawk.Client.EmuHawk private void OrderColumn(int columnToOrder) { - string columnName = MovieView.Columns[columnToOrder].Text; + var columnName = MovieView.Columns[columnToOrder].Text; if (_sortedCol != columnName) { _sortReverse = false; @@ -594,10 +563,10 @@ namespace BizHawk.Client.EmuHawk { if (e.Control && e.KeyCode == Keys.C) { - ListView.SelectedIndexCollection indexes = MovieView.SelectedIndices; + var indexes = MovieView.SelectedIndices; if (indexes.Count > 0) { - StringBuilder copyStr = new StringBuilder(); + var copyStr = new StringBuilder(); foreach (int index in indexes) { copyStr diff --git a/BizHawk.Client.EmuHawk/movie/RecordMovie.Designer.cs b/BizHawk.Client.EmuHawk/movie/RecordMovie.Designer.cs index 4834b1f650..ef3cd7c7b6 100644 --- a/BizHawk.Client.EmuHawk/movie/RecordMovie.Designer.cs +++ b/BizHawk.Client.EmuHawk/movie/RecordMovie.Designer.cs @@ -28,167 +28,168 @@ /// private void InitializeComponent() { - System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(RecordMovie)); - this.Cancel = new System.Windows.Forms.Button(); - this.OK = new System.Windows.Forms.Button(); - this.Browse = new System.Windows.Forms.Button(); - this.RecordBox = new System.Windows.Forms.TextBox(); - this.StartFromCombo = new System.Windows.Forms.ComboBox(); - this.groupBox1 = new System.Windows.Forms.GroupBox(); - this.DefaultAuthorCheckBox = new System.Windows.Forms.CheckBox(); - this.AuthorBox = new System.Windows.Forms.TextBox(); - this.label3 = new System.Windows.Forms.Label(); - this.label2 = new System.Windows.Forms.Label(); - this.label1 = new System.Windows.Forms.Label(); - this.groupBox1.SuspendLayout(); - this.SuspendLayout(); - // - // Cancel - // - this.Cancel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); - this.Cancel.DialogResult = System.Windows.Forms.DialogResult.Cancel; - this.Cancel.Location = new System.Drawing.Point(391, 139); - this.Cancel.Name = "Cancel"; - this.Cancel.Size = new System.Drawing.Size(75, 23); - this.Cancel.TabIndex = 1; - this.Cancel.Text = "&Cancel"; - this.Cancel.UseVisualStyleBackColor = true; - this.Cancel.Click += new System.EventHandler(this.Cancel_Click); - // - // OK - // - this.OK.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); - this.OK.Location = new System.Drawing.Point(310, 139); - this.OK.Name = "OK"; - this.OK.Size = new System.Drawing.Size(75, 23); - this.OK.TabIndex = 0; - this.OK.Text = "&Ok"; - this.OK.UseVisualStyleBackColor = true; - this.OK.Click += new System.EventHandler(this.OK_Click); - // - // Browse - // - this.Browse.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); - this.Browse.Image = global::BizHawk.Client.EmuHawk.Properties.Resources.OpenFile; - this.Browse.Location = new System.Drawing.Point(423, 13); - this.Browse.Name = "Browse"; - this.Browse.Size = new System.Drawing.Size(25, 23); - this.Browse.TabIndex = 1; - this.Browse.UseVisualStyleBackColor = true; - this.Browse.Click += new System.EventHandler(this.button1_Click); - // - // RecordBox - // - this.RecordBox.AllowDrop = true; - this.RecordBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(RecordMovie)); + this.Cancel = new System.Windows.Forms.Button(); + this.OK = new System.Windows.Forms.Button(); + this.Browse = new System.Windows.Forms.Button(); + this.RecordBox = new System.Windows.Forms.TextBox(); + this.StartFromCombo = new System.Windows.Forms.ComboBox(); + this.groupBox1 = new System.Windows.Forms.GroupBox(); + this.DefaultAuthorCheckBox = new System.Windows.Forms.CheckBox(); + this.AuthorBox = new System.Windows.Forms.TextBox(); + this.label3 = new System.Windows.Forms.Label(); + this.label2 = new System.Windows.Forms.Label(); + this.label1 = new System.Windows.Forms.Label(); + this.groupBox1.SuspendLayout(); + this.SuspendLayout(); + // + // Cancel + // + this.Cancel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); + this.Cancel.DialogResult = System.Windows.Forms.DialogResult.Cancel; + this.Cancel.Location = new System.Drawing.Point(391, 139); + this.Cancel.Name = "Cancel"; + this.Cancel.Size = new System.Drawing.Size(75, 23); + this.Cancel.TabIndex = 1; + this.Cancel.Text = "&Cancel"; + this.Cancel.UseVisualStyleBackColor = true; + this.Cancel.Click += new System.EventHandler(this.Cancel_Click); + // + // OK + // + this.OK.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); + this.OK.Location = new System.Drawing.Point(310, 139); + this.OK.Name = "OK"; + this.OK.Size = new System.Drawing.Size(75, 23); + this.OK.TabIndex = 0; + this.OK.Text = "&Ok"; + this.OK.UseVisualStyleBackColor = true; + this.OK.Click += new System.EventHandler(this.OK_Click); + // + // Browse + // + this.Browse.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + this.Browse.Image = global::BizHawk.Client.EmuHawk.Properties.Resources.OpenFile; + this.Browse.Location = new System.Drawing.Point(423, 13); + this.Browse.Name = "Browse"; + this.Browse.Size = new System.Drawing.Size(25, 23); + this.Browse.TabIndex = 1; + this.Browse.UseVisualStyleBackColor = true; + this.Browse.Click += new System.EventHandler(this.button1_Click); + // + // RecordBox + // + this.RecordBox.AllowDrop = true; + this.RecordBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); - this.RecordBox.Location = new System.Drawing.Point(83, 13); - this.RecordBox.Name = "RecordBox"; - this.RecordBox.Size = new System.Drawing.Size(334, 20); - this.RecordBox.TabIndex = 0; - this.RecordBox.DragDrop += new System.Windows.Forms.DragEventHandler(this.RecordBox_DragDrop); - this.RecordBox.DragEnter += new System.Windows.Forms.DragEventHandler(this.RecordBox_DragEnter); - // - // StartFromCombo - // - this.StartFromCombo.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; - this.StartFromCombo.FormattingEnabled = true; - this.StartFromCombo.Items.AddRange(new object[] { + this.RecordBox.Location = new System.Drawing.Point(83, 13); + this.RecordBox.Name = "RecordBox"; + this.RecordBox.Size = new System.Drawing.Size(334, 20); + this.RecordBox.TabIndex = 0; + this.RecordBox.DragDrop += new System.Windows.Forms.DragEventHandler(this.RecordBox_DragDrop); + this.RecordBox.DragEnter += new System.Windows.Forms.DragEventHandler(this.RecordBox_DragEnter); + // + // StartFromCombo + // + this.StartFromCombo.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + this.StartFromCombo.FormattingEnabled = true; + this.StartFromCombo.Items.AddRange(new object[] { "Power-On", "Now"}); - this.StartFromCombo.Location = new System.Drawing.Point(83, 65); - this.StartFromCombo.MaxDropDownItems = 32; - this.StartFromCombo.Name = "StartFromCombo"; - this.StartFromCombo.Size = new System.Drawing.Size(152, 21); - this.StartFromCombo.TabIndex = 3; - // - // groupBox1 - // - this.groupBox1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + this.StartFromCombo.Location = new System.Drawing.Point(83, 65); + this.StartFromCombo.MaxDropDownItems = 32; + this.StartFromCombo.Name = "StartFromCombo"; + this.StartFromCombo.Size = new System.Drawing.Size(152, 21); + this.StartFromCombo.TabIndex = 3; + // + // groupBox1 + // + this.groupBox1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); - this.groupBox1.Controls.Add(this.DefaultAuthorCheckBox); - this.groupBox1.Controls.Add(this.AuthorBox); - this.groupBox1.Controls.Add(this.StartFromCombo); - this.groupBox1.Controls.Add(this.Browse); - this.groupBox1.Controls.Add(this.label3); - this.groupBox1.Controls.Add(this.label2); - this.groupBox1.Controls.Add(this.label1); - this.groupBox1.Controls.Add(this.RecordBox); - this.groupBox1.Location = new System.Drawing.Point(12, 12); - this.groupBox1.Name = "groupBox1"; - this.groupBox1.Size = new System.Drawing.Size(454, 112); - this.groupBox1.TabIndex = 0; - this.groupBox1.TabStop = false; - // - // DefaultAuthorCheckBox - // - this.DefaultAuthorCheckBox.Anchor = System.Windows.Forms.AnchorStyles.Right; - this.DefaultAuthorCheckBox.AutoSize = true; - this.DefaultAuthorCheckBox.Location = new System.Drawing.Point(327, 64); - this.DefaultAuthorCheckBox.Name = "DefaultAuthorCheckBox"; - this.DefaultAuthorCheckBox.Size = new System.Drawing.Size(121, 17); - this.DefaultAuthorCheckBox.TabIndex = 6; - this.DefaultAuthorCheckBox.Text = "Make default author"; - this.DefaultAuthorCheckBox.UseVisualStyleBackColor = true; - // - // AuthorBox - // - this.AuthorBox.AllowDrop = true; - this.AuthorBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + this.groupBox1.Controls.Add(this.DefaultAuthorCheckBox); + this.groupBox1.Controls.Add(this.AuthorBox); + this.groupBox1.Controls.Add(this.StartFromCombo); + this.groupBox1.Controls.Add(this.Browse); + this.groupBox1.Controls.Add(this.label3); + this.groupBox1.Controls.Add(this.label2); + this.groupBox1.Controls.Add(this.label1); + this.groupBox1.Controls.Add(this.RecordBox); + this.groupBox1.Location = new System.Drawing.Point(12, 12); + this.groupBox1.Name = "groupBox1"; + this.groupBox1.Size = new System.Drawing.Size(454, 112); + this.groupBox1.TabIndex = 0; + this.groupBox1.TabStop = false; + // + // DefaultAuthorCheckBox + // + this.DefaultAuthorCheckBox.Anchor = System.Windows.Forms.AnchorStyles.Right; + this.DefaultAuthorCheckBox.AutoSize = true; + this.DefaultAuthorCheckBox.Location = new System.Drawing.Point(327, 64); + this.DefaultAuthorCheckBox.Name = "DefaultAuthorCheckBox"; + this.DefaultAuthorCheckBox.Size = new System.Drawing.Size(121, 17); + this.DefaultAuthorCheckBox.TabIndex = 6; + this.DefaultAuthorCheckBox.Text = "Make default author"; + this.DefaultAuthorCheckBox.UseVisualStyleBackColor = true; + // + // AuthorBox + // + this.AuthorBox.AllowDrop = true; + this.AuthorBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); - this.AuthorBox.Location = new System.Drawing.Point(83, 39); - this.AuthorBox.Name = "AuthorBox"; - this.AuthorBox.Size = new System.Drawing.Size(365, 20); - this.AuthorBox.TabIndex = 2; - // - // label3 - // - this.label3.AutoSize = true; - this.label3.Location = new System.Drawing.Point(36, 41); - this.label3.Name = "label3"; - this.label3.Size = new System.Drawing.Size(41, 13); - this.label3.TabIndex = 2; - this.label3.Text = "Author:"; - // - // label2 - // - this.label2.AutoSize = true; - this.label2.Location = new System.Drawing.Point(6, 68); - this.label2.Name = "label2"; - this.label2.Size = new System.Drawing.Size(71, 13); - this.label2.TabIndex = 5; - this.label2.Text = "Record From:"; - // - // label1 - // - this.label1.AutoSize = true; - this.label1.Location = new System.Drawing.Point(51, 16); - this.label1.Name = "label1"; - this.label1.Size = new System.Drawing.Size(26, 13); - this.label1.TabIndex = 4; - this.label1.Text = "File:"; - // - // RecordMovie - // - this.AcceptButton = this.OK; - this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.CancelButton = this.Cancel; - this.ClientSize = new System.Drawing.Size(478, 163); - this.Controls.Add(this.groupBox1); - this.Controls.Add(this.OK); - this.Controls.Add(this.Cancel); - this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); - this.MaximizeBox = false; - this.MaximumSize = new System.Drawing.Size(1440, 201); - this.MinimizeBox = false; - this.Name = "RecordMovie"; - this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; - this.Text = "Record Movie"; - this.Load += new System.EventHandler(this.RecordMovie_Load); - this.groupBox1.ResumeLayout(false); - this.groupBox1.PerformLayout(); - this.ResumeLayout(false); + this.AuthorBox.Location = new System.Drawing.Point(83, 39); + this.AuthorBox.Name = "AuthorBox"; + this.AuthorBox.Size = new System.Drawing.Size(365, 20); + this.AuthorBox.TabIndex = 2; + // + // label3 + // + this.label3.AutoSize = true; + this.label3.Location = new System.Drawing.Point(36, 41); + this.label3.Name = "label3"; + this.label3.Size = new System.Drawing.Size(41, 13); + this.label3.TabIndex = 2; + this.label3.Text = "Author:"; + // + // label2 + // + this.label2.AutoSize = true; + this.label2.Location = new System.Drawing.Point(6, 68); + this.label2.Name = "label2"; + this.label2.Size = new System.Drawing.Size(71, 13); + this.label2.TabIndex = 5; + this.label2.Text = "Record From:"; + // + // label1 + // + this.label1.AutoSize = true; + this.label1.Location = new System.Drawing.Point(51, 16); + this.label1.Name = "label1"; + this.label1.Size = new System.Drawing.Size(26, 13); + this.label1.TabIndex = 4; + this.label1.Text = "File:"; + // + // RecordMovie + // + this.AcceptButton = this.OK; + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.CancelButton = this.Cancel; + this.ClientSize = new System.Drawing.Size(478, 163); + this.Controls.Add(this.groupBox1); + this.Controls.Add(this.OK); + this.Controls.Add(this.Cancel); + this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); + this.MaximizeBox = false; + this.MaximumSize = new System.Drawing.Size(1440, 201); + this.MinimizeBox = false; + this.MinimumSize = new System.Drawing.Size(425, 201); + this.Name = "RecordMovie"; + this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; + this.Text = "Record Movie"; + this.Load += new System.EventHandler(this.RecordMovie_Load); + this.groupBox1.ResumeLayout(false); + this.groupBox1.PerformLayout(); + this.ResumeLayout(false); } diff --git a/BizHawk.Client.EmuHawk/movie/RecordMovie.cs b/BizHawk.Client.EmuHawk/movie/RecordMovie.cs index 16e022873f..35f4390918 100644 --- a/BizHawk.Client.EmuHawk/movie/RecordMovie.cs +++ b/BizHawk.Client.EmuHawk/movie/RecordMovie.cs @@ -18,7 +18,7 @@ namespace BizHawk.Client.EmuHawk //TODO //Allow relative paths in record textbox - Movie MovieToRecord; + private Movie _movieToRecord; public RecordMovie() { @@ -28,105 +28,116 @@ namespace BizHawk.Client.EmuHawk private string MakePath() { if (RecordBox.Text.Length == 0) - return ""; - string path = RecordBox.Text; + { + return String.Empty; + } + var path = RecordBox.Text; if (path.LastIndexOf(Path.DirectorySeparatorChar) == -1) { if (path[0] != Path.DirectorySeparatorChar) + { path = path.Insert(0, Path.DirectorySeparatorChar.ToString()); + } path = PathManager.MakeAbsolutePath(Global.Config.PathEntries.MoviesPath, null) + path; if (path[path.Length - 4] != '.') //If no file extension, add movie extension + { path += "." + Global.Config.MovieExtension; + } return path; } else + { return path; + } } private void OK_Click(object sender, EventArgs e) { - string path = MakePath(); + var path = MakePath(); - if (path.Length > 0) + if (!String.IsNullOrWhiteSpace(path)) { - FileInfo test = new FileInfo(path); + var test = new FileInfo(path); if (test.Exists) { var result = MessageBox.Show(path + " already exists, overwrite?", "Confirm overwrite", MessageBoxButtons.OKCancel, MessageBoxIcon.Warning); if (result == DialogResult.Cancel) + { return; + } } - - MovieToRecord = new Movie(path); + _movieToRecord = new Movie(path); //Header - MovieToRecord.Header.SetHeaderLine(MovieHeader.AUTHOR, AuthorBox.Text); - MovieToRecord.Header.SetHeaderLine(MovieHeader.EMULATIONVERSION, VersionInfo.GetEmuVersion()); - MovieToRecord.Header.SetHeaderLine(MovieHeader.MOVIEVERSION, MovieHeader.MovieVersion); - MovieToRecord.Header.SetHeaderLine(MovieHeader.GUID, MovieHeader.MakeGUID()); - MovieToRecord.Header.SetHeaderLine(MovieHeader.PLATFORM, Global.Game.System); + _movieToRecord.Header.SetHeaderLine(MovieHeader.AUTHOR, AuthorBox.Text); + _movieToRecord.Header.SetHeaderLine(MovieHeader.EMULATIONVERSION, VersionInfo.GetEmuVersion()); + _movieToRecord.Header.SetHeaderLine(MovieHeader.MOVIEVERSION, MovieHeader.MovieVersion); + _movieToRecord.Header.SetHeaderLine(MovieHeader.GUID, MovieHeader.MakeGUID()); + _movieToRecord.Header.SetHeaderLine(MovieHeader.PLATFORM, Global.Game.System); if (Global.Game != null) { - MovieToRecord.Header.SetHeaderLine(MovieHeader.GAMENAME, PathManager.FilesystemSafeName(Global.Game)); - MovieToRecord.Header.SetHeaderLine(MovieHeader.SHA1, Global.Game.Hash); + _movieToRecord.Header.SetHeaderLine(MovieHeader.GAMENAME, PathManager.FilesystemSafeName(Global.Game)); + _movieToRecord.Header.SetHeaderLine(MovieHeader.SHA1, Global.Game.Hash); if (Global.Game.FirmwareHash != null) - MovieToRecord.Header.SetHeaderLine(MovieHeader.FIRMWARESHA1, Global.Game.FirmwareHash); + { + _movieToRecord.Header.SetHeaderLine(MovieHeader.FIRMWARESHA1, Global.Game.FirmwareHash); + } } else { - MovieToRecord.Header.SetHeaderLine(MovieHeader.GAMENAME, "NULL"); + _movieToRecord.Header.SetHeaderLine(MovieHeader.GAMENAME, "NULL"); } if (Global.Emulator.BoardName != null) { - MovieToRecord.Header.SetHeaderLine(MovieHeader.BOARDNAME, Global.Emulator.BoardName); + _movieToRecord.Header.SetHeaderLine(MovieHeader.BOARDNAME, Global.Emulator.BoardName); } if (Global.Emulator is Gameboy) { - MovieToRecord.Header.SetHeaderLine(MovieHeader.GB_FORCEDMG, Global.Config.GB_ForceDMG.ToString()); - MovieToRecord.Header.SetHeaderLine(MovieHeader.GB_GBA_IN_CGB, Global.Config.GB_GBACGB.ToString()); + _movieToRecord.Header.SetHeaderLine(MovieHeader.GB_FORCEDMG, Global.Config.GB_ForceDMG.ToString()); + _movieToRecord.Header.SetHeaderLine(MovieHeader.GB_GBA_IN_CGB, Global.Config.GB_GBACGB.ToString()); } if (Global.Emulator is LibsnesCore) { - MovieToRecord.Header.SetHeaderLine(MovieHeader.SGB, ((Global.Emulator) as LibsnesCore).IsSGB.ToString()); + _movieToRecord.Header.SetHeaderLine(MovieHeader.SGB, ((Global.Emulator) as LibsnesCore).IsSGB.ToString()); if ((Global.Emulator as LibsnesCore).DisplayType == DisplayType.PAL) { - MovieToRecord.Header.SetHeaderLine(MovieHeader.PAL, "1"); + _movieToRecord.Header.SetHeaderLine(MovieHeader.PAL, "1"); } } else if (Global.Emulator is SMS) { if ((Global.Emulator as SMS).DisplayType == DisplayType.PAL) { - MovieToRecord.Header.SetHeaderLine(MovieHeader.PAL, "1"); + _movieToRecord.Header.SetHeaderLine(MovieHeader.PAL, "1"); } } else if (Global.Emulator is NES) { if ((Global.Emulator as NES).DisplayType == DisplayType.PAL) { - MovieToRecord.Header.SetHeaderLine(MovieHeader.PAL, "1"); + _movieToRecord.Header.SetHeaderLine(MovieHeader.PAL, "1"); } } else if (Global.Emulator is ColecoVision) { - MovieToRecord.Header.SetHeaderLine(MovieHeader.SKIPBIOS, Global.Config.ColecoSkipBiosIntro.ToString()); + _movieToRecord.Header.SetHeaderLine(MovieHeader.SKIPBIOS, Global.Config.ColecoSkipBiosIntro.ToString()); } else if (Global.Emulator is N64) { - MovieToRecord.Header.SetHeaderLine(MovieHeader.VIDEOPLUGIN, Global.Config.N64VidPlugin); + _movieToRecord.Header.SetHeaderLine(MovieHeader.VIDEOPLUGIN, Global.Config.N64VidPlugin); if (Global.Config.N64VidPlugin == "Rice") { var rice_settings = Global.Config.RicePlugin.GetPluginSettings(); foreach(var setting in rice_settings) { - MovieToRecord.Header.SetHeaderLine(setting.Key, setting.Value.ToString()); + _movieToRecord.Header.SetHeaderLine(setting.Key, setting.Value.ToString()); } } else if (Global.Config.N64VidPlugin == "Glide64") @@ -134,41 +145,38 @@ namespace BizHawk.Client.EmuHawk var glide_settings = Global.Config.GlidePlugin.GetPluginSettings(); foreach (var setting in glide_settings) { - MovieToRecord.Header.SetHeaderLine(setting.Key, setting.Value.ToString()); + _movieToRecord.Header.SetHeaderLine(setting.Key, setting.Value.ToString()); } } if ((Global.Emulator as N64).DisplayType == DisplayType.PAL) { - MovieToRecord.Header.SetHeaderLine(MovieHeader.PAL, "1"); + _movieToRecord.Header.SetHeaderLine(MovieHeader.PAL, "1"); } } if (StartFromCombo.SelectedItem.ToString() == "Now") { - MovieToRecord.StartsFromSavestate = true; + _movieToRecord.StartsFromSavestate = true; var temppath = path; var writer = new StreamWriter(temppath); Global.Emulator.SaveStateText(writer); writer.Close(); var file = new FileInfo(temppath); - using (StreamReader sr = file.OpenText()) + using (var sr = file.OpenText()) { string str; - while ((str = sr.ReadLine()) != null) { - if (str == "") + if (!String.IsNullOrWhiteSpace(str)) { - continue; + _movieToRecord.Header.Comments.Add(str); } - else - MovieToRecord.Header.Comments.Add(str); } } } - GlobalWin.MainForm.StartNewMovie(MovieToRecord, true); + GlobalWin.MainForm.StartNewMovie(_movieToRecord, true); Global.Config.UseDefaultAuthor = DefaultAuthorCheckBox.Checked; if (DefaultAuthorCheckBox.Checked) @@ -191,26 +199,23 @@ namespace BizHawk.Client.EmuHawk private void button1_Click(object sender, EventArgs e) { - string filename = ""; - SaveFileDialog sfd = new SaveFileDialog + var filename = String.Empty; + var sfd = new SaveFileDialog { InitialDirectory = PathManager.MakeAbsolutePath(Global.Config.PathEntries.MoviesPath, null), DefaultExt = "." + Global.Config.MovieExtension, FileName = RecordBox.Text, OverwritePrompt = false }; - string filter = "Movie Files (*." + Global.Config.MovieExtension + ")|*." + Global.Config.MovieExtension + "|Savestates|*.state|All Files|*.*"; + var filter = "Movie Files (*." + Global.Config.MovieExtension + ")|*." + Global.Config.MovieExtension + "|Savestates|*.state|All Files|*.*"; sfd.Filter = filter; GlobalWin.Sound.StopSound(); var result = sfd.ShowDialog(); GlobalWin.Sound.StartSound(); - if (result == DialogResult.OK) - { - filename = sfd.FileName; - } - - if ("" != filename) + + if (result == DialogResult.OK + && !String.IsNullOrWhiteSpace(sfd.FileName)) { RecordBox.Text = filename; } @@ -218,13 +223,15 @@ namespace BizHawk.Client.EmuHawk private void RecordMovie_Load(object sender, EventArgs e) { - string name = PathManager.FilesystemSafeName(Global.Game); + var name = PathManager.FilesystemSafeName(Global.Game); name = Path.GetFileNameWithoutExtension(name); RecordBox.Text = name; StartFromCombo.SelectedIndex = 0; DefaultAuthorCheckBox.Checked = Global.Config.UseDefaultAuthor; if (Global.Config.UseDefaultAuthor) + { AuthorBox.Text = Global.Config.DefaultAuthor; + } } private void RecordBox_DragEnter(object sender, DragEventArgs e) @@ -234,7 +241,7 @@ namespace BizHawk.Client.EmuHawk private void RecordBox_DragDrop(object sender, DragEventArgs e) { - string[] filePaths = (string[])e.Data.GetData(DataFormats.FileDrop); + var filePaths = (string[])e.Data.GetData(DataFormats.FileDrop); RecordBox.Text = filePaths[0]; } } diff --git a/BizHawk.Client.EmuHawk/movie/SubtitleMaker.cs b/BizHawk.Client.EmuHawk/movie/SubtitleMaker.cs index cdc2bca05d..0d028766fd 100644 --- a/BizHawk.Client.EmuHawk/movie/SubtitleMaker.cs +++ b/BizHawk.Client.EmuHawk/movie/SubtitleMaker.cs @@ -8,7 +8,7 @@ namespace BizHawk.Client.EmuHawk { public partial class SubtitleMaker : Form { - public Subtitle sub = new Subtitle(); + public Subtitle Sub = new Subtitle(); public SubtitleMaker() { @@ -27,24 +27,24 @@ namespace BizHawk.Client.EmuHawk private void OK_Click(object sender, EventArgs e) { - sub.Frame = (int)FrameNumeric.Value; - sub.Message = Message.Text; - sub.X = (int)XNumeric.Value; - sub.Y = (int)YNumeric.Value; - sub.Duration = (int)DurationNumeric.Value; - sub.Color = (uint)colorDialog1.Color.ToArgb(); + Sub.Frame = (int)FrameNumeric.Value; + Sub.Message = Message.Text; + Sub.X = (int)XNumeric.Value; + Sub.Y = (int)YNumeric.Value; + Sub.Duration = (int)DurationNumeric.Value; + Sub.Color = (uint)colorDialog1.Color.ToArgb(); DialogResult = DialogResult.OK; Close(); } private void SubtitleMaker_Load(object sender, EventArgs e) { - FrameNumeric.Value = sub.Frame; - Message.Text = sub.Message; - XNumeric.Value = sub.X; - YNumeric.Value = sub.Y; - DurationNumeric.Value = sub.Duration; - colorDialog1.Color = Color.FromArgb((int)sub.Color); + FrameNumeric.Value = Sub.Frame; + Message.Text = Sub.Message; + XNumeric.Value = Sub.X; + YNumeric.Value = Sub.Y; + DurationNumeric.Value = Sub.Duration; + colorDialog1.Color = Color.FromArgb((int)Sub.Color); ColorPanel.BackColor = colorDialog1.Color; Message.Focus(); }