unit uimpcheque;

interface

uses
  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  StdCtrls, ExtCtrls, QuickRpt, Qrctrls, Spin;

type
  Tfimpcheque = class(TForm)
    Panel1: TPanel;
    Label1: TLabel;
    Label2: TLabel;
    Editvalor: TEdit;
    Editextenso: TEdit;
    Label3: TLabel;
    Editportador: TEdit;
    Button1: TButton;
    Quickimpcheque: TQuickRep;
    QRBand1: TQRBand;
    lvalor: TQRLabel;
    lextenso: TQRLabel;
    lportador: TQRLabel;
    Label4: TLabel;
    Editmunicipio: TEdit;
    Label5: TLabel;
    Editdia: TEdit;
    Label6: TLabel;
    Editmes: TEdit;
    Editano: TEdit;
    Label7: TLabel;
    lmunicipio: TQRLabel;
    ldia: TQRLabel;
    lmes: TQRLabel;
    lano: TQRLabel;
    procedure Button1Click(Sender: TObject);
    procedure EditvalorExit(Sender: TObject);
    procedure FormKeyPress(Sender: TObject; var Key: Char);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  fimpcheque: Tfimpcheque;

implementation
       uses Extens;
{$R *.DFM}

procedure Tfimpcheque.Button1Click(Sender: TObject);
begin
        lvalor.caption := editvalor.text;
        lextenso.caption := editextenso.text;
        lportador.caption := editportador.text;
        lmunicipio.caption := editmunicipio.text;
        ldia.caption := editdia.text;
        lmes.caption := editmes.text;
        lano.caption := editano.text;
        Quickimpcheque.preview;
end;

procedure Tfimpcheque.EditvalorExit(Sender: TObject);
begin
        editextenso.text := Extens.Extenso(strtofloat(editvalor.text));
        editdia.text := formatdatetime('dd', date);
        editmes.text := formatdatetime('mmmm', date);
        editano.text := formatdatetime('yyyy', date);
        editvalor.text := format('%n',[strtofloat(editvalor.text)]);

end;

procedure Tfimpcheque.FormKeyPress(Sender: TObject; var Key: Char);
begin
 if key=#13 then begin
   key:=#0;
     Perform(WM_nextdlgctl,0,0);

    end else

      if key=#27 then 
      Perform(WM_nextdlgctl,1,0);

end;

end.
