Lazarus

Using the Lazarus IDE => General => Topic started by: AlexTP on April 17, 2021, 09:21:35 pm

Title: TCustomForm.Show and .Hide are not virtual
Post by: AlexTP on April 17, 2021, 09:21:35 pm
Subj. So, my custom form class, which inherites from another my own class, cannot declare "Show; override" and call 'inherited Show'? It's bad.
Title: Re: TCustomForm.Show and .Hide are not virtual
Post by: wp on April 17, 2021, 10:00:03 pm
But SetVisible is virtual.
Title: Re: TCustomForm.Show and .Hide are not virtual
Post by: lucamar on April 17, 2021, 11:46:34 pm
Subj. So, my custom form class, which inherites from another my own class, cannot declare "Show; override" and call 'inherited Show'? It's bad.

Could be worse: DoShow, which implements Show, is virtual, though protected. :)
Title: Re: TCustomForm.Show and .Hide are not virtual
Post by: AlexTP on April 18, 2021, 08:48:12 am
OK, if it is Delphi compatible, let it be. Will use DoShow.
Title: Re: TCustomForm.Show and .Hide are not virtual
Post by: Remy Lebeau on April 19, 2021, 06:52:37 pm
Subj. So, my custom form class, which inherites from another my own class, cannot declare "Show; override" and call 'inherited Show'? It's bad.

What is it you are actually trying to accomplish?  There are ways to detect when the Form's window actually changes visibility, rather than when it is requested to change.
Title: Re: TCustomForm.Show and .Hide are not virtual
Post by: AlexTP on April 19, 2021, 10:14:34 pm
I needed the OnShow reaction in the base Frame, and needed 2nd reaction in child of that Frame (2nd reaction must call inherited one).
TinyPortal © 2005-2018