MainUnit.pas 770 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. {
  2. This is the MainForm of the LCL application.
  3. Once it is shown, it automatically opens the fresnel form.
  4. }
  5. unit MainUnit;
  6. {$mode objfpc}{$H+}
  7. interface
  8. uses
  9. Classes, SysUtils, Forms, Controls, Graphics, Dialogs, FreBtnForm;
  10. type
  11. { TMainForm }
  12. TMainForm = class(TForm)
  13. procedure FormPaint(Sender: TObject);
  14. private
  15. FQueued: boolean;
  16. procedure ShowFresnelForm({%H-}Data: PtrInt);
  17. public
  18. end;
  19. var
  20. MainForm: TMainForm;
  21. implementation
  22. {$R *.lfm}
  23. { TMainForm }
  24. procedure TMainForm.FormPaint(Sender: TObject);
  25. begin
  26. if FQueued then exit;
  27. FQueued:=true;
  28. Application.QueueAsyncCall(@ShowFresnelForm,0)
  29. end;
  30. procedure TMainForm.ShowFresnelForm(Data: PtrInt);
  31. begin
  32. FresnelButtonForm:=TFresnelButtonForm.Create(Self);
  33. end;
  34. end.