package es.dalocar.facturamas.swt.components;

import com.cloudgarden.resource.SWTResourceManager;

import es.dalocar.facturamas.swt.SWTUtils;

import org.eclipse.swt.layout.FillLayout;
import org.eclipse.swt.layout.FormAttachment;
import org.eclipse.swt.layout.FormData;
import org.eclipse.swt.layout.FormLayout;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Combo;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.widgets.Text;
import org.eclipse.swt.graphics.Point;
import org.eclipse.swt.graphics.Rectangle;
import org.eclipse.swt.SWT;
import org.eclipse.swt.custom.CLabel;

/**
 * This code was edited or generated using CloudGarden's Jigloo SWT/Swing GUI
 * Builder, which is free for non-commercial use. If Jigloo is being used
 * commercially (ie, by a corporation, company or business for any purpose
 * whatever) then you should purchase a license for each developer using Jigloo.
 * Please visit www.cloudgarden.com for details. Use of Jigloo implies
 * acceptance of these licensing terms. A COMMERCIAL LICENSE HAS NOT BEEN
 * PURCHASED FOR THIS MACHINE, SO JIGLOO OR THIS CODE CANNOT BE USED LEGALLY FOR
 * ANY CORPORATE OR COMMERCIAL PURPOSE.
 */
public class FacturaSearchComposite extends org.eclipse.swt.widgets.Composite {

	private Button btnBuscar;
	private Label lblEstado;
	private Combo cmbCliente;
	private Label lblRelleno3;
	private Label lblRelleno2;
	private Label lblRelleno1;
	private Label lblNumero;
	private Text txtNumFactura;
	private Label Cliente;
	private CLabel lblAnyo;
	private Text txtAnyo;
	private Combo cmbEstado;

	/**
	 * Overriding checkSubclass allows this class to extend
	 * org.eclipse.swt.widgets.Composite
	 */
	protected void checkSubclass() {
	}

	/**
	 * @return the btnBuscar
	 */
	public Button getBtnBuscar() {
		return btnBuscar;
	}

	

	/**
	 * @return the cmbCliente
	 */
	public Combo getCmbCliente() {
		return cmbCliente;
	}

	

	/**
	 * @return the txtNumFactura
	 */
	public Text getTxtNumFactura() {
		return txtNumFactura;
	}

	

	/**
	 * @return the txtAnyo
	 */
	public Text getTxtAnyo() {
		return txtAnyo;
	}

	
	/**
	 * @return the cmbEstado
	 */
	public Combo getCmbEstado() {
		return cmbEstado;
	}

	
	public FacturaSearchComposite(org.eclipse.swt.widgets.Composite parent, int style) {
		super(parent, style);

		GridLayout thisLayout = new GridLayout();
		thisLayout.numColumns = 4;
		thisLayout.marginRight = 10;
		thisLayout.verticalSpacing = 10;
		thisLayout.horizontalSpacing = 10;
		this.setLayout(thisLayout);
		{
			lblNumero = new Label(this, SWT.NONE);
			lblNumero.setText("Nš Factura:");
			lblNumero.setFont(SWTResourceManager.getFont("Arial", 14, 0, false,
					false));
		}
		{
			txtNumFactura = new Text(this, SWT.BORDER);
			txtNumFactura.setFont(SWTResourceManager.getFont("Arial", 14, 0,
					false, false));
			txtNumFactura.setOrientation(SWT.HORIZONTAL);
			GridData txtNumFacturaLData = new GridData();
			txtNumFacturaLData.widthHint = 126;
			txtNumFacturaLData.heightHint = 22;
			txtNumFactura.setLayoutData(txtNumFacturaLData);
		}
		{
			Cliente = new Label(this, SWT.NONE);
			Cliente.setText("Cliente:");
			Cliente.setFont(SWTResourceManager.getFont("Arial", 14, 0, false,
					false));
		}
		{
			cmbCliente = new Combo(this, SWT.BORDER);
			cmbCliente.setFont(com.swtdesigner.SWTResourceManager.getFont("Arial", 12, SWT.NORMAL));
			GridData cmbClienteLData = new GridData();
			cmbClienteLData.widthHint = 281;
			cmbClienteLData.heightHint = 30;
			cmbCliente.setLayoutData(cmbClienteLData);
			cmbCliente.setVisibleItemCount(10);
		}
		{
			lblAnyo = new CLabel(this, SWT.NONE);
			lblAnyo.setFont(SWTResourceManager.getFont("Arial", 14, 0, false,
					false));
			lblAnyo.setText("Aņo Factura:");
		}
		{
			txtAnyo = new Text(this, SWT.BORDER);
			txtAnyo.setFont(SWTResourceManager.getFont("Arial", 14, 0, false,
					false));
			GridData txtAnyoLData = new GridData();
			txtAnyoLData.widthHint = 126;
			txtAnyoLData.heightHint = 22;
			txtAnyo.setLayoutData(txtAnyoLData);
		}
		{
			lblEstado = new Label(this, SWT.NONE);
			lblEstado.setText("Estado:");
			lblEstado.setFont(SWTResourceManager.getFont("Arial", 14, 0, false,
					false));
		}
		{
			cmbEstado = new Combo(this, SWT.NONE);
			cmbEstado.setFont(SWTResourceManager.getFont("Arial", 14, 0, false,
					false));
			GridData cmbEstadoLData = new GridData();
			cmbEstadoLData.widthHint = 145;
			cmbEstadoLData.heightHint = 30;
			cmbEstado.setLayoutData(cmbEstadoLData);
		}
		{
			lblRelleno1 = new Label(this, SWT.NONE);
		}
		{
			lblRelleno2 = new Label(this, SWT.NONE);
			GridData label1LData = new GridData();
			label1LData.widthHint = 60;
			label1LData.heightHint = 40;
			lblRelleno2.setLayoutData(label1LData);
		}
		{
			lblRelleno3 = new Label(this, SWT.NONE);
			GridData label2LData = new GridData();
			label2LData.widthHint = 60;
			label2LData.heightHint = 40;
			lblRelleno3.setLayoutData(label2LData);
		}
		{
			btnBuscar = new Button(this, SWT.PUSH | SWT.CENTER);
			btnBuscar.setText("Buscar");
			GridData btnBuscarLData = new GridData();
			btnBuscarLData.horizontalAlignment = GridData.END;
			btnBuscar.setLayoutData(btnBuscarLData);
			btnBuscar.setFont(SWTResourceManager.getFont("Arial", 14, 0, false,
					false));
		}
		this.layout();

	}

	/**
	 * Metodo que abre deja el nuevo composite en el bucle de espera de eventos
	 */
	public void open() {
		final Display display = Display.getCurrent();
		Shell shell = this.getShell();
		Point size = this.getSize();
		shell.setLayout(new FillLayout());
		shell.layout();
		if (size.x == 0 && size.y == 0) {
			this.pack();
			shell.pack();
		} else {
			Rectangle shellBounds = shell.computeTrim(0, 0, size.x, size.y);
			shell.setSize(shellBounds.width, shellBounds.height);
		}
		SWTUtils.openCentered(shell);
	}

}
