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

namespace Cajero
{
	/// <summary>
	/// Descripción breve de Teclado.
	/// </summary>
	public class Teclado : System.Windows.Forms.UserControl
	{
		private System.Windows.Forms.Button button1;
		private System.Windows.Forms.Button button2;
		private System.Windows.Forms.Button button3;
		private System.Windows.Forms.Button button4;
		private System.Windows.Forms.Button button5;
		private System.Windows.Forms.Button button6;
		private System.Windows.Forms.Button button7;
		private System.Windows.Forms.Button button8;
		private System.Windows.Forms.Button button9;
		private System.Windows.Forms.Button button0;
		private System.Windows.Forms.Button buttonAsterisco;
		private System.Windows.Forms.Button buttonAlmohadilla;
		private System.Windows.Forms.Button buttonConfirmar;
		private System.Windows.Forms.Button buttoCorregir;
		private System.Windows.Forms.Button buttoCancelar;
		private System.Windows.Forms.TextBox tbPantalla;
		/// <summary> 
		/// Variable del diseñador requerida.
		/// </summary>
		private System.ComponentModel.Container components = null;
		protected ISoporteDeTeclado mSoporte;

		public Teclado()
		{
			// Llamada necesaria para el Diseñador de formularios Windows.Forms.
			InitializeComponent();

			// TODO: agregar cualquier inicialización después de llamar a InitializeComponent

		}

		public void setSoporte(ISoporteDeTeclado soporte) 
		{
			mSoporte=soporte;
		}

		/// <summary> 
		/// Limpiar los recursos que se estén utilizando.
		/// </summary>
		protected override void Dispose( bool disposing )
		{
			if( disposing )
			{
				if(components != null)
				{
					components.Dispose();
				}
			}
			base.Dispose( disposing );
		}

		#region Código generado por el Diseñador de componentes
		/// <summary> 
		/// Método necesario para admitir el Diseñador. No se puede modificar 
		/// el contenido del método con el editor de código.
		/// </summary>
		private void InitializeComponent()
		{
			this.button1 = new System.Windows.Forms.Button();
			this.button2 = new System.Windows.Forms.Button();
			this.button3 = new System.Windows.Forms.Button();
			this.button4 = new System.Windows.Forms.Button();
			this.button5 = new System.Windows.Forms.Button();
			this.button6 = new System.Windows.Forms.Button();
			this.button7 = new System.Windows.Forms.Button();
			this.button8 = new System.Windows.Forms.Button();
			this.button9 = new System.Windows.Forms.Button();
			this.buttonAsterisco = new System.Windows.Forms.Button();
			this.button0 = new System.Windows.Forms.Button();
			this.buttonAlmohadilla = new System.Windows.Forms.Button();
			this.buttonConfirmar = new System.Windows.Forms.Button();
			this.buttoCorregir = new System.Windows.Forms.Button();
			this.buttoCancelar = new System.Windows.Forms.Button();
			this.tbPantalla = new System.Windows.Forms.TextBox();
			this.SuspendLayout();
			// 
			// button1
			// 
			this.button1.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
			this.button1.Location = new System.Drawing.Point(40, 224);
			this.button1.Name = "button1";
			this.button1.Size = new System.Drawing.Size(48, 40);
			this.button1.TabIndex = 0;
			this.button1.Text = "1";
			this.button1.Click += new System.EventHandler(this.enviar);
			// 
			// button2
			// 
			this.button2.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
			this.button2.Location = new System.Drawing.Point(88, 224);
			this.button2.Name = "button2";
			this.button2.Size = new System.Drawing.Size(48, 40);
			this.button2.TabIndex = 1;
			this.button2.Text = "2";
			this.button2.Click += new System.EventHandler(this.enviar);
			// 
			// button3
			// 
			this.button3.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
			this.button3.Location = new System.Drawing.Point(136, 224);
			this.button3.Name = "button3";
			this.button3.Size = new System.Drawing.Size(48, 40);
			this.button3.TabIndex = 2;
			this.button3.Text = "3";
			this.button3.Click += new System.EventHandler(this.enviar);
			// 
			// button4
			// 
			this.button4.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
			this.button4.Location = new System.Drawing.Point(40, 264);
			this.button4.Name = "button4";
			this.button4.Size = new System.Drawing.Size(48, 40);
			this.button4.TabIndex = 3;
			this.button4.Text = "4";
			this.button4.Click += new System.EventHandler(this.enviar);
			// 
			// button5
			// 
			this.button5.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
			this.button5.Location = new System.Drawing.Point(88, 264);
			this.button5.Name = "button5";
			this.button5.Size = new System.Drawing.Size(48, 40);
			this.button5.TabIndex = 4;
			this.button5.Text = "5";
			this.button5.Click += new System.EventHandler(this.enviar);
			// 
			// button6
			// 
			this.button6.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
			this.button6.Location = new System.Drawing.Point(136, 264);
			this.button6.Name = "button6";
			this.button6.Size = new System.Drawing.Size(48, 40);
			this.button6.TabIndex = 5;
			this.button6.Text = "6";
			this.button6.Click += new System.EventHandler(this.enviar);
			// 
			// button7
			// 
			this.button7.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
			this.button7.Location = new System.Drawing.Point(40, 304);
			this.button7.Name = "button7";
			this.button7.Size = new System.Drawing.Size(48, 40);
			this.button7.TabIndex = 6;
			this.button7.Text = "7";
			this.button7.Click += new System.EventHandler(this.enviar);
			// 
			// button8
			// 
			this.button8.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
			this.button8.Location = new System.Drawing.Point(88, 304);
			this.button8.Name = "button8";
			this.button8.Size = new System.Drawing.Size(48, 40);
			this.button8.TabIndex = 7;
			this.button8.Text = "8";
			this.button8.Click += new System.EventHandler(this.enviar);
			// 
			// button9
			// 
			this.button9.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
			this.button9.Location = new System.Drawing.Point(136, 304);
			this.button9.Name = "button9";
			this.button9.Size = new System.Drawing.Size(48, 40);
			this.button9.TabIndex = 8;
			this.button9.Text = "9";
			this.button9.Click += new System.EventHandler(this.enviar);
			// 
			// buttonAsterisco
			// 
			this.buttonAsterisco.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
			this.buttonAsterisco.Location = new System.Drawing.Point(40, 344);
			this.buttonAsterisco.Name = "buttonAsterisco";
			this.buttonAsterisco.Size = new System.Drawing.Size(48, 40);
			this.buttonAsterisco.TabIndex = 9;
			this.buttonAsterisco.Text = "*";
			this.buttonAsterisco.Click += new System.EventHandler(this.enviar);
			// 
			// button0
			// 
			this.button0.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
			this.button0.Location = new System.Drawing.Point(88, 344);
			this.button0.Name = "button0";
			this.button0.Size = new System.Drawing.Size(48, 40);
			this.button0.TabIndex = 10;
			this.button0.Text = "0";
			this.button0.Click += new System.EventHandler(this.enviar);
			// 
			// buttonAlmohadilla
			// 
			this.buttonAlmohadilla.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
			this.buttonAlmohadilla.Location = new System.Drawing.Point(136, 344);
			this.buttonAlmohadilla.Name = "buttonAlmohadilla";
			this.buttonAlmohadilla.Size = new System.Drawing.Size(48, 40);
			this.buttonAlmohadilla.TabIndex = 11;
			this.buttonAlmohadilla.Text = "#";
			this.buttonAlmohadilla.Click += new System.EventHandler(this.enviar);
			// 
			// buttonConfirmar
			// 
			this.buttonConfirmar.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
			this.buttonConfirmar.ForeColor = System.Drawing.Color.Lime;
			this.buttonConfirmar.Location = new System.Drawing.Point(208, 224);
			this.buttonConfirmar.Name = "buttonConfirmar";
			this.buttonConfirmar.Size = new System.Drawing.Size(128, 40);
			this.buttonConfirmar.TabIndex = 12;
			this.buttonConfirmar.Text = "Confirmar";
			this.buttonConfirmar.Click += new System.EventHandler(this.enviar);
			// 
			// buttoCorregir
			// 
			this.buttoCorregir.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
			this.buttoCorregir.ForeColor = System.Drawing.Color.Yellow;
			this.buttoCorregir.Location = new System.Drawing.Point(208, 264);
			this.buttoCorregir.Name = "buttoCorregir";
			this.buttoCorregir.Size = new System.Drawing.Size(128, 40);
			this.buttoCorregir.TabIndex = 13;
			this.buttoCorregir.Text = "Corregir";
			this.buttoCorregir.Click += new System.EventHandler(this.enviar);
			// 
			// buttoCancelar
			// 
			this.buttoCancelar.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
			this.buttoCancelar.ForeColor = System.Drawing.Color.Red;
			this.buttoCancelar.Location = new System.Drawing.Point(208, 304);
			this.buttoCancelar.Name = "buttoCancelar";
			this.buttoCancelar.Size = new System.Drawing.Size(128, 40);
			this.buttoCancelar.TabIndex = 14;
			this.buttoCancelar.Text = "Cancelar";
			this.buttoCancelar.Click += new System.EventHandler(this.enviar);
			// 
			// tbPantalla
			// 
			this.tbPantalla.BackColor = System.Drawing.Color.Black;
			this.tbPantalla.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
			this.tbPantalla.ForeColor = System.Drawing.Color.Lime;
			this.tbPantalla.Location = new System.Drawing.Point(8, 8);
			this.tbPantalla.Multiline = true;
			this.tbPantalla.Name = "tbPantalla";
			this.tbPantalla.Size = new System.Drawing.Size(376, 208);
			this.tbPantalla.TabIndex = 15;
			this.tbPantalla.Text = "";
			// 
			// Teclado
			// 
			this.Controls.Add(this.tbPantalla);
			this.Controls.Add(this.buttoCancelar);
			this.Controls.Add(this.buttoCorregir);
			this.Controls.Add(this.buttonConfirmar);
			this.Controls.Add(this.buttonAlmohadilla);
			this.Controls.Add(this.button0);
			this.Controls.Add(this.buttonAsterisco);
			this.Controls.Add(this.button9);
			this.Controls.Add(this.button8);
			this.Controls.Add(this.button7);
			this.Controls.Add(this.button6);
			this.Controls.Add(this.button5);
			this.Controls.Add(this.button4);
			this.Controls.Add(this.button3);
			this.Controls.Add(this.button2);
			this.Controls.Add(this.button1);
			this.Name = "Teclado";
			this.Size = new System.Drawing.Size(392, 392);
			this.ResumeLayout(false);

		}
		#endregion

		private void enviar(object sender, System.EventArgs e)
		{
			Button boton=(Button) sender;
			mSoporte.recibirPulsacion(boton.Text);
		}

		public void mostrar(String texto) 
		{
			this.tbPantalla.Text=texto;
		}
	}
}
