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

namespace HearingAidLab
{
	/// <summary>
	/// Summary description for Progress.
	/// </summary>
	public class Progress : System.Windows.Forms.Form
	{
		public System.Windows.Forms.ProgressBar progressBar1;
		public System.Windows.Forms.Label lblProgress;
		/// <summary>
		/// Required designer variable.
		/// </summary>
		private System.ComponentModel.Container components = null;

		public Progress()
		{
			//
			// Required for Windows Form Designer support
			//
			InitializeComponent();

			//
			// TODO: Add any constructor code after InitializeComponent call
			//
		}

		/// <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.progressBar1 = new System.Windows.Forms.ProgressBar();
			this.lblProgress = new System.Windows.Forms.Label();
			this.SuspendLayout();
			// 
			// progressBar1
			// 
			this.progressBar1.Location = new System.Drawing.Point(8, 40);
			this.progressBar1.Name = "progressBar1";
			this.progressBar1.Size = new System.Drawing.Size(272, 23);
			this.progressBar1.TabIndex = 0;
			// 
			// lblProgress
			// 
			this.lblProgress.Location = new System.Drawing.Point(8, 8);
			this.lblProgress.Name = "lblProgress";
			this.lblProgress.Size = new System.Drawing.Size(272, 23);
			this.lblProgress.TabIndex = 1;
			this.lblProgress.Text = "Copying Gel File";
			// 
			// Progress
			// 
			this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
			this.ClientSize = new System.Drawing.Size(292, 85);
			this.Controls.AddRange(new System.Windows.Forms.Control[] {
																		  this.lblProgress,
																		  this.progressBar1});
			this.Name = "Progress";
			this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
			this.Text = "Progress";
			this.ResumeLayout(false);

		}
		#endregion

		public void Init(string strLabel, int nMax, int nMin, int nValue)
		{
			lblProgress.Text = strLabel;
			progressBar1.Maximum = nMax;
			progressBar1.Minimum = nMin;
			progressBar1.Value = nValue;
			this.Update();
		}
		public void Increment()
		{
			if(progressBar1.Value < progressBar1.Maximum)
				progressBar1.Value++;
			else
				progressBar1.Value = 0;
			this.Update();
		}
		public void SetLevel(int n)
		{
			if(progressBar1.Maximum>n)
				progressBar1.Value = n;
			this.Update();
		}
		public void SetLabel(string str)
		{
			lblProgress.Text = str;
			this.Update();
		}
	}
}
