unit p_searsh;

interface

uses
  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  ExtCtrls, StdCtrls, Buttons, VrControls, VrLeds, VrScanner, Menus, Grids,
  DBGrids, rsdbgrid, IvDictio, IvMulti, RzButton;

type
  Tf_searsh = class(TForm)
    Timer1: TTimer;
    Timer2: TTimer;
    VrScanner1: TVrScanner;
    Panel1: TPanel;
    Label1: TLabel;
    Edit1: TEdit;
    Panel2: TPanel;
    Image1: TImage;
    PopupMenu1: TPopupMenu;
    ghjhgj1: TMenuItem;
    jhgj1: TMenuItem;
    jhgjhg1: TMenuItem;
    hgjhg1: TMenuItem;
    jhgj2: TMenuItem;
    rsDBGrid1: TrsDBGrid;
    IvTranslator1: TIvTranslator;
    procedure Timer1Timer(Sender: TObject);
    procedure Timer2Timer(Sender: TObject);
    procedure Edit1KeyPress(Sender: TObject; var Key: Char);
    procedure FormKeyPress(Sender: TObject; var Key: Char);
    procedure FormCloseQuery(Sender: TObject; var CanClose: Boolean);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  f_searsh: Tf_searsh;

implementation

uses p_posmodule;



{$R *.DFM}

procedure Tf_searsh.Timer1Timer(Sender: TObject);
var x,y:integer;
begin
 with Canvas do
  begin

      // Get a random pen color draw a line using that color
      x:=random(ClientWidth);
      y:=Random(ClientHeight-400);
      Pen.Color := RGB(Random(256),Random(256), Random(256));
      MoveTo(x,y );
      LineTo(x+2, y);
   end;
end;

procedure Tf_searsh.Timer2Timer(Sender: TObject);
var x,y:integer;
begin
 with Canvas do
  begin

      // Get a random pen color draw a line using that color
      x:=random(ClientWidth);
      y:=Random(ClientHeight-400);
      Pen.Color := RGB(0,0,0);
      MoveTo(x,y );
      LineTo(x+5, y);
   end;
end;

procedure Tf_searsh.Edit1KeyPress(Sender: TObject; var Key: Char);

var i,j:integer;x:real;
begin
if key=#13 then
begin
posmodule.stock.close;
posmodule.stock.ParamByName('myitem').asstring:=trim(edit1.text);
posmodule.stock.open;

edit1.Text:='';
end;

end;

procedure Tf_searsh.FormKeyPress(Sender: TObject; var Key: Char);
begin
if key=#27 then
f_searsh.ModalResult:=mrok;
end;

procedure Tf_searsh.FormCloseQuery(Sender: TObject; var CanClose: Boolean);
begin

timer1.Enabled:=false;
timer2.Enabled:=false;
timer1.free;
timer2.free;
VrScanner1.free;
end;

end.
