Recent

Author Topic: Change OnShow Event Signature  (Read 1427 times)

Weitentaaal

  • Sr. Member
  • ****
  • Posts: 339
  • Weitental is a very beautiful garbage depot.
Change OnShow Event Signature
« on: November 16, 2021, 02:22:52 pm »
Hello Guys,

Is it Possible to change this:

procedure TMyForm.FormCreate(Sender: TObject);

to this :

procedure TMyForm.FormCreate(Sender: TObject, CurrentController: TMyFormController);

Thanks in advance
Lazarus: 2.0.12 x86_64-win64-win32/win64
Compiler Version: 3.2.0

Bart

  • Hero Member
  • *****
  • Posts: 4602
    • Bart en Mariska's Webstek
Re: Change OnShow Event Signature
« Reply #1 on: November 16, 2021, 03:01:10 pm »
If you don't mind a crash at startup, then yes  O:-)

(You can chage the code manually and the IDE won't mind if teh signature is wrong when you load the project, but at runtime you're in for a nasty surpise.)

Of course you can extend your form with a new event and fire that in it's OnCreate (or override it's constructor to do it).

Bart

Weitentaaal

  • Sr. Member
  • ****
  • Posts: 339
  • Weitental is a very beautiful garbage depot.
Re: Change OnShow Event Signature
« Reply #2 on: November 16, 2021, 03:59:53 pm »
OK was just wondering  :)

Thank you !
Lazarus: 2.0.12 x86_64-win64-win32/win64
Compiler Version: 3.2.0

 

TinyPortal © 2005-2018