unit urecibo;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls, ExtCtrls, Buttons, QuickRpt, QRCtrls, ActnList;

type
  Tfrecibo = class(TForm)
    ScrollBox1: TScrollBox;
    LabeledEdit1: TLabeledEdit;
    LabeledEdit2: TLabeledEdit;
    LabeledEdit3: TLabeledEdit;
    LabeledEdit4: TLabeledEdit;
    Label1: TLabel;
    Memo1: TMemo;
    Label2: TLabel;
    Memo2: TMemo;
    LabeledEdit5: TLabeledEdit;
    LabeledEdit6: TLabeledEdit;
    LabeledEdit7: TLabeledEdit;
    LabeledEdit8: TLabeledEdit;
    LabeledEdit9: TLabeledEdit;
    Label3: TLabel;
    Label4: TLabel;
    QuickRep1: TQuickRep;
    QRBand1: TQRBand;
    QRLabel1: TQRLabel;
    lnrecibo: TQRLabel;
    lvalor: TQRLabel;
    lrecebi: TQRLabel;
    Limportancia: TQRLabel;
    lreferente: TQRLabel;
    lcidade: TQRLabel;
    lemitente: TQRLabel;
    lendereco1: TQRLabel;
    lassinatura: TQRLabel;
    SpeedButton1: TSpeedButton;
    lendereco: TQRLabel;
    QRShape1: TQRShape;
    QRShape2: TQRShape;
    QRShape3: TQRShape;
    QRShape4: TQRShape;
    QRShape5: TQRShape;
    QRShape6: TQRShape;
    QRShape7: TQRShape;
    QRShape8: TQRShape;
    QRShape9: TQRShape;
    QRShape10: TQRShape;
    QRShape11: TQRShape;
    QRShape12: TQRShape;
    QRShape13: TQRShape;
    ActionList1: TActionList;
    ajuda: TAction;
    procedure LabeledEdit5Exit(Sender: TObject);
    procedure FormKeyPress(Sender: TObject; var Key: Char);
    procedure SpeedButton1Click(Sender: TObject);
    procedure LabeledEdit2Exit(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  frecibo: Tfrecibo;

implementation
 uses Extens;
{$R *.dfm}

procedure Tfrecibo.LabeledEdit5Exit(Sender: TObject);
begin
        LabeledEdit6.Text :=formatdatetime('dd',Date)+
        ' de ' + formatdatetime('mmmm',Date)+
        ' de ' + formatdatetime('yyyy',Date);
end;

procedure Tfrecibo.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;

procedure Tfrecibo.SpeedButton1Click(Sender: TObject);
begin
        Lnrecibo.Caption := 'Nş ' + LabeledEdit1.Text;
        Lvalor.Caption := 'VALOR R$ ' + LabeledEdit2.Text;
        LRECEBI.Caption := 'Recebi (emos) de: ' + LabeledEdit3.Text;
        Lendereco.Caption := 'Endereço: ' + LabeledEdit4.Text;
        Limportancia.Caption := 'A importância de: ' + memo1.Text;
        Lreferente.Caption := 'Referente ' + memo2.Text;
        LCidade.Caption := LabeledEdit5.Text + ', '+ LabeledEdit6.text;
        Lemitente.Caption := 'Emitente: ' + LabeledEdit7.Text + ' CPF/RG: ' + LabeledEdit8.Text;
        LEndereco1.Caption := 'Endereço: ' + LabeledEdit9.Text;
        Lassinatura.Caption := 'Assinatura ';
        quickrep1.Preview;
end;

procedure Tfrecibo.LabeledEdit2Exit(Sender: TObject);
begin
        Memo1.text := Extens.Extenso(strtofloat(labelededit2.Text));
         labelededit2.Text:= format('%n', [strtofloat(labelededit2.Text)]);
end;

end.
