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

namespace StarGame
{
	/// <summary>
	/// Summary description for TimerForm.
	/// </summary>
	public class TimerForm : System.Windows.Forms.Form
	{
		/// <summary>
		/// Required designer variable.
		/// </summary>
		private System.ComponentModel.Container components = null;

		public TimerForm()
		{
			//
			// 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()
		{
			// 
			// TimerForm
			// 
			this.AutoScaleMode = AutoScaleMode.None;
			this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
			this.ClientSize = new System.Drawing.Size(292, 266);
			this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
			this.MaximizeBox = false;
			this.Name = "TimerForm";
			this.Opacity = 0.5;
			this.ShowInTaskbar = false;
			this.StartPosition = System.Windows.Forms.FormStartPosition.Manual;
			this.Text = "TimerForm";
			this.TopMost = true;
			this.Paint += new System.Windows.Forms.PaintEventHandler(this.TimerForm_Paint);

		}
		#endregion

		public void StopWatch(int TOT_DELAY)
		{
			int h = this.Height;
			int w = this.Width;
			
			Graphics g = this.CreateGraphics();
			Pen p = new Pen(Color.Red,2);
			System.Threading.Thread.Sleep(TOT_DELAY/4);
			g.FillRectangle(p.Brush,w/2,0,w/2,h/2);
			Application.DoEvents();
			System.Threading.Thread.Sleep(TOT_DELAY/4);
			g.FillRectangle(p.Brush,w/2,h/2,w/2,h/2);
			Application.DoEvents();
			System.Threading.Thread.Sleep(TOT_DELAY/4);
			Application.DoEvents();
			g.FillRectangle(p.Brush,0,h/2,w/2,h/2);
			Application.DoEvents();
			System.Threading.Thread.Sleep(TOT_DELAY/4);
			g.FillRectangle(p.Brush,0,0,w/2,h/2);
			Application.DoEvents();
			System.Threading.Thread.Sleep(TOT_DELAY/4);
		}

		private void TimerForm_Paint(object sender, System.Windows.Forms.PaintEventArgs e)
		{
			
		}
	}
}
