diff --git a/Board/Board.cs b/Board/Board.cs index b3492d6..9024814 100644 --- a/Board/Board.cs +++ b/Board/Board.cs @@ -371,8 +371,7 @@ protected override void OnResize(EventArgs e) _nDiameter = (int)(_nMinDimension * _fNumbersFactor); var form = FindForm(); - if (form == null) return; - if (form.WindowState == FormWindowState.Minimized) return; + if (form == null || form.WindowState == FormWindowState.Minimized) return; // Update the controls if the board is not shrunk if (_nMinDimension != 0) @@ -433,15 +432,10 @@ private async Task PictureBoxResultUpdate() //bmpCorrect = DrawSVG(_svgCorrect, this.pctCorrect.Width, this.pctCorrect.Height); //bmpWrong = DrawSVG(_svgWrong, this.pctWrong.Width, this.pctWrong.Height); - System.Diagnostics.Debug.WriteLine("Mark stamp #1"); await Task.Run(() => { - System.Diagnostics.Debug.WriteLine("Mark stamp #2"); rgCorrect = new Region(GetRegionFromTransparentBitmap(bmpCorrect)); rgWrong = new Region(GetRegionFromTransparentBitmap(bmpWrong)); - System.Diagnostics.Debug.WriteLine("pctWrong size {0}x{1}", pctWrong.Width, pctWrong.Height); - System.Diagnostics.Debug.WriteLine("bmpWrong size {0}x{1}", bmpWrong.Width, bmpWrong.Height); - System.Diagnostics.Debug.WriteLine("Mark stamp #3"); this.pctCorrect.Image = bmpCorrect; if (this.pctCorrect.InvokeRequired) this.pctCorrect.Invoke((Action)(() => this.pctCorrect.Region = rgCorrect)); @@ -449,11 +443,8 @@ await Task.Run(() => this.pctWrong.Image = bmpWrong; if (this.pctWrong.InvokeRequired) this.pctWrong.Invoke((Action)(() => this.pctWrong.Region = rgWrong)); else this.pctWrong.Region = rgWrong; - }); - System.Diagnostics.Debug.WriteLine("Mark stamp #4"); - } } diff --git a/MemoryNumbers/Game.cs b/MemoryNumbers/Game.cs index 49fdad7..b45b86b 100644 --- a/MemoryNumbers/Game.cs +++ b/MemoryNumbers/Game.cs @@ -246,7 +246,6 @@ public class OverEventArgs : EventArgs #endregion Events - //if (GameOver != null) OnGameOver(new OverEventArgs(_nScore)); public Game() { diff --git a/MemoryNumbers/MemoryNumbers.csproj b/MemoryNumbers/MemoryNumbers.csproj index fbfd80e..e6a352d 100644 --- a/MemoryNumbers/MemoryNumbers.csproj +++ b/MemoryNumbers/MemoryNumbers.csproj @@ -75,17 +75,11 @@ - + Form - - Form1.cs - - - Form - - - Form2.cs + + frmMain.cs Form @@ -103,11 +97,8 @@ - - Form1.cs - - - Form2.cs + + frmMain.cs frmAbout.cs diff --git a/MemoryNumbers/Program.cs b/MemoryNumbers/Program.cs index 0fff9d4..792ac01 100644 --- a/MemoryNumbers/Program.cs +++ b/MemoryNumbers/Program.cs @@ -16,7 +16,7 @@ static void Main() { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); - Application.Run(new Form1()); + Application.Run(new frmMain()); } } } diff --git a/MemoryNumbers/Properties/AssemblyInfo.cs b/MemoryNumbers/Properties/AssemblyInfo.cs index 35b40c2..8a5997d 100644 --- a/MemoryNumbers/Properties/AssemblyInfo.cs +++ b/MemoryNumbers/Properties/AssemblyInfo.cs @@ -6,11 +6,11 @@ // conjunto de atributos. Cambie estos valores de atributo para modificar la información // asociada con un ensamblado. [assembly: AssemblyTitle("MemoryNumbers")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] +[assembly: AssemblyDescription("Short-term memory game")] +[assembly: AssemblyConfiguration("Winddows 10 x64")] [assembly: AssemblyCompany("Alf Interactive Entertainment Ltd.")] [assembly: AssemblyProduct("MemoryNumbers")] -[assembly: AssemblyCopyright("Copyright © 2020")] +[assembly: AssemblyCopyright("Copyright © 2020")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] @@ -32,5 +32,5 @@ // Puede especificar todos los valores o utilizar los números de compilación y de revisión predeterminados // mediante el carácter '*', como se muestra a continuación: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.1")] -[assembly: AssemblyFileVersion("1.0.0.1")] +[assembly: AssemblyVersion("1.1.0.0")] +[assembly: AssemblyFileVersion("1.1.0.0")] diff --git a/MemoryNumbers/frmAbout.Designer.cs b/MemoryNumbers/frmAbout.Designer.cs index 493e114..5068192 100644 --- a/MemoryNumbers/frmAbout.Designer.cs +++ b/MemoryNumbers/frmAbout.Designer.cs @@ -71,7 +71,8 @@ private void InitializeComponent() // // logoPictureBox // - this.logoPictureBox.Location = new System.Drawing.Point(4, 4); + this.logoPictureBox.Anchor = System.Windows.Forms.AnchorStyles.None; + this.logoPictureBox.Location = new System.Drawing.Point(5, 35); this.logoPictureBox.Margin = new System.Windows.Forms.Padding(4); this.logoPictureBox.Name = "logoPictureBox"; this.tableLayoutPanel.SetRowSpan(this.logoPictureBox, 6); @@ -101,7 +102,7 @@ private void InitializeComponent() this.labelVersion.Name = "labelVersion"; this.labelVersion.Size = new System.Drawing.Size(278, 21); this.labelVersion.TabIndex = 0; - this.labelVersion.Text = "Versión"; + this.labelVersion.Text = "Version"; this.labelVersion.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; // // labelCopyright diff --git a/MemoryNumbers/frmAbout.cs b/MemoryNumbers/frmAbout.cs index 93ad070..696daf3 100644 --- a/MemoryNumbers/frmAbout.cs +++ b/MemoryNumbers/frmAbout.cs @@ -98,7 +98,7 @@ public frmAbout() InitializeComponent(); // this.Text = String.Format("About {0}", AssemblyTitle); this.labelProductName.Text = AssemblyProduct; - this.labelVersion.Text = String.Format("Versión {0}", AssemblyVersion); + this.labelVersion.Text = String.Format("Version {0}", AssemblyVersion); this.labelCopyright.Text = AssemblyCopyright; this.labelCompanyName.Text = AssemblyCompany; this.textBoxDescription.Text = AssemblyDescription; diff --git a/MemoryNumbers/Form1.Designer.cs b/MemoryNumbers/frmMain.Designer.cs similarity index 99% rename from MemoryNumbers/Form1.Designer.cs rename to MemoryNumbers/frmMain.Designer.cs index 03c7e0e..2bad5bf 100644 --- a/MemoryNumbers/Form1.Designer.cs +++ b/MemoryNumbers/frmMain.Designer.cs @@ -1,6 +1,6 @@ namespace MemoryNumbers { - partial class Form1 + partial class frmMain { /// /// Variable del diseñador necesaria. @@ -28,7 +28,7 @@ protected override void Dispose(bool disposing) /// private void InitializeComponent() { - System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Form1)); + System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(frmMain)); System.Windows.Forms.DataVisualization.Charting.ChartArea chartArea1 = new System.Windows.Forms.DataVisualization.Charting.ChartArea(); System.Windows.Forms.DataVisualization.Charting.Legend legend1 = new System.Windows.Forms.DataVisualization.Charting.Legend(); System.Windows.Forms.DataVisualization.Charting.Series series1 = new System.Windows.Forms.DataVisualization.Charting.Series(); @@ -65,15 +65,16 @@ private void InitializeComponent() this.toolStripMain_About = new System.Windows.Forms.ToolStripButton(); this.tabGame = new System.Windows.Forms.TabControl(); this.tabBoard = new System.Windows.Forms.TabPage(); + this.board1 = new Controls.Board(); this.tabStats = new System.Windows.Forms.TabPage(); this.splitStats = new System.Windows.Forms.SplitContainer(); this.chartStatsNumbers = new System.Windows.Forms.DataVisualization.Charting.Chart(); this.chartStatsTime = new System.Windows.Forms.DataVisualization.Charting.Chart(); - this.board1 = new Controls.Board(); this.statusStrip.SuspendLayout(); this.toolStripMain.SuspendLayout(); this.tabGame.SuspendLayout(); this.tabBoard.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.board1)).BeginInit(); this.tabStats.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.splitStats)).BeginInit(); this.splitStats.Panel1.SuspendLayout(); @@ -81,7 +82,6 @@ private void InitializeComponent() this.splitStats.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.chartStatsNumbers)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.chartStatsTime)).BeginInit(); - ((System.ComponentModel.ISupportInitialize)(this.board1)).BeginInit(); this.SuspendLayout(); // // tspTop @@ -112,7 +112,7 @@ private void InitializeComponent() this.statusStrip.Name = "statusStrip"; this.statusStrip.RenderMode = System.Windows.Forms.ToolStripRenderMode.Professional; this.statusStrip.Size = new System.Drawing.Size(538, 25); - this.statusStrip.TabIndex = 4; + this.statusStrip.TabIndex = 2; // // toolStripStatusLabel_Secuence // @@ -141,7 +141,7 @@ private void InitializeComponent() this.toolStripMain.Name = "toolStripMain"; this.toolStripMain.RenderMode = System.Windows.Forms.ToolStripRenderMode.Professional; this.toolStripMain.Size = new System.Drawing.Size(538, 70); - this.toolStripMain.TabIndex = 3; + this.toolStripMain.TabIndex = 0; // // toolStripMain_Exit // @@ -257,7 +257,7 @@ private void InitializeComponent() this.tabGame.SelectedIndex = 0; this.tabGame.Size = new System.Drawing.Size(538, 271); this.tabGame.SizeMode = System.Windows.Forms.TabSizeMode.Fixed; - this.tabGame.TabIndex = 7; + this.tabGame.TabIndex = 1; // // tabBoard // @@ -270,6 +270,27 @@ private void InitializeComponent() this.tabBoard.Text = "Board"; this.tabBoard.UseVisualStyleBackColor = true; // + // board1 + // + this.board1.BackColor = System.Drawing.Color.White; + this.board1.BorderColor = System.Drawing.Color.Black; + this.board1.BorderRatio = 0.12F; + this.board1.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; + this.board1.CountDownRatio = 0.37F; + this.board1.Diameter = 65; + this.board1.Dock = System.Windows.Forms.DockStyle.Fill; + this.board1.FillColor = System.Drawing.Color.White; + this.board1.FontRatio = 0.6F; + this.board1.Location = new System.Drawing.Point(0, 0); + this.board1.Name = "board1"; + this.board1.NumbersRatio = 0.25F; + this.board1.PlaySounds = true; + this.board1.ResultRatio = 0.56F; + this.board1.Size = new System.Drawing.Size(530, 262); + this.board1.TabIndex = 11; + this.board1.TabStop = false; + this.board1.Time = 700; + // // tabStats // this.tabStats.Controls.Add(this.splitStats); @@ -407,27 +428,6 @@ private void InitializeComponent() this.chartStatsTime.TabIndex = 0; this.chartStatsTime.Text = "chartStatsTime"; // - // board1 - // - this.board1.BackColor = System.Drawing.Color.White; - this.board1.BorderColor = System.Drawing.Color.Black; - this.board1.BorderRatio = 0.12F; - this.board1.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; - this.board1.CountDownRatio = 0.37F; - this.board1.Diameter = 65; - this.board1.Dock = System.Windows.Forms.DockStyle.Fill; - this.board1.FillColor = System.Drawing.Color.White; - this.board1.FontRatio = 0.6F; - this.board1.Location = new System.Drawing.Point(0, 0); - this.board1.Name = "board1"; - this.board1.NumbersRatio = 0.25F; - this.board1.PlaySounds = true; - this.board1.ResultRatio = 0.56F; - this.board1.Size = new System.Drawing.Size(530, 262); - this.board1.TabIndex = 11; - this.board1.TabStop = false; - this.board1.Time = 700; - // // Form1 // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); @@ -455,6 +455,7 @@ private void InitializeComponent() this.toolStripMain.PerformLayout(); this.tabGame.ResumeLayout(false); this.tabBoard.ResumeLayout(false); + ((System.ComponentModel.ISupportInitialize)(this.board1)).EndInit(); this.tabStats.ResumeLayout(false); this.splitStats.Panel1.ResumeLayout(false); this.splitStats.Panel2.ResumeLayout(false); @@ -462,7 +463,6 @@ private void InitializeComponent() this.splitStats.ResumeLayout(false); ((System.ComponentModel.ISupportInitialize)(this.chartStatsNumbers)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.chartStatsTime)).EndInit(); - ((System.ComponentModel.ISupportInitialize)(this.board1)).EndInit(); this.ResumeLayout(false); this.PerformLayout(); diff --git a/MemoryNumbers/Form1.cs b/MemoryNumbers/frmMain.cs similarity index 97% rename from MemoryNumbers/Form1.cs rename to MemoryNumbers/frmMain.cs index 4d6e4e3..d2eb519 100644 --- a/MemoryNumbers/Form1.cs +++ b/MemoryNumbers/frmMain.cs @@ -15,7 +15,7 @@ namespace MemoryNumbers { - public partial class Form1 : Form + public partial class frmMain : Form { //RoundButton.RoundButton btn = new RoundButton.RoundButton(); Game _game = new Game(); @@ -25,7 +25,7 @@ public partial class Form1 : Form private ProgramSettings _defaultSettings; private static readonly string _programSettingsFileName = @"Configuration.xml"; - public Form1() + public frmMain() { // Set form icon _path = Path.GetDirectoryName(System.Diagnostics.Process.GetCurrentProcess().MainModule.FileName); @@ -39,32 +39,27 @@ public Form1() InitializeStatusStrip(); InitializeChartStats(); + // Initialization extras splitStats.SplitterWidth = 1; // This is a known bug - //board1.Parent = this; - // Subscribe to events - //countDown1.TimerEnding += new EventHandler(OnTimerEnding); board1.ButtonClick += new EventHandler(OnButtonClick); - //board1.RightSequence += new EventHandler(OnCorrectSequence); - //board1.WrongSequence += new EventHandler(OnWrongSequence); + _game.CorrectSequence += new EventHandler(OnCorrectSequence); _game.WrongSequence += new EventHandler(OnWrongSequence); _game.GameOver += new EventHandler(OnGameOver); - //_game.CorrectSequence += async (object s, Game.CorrectEventArgs e) => await OnCorrectSequence(s, e); - //_game.WrongSequence += async (object s, Game.WrongEventArgs e) => await OnWrongSequence(s, e); //_game.GameOver += async (object s, Game.OverEventArgs e) => await OnGameOver(s, e); - // Read the program settings file and apply them + // Read the program settings file LoadProgramSettings(ref _programSettings); + // Load defalut settings _defaultSettings = new ProgramSettings(); LoadDefaultSettings(_defaultSettings); + // Apply settings if (_programSettings == null) _programSettings = _defaultSettings; - ApplySettings(_programSettings, _defaultSettings, true); - } #region Initialization routines diff --git a/MemoryNumbers/Form1.resx b/MemoryNumbers/frmMain.resx similarity index 100% rename from MemoryNumbers/Form1.resx rename to MemoryNumbers/frmMain.resx diff --git a/MemoryNumbers/frmSettings.Designer.cs b/MemoryNumbers/frmSettings.Designer.cs index 8e409fe..ce5630f 100644 --- a/MemoryNumbers/frmSettings.Designer.cs +++ b/MemoryNumbers/frmSettings.Designer.cs @@ -52,6 +52,7 @@ private void InitializeComponent() this.trackTime = new System.Windows.Forms.TrackBar(); this.lblTime = new System.Windows.Forms.Label(); this.tabGUI = new System.Windows.Forms.TabPage(); + this.btnFontFamily = new System.Windows.Forms.Button(); this.lblFontFamily = new System.Windows.Forms.Label(); this.roundSample = new Controls.RoundButton(); this.pctSample = new System.Windows.Forms.PictureBox(); @@ -76,7 +77,6 @@ private void InitializeComponent() this.btnAccept = new System.Windows.Forms.Button(); this.btnCancel = new System.Windows.Forms.Button(); this.btnReset = new System.Windows.Forms.Button(); - this.btnFontFamily = new System.Windows.Forms.Button(); this.tabSettings.SuspendLayout(); this.tabPage1.SuspendLayout(); this.grpTime.SuspendLayout(); @@ -137,7 +137,7 @@ private void InitializeComponent() this.grpTime.Location = new System.Drawing.Point(267, 53); this.grpTime.Name = "grpTime"; this.grpTime.Size = new System.Drawing.Size(237, 143); - this.grpTime.TabIndex = 5; + this.grpTime.TabIndex = 1; this.grpTime.TabStop = false; this.grpTime.Text = "Time"; // @@ -148,7 +148,7 @@ private void InitializeComponent() this.radFixed.Location = new System.Drawing.Point(47, 42); this.radFixed.Name = "radFixed"; this.radFixed.Size = new System.Drawing.Size(89, 21); - this.radFixed.TabIndex = 2; + this.radFixed.TabIndex = 0; this.radFixed.TabStop = true; this.radFixed.Text = "Fixed time"; this.radFixed.UseVisualStyleBackColor = true; @@ -159,7 +159,7 @@ private void InitializeComponent() this.radIncremental.Location = new System.Drawing.Point(47, 90); this.radIncremental.Name = "radIncremental"; this.radIncremental.Size = new System.Drawing.Size(129, 21); - this.radIncremental.TabIndex = 3; + this.radIncremental.TabIndex = 1; this.radIncremental.Text = "Incremental time"; this.radIncremental.UseVisualStyleBackColor = true; this.radIncremental.CheckedChanged += new System.EventHandler(this.radIncremental_CheckedChanged); @@ -171,7 +171,7 @@ private void InitializeComponent() this.grpSequence.Location = new System.Drawing.Point(28, 53); this.grpSequence.Name = "grpSequence"; this.grpSequence.Size = new System.Drawing.Size(188, 143); - this.grpSequence.TabIndex = 4; + this.grpSequence.TabIndex = 0; this.grpSequence.TabStop = false; this.grpSequence.Text = "Numeric sequence"; // @@ -238,7 +238,7 @@ private void InitializeComponent() 0}); this.numMinLength.Name = "numMinLength"; this.numMinLength.Size = new System.Drawing.Size(50, 23); - this.numMinLength.TabIndex = 17; + this.numMinLength.TabIndex = 5; this.numMinLength.Value = new decimal(new int[] { 1, 0, @@ -251,7 +251,7 @@ private void InitializeComponent() this.lblMinLength.Location = new System.Drawing.Point(49, 149); this.lblMinLength.Name = "lblMinLength"; this.lblMinLength.Size = new System.Drawing.Size(124, 17); - this.lblMinLength.TabIndex = 16; + this.lblMinLength.TabIndex = 10; this.lblMinLength.Text = "Startup sequence:"; // // trackTimeIncrement @@ -261,7 +261,7 @@ private void InitializeComponent() this.trackTimeIncrement.Name = "trackTimeIncrement"; this.trackTimeIncrement.Size = new System.Drawing.Size(268, 45); this.trackTimeIncrement.SmallChange = 10; - this.trackTimeIncrement.TabIndex = 15; + this.trackTimeIncrement.TabIndex = 4; this.trackTimeIncrement.TickFrequency = 100; this.trackTimeIncrement.ValueChanged += new System.EventHandler(this.trackTimeIncrement_ValueChanged); // @@ -275,7 +275,7 @@ private void InitializeComponent() 0}); this.numTimeIncrement.Name = "numTimeIncrement"; this.numTimeIncrement.Size = new System.Drawing.Size(61, 23); - this.numTimeIncrement.TabIndex = 14; + this.numTimeIncrement.TabIndex = 3; this.numTimeIncrement.ValueChanged += new System.EventHandler(this.numTimeIncrement_ValueChanged); // // lblTimeIncrement @@ -284,30 +284,40 @@ private void InitializeComponent() this.lblTimeIncrement.Location = new System.Drawing.Point(49, 90); this.lblTimeIncrement.Name = "lblTimeIncrement"; this.lblTimeIncrement.Size = new System.Drawing.Size(74, 17); - this.lblTimeIncrement.TabIndex = 13; + this.lblTimeIncrement.TabIndex = 9; this.lblTimeIncrement.Text = "Increment:"; // // numMaxDigit // this.numMaxDigit.Location = new System.Drawing.Point(179, 249); + this.numMaxDigit.Maximum = new decimal(new int[] { + 99, + 0, + 0, + 0}); this.numMaxDigit.Name = "numMaxDigit"; this.numMaxDigit.Size = new System.Drawing.Size(50, 23); - this.numMaxDigit.TabIndex = 12; + this.numMaxDigit.TabIndex = 8; this.numMaxDigit.ValueChanged += new System.EventHandler(this.numMaxDigit_ValueChanged); // // numMinDigit // this.numMinDigit.Location = new System.Drawing.Point(179, 215); + this.numMinDigit.Maximum = new decimal(new int[] { + 99, + 0, + 0, + 0}); this.numMinDigit.Name = "numMinDigit"; this.numMinDigit.Size = new System.Drawing.Size(50, 23); - this.numMinDigit.TabIndex = 11; + this.numMinDigit.TabIndex = 7; // // numMaxAttempts // this.numMaxAttempts.Location = new System.Drawing.Point(179, 181); this.numMaxAttempts.Name = "numMaxAttempts"; this.numMaxAttempts.Size = new System.Drawing.Size(50, 23); - this.numMaxAttempts.TabIndex = 10; + this.numMaxAttempts.TabIndex = 6; // // numTime // @@ -320,7 +330,7 @@ private void InitializeComponent() 0}); this.numTime.Name = "numTime"; this.numTime.Size = new System.Drawing.Size(61, 23); - this.numTime.TabIndex = 9; + this.numTime.TabIndex = 1; this.numTime.ValueChanged += new System.EventHandler(this.numTime_ValueChanged); // // lblMaxDigit @@ -329,7 +339,7 @@ private void InitializeComponent() this.lblMaxDigit.Location = new System.Drawing.Point(49, 251); this.lblMaxDigit.Name = "lblMaxDigit"; this.lblMaxDigit.Size = new System.Drawing.Size(100, 17); - this.lblMaxDigit.TabIndex = 4; + this.lblMaxDigit.TabIndex = 13; this.lblMaxDigit.Text = "Maximum digit:"; // // lblMinDigit @@ -338,7 +348,7 @@ private void InitializeComponent() this.lblMinDigit.Location = new System.Drawing.Point(49, 217); this.lblMinDigit.Name = "lblMinDigit"; this.lblMinDigit.Size = new System.Drawing.Size(97, 17); - this.lblMinDigit.TabIndex = 3; + this.lblMinDigit.TabIndex = 12; this.lblMinDigit.Text = "Minimum digit:"; // // lblMaxAttempts @@ -347,7 +357,7 @@ private void InitializeComponent() this.lblMaxAttempts.Location = new System.Drawing.Point(49, 183); this.lblMaxAttempts.Name = "lblMaxAttempts"; this.lblMaxAttempts.Size = new System.Drawing.Size(124, 17); - this.lblMaxAttempts.TabIndex = 2; + this.lblMaxAttempts.TabIndex = 11; this.lblMaxAttempts.Text = "Maximum attemps:"; // // trackTime @@ -358,7 +368,7 @@ private void InitializeComponent() this.trackTime.Name = "trackTime"; this.trackTime.Size = new System.Drawing.Size(269, 45); this.trackTime.SmallChange = 10; - this.trackTime.TabIndex = 1; + this.trackTime.TabIndex = 2; this.trackTime.TickFrequency = 100; this.trackTime.ValueChanged += new System.EventHandler(this.trackTime_ValueChanged); // @@ -403,6 +413,17 @@ private void InitializeComponent() this.tabGUI.TabIndex = 1; this.tabGUI.Text = "Interface"; // + // btnFontFamily + // + this.btnFontFamily.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.btnFontFamily.Location = new System.Drawing.Point(226, 204); + this.btnFontFamily.Name = "btnFontFamily"; + this.btnFontFamily.Size = new System.Drawing.Size(76, 21); + this.btnFontFamily.TabIndex = 10; + this.btnFontFamily.Text = "Select font..."; + this.btnFontFamily.UseVisualStyleBackColor = true; + this.btnFontFamily.Click += new System.EventHandler(this.btnFontFamily_Click); + // // lblFontFamily // this.lblFontFamily.AutoSize = true; @@ -468,7 +489,7 @@ private void InitializeComponent() this.chkStartUp.Location = new System.Drawing.Point(52, 275); this.chkStartUp.Name = "chkStartUp"; this.chkStartUp.Size = new System.Drawing.Size(266, 21); - this.chkStartUp.TabIndex = 18; + this.chkStartUp.TabIndex = 11; this.chkStartUp.Text = "Remember window position on startup"; this.chkStartUp.TextAlign = System.Drawing.ContentAlignment.MiddleRight; this.chkStartUp.UseVisualStyleBackColor = true; @@ -479,7 +500,7 @@ private void InitializeComponent() this.trackResultsRatio.Maximum = 100; this.trackResultsRatio.Name = "trackResultsRatio"; this.trackResultsRatio.Size = new System.Drawing.Size(225, 45); - this.trackResultsRatio.TabIndex = 17; + this.trackResultsRatio.TabIndex = 9; this.trackResultsRatio.TickFrequency = 10; this.trackResultsRatio.ValueChanged += new System.EventHandler(this.trackResultsRatio_ValueChanged); // @@ -499,7 +520,7 @@ private void InitializeComponent() 0}); this.numResultsRatio.Name = "numResultsRatio"; this.numResultsRatio.Size = new System.Drawing.Size(55, 23); - this.numResultsRatio.TabIndex = 16; + this.numResultsRatio.TabIndex = 8; this.numResultsRatio.ValueChanged += new System.EventHandler(this.numResultsRatio_ValueChanged); // // lblResultsRatio @@ -517,7 +538,7 @@ private void InitializeComponent() this.trackFontRatio.Maximum = 100; this.trackFontRatio.Name = "trackFontRatio"; this.trackFontRatio.Size = new System.Drawing.Size(225, 45); - this.trackFontRatio.TabIndex = 14; + this.trackFontRatio.TabIndex = 7; this.trackFontRatio.TickFrequency = 10; this.trackFontRatio.ValueChanged += new System.EventHandler(this.trackFontRatio_ValueChanged); // @@ -537,7 +558,7 @@ private void InitializeComponent() 0}); this.numFontRatio.Name = "numFontRatio"; this.numFontRatio.Size = new System.Drawing.Size(55, 23); - this.numFontRatio.TabIndex = 13; + this.numFontRatio.TabIndex = 6; this.numFontRatio.ValueChanged += new System.EventHandler(this.numFontRatio_ValueChanged); // // lblFontRatio @@ -555,7 +576,7 @@ private void InitializeComponent() this.trackBorderRatio.Maximum = 100; this.trackBorderRatio.Name = "trackBorderRatio"; this.trackBorderRatio.Size = new System.Drawing.Size(226, 45); - this.trackBorderRatio.TabIndex = 11; + this.trackBorderRatio.TabIndex = 5; this.trackBorderRatio.TickFrequency = 10; this.trackBorderRatio.ValueChanged += new System.EventHandler(this.trackBorderRatio_ValueChanged); // @@ -565,7 +586,7 @@ private void InitializeComponent() this.trackNumbersRatio.Maximum = 100; this.trackNumbersRatio.Name = "trackNumbersRatio"; this.trackNumbersRatio.Size = new System.Drawing.Size(226, 45); - this.trackNumbersRatio.TabIndex = 10; + this.trackNumbersRatio.TabIndex = 3; this.trackNumbersRatio.TickFrequency = 10; this.trackNumbersRatio.ValueChanged += new System.EventHandler(this.trackNumbersRatio_ValueChanged); // @@ -575,7 +596,7 @@ private void InitializeComponent() this.trackCountRatio.Maximum = 100; this.trackCountRatio.Name = "trackCountRatio"; this.trackCountRatio.Size = new System.Drawing.Size(226, 45); - this.trackCountRatio.TabIndex = 9; + this.trackCountRatio.TabIndex = 1; this.trackCountRatio.TickFrequency = 10; this.trackCountRatio.ValueChanged += new System.EventHandler(this.trackCountRatio_ValueChanged); // @@ -595,7 +616,7 @@ private void InitializeComponent() 0}); this.numBorderRatio.Name = "numBorderRatio"; this.numBorderRatio.Size = new System.Drawing.Size(55, 23); - this.numBorderRatio.TabIndex = 8; + this.numBorderRatio.TabIndex = 4; this.numBorderRatio.ValueChanged += new System.EventHandler(this.numBorderRatio_ValueChanged); // // numNumbersRatio @@ -614,7 +635,7 @@ private void InitializeComponent() 0}); this.numNumbersRatio.Name = "numNumbersRatio"; this.numNumbersRatio.Size = new System.Drawing.Size(55, 23); - this.numNumbersRatio.TabIndex = 7; + this.numNumbersRatio.TabIndex = 2; this.numNumbersRatio.ValueChanged += new System.EventHandler(this.numNumbersRatio_ValueChanged); // // numCountRatio @@ -633,7 +654,7 @@ private void InitializeComponent() 0}); this.numCountRatio.Name = "numCountRatio"; this.numCountRatio.Size = new System.Drawing.Size(55, 23); - this.numCountRatio.TabIndex = 6; + this.numCountRatio.TabIndex = 0; this.numCountRatio.ValueChanged += new System.EventHandler(this.numCountRatio_ValueChanged); // // lblBorderRatio @@ -695,17 +716,6 @@ private void InitializeComponent() this.btnReset.UseVisualStyleBackColor = true; this.btnReset.Click += new System.EventHandler(this.btnReset_Click); // - // btnFontFamily - // - this.btnFontFamily.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.btnFontFamily.Location = new System.Drawing.Point(226, 204); - this.btnFontFamily.Name = "btnFontFamily"; - this.btnFontFamily.Size = new System.Drawing.Size(76, 21); - this.btnFontFamily.TabIndex = 24; - this.btnFontFamily.Text = "Select font..."; - this.btnFontFamily.UseVisualStyleBackColor = true; - this.btnFontFamily.Click += new System.EventHandler(this.btnFontFamily_Click); - // // frmSettings // this.AcceptButton = this.btnAccept; diff --git a/MemoryNumbers/frmSettings.cs b/MemoryNumbers/frmSettings.cs index ea1c774..257d7c2 100644 --- a/MemoryNumbers/frmSettings.cs +++ b/MemoryNumbers/frmSettings.cs @@ -46,8 +46,13 @@ public frmSettings(ProgramSettings settings, ProgramSettings numMaxDigit.Maximum ? numMaxDigit.Maximum : (value < numMaxDigit.Minimum ? numMaxDigit.Minimum : value); + this.numMinDigit.Maximum = this.numMaxDigit.Value; + value = Convert.ToInt32(settings.ContainsKey("MinimumDigit") ? settings["MinimumDigit"] : defSets["MinimumDigit"]); + this.numMinDigit.Value = value > numMinDigit.Maximum ? numMinDigit.Maximum : (value < numMinDigit.Minimum ? numMinDigit.Minimum : value); + this.numMaxAttempts.Value = Convert.ToInt32(settings.ContainsKey("MaximumAttempts") ? settings["MaximumAttempts"] : defSets["MaximumAttempts"]); this.numMinLength.Value = Convert.ToInt32(settings.ContainsKey("MinimumLength") ? settings["MinimumLength"] : defSets["MinimumLength"]); @@ -70,7 +75,6 @@ public frmSettings(ProgramSettings settings, ProgramSettings