unit antmovin;

interface

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

type
  TFormaAnteriorMovInv = class(TForm)
    Shape1: TShape;
    Panel1: TPanel;
    Bevel9: TBevel;
    Bevel10: TBevel;
    Bevel11: TBevel;
    Label9: TLabel;
    Panel2: TPanel;
    Label1: TLabel;
    procedure FormActivate(Sender: TObject);
    procedure Panel1MouseDown(Sender: TObject; Button: TMouseButton;
      Shift: TShiftState; X, Y: Integer);
    procedure Panel1Click(Sender: TObject);
    procedure Panel2Click(Sender: TObject);
    procedure Label9MouseDown(Sender: TObject; Button: TMouseButton;
      Shift: TShiftState; X, Y: Integer);
    procedure Label9Click(Sender: TObject);
    procedure FormPaint(Sender: TObject);
    procedure FormClose(Sender: TObject; var Action: TCloseAction);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  FormaAnteriorMovInv: TFormaAnteriorMovInv;

implementation

uses movinv;

{$R *.DFM}

procedure actualizacoordenadas;
begin
with FormaAnteriorMovInv do
begin
FormaMovimientosInventario.Top:=FormaAnteriorMovInv.Top+23;
FormaMovimientosInventario.Left:=FormaAnteriorMovInv.Left+7;
FormaMovimientosInventario.Width:=FormaAnteriorMovInv.Width-14;
FormaMovimientosInventario.Height:=FormaAnteriorMovInv.Height-Panel1.Height-10;
end;
end;

procedure ponecoordenadas;
begin
with FormaAnteriorMovInv do
begin
FormaMovimientosInventario.Top:=FormaAnteriorMovInv.Top+23;
FormaMovimientosInventario.Left:=FormaAnteriorMovInv.Left+7;
end;
end;

procedure poneforma;
begin
with FormaAnteriorMovInv do
begin
ponecoordenadas;
FormaMovimientosInventario.Visible:=True;
FormaMovimientosInventario.Show;
Tag:=Tag+1; if tag>3 then Tag:=3;
end;
end;

{******************************}

procedure TFormaAnteriorMovInv.FormActivate(Sender: TObject);
begin
{*******va en Activa*******}
if Tag<2 then
begin
actualizacoordenadas;
poneforma;
end;
end;

procedure TFormaAnteriorMovInv.Panel1MouseDown(Sender: TObject;
  Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
begin
{*******va en el Click del panel*******}
FormaMovimientosInventario.Visible:=False;
ReleaseCapture;
SendMessage(FormaAnteriorMovInv.Handle, WM_SYSCOMMAND, $F012, 0);
poneforma;
{**********************}
end;

procedure TFormaAnteriorMovInv.Panel1Click(Sender: TObject);
begin
poneforma;
end;

procedure TFormaAnteriorMovInv.Panel2Click(Sender: TObject);
begin
{******panel que simula el boton cerrar*****}
Tag:=0;
FormaMovimientosInventario.Close;
Close;
{************************************}
end;

procedure TFormaAnteriorMovInv.Label9MouseDown(Sender: TObject;
  Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
begin
FormaMovimientosInventario.Visible:=False;
ReleaseCapture;
SendMessage(FormaAnteriorMovInv.Handle, WM_SYSCOMMAND, $F012, 0);
poneforma;
end;

procedure TFormaAnteriorMovInv.Label9Click(Sender: TObject);
begin
poneforma;
end;

procedure TFormaAnteriorMovInv.FormPaint(Sender: TObject);
begin
if FormaMovimientosInventario.BotonSalir.Tag=1000 then
begin
Close;
Tag:=0;
FormaMovimientosInventario.BotonSalir.Tag:=0;
end;
end;
procedure TFormaAnteriorMovInv.FormClose(Sender: TObject;
  var Action: TCloseAction);
begin
FormaMovimientosInventario.BotonSalir.Tag:=0;
Tag:=0;
end;

end.
