using System;
using System.IO;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;

namespace MyNamespace
{
	/// <summary>
	///		Configuration form for XICalc - Extra Precision Integer Calculator
	///		Developed in TURBO Pascal 5.5 and 6.0, converted to Visual Basic 6
	///		and now in Visual C# .Net
	///
	/// ---------------- *** LEGAL NOTICE: *** ------------------
	///
	/// This program is free software; you can redistribute it and/or modify
	/// it under the terms of the GNU General Public License (GPL) as published
	/// by the Free Software Foundation. cf. the file COPYING.txt.
	///
	/// ------------ *** end of legal notice *** ------------------
	/// </summary>

	public class ConfigForm : Form
	{
		private System.ComponentModel.IContainer components;

		public ConfigForm()
		{
			InitializeComponent();

			// no constructor logic
		}

		/// <summary>
		/// Clean up any resources being used.
		/// </summary>
		protected override void Dispose( bool disposing )
		{
			if( disposing )
			{
				if(components != null)
				{
					components.Dispose();
				}
			}
			base.Dispose( disposing );
		}

		#region Windows Form Designer generated code
		/// <summary>
		/// Required method for Designer support - do not modify
		/// the contents of this method with the code editor.
		/// </summary>
		private void InitializeComponent()
		{
			this.components = new System.ComponentModel.Container();
			System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(ConfigForm));
			this.buttonAllowFHT = new System.Windows.Forms.Button();
			this.buttonAutoD = new System.Windows.Forms.Button();
			this.buttonBaseI = new System.Windows.Forms.Button();
			this.buttonBaseO = new System.Windows.Forms.Button();
			this.buttonChangeDir = new System.Windows.Forms.Button();
			this.buttonDiagOn = new System.Windows.Forms.Button();
			this.buttonExit = new System.Windows.Forms.Button();
			this.buttonForceFHT = new System.Windows.Forms.Button();
			this.buttonLog = new System.Windows.Forms.Button();
			this.buttonMaxDis = new System.Windows.Forms.Button();
			this.buttonMMax = new System.Windows.Forms.Button();
			this.buttonMuDpG = new System.Windows.Forms.Button();
			this.buttonPri = new System.Windows.Forms.Button();
			this.buttonQuiet = new System.Windows.Forms.Button();
			this.buttonRestoreConfig = new System.Windows.Forms.Button();
			this.buttonSaveConfig = new System.Windows.Forms.Button();
			this.buttonSaveTop = new System.Windows.Forms.Button();
			this.buttonSelectFile = new System.Windows.Forms.Button();
			this.buttonXICIn = new System.Windows.Forms.Button();
			this.buttonXILOut = new System.Windows.Forms.Button();
			this.buttonXINIn = new System.Windows.Forms.Button();
			this.buttonXINOut = new System.Windows.Forms.Button();
			this.folderBrowserDialogConfig = new System.Windows.Forms.FolderBrowserDialog();
			this.labelAllowFHT = new System.Windows.Forms.Label();
			this.labelAutoD = new System.Windows.Forms.Label();
			this.labelBaseI = new System.Windows.Forms.Label();
			this.labelBaseO = new System.Windows.Forms.Label();
			this.labelDiagOn = new System.Windows.Forms.Label();
			this.labelFilePath = new System.Windows.Forms.Label();
			this.labelFMB = new System.Windows.Forms.Label();
			this.labelForceFHT = new System.Windows.Forms.Label();
			this.labelHomeDir = new System.Windows.Forms.Label();
			this.labelLog = new System.Windows.Forms.Label();
			this.labelLogName = new System.Windows.Forms.Label();
			this.labelMaxDis = new System.Windows.Forms.Label();
			this.labelMMax = new System.Windows.Forms.Label();
			this.labelMuDpG = new System.Windows.Forms.Label();
			this.labelPri = new System.Windows.Forms.Label();
			this.labelQuiet = new System.Windows.Forms.Label();
			this.labelSaveTop = new System.Windows.Forms.Label();
			this.labelSelectedFile = new System.Windows.Forms.Label();
			this.labelXICIn = new System.Windows.Forms.Label();
			this.labelXILOut = new System.Windows.Forms.Label();
			this.labelXINIn = new System.Windows.Forms.Label();
			this.labelXINOut = new System.Windows.Forms.Label();
			this.listBoxFile = new System.Windows.Forms.ListBox();
			this.openFileDialogConfig = new System.Windows.Forms.OpenFileDialog();
			this.richTextBoxFMB = new System.Windows.Forms.RichTextBox();
			this.textBoxBaseI = new System.Windows.Forms.TextBox();
			this.textBoxBaseO = new System.Windows.Forms.TextBox();
			this.textBoxMaxDis = new System.Windows.Forms.TextBox();
			this.textBoxMMax = new System.Windows.Forms.TextBox();
			this.textBoxMuDpG = new System.Windows.Forms.TextBox();
			this.textBoxPri = new System.Windows.Forms.TextBox();
			this.textBoxXICIn = new System.Windows.Forms.TextBox();
			this.textBoxXILOut = new System.Windows.Forms.TextBox();
			this.textBoxXINIn = new System.Windows.Forms.TextBox();
			this.textBoxXINOut = new System.Windows.Forms.TextBox();
			this.timerConfig = new System.Windows.Forms.Timer(this.components);
			this.SuspendLayout();
			// 
			// buttonAllowFHT
			// 
			this.buttonAllowFHT.Location = new System.Drawing.Point(512, 184);
			this.buttonAllowFHT.Name = "buttonAllowFHT";
			this.buttonAllowFHT.Size = new System.Drawing.Size(88, 21);
			this.buttonAllowFHT.TabIndex = 115;
			this.buttonAllowFHT.Text = "Is Off";
			this.buttonAllowFHT.Click += new System.EventHandler(this.buttonAllowFHT_Click);
			// 
			// buttonAutoD
			// 
			this.buttonAutoD.Font = new System.Drawing.Font("Courier New", 9.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
			this.buttonAutoD.Location = new System.Drawing.Point(264, 184);
			this.buttonAutoD.Name = "buttonAutoD";
			this.buttonAutoD.Size = new System.Drawing.Size(88, 21);
			this.buttonAutoD.TabIndex = 111;
			this.buttonAutoD.Text = "Is Off";
			this.buttonAutoD.Click += new System.EventHandler(this.buttonAutoD_Click);
			// 
			// buttonBaseI
			// 
			this.buttonBaseI.Font = new System.Drawing.Font("Courier New", 9.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
			this.buttonBaseI.Location = new System.Drawing.Point(424, 80);
			this.buttonBaseI.Name = "buttonBaseI";
			this.buttonBaseI.Size = new System.Drawing.Size(96, 21);
			this.buttonBaseI.TabIndex = 108;
			this.buttonBaseI.Text = "Change It";
			this.buttonBaseI.Click += new System.EventHandler(this.buttonBaseI_Click);
			// 
			// buttonBaseO
			// 
			this.buttonBaseO.Font = new System.Drawing.Font("Courier New", 9.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
			this.buttonBaseO.Location = new System.Drawing.Point(424, 104);
			this.buttonBaseO.Name = "buttonBaseO";
			this.buttonBaseO.Size = new System.Drawing.Size(96, 21);
			this.buttonBaseO.TabIndex = 109;
			this.buttonBaseO.Text = "Change It";
			this.buttonBaseO.Click += new System.EventHandler(this.buttonBaseO_Click);
			// 
			// buttonChangeDir
			// 
			this.buttonChangeDir.Font = new System.Drawing.Font("Courier New", 9.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
			this.buttonChangeDir.Location = new System.Drawing.Point(528, 104);
			this.buttonChangeDir.Name = "buttonChangeDir";
			this.buttonChangeDir.Size = new System.Drawing.Size(72, 48);
			this.buttonChangeDir.TabIndex = 129;
			this.buttonChangeDir.Text = "Change File Path";
			this.buttonChangeDir.Click += new System.EventHandler(this.buttonChangeDir_Click);
			// 
			// buttonDiagOn
			// 
			this.buttonDiagOn.Font = new System.Drawing.Font("Courier New", 9.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
			this.buttonDiagOn.Location = new System.Drawing.Point(264, 160);
			this.buttonDiagOn.Name = "buttonDiagOn";
			this.buttonDiagOn.Size = new System.Drawing.Size(88, 21);
			this.buttonDiagOn.TabIndex = 110;
			this.buttonDiagOn.Text = "Is Off";
			this.buttonDiagOn.Click += new System.EventHandler(this.buttonDiagOn_Click);
			// 
			// buttonExit
			// 
			this.buttonExit.Font = new System.Drawing.Font("Courier New", 9.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
			this.buttonExit.Location = new System.Drawing.Point(608, 64);
			this.buttonExit.Name = "buttonExit";
			this.buttonExit.Size = new System.Drawing.Size(64, 24);
			this.buttonExit.TabIndex = 131;
			this.buttonExit.Text = "Exit";
			this.buttonExit.Click += new System.EventHandler(this.buttonExit_Click);
			// 
			// buttonForceFHT
			// 
			this.buttonForceFHT.Location = new System.Drawing.Point(512, 208);
			this.buttonForceFHT.Name = "buttonForceFHT";
			this.buttonForceFHT.Size = new System.Drawing.Size(88, 21);
			this.buttonForceFHT.TabIndex = 116;
			this.buttonForceFHT.Text = "Is Off";
			this.buttonForceFHT.Click += new System.EventHandler(this.buttonForceFHT_Click);
			// 
			// buttonLog
			// 
			this.buttonLog.Font = new System.Drawing.Font("Courier New", 9.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
			this.buttonLog.Location = new System.Drawing.Point(264, 256);
			this.buttonLog.Name = "buttonLog";
			this.buttonLog.Size = new System.Drawing.Size(88, 21);
			this.buttonLog.TabIndex = 114;
			this.buttonLog.Text = "Is Off";
			this.buttonLog.Click += new System.EventHandler(this.buttonLog_Click);
			// 
			// buttonMaxDis
			// 
			this.buttonMaxDis.Font = new System.Drawing.Font("Courier New", 9.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
			this.buttonMaxDis.Location = new System.Drawing.Point(424, 32);
			this.buttonMaxDis.Name = "buttonMaxDis";
			this.buttonMaxDis.Size = new System.Drawing.Size(96, 21);
			this.buttonMaxDis.TabIndex = 106;
			this.buttonMaxDis.Text = "Change It";
			this.buttonMaxDis.Click += new System.EventHandler(this.buttonMaxDis_Click);
			// 
			// buttonMMax
			// 
			this.buttonMMax.Font = new System.Drawing.Font("Courier New", 9.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
			this.buttonMMax.Location = new System.Drawing.Point(424, 8);
			this.buttonMMax.Name = "buttonMMax";
			this.buttonMMax.Size = new System.Drawing.Size(96, 21);
			this.buttonMMax.TabIndex = 105;
			this.buttonMMax.Text = "Change It";
			this.buttonMMax.Click += new System.EventHandler(this.buttonMMax_Click);
			// 
			// buttonMuDpG
			// 
			this.buttonMuDpG.Font = new System.Drawing.Font("Courier New", 9.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
			this.buttonMuDpG.Location = new System.Drawing.Point(424, 56);
			this.buttonMuDpG.Name = "buttonMuDpG";
			this.buttonMuDpG.Size = new System.Drawing.Size(96, 21);
			this.buttonMuDpG.TabIndex = 107;
			this.buttonMuDpG.Text = "Change It";
			this.buttonMuDpG.Click += new System.EventHandler(this.buttonMuDpG_Click);
			// 
			// buttonPri
			// 
			this.buttonPri.Location = new System.Drawing.Point(424, 128);
			this.buttonPri.Name = "buttonPri";
			this.buttonPri.Size = new System.Drawing.Size(96, 21);
			this.buttonPri.TabIndex = 134;
			this.buttonPri.Text = "Change It";
			this.buttonPri.Click += new System.EventHandler(this.buttonPri_Click);
			// 
			// buttonQuiet
			// 
			this.buttonQuiet.Font = new System.Drawing.Font("Courier New", 9.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
			this.buttonQuiet.Location = new System.Drawing.Point(264, 232);
			this.buttonQuiet.Name = "buttonQuiet";
			this.buttonQuiet.Size = new System.Drawing.Size(88, 21);
			this.buttonQuiet.TabIndex = 113;
			this.buttonQuiet.Text = "Is Off";
			this.buttonQuiet.Click += new System.EventHandler(this.buttonQuiet_Click);
			// 
			// buttonRestoreConfig
			// 
			this.buttonRestoreConfig.Font = new System.Drawing.Font("Courier New", 9.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
			this.buttonRestoreConfig.Location = new System.Drawing.Point(528, 56);
			this.buttonRestoreConfig.Name = "buttonRestoreConfig";
			this.buttonRestoreConfig.Size = new System.Drawing.Size(72, 40);
			this.buttonRestoreConfig.TabIndex = 128;
			this.buttonRestoreConfig.Text = "Restore Config";
			this.buttonRestoreConfig.Click += new System.EventHandler(this.buttonRestoreConfig_Click);
			// 
			// buttonSaveConfig
			// 
			this.buttonSaveConfig.Font = new System.Drawing.Font("Courier New", 9.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
			this.buttonSaveConfig.Location = new System.Drawing.Point(528, 8);
			this.buttonSaveConfig.Name = "buttonSaveConfig";
			this.buttonSaveConfig.Size = new System.Drawing.Size(72, 40);
			this.buttonSaveConfig.TabIndex = 127;
			this.buttonSaveConfig.Text = "Save Config";
			this.buttonSaveConfig.Click += new System.EventHandler(this.buttonSaveConfig_Click);
			// 
			// buttonSaveTop
			// 
			this.buttonSaveTop.Font = new System.Drawing.Font("Courier New", 9.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
			this.buttonSaveTop.Location = new System.Drawing.Point(264, 208);
			this.buttonSaveTop.Name = "buttonSaveTop";
			this.buttonSaveTop.Size = new System.Drawing.Size(88, 21);
			this.buttonSaveTop.TabIndex = 112;
			this.buttonSaveTop.Text = "Is Off";
			this.buttonSaveTop.Click += new System.EventHandler(this.buttonSaveTop_Click);
			// 
			// buttonSelectFile
			// 
			this.buttonSelectFile.Location = new System.Drawing.Point(608, 104);
			this.buttonSelectFile.Name = "buttonSelectFile";
			this.buttonSelectFile.Size = new System.Drawing.Size(64, 48);
			this.buttonSelectFile.TabIndex = 130;
			this.buttonSelectFile.Text = "Select a File";
			this.buttonSelectFile.Click += new System.EventHandler(this.buttonSelectFile_Click);
			// 
			// buttonXICIn
			// 
			this.buttonXICIn.Font = new System.Drawing.Font("Courier New", 9.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
			this.buttonXICIn.Location = new System.Drawing.Point(120, 368);
			this.buttonXICIn.Name = "buttonXICIn";
			this.buttonXICIn.Size = new System.Drawing.Size(112, 21);
			this.buttonXICIn.TabIndex = 117;
			this.buttonXICIn.Text = "Change It";
			this.buttonXICIn.Click += new System.EventHandler(this.buttonXICIn_Click);
			// 
			// buttonXILOut
			// 
			this.buttonXILOut.Font = new System.Drawing.Font("Courier New", 9.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
			this.buttonXILOut.Location = new System.Drawing.Point(128, 408);
			this.buttonXILOut.Name = "buttonXILOut";
			this.buttonXILOut.Size = new System.Drawing.Size(104, 21);
			this.buttonXILOut.TabIndex = 118;
			this.buttonXILOut.Text = "Change It";
			this.buttonXILOut.Click += new System.EventHandler(this.buttonXILOut_Click);
			// 
			// buttonXINIn
			// 
			this.buttonXINIn.Font = new System.Drawing.Font("Courier New", 9.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
			this.buttonXINIn.Location = new System.Drawing.Point(128, 448);
			this.buttonXINIn.Name = "buttonXINIn";
			this.buttonXINIn.Size = new System.Drawing.Size(104, 21);
			this.buttonXINIn.TabIndex = 119;
			this.buttonXINIn.Text = "Change It";
			this.buttonXINIn.Click += new System.EventHandler(this.buttonXINIn_Click);
			// 
			// buttonXINOut
			// 
			this.buttonXINOut.Font = new System.Drawing.Font("Courier New", 9.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
			this.buttonXINOut.Location = new System.Drawing.Point(128, 488);
			this.buttonXINOut.Name = "buttonXINOut";
			this.buttonXINOut.Size = new System.Drawing.Size(104, 21);
			this.buttonXINOut.TabIndex = 120;
			this.buttonXINOut.Text = "Change It";
			this.buttonXINOut.Click += new System.EventHandler(this.buttonXINOut_Click);
			// 
			// labelAllowFHT
			// 
			this.labelAllowFHT.Location = new System.Drawing.Point(384, 184);
			this.labelAllowFHT.Name = "labelAllowFHT";
			this.labelAllowFHT.Size = new System.Drawing.Size(136, 23);
			this.labelAllowFHT.TabIndex = 49;
			this.labelAllowFHT.Text = "Allow FHT mode:";
			// 
			// labelAutoD
			// 
			this.labelAutoD.Font = new System.Drawing.Font("Courier New", 9.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
			this.labelAutoD.Location = new System.Drawing.Point(120, 184);
			this.labelAutoD.Name = "labelAutoD";
			this.labelAutoD.Size = new System.Drawing.Size(144, 16);
			this.labelAutoD.TabIndex = 6;
			this.labelAutoD.Text = "AutoDisplay mode:";
			// 
			// labelBaseI
			// 
			this.labelBaseI.Font = new System.Drawing.Font("Courier New", 9.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
			this.labelBaseI.Location = new System.Drawing.Point(64, 80);
			this.labelBaseI.Name = "labelBaseI";
			this.labelBaseI.Size = new System.Drawing.Size(256, 23);
			this.labelBaseI.TabIndex = 3;
			this.labelBaseI.Text = "Input base = 36 (max digit = z)";
			// 
			// labelBaseO
			// 
			this.labelBaseO.Font = new System.Drawing.Font("Courier New", 9.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
			this.labelBaseO.Location = new System.Drawing.Point(56, 104);
			this.labelBaseO.Name = "labelBaseO";
			this.labelBaseO.Size = new System.Drawing.Size(264, 23);
			this.labelBaseO.TabIndex = 4;
			this.labelBaseO.Text = "Output base = 36 (max digit = z)";
			// 
			// labelDiagOn
			// 
			this.labelDiagOn.Font = new System.Drawing.Font("Courier New", 9.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
			this.labelDiagOn.Location = new System.Drawing.Point(128, 160);
			this.labelDiagOn.Name = "labelDiagOn";
			this.labelDiagOn.Size = new System.Drawing.Size(136, 23);
			this.labelDiagOn.TabIndex = 5;
			this.labelDiagOn.Text = "Diagnostic mode:";
			// 
			// labelFilePath
			// 
			this.labelFilePath.Font = new System.Drawing.Font("Courier New", 9.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
			this.labelFilePath.Location = new System.Drawing.Point(24, 304);
			this.labelFilePath.Name = "labelFilePath";
			this.labelFilePath.Size = new System.Drawing.Size(648, 16);
			this.labelFilePath.TabIndex = 11;
			this.labelFilePath.Text = "File path: C:\\MMMMMMMMMMMM\\MMMMMMMMMM\\MMMMMMMMMMM\\MMMMMMMMM\\MMMMMM\\MMMMM";
			// 
			// labelFMB
			// 
			this.labelFMB.Font = new System.Drawing.Font("Courier New", 9.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
			this.labelFMB.Location = new System.Drawing.Point(8, 496);
			this.labelFMB.Name = "labelFMB";
			this.labelFMB.Size = new System.Drawing.Size(104, 16);
			this.labelFMB.TabIndex = 16;
			this.labelFMB.Text = "Modulo base:";
			// 
			// labelForceFHT
			// 
			this.labelForceFHT.Location = new System.Drawing.Point(384, 208);
			this.labelForceFHT.Name = "labelForceFHT";
			this.labelForceFHT.Size = new System.Drawing.Size(136, 23);
			this.labelForceFHT.TabIndex = 50;
			this.labelForceFHT.Text = "Force FHT mode:";
			// 
			// labelHomeDir
			// 
			this.labelHomeDir.Font = new System.Drawing.Font("Courier New", 9.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
			this.labelHomeDir.Location = new System.Drawing.Point(32, 280);
			this.labelHomeDir.Name = "labelHomeDir";
			this.labelHomeDir.Size = new System.Drawing.Size(640, 16);
			this.labelHomeDir.TabIndex = 10;
			this.labelHomeDir.Text = "Home Dir: C:\\MMMMMMMMMMMM\\MMMMMMMMMM\\MMMMMMMMMMM\\MMMMMMMMM\\MMMMMM\\MMMMM";
			// 
			// labelLog
			// 
			this.labelLog.Font = new System.Drawing.Font("Courier New", 9.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
			this.labelLog.Location = new System.Drawing.Point(120, 256);
			this.labelLog.Name = "labelLog";
			this.labelLog.Size = new System.Drawing.Size(144, 16);
			this.labelLog.TabIndex = 9;
			this.labelLog.Text = "Log to file mode:";
			// 
			// labelLogName
			// 
			this.labelLogName.Font = new System.Drawing.Font("Courier New", 9.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
			this.labelLogName.Location = new System.Drawing.Point(360, 256);
			this.labelLogName.Name = "labelLogName";
			this.labelLogName.Size = new System.Drawing.Size(312, 16);
			this.labelLogName.TabIndex = 17;
			this.labelLogName.Text = "To log file: NoName.XIL";
			// 
			// labelMaxDis
			// 
			this.labelMaxDis.Font = new System.Drawing.Font("Courier New", 9.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
			this.labelMaxDis.Location = new System.Drawing.Point(56, 32);
			this.labelMaxDis.Name = "labelMaxDis";
			this.labelMaxDis.Size = new System.Drawing.Size(272, 16);
			this.labelMaxDis.TabIndex = 1;
			this.labelMaxDis.Text = "Max digits in display = XXXXXXXXX";
			// 
			// labelMMax
			// 
			this.labelMMax.Font = new System.Drawing.Font("Courier New", 9.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
			this.labelMMax.Location = new System.Drawing.Point(16, 8);
			this.labelMMax.Name = "labelMMax";
			this.labelMMax.Size = new System.Drawing.Size(312, 16);
			this.labelMMax.TabIndex = 0;
			this.labelMMax.Text = "Max decimal digits allowed = XXXXXXXXX";
			// 
			// labelMuDpG
			// 
			this.labelMuDpG.Font = new System.Drawing.Font("Courier New", 9.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
			this.labelMuDpG.Location = new System.Drawing.Point(8, 56);
			this.labelMuDpG.Name = "labelMuDpG";
			this.labelMuDpG.Size = new System.Drawing.Size(320, 23);
			this.labelMuDpG.TabIndex = 2;
			this.labelMuDpG.Text = "Digits per group in display = XXXXXXXXX";
			// 
			// labelPri
			// 
			this.labelPri.Location = new System.Drawing.Point(64, 128);
			this.labelPri.Name = "labelPri";
			this.labelPri.Size = new System.Drawing.Size(256, 23);
			this.labelPri.TabIndex = 132;
			this.labelPri.Text = "Execution Priority [-2, 2] = -2";
			// 
			// labelQuiet
			// 
			this.labelQuiet.Font = new System.Drawing.Font("Courier New", 9.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
			this.labelQuiet.Location = new System.Drawing.Point(168, 232);
			this.labelQuiet.Name = "labelQuiet";
			this.labelQuiet.Size = new System.Drawing.Size(96, 16);
			this.labelQuiet.TabIndex = 8;
			this.labelQuiet.Text = "Quiet mode:";
			// 
			// labelSaveTop
			// 
			this.labelSaveTop.Font = new System.Drawing.Font("Courier New", 9.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
			this.labelSaveTop.Location = new System.Drawing.Point(112, 208);
			this.labelSaveTop.Name = "labelSaveTop";
			this.labelSaveTop.Size = new System.Drawing.Size(152, 16);
			this.labelSaveTop.TabIndex = 7;
			this.labelSaveTop.Text = "Save lastTop mode:";
			// 
			// labelSelectedFile
			// 
			this.labelSelectedFile.Location = new System.Drawing.Point(120, 328);
			this.labelSelectedFile.Name = "labelSelectedFile";
			this.labelSelectedFile.Size = new System.Drawing.Size(352, 16);
			this.labelSelectedFile.TabIndex = 48;
			this.labelSelectedFile.Text = "Selected file: NoName.XIL";
			// 
			// labelXICIn
			// 
			this.labelXICIn.Font = new System.Drawing.Font("Courier New", 9.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
			this.labelXICIn.Location = new System.Drawing.Point(16, 352);
			this.labelXICIn.Name = "labelXICIn";
			this.labelXICIn.Size = new System.Drawing.Size(456, 16);
			this.labelXICIn.TabIndex = 12;
			this.labelXICIn.Text = "Calculator code file MICIn: <Not set>";
			// 
			// labelXILOut
			// 
			this.labelXILOut.Font = new System.Drawing.Font("Courier New", 9.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
			this.labelXILOut.Location = new System.Drawing.Point(48, 392);
			this.labelXILOut.Name = "labelXILOut";
			this.labelXILOut.Size = new System.Drawing.Size(424, 16);
			this.labelXILOut.TabIndex = 13;
			this.labelXILOut.Text = "Output log file MILOut: <Not set>";
			// 
			// labelXINIn
			// 
			this.labelXINIn.Font = new System.Drawing.Font("Courier New", 9.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
			this.labelXINIn.Location = new System.Drawing.Point(40, 432);
			this.labelXINIn.Name = "labelXINIn";
			this.labelXINIn.Size = new System.Drawing.Size(432, 16);
			this.labelXINIn.TabIndex = 14;
			this.labelXINIn.Text = "Input number file XINIn: <Not set>";
			// 
			// labelXINOut
			// 
			this.labelXINOut.Font = new System.Drawing.Font("Courier New", 9.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
			this.labelXINOut.Location = new System.Drawing.Point(24, 472);
			this.labelXINOut.Name = "labelXINOut";
			this.labelXINOut.Size = new System.Drawing.Size(448, 16);
			this.labelXINOut.TabIndex = 15;
			this.labelXINOut.Text = "Output number file XINOut: <Not set>";
			// 
			// listBoxFile
			// 
			this.listBoxFile.Font = new System.Drawing.Font("Courier New", 9.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
			this.listBoxFile.ItemHeight = 16;
			this.listBoxFile.Location = new System.Drawing.Point(480, 328);
			this.listBoxFile.Name = "listBoxFile";
			this.listBoxFile.ScrollAlwaysVisible = true;
			this.listBoxFile.Size = new System.Drawing.Size(200, 212);
			this.listBoxFile.TabIndex = 125;
			this.listBoxFile.SelectedIndexChanged += new System.EventHandler(this.listBoxFile_SelectedIndexChanged);
			// 
			// openFileDialogConfig
			// 
			this.openFileDialogConfig.Title = "<Title ?>";
			// 
			// richTextBoxFMB
			// 
			this.richTextBoxFMB.BackColor = System.Drawing.SystemColors.Window;
			this.richTextBoxFMB.Font = new System.Drawing.Font("Courier New", 9.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
			this.richTextBoxFMB.Location = new System.Drawing.Point(16, 512);
			this.richTextBoxFMB.Name = "richTextBoxFMB";
			this.richTextBoxFMB.ReadOnly = true;
			this.richTextBoxFMB.ScrollBars = System.Windows.Forms.RichTextBoxScrollBars.ForcedVertical;
			this.richTextBoxFMB.Size = new System.Drawing.Size(456, 37);
			this.richTextBoxFMB.TabIndex = 126;
			this.richTextBoxFMB.Text = "111111111111111111111111111111111111111111111111111111111111";
			// 
			// textBoxBaseI
			// 
			this.textBoxBaseI.Font = new System.Drawing.Font("Courier New", 9.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
			this.textBoxBaseI.Location = new System.Drawing.Point(326, 79);
			this.textBoxBaseI.Name = "textBoxBaseI";
			this.textBoxBaseI.Size = new System.Drawing.Size(90, 22);
			this.textBoxBaseI.TabIndex = 103;
			this.textBoxBaseI.TextChanged += new System.EventHandler(this.textBoxBaseI_TextChanged);
			this.textBoxBaseI.KeyDown += new System.Windows.Forms.KeyEventHandler(this.textBoxBaseI_KeyDown);
			// 
			// textBoxBaseO
			// 
			this.textBoxBaseO.Font = new System.Drawing.Font("Courier New", 9.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
			this.textBoxBaseO.Location = new System.Drawing.Point(326, 104);
			this.textBoxBaseO.Name = "textBoxBaseO";
			this.textBoxBaseO.Size = new System.Drawing.Size(90, 22);
			this.textBoxBaseO.TabIndex = 104;
			this.textBoxBaseO.TextChanged += new System.EventHandler(this.textBoxBaseO_TextChanged);
			this.textBoxBaseO.KeyDown += new System.Windows.Forms.KeyEventHandler(this.textBoxBaseO_KeyDown);
			// 
			// textBoxMaxDis
			// 
			this.textBoxMaxDis.Font = new System.Drawing.Font("Courier New", 9.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
			this.textBoxMaxDis.Location = new System.Drawing.Point(326, 32);
			this.textBoxMaxDis.Name = "textBoxMaxDis";
			this.textBoxMaxDis.Size = new System.Drawing.Size(90, 22);
			this.textBoxMaxDis.TabIndex = 101;
			this.textBoxMaxDis.TextChanged += new System.EventHandler(this.textBoxMaxDis_TextChanged);
			this.textBoxMaxDis.KeyDown += new System.Windows.Forms.KeyEventHandler(this.textBoxMaxDis_KeyDown);
			// 
			// textBoxMMax
			// 
			this.textBoxMMax.Font = new System.Drawing.Font("Courier New", 9.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
			this.textBoxMMax.Location = new System.Drawing.Point(326, 8);
			this.textBoxMMax.Name = "textBoxMMax";
			this.textBoxMMax.Size = new System.Drawing.Size(90, 22);
			this.textBoxMMax.TabIndex = 100;
			this.textBoxMMax.TextChanged += new System.EventHandler(this.textBoxMMax_TextChanged);
			this.textBoxMMax.KeyDown += new System.Windows.Forms.KeyEventHandler(this.textBoxMMax_KeyDown);
			// 
			// textBoxMuDpG
			// 
			this.textBoxMuDpG.Font = new System.Drawing.Font("Courier New", 9.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
			this.textBoxMuDpG.Location = new System.Drawing.Point(326, 56);
			this.textBoxMuDpG.Name = "textBoxMuDpG";
			this.textBoxMuDpG.Size = new System.Drawing.Size(90, 22);
			this.textBoxMuDpG.TabIndex = 102;
			this.textBoxMuDpG.TextChanged += new System.EventHandler(this.textBoxMuDpG_TextChanged);
			this.textBoxMuDpG.KeyDown += new System.Windows.Forms.KeyEventHandler(this.textBoxMuDpG_KeyDown);
			// 
			// textBoxPri
			// 
			this.textBoxPri.Location = new System.Drawing.Point(326, 128);
			this.textBoxPri.Name = "textBoxPri";
			this.textBoxPri.Size = new System.Drawing.Size(90, 22);
			this.textBoxPri.TabIndex = 133;
			this.textBoxPri.TextChanged += new System.EventHandler(this.textBoxPri_TextChanged);
			this.textBoxPri.KeyDown += new System.Windows.Forms.KeyEventHandler(this.textBoxPri_KeyDown);
			// 
			// textBoxXICIn
			// 
			this.textBoxXICIn.Location = new System.Drawing.Point(240, 368);
			this.textBoxXICIn.Name = "textBoxXICIn";
			this.textBoxXICIn.Size = new System.Drawing.Size(232, 22);
			this.textBoxXICIn.TabIndex = 121;
			this.textBoxXICIn.TextChanged += new System.EventHandler(this.textBoxXICIn_TextChanged);
			this.textBoxXICIn.KeyDown += new System.Windows.Forms.KeyEventHandler(this.textBoxXICIn_KeyDown);
			// 
			// textBoxXILOut
			// 
			this.textBoxXILOut.Location = new System.Drawing.Point(240, 408);
			this.textBoxXILOut.Name = "textBoxXILOut";
			this.textBoxXILOut.Size = new System.Drawing.Size(232, 22);
			this.textBoxXILOut.TabIndex = 122;
			this.textBoxXILOut.TextChanged += new System.EventHandler(this.textBoxXILOut_TextChanged);
			this.textBoxXILOut.KeyDown += new System.Windows.Forms.KeyEventHandler(this.textBoxXILOut_KeyDown);
			// 
			// textBoxXINIn
			// 
			this.textBoxXINIn.Location = new System.Drawing.Point(240, 448);
			this.textBoxXINIn.Name = "textBoxXINIn";
			this.textBoxXINIn.Size = new System.Drawing.Size(232, 22);
			this.textBoxXINIn.TabIndex = 123;
			this.textBoxXINIn.TextChanged += new System.EventHandler(this.textBoxXINIn_TextChanged);
			this.textBoxXINIn.KeyDown += new System.Windows.Forms.KeyEventHandler(this.textBoxXINIn_KeyDown);
			// 
			// textBoxXINOut
			// 
			this.textBoxXINOut.Location = new System.Drawing.Point(240, 488);
			this.textBoxXINOut.Name = "textBoxXINOut";
			this.textBoxXINOut.Size = new System.Drawing.Size(232, 22);
			this.textBoxXINOut.TabIndex = 124;
			this.textBoxXINOut.TextChanged += new System.EventHandler(this.textBoxXINOut_TextChanged);
			this.textBoxXINOut.KeyDown += new System.Windows.Forms.KeyEventHandler(this.textBoxXINOut_KeyDown);
			// 
			// timerConfig
			// 
			this.timerConfig.Enabled = true;
			this.timerConfig.Interval = 500;
			this.timerConfig.Tick += new System.EventHandler(this.timerConfig_Tick);
			// 
			// ConfigForm
			// 
			this.AutoScaleBaseSize = new System.Drawing.Size(8, 15);
			this.ClientSize = new System.Drawing.Size(680, 550);
			this.Controls.Add(this.buttonPri);
			this.Controls.Add(this.textBoxPri);
			this.Controls.Add(this.textBoxXINOut);
			this.Controls.Add(this.textBoxXINIn);
			this.Controls.Add(this.textBoxXILOut);
			this.Controls.Add(this.textBoxXICIn);
			this.Controls.Add(this.textBoxBaseO);
			this.Controls.Add(this.textBoxBaseI);
			this.Controls.Add(this.textBoxMuDpG);
			this.Controls.Add(this.textBoxMaxDis);
			this.Controls.Add(this.textBoxMMax);
			this.Controls.Add(this.labelPri);
			this.Controls.Add(this.buttonForceFHT);
			this.Controls.Add(this.buttonAllowFHT);
			this.Controls.Add(this.labelForceFHT);
			this.Controls.Add(this.labelAllowFHT);
			this.Controls.Add(this.labelSelectedFile);
			this.Controls.Add(this.buttonSelectFile);
			this.Controls.Add(this.buttonExit);
			this.Controls.Add(this.buttonChangeDir);
			this.Controls.Add(this.buttonRestoreConfig);
			this.Controls.Add(this.buttonSaveConfig);
			this.Controls.Add(this.buttonXINOut);
			this.Controls.Add(this.buttonXINIn);
			this.Controls.Add(this.buttonXILOut);
			this.Controls.Add(this.buttonXICIn);
			this.Controls.Add(this.buttonLog);
			this.Controls.Add(this.buttonQuiet);
			this.Controls.Add(this.buttonSaveTop);
			this.Controls.Add(this.buttonAutoD);
			this.Controls.Add(this.buttonDiagOn);
			this.Controls.Add(this.buttonBaseO);
			this.Controls.Add(this.buttonBaseI);
			this.Controls.Add(this.buttonMuDpG);
			this.Controls.Add(this.buttonMaxDis);
			this.Controls.Add(this.buttonMMax);
			this.Controls.Add(this.listBoxFile);
			this.Controls.Add(this.richTextBoxFMB);
			this.Controls.Add(this.labelLogName);
			this.Controls.Add(this.labelFMB);
			this.Controls.Add(this.labelXINOut);
			this.Controls.Add(this.labelXINIn);
			this.Controls.Add(this.labelXILOut);
			this.Controls.Add(this.labelXICIn);
			this.Controls.Add(this.labelFilePath);
			this.Controls.Add(this.labelHomeDir);
			this.Controls.Add(this.labelLog);
			this.Controls.Add(this.labelQuiet);
			this.Controls.Add(this.labelSaveTop);
			this.Controls.Add(this.labelAutoD);
			this.Controls.Add(this.labelDiagOn);
			this.Controls.Add(this.labelBaseO);
			this.Controls.Add(this.labelBaseI);
			this.Controls.Add(this.labelMuDpG);
			this.Controls.Add(this.labelMaxDis);
			this.Controls.Add(this.labelMMax);
			this.Font = new System.Drawing.Font("Courier New", 9.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
			this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
			this.Name = "ConfigForm";
			this.Text = "ConfigForm";
			this.Closing += new System.ComponentModel.CancelEventHandler(this.ConfigForm_Closing);
			this.ResumeLayout(false);
			this.PerformLayout();

		}
		#endregion

		private Timer timerConfig;
		private Label labelMMax;
		private Label labelMaxDis;
		private Label labelMuDpG;
		private Label labelBaseI;
		private Label labelBaseO;
		private Label labelDiagOn;
		private Label labelAutoD;
		private Label labelSaveTop;
		private Label labelQuiet;
		private Label labelLog;
		private Label labelHomeDir;
		private Label labelXICIn;
		private Label labelXILOut;
		private Label labelXINIn;
		private Label labelXINOut;
		private Label labelFMB;
		private Label labelLogName;
		private RichTextBox richTextBoxFMB;
		private TextBox textBoxMaxDis;
		private TextBox textBoxMuDpG;
		private TextBox textBoxBaseI;
		private TextBox textBoxBaseO;
		private Button buttonMMax;
		private Button buttonMaxDis;
		private Button buttonMuDpG;
		private Button buttonBaseI;
		private Button buttonBaseO;
		private Button buttonXICIn;
		private Button buttonXILOut;
		private Button buttonXINIn;
		private Button buttonXINOut;
		private Button buttonSaveConfig;
		private Button buttonRestoreConfig;
		private Button buttonChangeDir;
		private Button buttonExit;
		private TextBox textBoxXICIn;
		private TextBox textBoxXILOut;
		private TextBox textBoxXINIn;
		private TextBox textBoxXINOut;
		private Button buttonDiagOn;
		private Button buttonAutoD;
		private Button buttonSaveTop;
		private Button buttonQuiet;
		private Button buttonLog;
		private TextBox textBoxMMax;
		private ListBox listBoxFile;
		private FolderBrowserDialog folderBrowserDialogConfig;
		private OpenFileDialog openFileDialogConfig;
		private Label labelSelectedFile;
		private Label labelAllowFHT;
		private Label labelForceFHT;
		private Button buttonAllowFHT;
		private Button buttonForceFHT;
		private Label labelFilePath;
		private Label labelPri;
		private TextBox textBoxPri;
		private Button buttonPri;
		private Button buttonSelectFile;

		// -------- Begin Main program, Configuration
		public void Config()
		{
			// don't allow Config form to be brought up more than once
			if (Common.configUp) { Dispose(true); return; }
			Common.configUp = true;
			this.Text = Global.title + " - Configuration";
			labelHomeDir.Text = "Home Dir: " + Common.homeDir;
			timerConfig_Tick();
			DisplayFMB();
			textBoxMMax.Focus();
			GetFileNames();
		}

		private void GetFileNames() // populate the listBoxFile with file names
		{
			try
			{
				DirectoryInfo di = new DirectoryInfo(Environment.CurrentDirectory);
				listBoxFile.Items.Clear();
				string filter = "*.XI?";
				if (Common.selectFilter == 2) filter = "*.txt";
				if (Common.selectFilter > 2) filter = "*.*";
				foreach (FileInfo FI in di.GetFiles(filter))
				{
					listBoxFile.Items.Add(FI.Name);
				}
			}
			catch (Exception ex)
			{
				Common.ReportError("GetFileNames:", ex.Message);
			}
		}

		private void buttonAllowFHT_Click(object sender, System.EventArgs e)
		{
			MultiID.allowFHT = !MultiID.allowFHT;
			if (!MultiID.allowFHT) MultiID.forceFHT = false;
			DisplayAllowFHT();
			DisplayForceFHT();
		}

		private void buttonAutoD_Click(object sender, System.EventArgs e)
		// toggle AutoDisplay mode
		{
			Common.autoD = !Common.autoD;
			DisplayAutoD();
		}

		private void buttonBaseI_Click(object sender, System.EventArgs e) // change baseI
		{
			buttonBaseI_Click();
		}

		private void buttonBaseI_Click() // change baseI
		{
			int iL;
			if (textBoxBaseI.Text == "")
				textBoxBaseI.Text = MultiID.baseI.ToString(); // if "", set to current
			iL = Convert.ToInt32(textBoxBaseI.Text);
			if (iL < 2) iL = 10;
			if (iL > 36) iL = 36;
			MultiID.baseI = iL;
			DisplayBaseI();
			textBoxBaseI.Text = MultiID.baseI.ToString();
			textBoxBaseI.Focus();
			textBoxBaseI.SelectionStart = textBoxBaseI.Text.Length;
		}

		private void buttonBaseO_Click(object sender, System.EventArgs e) // change baseO
		{
			buttonBaseO_Click();
		}

		private void buttonBaseO_Click() // change baseO
		{
			int iL;
			if (textBoxBaseO.Text == "")
				textBoxBaseO.Text = MultiID.baseO.ToString(); // if "", set to current
			iL = Convert.ToInt32(textBoxBaseO.Text);
			if (iL < 2) iL = 10;
			if (iL > 36) iL = 36;
			MultiID.baseO = iL;
			DisplayBaseO();
			textBoxBaseO.Text = MultiID.baseO.ToString();
			textBoxBaseO.Focus();
			textBoxBaseO.SelectionStart = textBoxBaseO.Text.Length;
			DisplayFMB();
		}

		private void buttonChangeDir_Click(object sender, System.EventArgs e)
		// bring up folderBrowserDialog
		{
			folderBrowserDialogConfig.SelectedPath = Environment.CurrentDirectory;
			folderBrowserDialogConfig.Description = Global.title + " - Select a file path";
			folderBrowserDialogConfig.ShowDialog();
			Directory.SetCurrentDirectory(folderBrowserDialogConfig.SelectedPath);
			Common.selectPath = Environment.CurrentDirectory;
			GetFileNames();
		}

		private void buttonDiagOn_Click(object sender, System.EventArgs e)
		// toggle Diagnostic display mode Off/Time/Diag/Debug
		{
				 if (!MultiID.timeIt) MultiID.timeIt = true;
			else if (!MultiID.diagOn) MultiID.diagOn = true;
			else if (!MultiID.debug)  MultiID.debug  = true;
			else
			{
				MultiID.debug  = false;
				MultiID.diagOn = false;
				MultiID.timeIt = false;
			}
			DisplayDiagOn();
		}

		private void buttonExit_Click(object sender, System.EventArgs e)
		// exit Configuration form
		{
			Common.configUp = false;
			Dispose(true);
		}

		private void buttonForceFHT_Click(object sender, System.EventArgs e)
		{
			MultiID.forceFHT = !MultiID.forceFHT;
			if (MultiID.forceFHT) MultiID.allowFHT = true;
			DisplayAllowFHT();
			DisplayForceFHT();
		}

		private void buttonLog_Click(object sender, System.EventArgs e)
		// toggle Logging of output screen to Log File
		{
			Common.ToggleLogg();
			DisplayLog();
			buttonLog.Focus();
		}

		private void buttonMaxDis_Click(object sender, System.EventArgs e)
		// change Max digits in display
		{
			buttonMaxDis_Click();
		}

		private void buttonMaxDis_Click()
		// change Max digits in display
		{
			int iL;
			if (textBoxMaxDis.Text == "")
				textBoxMaxDis.Text = MultiID.maxDis.ToString(); // if "", set to current
			iL = Convert.ToInt32(textBoxMaxDis.Text);
			if (iL < 14) iL = 14;
			if (iL > Common.nMax * MultiID.muDMax)
				iL = Common.nMax * MultiID.muDMax;
			MultiID.maxDis = iL;
			DisplayMaxDis();
			textBoxMaxDis.Text = MultiID.maxDis.ToString();
			textBoxMaxDis.Focus();
			textBoxMaxDis.SelectionStart = textBoxMaxDis.Text.Length;
		}

		private void buttonMMax_Click(object sender, System.EventArgs e)
		// change Max decimal digits allowed
		{
			buttonMMax_Click();
		}

		private void buttonMMax_Click()
		// change Max decimal digits allowed
		{
			double db;
			if (textBoxMMax.Text == "")		// if "", set to current
				textBoxMMax.Text = (MultiID.mMax * MultiID.muDMax).ToString();
			db = Convert.ToDouble(textBoxMMax.Text);
			db = 1 + Math.Floor((db - 1) / MultiID.muDMax);
			MultiID.mMax = (int)db;
			Calc.CheckNMax();
			DisplayMMax();
			textBoxMMax.Text = (MultiID.mMax * MultiID.muDMax).ToString();
			textBoxMMax.Focus();
			textBoxMMax.SelectionStart = textBoxMMax.Text.Length;
		}

		private void buttonMuDpG_Click(object sender, System.EventArgs e)
		// change digits per group in display
		{
			buttonMuDpG_Click();
		}

		private void buttonMuDpG_Click()
		// change digits per group in display
		{
			int iL;
			if (textBoxMuDpG.Text == "") // if "", set to current
				textBoxMuDpG.Text = MultiID.muDpG.ToString();
			iL = Convert.ToInt32(textBoxMuDpG.Text);
			if (iL < 0) iL = 0;
			if (iL > Common.nMax * MultiID.muDMax)
				iL = Common.nMax * MultiID.muDMax;
			MultiID.muDpG = iL;
			DisplayMuDpG();
			textBoxMuDpG.Text = MultiID.muDpG.ToString();
			textBoxMuDpG.Focus();
			textBoxMuDpG.SelectionStart = textBoxMuDpG.Text.Length;
		}

		private void buttonPri_Click(object sender, System.EventArgs e)
		{
			buttonPri_Click();
		}

		private void buttonPri_Click()
		{
			int iL;
			if (textBoxPri.Text == "") // if "", set to current
				textBoxPri.Text = Common.pri.ToString();
			iL = Convert.ToInt32(textBoxPri.Text);
			Common.SetPriority(iL);
			textBoxPri.Text = Common.pri.ToString();
			DisplayPri();
			textBoxPri.Focus();
			textBoxPri.SelectionStart = textBoxPri.Text.Length;
		}

		private void buttonQuiet_Click(object sender, System.EventArgs e)
		// toggle quiet mode on/off
		{
			Common.quiet = !Common.quiet;
			DisplayQuiet();
		}

		private void buttonRestoreConfig_Click(object sender, System.EventArgs e)
		// restore configeration, same as < command
		{
			Common.DoubleSpace();
			Common.running = true;
			buttonRestoreConfig.Enabled = false;
			buttonSaveConfig.Enabled = false;
			Calc.CalReadConfig();
			DisplayFMB();
			buttonRestoreConfig.Enabled = true;
			buttonSaveConfig.Enabled = true;
			Common.running = false;
			RunForm.FocusBothUs();
			buttonRestoreConfig.Focus();
		}

		private void buttonSaveConfig_Click(object sender, System.EventArgs e)
		// save configuration, same as > command
		{
			Common.DoubleSpace();
			if (Common.running) return;
			Common.running = true;
			buttonRestoreConfig.Enabled = false;
			buttonSaveConfig.Enabled = false;
			DisplayFMB();
			Calc.CalWriteConfig();
			buttonRestoreConfig.Enabled = true;
			buttonSaveConfig.Enabled = true;
			Common.running = false;
			RunForm.FocusBothUs();
			buttonSaveConfig.Focus();
		}

		private void buttonSaveTop_Click(object sender, System.EventArgs e)
		// toggle the SaveTop option
		{
			Common.saveTop = !Common.saveTop;
			DisplaySaveTop();
		}

		private void buttonSelectFile_Click(object sender, System.EventArgs e)
		// bring up openFileDialog
		{
			string st = Environment.CurrentDirectory.ToString();
			openFileDialogConfig.Reset();	// Reset needed to be able to change InitialDirectory
			openFileDialogConfig.InitialDirectory = st;
			openFileDialogConfig.Filter = "XICalc files (*.XI?)|*.XI?|txt files (*.txt)|*.txt|All files(*.*)|*.*";
			openFileDialogConfig.FilterIndex = Common.selectFilter;
			openFileDialogConfig.RestoreDirectory = false;
			openFileDialogConfig.Title = Global.title + " - Select a file";
			if(openFileDialogConfig.ShowDialog() == DialogResult.OK)
			{
				st = openFileDialogConfig.FileName.ToString();
 				int i = st.LastIndexOf(@"\");					// seperate selected path and file strings
				Common.selectPath = st.Substring(0, i);
				Common.selectFile = st.Substring(i+1);
				Directory.SetCurrentDirectory(Common.selectPath);
				labelSelectedFile.Text = "Selected file: " + Common.selectFile;
			}
			Common.selectFilter = openFileDialogConfig.FilterIndex;
			GetFileNames();
		}

		private void buttonXICIn_Click(object sender, System.EventArgs e)
		// change name of calculator code file
		{
			buttonXICIn_Click();
		}

		private void buttonXICIn_Click()
		// change name of calculator code file
		{
			Common.DoubleSpace();
			string st = textBoxXICIn.Text;
			if (st != "")
			{
				Common.FixFName(ref st, "XIC");
				textBoxXICIn.Text = st;
				st = "\"" + st;
				Calc.CalFileNm("XICIn", ref st, ref Calc.xICIn);
			}
			else
			{
				if (Common.selectFile == "") // remove "XICIn:" from XICIn: xxx..."
				{
					if (Calc.xICIn != 0) textBoxXICIn.Text = Common.nList[Calc.xICIn].Nm.Substring(6);
				}
				else
				{
					textBoxXICIn.Text = Common.selectFile;
				}
			}
			DisplayXICIn();
			RunForm.FocusBothUs();
			textBoxXICIn.Focus();
			textBoxXICIn.SelectionStart = textBoxXICIn.Text.Length;
		}

		private void buttonXILOut_Click(object sender, System.EventArgs e)
		// change name of output log file
		{
			buttonXILOut_Click();
		}

		private void buttonXILOut_Click()
		// change name of output log file
		{
			Common.DoubleSpace();
			string st = textBoxXILOut.Text;
			if (st != "")
			{
				Common.FixFName(ref st, "XIL");
				textBoxXILOut.Text = st;
				st = "\"" + st;
				Calc.CalFileNm("XILOut", ref st, ref Calc.xILOut);
			}
			else
			{
				if (Common.selectFile == "")
				{
					if (Calc.xILOut != 0) textBoxXILOut.Text = Common.nList[Calc.xILOut].Nm.Substring(7);
				}
				else
				{
					textBoxXILOut.Text = Common.selectFile;
				}
			}
			DisplayXILOut();
			RunForm.FocusBothUs();
			textBoxXILOut.Focus();
			textBoxXILOut.SelectionStart = textBoxXILOut.Text.Length;
		}

		private void buttonXINIn_Click(object sender, System.EventArgs e)
		// change name of input number file
		{
			buttonXINIn_Click();
		}

		private void buttonXINIn_Click()
		// change name of input number file
		{
			Common.DoubleSpace();
			string st = textBoxXINIn.Text;
			if (st != "")
			{
				Common.FixFName(ref st, "XIN");
				textBoxXINIn.Text = st;
				st = "\"" + st;
				Calc.CalFileNm("XINIn", ref st, ref Calc.xINIn);
			}
			else
			{
				if (Common.selectFile == "")
				{
					if (Calc.xINIn != 0) textBoxXINIn.Text = Common.nList[Calc.xINIn].Nm.Substring(6);
				}
				else
				{
					textBoxXINIn.Text = Common.selectFile;
				}
			}
			DisplayXINIn();
			RunForm.FocusBothUs();
			textBoxXINIn.Focus();
			textBoxXINIn.SelectionStart = textBoxXINIn.Text.Length;
		}

		private void buttonXINOut_Click(object sender, System.EventArgs e)
		// change name of output number file
		{
			buttonXINOut_Click();
		}

		private void buttonXINOut_Click()
		// change name of output number file
		{
			Common.DoubleSpace();
			string st = textBoxXINOut.Text;
			if (st != "")
			{
				Common.FixFName(ref st, "XIN");
				textBoxXINOut.Text = st;
				st = "\"" + st;
				Calc.CalFileNm("XINOut", ref st, ref Calc.xINOut);
			}
			else
			{
				if (Common.selectFile == "")
				{
					if (Calc.xINOut != 0) textBoxXINOut.Text = Common.nList[Calc.xINOut].Nm.Substring(7);
				}
				else
				{
					textBoxXINOut.Text = Common.selectFile;
				}
			}
			DisplayXINOut();
			RunForm.FocusBothUs();
			textBoxXINOut.Focus();
			textBoxXINOut.SelectionStart = textBoxXINOut.Text.Length;
		}

		private void DisplayAllowFHT() // display AllowFHT mode: On/Off
		{
			if (MultiID.allowFHT)
				buttonAllowFHT.Text = "Is On";
			else
				buttonAllowFHT.Text = "Is Off";
		}

		private void DisplayAutoD() // display AutoDisplay mode: On/Off
		{
			if (Common.autoD)
				buttonAutoD.Text = "Is On";
			else
				buttonAutoD.Text = "Is Off";
		}

		private void DisplayBaseI() // display Input base
		{
			string maxD;
			string stB = MultiID.baseI.ToString();
			if (MultiID.baseI < 10) stB = " " + stB;
			maxD = MultiID.MaxDig(MultiID.baseI);
			labelBaseI.Text = "Input base = " + stB + " (max digit = " + maxD + ")";
		}

		private void DisplayBaseO() // display Output base
		{
			string maxD;
			string stB = MultiID.baseO.ToString();
			if (MultiID.baseO < 10) stB = " " + stB;
			maxD = MultiID.MaxDig(MultiID.baseO);
			labelBaseO.Text = "Output base = " + stB + " (max digit = " + maxD + ")";
		}

		private void DisplayDiagOn() // display Diagnostic mode: On/Off
		{
			if (MultiID.debug)
				buttonDiagOn.Text = "Debug";
			else if (MultiID.diagOn)
				buttonDiagOn.Text = "Diag";
			else if (MultiID.timeIt)
				buttonDiagOn.Text = "Time";
			else
				buttonDiagOn.Text = "Is Off";
		}

		private void DisplayFMB() // display modulo base "FMB" from named list
		{
			int fMBI;
			Common.LFind("FMB", out fMBI);
			if (fMBI == 0)
				richTextBoxFMB.Text = "<Not set, use % to set it.>";
			else
			{
				int tot = 0;
				richTextBoxFMB.Text = "";
				Calc.WriteNV(richTextBoxFMB, null, Common.nList[fMBI], ref tot, 54);
			}
		}

		private void DisplayForceFHT() // display ForceFHT mode: On/Off
		{
			if (MultiID.forceFHT)
				buttonForceFHT.Text = "Is On";
			else
				buttonForceFHT.Text = "Is Off";
		}

		private void DisplayLog() // display Log to file mode: On/Off
		{
			if (MultiID.logg)
				buttonLog.Text = "Is On";
			else
				buttonLog.Text = "Is Off";
		}

		private void DisplayLogName() // display name of open log file
		{
			if (MultiID.logg)
				labelLogName.Text = "To log file: " + Common.logFile;
			else
				labelLogName.Text = "";
		}

		private void DisplayMaxDis() // display Max digits in display
		{
			labelMaxDis.Text = "Max digits in display = " + MultiID.maxDis;
		}

		private void DisplayMMax() // display Max decimal digits allowed
		{
			labelMMax.Text = "Max decimal digits allowed = " + MultiID.mMax * MultiID.muDMax;
		}

		private void DisplayMuDpG() // display Digits per group
		{
			labelMuDpG.Text = "Digits per group in display = " + MultiID.muDpG;
		}

		private void DisplayPri() // display execution priority
		{
			labelPri.Text = "Execution Priority [-2, 2] = " + Common.pri;
		}

		private void DisplayQuiet() // display quiet mode: On/Off
		{
			if (Common.quiet)
				buttonQuiet.Text = "Is On";
			else
				buttonQuiet.Text = "Is Off";
		}

		private void DisplaySaveTop() // display Save LastTop mode: On/Off
		{
			if (Common.saveTop)
				buttonSaveTop.Text = "Is On";
			else
				buttonSaveTop.Text = "Is Off";
		}

		private void DisplayXICIn() // display name of Calculator code file
		{
			string st = Common.nList[Calc.xICIn].Nm;
			if (st == "") st = "XICIn: <Not set>";
			labelXICIn.Text = "Calculator code file " + st;
		}

		private void DisplayXILOut() // display name of Output Log file
		{
			string st = Common.nList[Calc.xILOut].Nm;
			if (st == "") st = "XILOut: <Not set>";
			labelXILOut.Text = "Output log file " + st;
		}

		private void DisplayXINIn() // display name of input number file
		{
			string st = Common.nList[Calc.xINIn].Nm;
			if (st == "") st = "XINIn: <Not set>";
			labelXINIn.Text = "Input number file " + st;
		}

		private void DisplayXINOut() // display name of output number file
		{
			string st = Common.nList[Calc.xINOut].Nm;
			if (st == "") st = "XINOut: <Not set>";
			labelXINOut.Text = "Output number file " + st;
		}

		private void listBoxFile_SelectedIndexChanged(object sender, System.EventArgs e)
		// save the selected file name
		{
			int i = listBoxFile.SelectedIndex;
			Common.selectFile = listBoxFile.Items[i].ToString();
		}

		private void textBoxBaseI_KeyDown(object sender, KeyEventArgs e)
		// process keys when in baseI box
		{
			if (e.KeyCode == Keys.Return) // return is an accept key here
			{
				// this sounds the bell
				if (buttonBaseI.Enabled) buttonBaseI_Click();
			}
		}

		private void textBoxBaseI_TextChanged(object sender, System.EventArgs e)
		// process input of Max decimal digits allowed
		{
			string sNum;
			int iNum;
			int n;
			if (Common.running) return; // don't allow a change when Calc is running
			textBoxBaseI.Text = textBoxBaseI.Text.TrimStart(' '); // remove leading spaces
			if (textBoxBaseI.Text == "")
			{
				buttonBaseI.Enabled = true;
				return;
			}
			sNum = textBoxBaseI.Text;
			if (Global.IsInt32(sNum))
			{
				iNum = Convert.ToInt32(sNum);
				buttonBaseI.Enabled = (0 <= iNum); // and iNum <= 36
			}
			else
			{
				buttonBaseI.Enabled = false;
			}
			n = sNum.Length;
			if (n > 0)
			{
				if (sNum[n-1] == ' ') // if space at right end of field
				{
					textBoxBaseI.Text = textBoxBaseI.Text.Trim(' ');		// remove trailing spaces
					textBoxBaseI.SelectionStart = textBoxBaseI.Text.Length; // move to right end of input
					if (buttonBaseI.Enabled) buttonBaseI_Click();			// accept the input
				}
			}
		}

		private void textBoxBaseO_KeyDown(object sender, KeyEventArgs e)
		// process keys when in baseO box
		{
			if (e.KeyCode == Keys.Return) // return is an accept key here
			{
				// this sounds the bell
				if (buttonBaseO.Enabled) buttonBaseO_Click();
			}
		}

		private void textBoxBaseO_TextChanged(object sender, System.EventArgs e)
		// process input of Max decimal digits allowed
		{
			string sNum;
			int iNum;
			int n;
			if (Common.running) return; // don't allow a change when Calc is running
			textBoxBaseO.Text = textBoxBaseO.Text.TrimStart(' '); // remove leading spaces
			if (textBoxBaseO.Text == "")
			{
				buttonBaseO.Enabled = true;
				return;
			}
			sNum = textBoxBaseO.Text;
			if (Global.IsInt32(sNum))
			{
				iNum = Convert.ToInt32(sNum);
				buttonBaseO.Enabled = (0 <= iNum); // and iNum <= 36
			}
			else
			{
				buttonBaseO.Enabled = false;
			}
			n = sNum.Length;
			if (n > 0)
			{
				if (sNum[n-1] == ' ') // if space at right end of field
				{
					textBoxBaseO.Text = textBoxBaseO.Text.Trim(' ');		// remove trailing spaces
					textBoxBaseO.SelectionStart = textBoxBaseO.Text.Length; // move to right end of input
					if (buttonBaseO.Enabled) buttonBaseO_Click();			// accept the input
				}
			}
		}

		private void textBoxMaxDis_KeyDown(object sender, KeyEventArgs e)
		// process keys when in maxDis box
		{
			if (e.KeyCode == Keys.Return) // return is an accept key here
			{
				// this sounds the bell
				if (buttonMaxDis.Enabled) buttonMaxDis_Click();
			}
		}

		private void textBoxMaxDis_TextChanged(object sender, System.EventArgs e)
		// process input of Max digits in display
		{
			string sNum;
			int iNum;
			int n;
			textBoxMaxDis.Text = textBoxMaxDis.Text.TrimStart(' '); // remove leading spaces
			if (textBoxMaxDis.Text == "")
			{
				buttonMaxDis.Enabled = true;
				return;
			}
			sNum = textBoxMaxDis.Text;
			if (Global.IsInt32(sNum))
			{
				iNum = Convert.ToInt32(sNum);
				buttonMaxDis.Enabled = (0 <= iNum);
			}
			else
			{
				buttonMaxDis.Enabled = false;
			}
			n = sNum.Length;
			if (n > 0)
			{
				if (sNum[n-1] == ' ') // if space at right end of field
				{
					textBoxMaxDis.Text = textBoxMaxDis.Text.Trim(' ');			// remove trailing spaces
					textBoxMaxDis.SelectionStart = textBoxMaxDis.Text.Length;	// move to right end of input
					if (buttonMaxDis.Enabled) buttonMaxDis_Click();				// accept the input
				}
			}
		}

		private void textBoxMMax_KeyDown(object sender, KeyEventArgs e)
		// process keys when in mMax box
		{
			if (e.KeyCode == Keys.Return) // return is an accept key here
			{
				// this sounds the bell
				if (buttonMMax.Enabled) buttonMMax_Click();
			}
			if (e.KeyCode == Keys.Escape) // ESC key pressed so exit ConfigForm
			{
				Common.configUp = false;
				Dispose(true);
			}
		}

		private void textBoxMMax_TextChanged(object sender, System.EventArgs e)
		// process input of Max decimal digits allowed
		{
			textBoxMMax_TextChanged();
		}

		private void textBoxMMax_TextChanged()
		// process input of Max decimal digits allowed
		{
			string sNum;
			int iNum;
			int n;
			if (Common.running) return;	// don't allow a change when Calc is running
			textBoxMMax.Text = textBoxMMax.Text.TrimStart(' ');	// remove leading spaces
			if (textBoxMMax.Text == "")
			{
				buttonMMax.Enabled = true;
				return;
			}
			sNum = textBoxMMax.Text;
			if (Global.IsInt32(sNum))
			{
				iNum = Convert.ToInt32(sNum);
				buttonMMax.Enabled = (0 <= iNum); // and iNum <= nMax * MultiID.muDMax)
			}
			else
			{
				buttonMMax.Enabled = false;
			}
			n = sNum.Length;
			if (n > 0)
			{
				if (sNum[n-1] == ' ') // if space at right end of field
				{
					textBoxMMax.Text = textBoxMMax.Text.Trim(' ');			// remove trailing spaces
					textBoxMMax.SelectionStart = textBoxMMax.Text.Length;	// move to right end of input
					if (buttonMMax.Enabled) buttonMMax_Click();				// accept the input
				}
			}
		}

		private void textBoxMuDpG_KeyDown(object sender, KeyEventArgs e)
		// process keys when in muDpG box
		{
			if (e.KeyCode == Keys.Return) // return is an accept key here
			{
				// this sounds the bell
				if (buttonMuDpG.Enabled) buttonMuDpG_Click();
			}
		}

		private void textBoxMuDpG_TextChanged(object sender, System.EventArgs e)
		// process input of digits per group in display
		{
			string sNum;
			int iNum;
			int n;
			textBoxMuDpG.Text = textBoxMuDpG.Text.TrimStart(' '); // remove leading spaces
			if (textBoxMuDpG.Text == "")
			{
				buttonMuDpG.Enabled = true;
				return;
			}
			sNum = textBoxMuDpG.Text;
			if (Global.IsInt32(sNum))
			{
				iNum = Convert.ToInt32(sNum);
				buttonMuDpG.Enabled = (0 <= iNum);
			}
			else
			{
				buttonMuDpG.Enabled = false;
			}
			n = sNum.Length;
			if (n > 0)
			{
				if (sNum[n-1] == ' ') // if space at right end of field
				{
					textBoxMuDpG.Text = textBoxMuDpG.Text.Trim(' ');		// remove trailing spaces
					textBoxMuDpG.SelectionStart = textBoxMuDpG.Text.Length; // move to right end of input
					if (buttonMuDpG.Enabled) buttonMuDpG_Click();			// accept the input
				}
			}
		}

		private void textBoxPri_KeyDown(object sender, KeyEventArgs e)
		// process keys when in Pri box
		{
			if (e.KeyCode == Keys.Return) // return is an accept key here
			{
				// this sounds the bell
				if (buttonPri.Enabled) buttonPri_Click();
			}
		}

		private void textBoxPri_TextChanged(object sender, System.EventArgs e)
		// process input of Execution Priority
		{
			textBoxPri_TextChanged();
		}

		private void textBoxPri_TextChanged()
		// process input of Execution Priority
		{
			string sNum;
			int iNum;
			int n;
			// allow a change when Calc is running
			textBoxPri.Text = textBoxPri.Text.TrimStart(' '); // remove leading spaces
			if (textBoxPri.Text == "")
			{
				buttonPri.Enabled = true;
				return;
			}
			sNum = textBoxPri.Text;
			if (Global.IsInt32(sNum))
			{
				buttonPri.Enabled = true;
				iNum = Convert.ToInt32(sNum);
			}
			else
				buttonPri.Enabled = false;
			n = sNum.Length;
			if (n > 0)
			{
				if (sNum[n-1] == ' ') // if space at right end of field
				{
					textBoxPri.Text = textBoxPri.Text.Trim(' ');		// remove trailing spaces
					textBoxPri.SelectionStart = textBoxPri.Text.Length; // move to right end of input
					if (buttonPri.Enabled) buttonPri_Click();			// accept the input
				}
			}
		}

		private void textBoxXICIn_KeyDown(object sender, KeyEventArgs e)
		// process keys when in XPCIn box
		{
			if (e.KeyCode == Keys.Return) // return is an accept key here
			{
				// this sounds the bell
				if (buttonXICIn.Enabled) buttonXICIn_Click();
			}
		}

		private void textBoxXICIn_TextChanged(object sender, System.EventArgs e)
		// process input of name of calculator code file
		{
			int n;
			string st;
			if (Common.running) return; // don't allow a change when Calc is running
			textBoxXICIn.Text = textBoxXICIn.Text.TrimStart(' '); // remove leading spaces
			st = textBoxXICIn.Text;
			n = st.Length;
			if (n == 0)
			{
				buttonXICIn.Enabled = true;
				return;
			}
			if (st[n-1] == ' ') // if space at right end of field
			{
				textBoxXICIn.Text = textBoxXICIn.Text.Trim(' ');		// remove trailing spaces
				textBoxXICIn.SelectionStart = textBoxXICIn.Text.Length; // move to right end of input
				if (buttonXICIn.Enabled) buttonXICIn_Click();			// accept the input
			}
		}

		private void textBoxXILOut_KeyDown(object sender, KeyEventArgs e)
		// process keys when in XILOut box
		{
			if (e.KeyCode == Keys.Return) // return is an accept key here
			{
				// this sounds the bell
				if (buttonXILOut.Enabled) buttonXILOut_Click();
			}
		}

		private void textBoxXILOut_TextChanged(object sender, System.EventArgs e)
		// process input of name of output log file
		{
			int n;
			string st;
			if (Common.running) return; // don't allow a change when Calc is running
			textBoxXILOut.Text = textBoxXILOut.Text.TrimStart(' '); // remove leading spaces
			st = textBoxXILOut.Text;
			n = st.Length;
			if (n == 0)
			{
				buttonXILOut.Enabled = true;
				return;
			}
			if (st[n-1] == ' ') // if space at right end of field
			{
				textBoxXILOut.Text = textBoxXILOut.Text.Trim(' ');			// remove trailing spaces
				textBoxXILOut.SelectionStart = textBoxXILOut.Text.Length;	// move to right end of input
				if (buttonXILOut.Enabled) buttonXILOut_Click();				// accept the input
			}
		}

		private void textBoxXINIn_KeyDown(object sender, KeyEventArgs e)
		// process keys when in XINIn box
		{
			if (e.KeyCode == Keys.Return) // return is an accept key here
			{
				// this sounds the bell
				if (buttonXINIn.Enabled) buttonXINIn_Click();
			}
		}

		private void textBoxXINIn_TextChanged(object sender, System.EventArgs e)
		// process input of name of input number file
		{
			int n;
			string st;
			if (Common.running) return; // don't allow a change when Calc is running
			textBoxXINIn.Text = textBoxXINIn.Text.TrimStart(' '); // remove leading spaces
			st = textBoxXINIn.Text;
			n = st.Length;
			if (n == 0)
			{
				buttonXINIn.Enabled = true;
				return;
			}
			if (st[n-1] == ' ') // if space at right end of field
			{
				textBoxXINIn.Text = textBoxXINIn.Text.Trim(' ');		// remove trailing spaces
				textBoxXINIn.SelectionStart = textBoxXINIn.Text.Length; // move to right end of input
				if (buttonXINIn.Enabled) buttonXINIn_Click();			// accept the input
			}
		}

		private void textBoxXINOut_KeyDown(object sender, KeyEventArgs e)
		// process keys when in XINOut box
		{
			if (e.KeyCode == Keys.Return) // return is an accept key here
			{
				// this sounds the bell
				if (buttonXINOut.Enabled) buttonXINOut_Click();
			}
		}

		private void textBoxXINOut_TextChanged(object sender, System.EventArgs e)
		// process input of name of output number file
		{
			int n;
			string st;
			if (Common.running) return; // don't allow a change when Calc is running
			textBoxXINOut.Text = textBoxXINOut.Text.TrimStart(' '); // remove leading spaces
			st = textBoxXINOut.Text;
			n = st.Length;
			if (n == 0)
			{
				buttonXINOut.Enabled = true;
				return;
			}
			if (st[n-1] == ' ') // if space at right end of field
			{
				textBoxXINOut.Text = textBoxXINOut.Text.Trim(' ');			// remove trailing spaces
				textBoxXINOut.SelectionStart = textBoxXINOut.Text.Length;	// move to right end of input
				if (buttonXINOut.Enabled) buttonXINOut_Click();				// accept the input
			}
		}

		private void timerConfig_Tick(object sender, System.EventArgs e)
		// update display of changeable items
		{
			if (!Global.runFormUp)
			{
				Common.configUp = false;
				Dispose(true);
				return;
			}
			timerConfig_Tick();
		}

		private void timerConfig_Tick()	// update display of changeable items
		{
			labelSelectedFile.Text = "Selected file: " + Common.selectFile;
			labelFilePath.Text = "File path: " + Environment.CurrentDirectory.ToString();
			DisplayAllowFHT();
			DisplayAutoD();
			DisplayBaseI();
			DisplayBaseO();
			DisplayDiagOn();
			DisplayFMB();
			DisplayForceFHT();
			DisplayLog();
			DisplayLogName();
			DisplayMaxDis();
			DisplayMMax();
			DisplayMuDpG();
			DisplayPri();
			DisplayQuiet();
			DisplaySaveTop();
			DisplayXICIn();
			DisplayXILOut();
			DisplayXINIn();
			DisplayXINOut();
			if (Common.running)
			{
				buttonChangeDir.Enabled = false;
				buttonMMax.Enabled = false;
				buttonRestoreConfig.Enabled = false;
				buttonSaveConfig.Enabled = false;
				buttonXICIn.Enabled = false;
				buttonXILOut.Enabled = false;
				buttonXINIn.Enabled = false;
				buttonXINOut.Enabled = false;
			}
			else
			{
				buttonChangeDir.Enabled = true;
				buttonRestoreConfig.Enabled = true;
				buttonSaveConfig.Enabled = true;
				buttonXICIn.Enabled = true;
				buttonXILOut.Enabled = true;
				buttonXINIn.Enabled = true;
				buttonXINOut.Enabled = true;
				textBoxMMax_TextChanged();
			}
		} // timerConfig_Tick

		private void ConfigForm_Closing(object sender, System.ComponentModel.CancelEventArgs e)
		// exit Configuration form
		{
			Common.configUp = false;
		}
	}
}
