Source file: /~heha/messtech/motor.zip/SRC/STEPDLG.PAS

unit StepDlg;
{Bereich-Abschreitungs-Dialog (ein Mini-Dialog!)}
interface

uses WinProcs,WinTypes,OWindows,ODialogs,
 smsh,smsp,mpk3d;

const
 ID_Proceed=101;
 ID_Timer=ID_StepDlg;

type
 PStepDlg=^TStepDlg;
 TStepDlg=object(TDialog)
  Timer: THandle;
  procedure SetupWindow; virtual;
  procedure IDProceed(var Msg:TMessage); virtual ID_First+ID_Proceed;
  procedure WMTimer(var Msg:TMessage); virtual WM_First+WM_Timer;
  procedure WMMovEnd(var Msg:TMessage); virtual WM_First+WM_MovEnd;
  destructor Done; virtual;
 end;

implementation

procedure TStepDlg.SetupWindow;
 begin
  inherited SetupWindow;
  Timer:=0;
  InformDlg:=HWindow;	{R├╝ckinformation}
  SendMessage(Parent^.HWindow,WM_Proceed,1,0);	{Initialisieren}
 end;

{"Weiter"-Taste gedr├╝ckt; sie bricht ggf. die Wartezeit ab!}
procedure TStepDlg.IDProceed(var Msg:TMessage);
 begin
  WMTimer(Msg);
 end;

procedure TStepDlg.WMTimer(var Msg:TMessage);
 begin
  if Timer<>0 then begin
   KillTimer(HWindow,ID_Timer);
   Timer:=0;	{ist nicht! automatisch gekillt}
  end;
  if SendMessage(Parent^.HWindow,WM_Proceed,0,0)=0
{  if DlgResult=0} then EndDlg(0);	{Ende und alles fertig!}
 end;

procedure TStepDlg.WMMovEnd(var Msg:TMessage);
 begin
  if BereichWarteCheck then	{Stillstandszeit starten}
   Timer:=SetTimer(HWindow,ID_Timer,BereichWarte,nil);
 end;

destructor TStepDlg.Done;
 begin
  if Timer<>0 then KillTimer(Timer,ID_Timer);
  InformDlg:=0;
  inherited Done;
 end;

end.
Detected encoding: OEM (CP437)1
Wrong umlauts? - Assume file is ANSI (CP1252) encoded