unit uestoque;

interface

uses
  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  Db, Grids, DBGrids, Qrctrls, QuickRpt, ExtCtrls, Buttons, ToolWin,
  ComCtrls;

type

THackDBGrid = class(TDBGrid);

  Tfestoque = class(TForm)
    DBGrid1: TDBGrid;
    DataSource1: TDataSource;
    ToolBar1: TToolBar;
    SpeedButton1: TSpeedButton;
    QuickRep1: TQuickRep;
    QRBand1: TQRBand;
    QRLabel1: TQRLabel;
    QRLabel2: TQRLabel;
    QRLabel3: TQRLabel;
    QRLabel4: TQRLabel;
    QRLabel5: TQRLabel;
    QRLabel6: TQRLabel;
    QRBand2: TQRBand;
    QRDBText1: TQRDBText;
    QRDBText2: TQRDBText;
    QRDBText3: TQRDBText;
    QRDBText4: TQRDBText;
    QRDBText5: TQRDBText;
    StatusBar1: TStatusBar;
    QuickRep2: TQuickRep;
    QRBand3: TQRBand;
    QRLabel7: TQRLabel;
    QRLabel8: TQRLabel;
    QRLabel9: TQRLabel;
    QRLabel10: TQRLabel;
    QRLabel11: TQRLabel;
    QRLabel12: TQRLabel;
    QRBand4: TQRBand;
    QRDBText6: TQRDBText;
    QRDBText7: TQRDBText;
    QRDBText8: TQRDBText;
    QRDBText9: TQRDBText;
    QRDBText10: TQRDBText;
    ChildBand1: TQRChildBand;
    ChildBand2: TQRChildBand;
    procedure SpeedButton1Click(Sender: TObject);
    procedure FormClose(Sender: TObject; var Action: TCloseAction);
    procedure FormActivate(Sender: TObject);
    procedure FormCreate(Sender: TObject);
    procedure FormKeyDown(Sender: TObject; var Key: Word;
      Shift: TShiftState);
  private
   procedure AppHint(Sender : TObject);
    { Private declarations }
  public
    { Public declarations }
  end;

var
  festoque: Tfestoque;

implementation

uses UnitMenu, udm;



procedure tfestoque.AppHint(Sender: TObject);
begin
  StatusBar1.Panels[0].Text := Application.Hint;
end;

{$R *.DFM}

procedure Tfestoque.SpeedButton1Click(Sender: TObject);
begin
        if fmenu.controle = 'estoque' then
        quickrep1.preview
        else
        quickrep2.preview;

end;

procedure Tfestoque.FormClose(Sender: TObject; var Action: TCloseAction);
begin



	        Application.OnHint := nil;
        fdm.query1.close;
end;

procedure Tfestoque.FormActivate(Sender: TObject);
begin
//THackDBGrid(DBGrid1).FixedCols := 6;
end;

procedure Tfestoque.FormCreate(Sender: TObject);
begin
        Application.OnHint := AppHint;
end;

procedure Tfestoque.FormKeyDown(Sender: TObject; var Key: Word;
  Shift: TShiftState);
var
  Comp: Trichedit; // * variável Comp da classe TMemo
  texto : string;
begin

  if key = vk_f1 then begin

  Comp := Trichedit.Create (Self);  // * cria o componente Memo
  Comp.Parent := Self;    // * exibe o componente criado

  if fileexists (extractfilepath(paramstr(0)) + '\ajuda\ajudaèstoque.txt') then
   comp.lines.loadfromfile (extractfilepath(paramstr(0)) + '\ajuda\ajudaestoque.txt');

  texto := comp.Text;
  comp.Destroy;

  Showmessage (texto);
  end;


end;

end.
