Wozu Globale form_Notify ?
Delphi-Quellcode:
Class Procedure NotifyWindow.CloseQuery(Sender: TObject; Var CanClose: Boolean);
Begin
Try
If OK_Pressed = True
Then CanClose := True
Else CanClose := False;
If boolean_Close = True Then CanClose := True;
Except
ErrorLog('uNotifyWindow: OnCloseQuery Failed');
Close_MainForm;
Exit;
End;
End;
Class Procedure NotifyWindow.KeyDown(Sender: TObject; Var Key: Word; Shift: TShiftstate);
Begin
Try
If OK_Pressed = True Then form_Notify.Close;
Except
ErrorLog('uNotifyWindow: OnKeyDown Failed');
Close_MainForm;
Exit;
End;
End;
Was meinst Du wer 'Sender' ist?
Richtig, deine Form!
Also mach z.B. aus
Delphi-Quellcode:
Procedure Close_MainForm;
Begin
Try
boolean_Close := True;
form_Notify.Close;
Except
Exit;
End;
End;
Delphi-Quellcode:
Procedure Close_MainForm(AForm : TForm);
Begin
Try
boolean_Close := True;
AForm.Close;
Except
Exit;
End;
End;
Class Procedure NotifyWindow.KeyDown(Sender: TObject; Var Key: Word; Shift: TShiftstate);
Begin
Try
If OK_Pressed = True Then TForm(Sender).Close;
Except
ErrorLog('uNotifyWindow: OnKeyDown Failed');
Close_MainForm(TForm(Sender));
Exit;
End;
End;
Und schon hat sich deine Globale Form erledigt..
und packe dann
in deine
Class Procedure Show(WindowTitle: String; WindowText: String);
als lokale Variable....