Recent

Author Topic: TCustomForm.Show and .Hide are not virtual  (Read 1187 times)

AlexTP

  • Hero Member
  • *****
  • Posts: 2386
    • UVviewsoft
TCustomForm.Show and .Hide are not virtual
« 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.

wp

  • Hero Member
  • *****
  • Posts: 11855
Re: TCustomForm.Show and .Hide are not virtual
« Reply #1 on: April 17, 2021, 10:00:03 pm »
But SetVisible is virtual.

lucamar

  • Hero Member
  • *****
  • Posts: 4219
Re: TCustomForm.Show and .Hide are not virtual
« Reply #2 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. :)
Turbo Pascal 3 CP/M - Amstrad PCW 8256 (512 KB !!!) :P
Lazarus/FPC 2.0.8/3.0.4 & 2.0.12/3.2.0 - 32/64 bits on:
(K|L|X)Ubuntu 12..18, Windows XP, 7, 10 and various DOSes.

AlexTP

  • Hero Member
  • *****
  • Posts: 2386
    • UVviewsoft
Re: TCustomForm.Show and .Hide are not virtual
« Reply #3 on: April 18, 2021, 08:48:12 am »
OK, if it is Delphi compatible, let it be. Will use DoShow.

Remy Lebeau

  • Hero Member
  • *****
  • Posts: 1312
    • Lebeau Software
Re: TCustomForm.Show and .Hide are not virtual
« Reply #4 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.
Remy Lebeau
Lebeau Software - Owner, Developer
Internet Direct (Indy) - Admin, Developer (Support forum)

AlexTP

  • Hero Member
  • *****
  • Posts: 2386
    • UVviewsoft
Re: TCustomForm.Show and .Hide are not virtual
« Reply #5 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