perdon!
Este es el codigo que se me olvidaba. si necesitas que te ponga toda la unit dimelo que te lo pongo si esto no es suficiente.
constructor cAscensor.Crear(NumPlantas, PlantaActual, PlantaDestino: Integer; Grid: tStringGrid);
begin
inherited Create;
self.NumPlantas := NumPlantas;
self.PlantaActual := PlantaActual;
self.PlantaDestino := PlantaDestino ;
PanelInterno := cPanelInterno.Create ((self as cSujeto), Grid, NumPlantas);
PanelInterno.parent := Grid;
PanelInterno.BoundsRect := Grid.CellRect (0,NumPlantas - PlantaActual);
PanelInterno.SetPisoSelected (NumPlantas - PlantaActual);
self.Grid := Grid;
Timer := tTimer.Create (Grid);
Timer.Enabled := False;
Timer.OnTimer := Llamar(PlantaDestino);
Timer.Interval := 1000;
end;
procedure cAscensor.Llamar(Destino: Integer);
begin
If Destino <> PlantaActual then
begin
RegistrarInicioAscensor;
RegistrarInicioPlanta (Destino);
PlantaDestino := Destino;
end;
end;
|