namespace VoServices.Footprint.Web
{
	using System;
	using System.Data;
	using System.Drawing;
	using System.Web;
	using System.Web.UI.WebControls;
	using System.Web.UI.HtmlControls;
	using System.ComponentModel;

	/// <summary>
	///		Summary description for WizardButtons.
	/// </summary>
	public partial class WizardButtons : System.Web.UI.UserControl
	{

		public delegate void WBEventHandler(string button);
		public event WBEventHandler Click;

		public bool DisplayProgress = false;

		public bool OkEnabled
		{
			get { return Ok.Enabled; }
			set { Ok.Enabled = value; }
		}

		public bool ResEnabled
		{
			get { return Res.Enabled; }
			set { Res.Enabled = value; }
		}

		public bool FinishEnabled
		{
			get { return Finish.Enabled; }
			set { Finish.Enabled = value; }
		}

		public bool BackEnabled
		{
			get { return Back.Enabled; }
			set { Back.Enabled = value; }
		}

		protected void Page_Load(object sender, System.EventArgs e)
		{
			//
		}

		#region Web Form Designer generated code
		override protected void OnInit(EventArgs e)
		{
			//
			// CODEGEN: This call is required by the ASP.NET Web Form Designer.
			//
			InitializeComponent();
			base.OnInit(e);
		}
		
		/// <summary>
		///		Required method for Designer support - do not modify
		///		the contents of this method with the code editor.
		/// </summary>
		private void InitializeComponent()
		{
			this.PreRender += new System.EventHandler(this.WizardButtons_PreRender);

		}
		#endregion

		protected void Ok_Click(object sender, System.EventArgs e)
		{
			Click("ok");
		}

		protected void Finish_Click(object sender, System.EventArgs e)
		{
			Click("finish");
		}

		protected void Back_Click(object sender, System.EventArgs e)
		{
			Click("back");
		}

		protected void Res_Click(object sender, System.EventArgs e)
		{
			Click("res");
		}

		protected void WizardButtons_PreRender(object sender, System.EventArgs e)
		{
			if ((Ok.Enabled || Finish.Enabled) && DisplayProgress)
			{
				Ok.Attributes.Add("onclick", "DisplayProgress();");
			}
		}


	}
}
