Recent

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

Alextp

  • Hero Member
  • *****
  • Posts: 1284
    • 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: 8401
Re: TCustomForm.Show and .Hide are not virtual
« Reply #1 on: April 17, 2021, 10:00:03 pm »
But SetVisible is virtual.
Mainly Lazarus trunk / fpc 3.2.0 / all 32-bit on Win-10, but many more...

lucamar

  • Hero Member
  • *****
  • Posts: 3880
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: 1284
    • 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: 918
    • 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: 1284
    • 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