Re: Inherited explained
- From: "Rudy Velthuis" <newsgroups@xxxxxxxxxxxx>
- Date: Wed, 22 Oct 2008 13:18:59 +0200
Rob Kennedy wrote:
Rudy Velthuis wrote:
Anonymous wrote:upper right hand corner of program interface >> ...do what
procedure WMSysCommand(var Msg: TWMSysCommand); message
WM_SYSCOMMAND;
procedure TForm1.WMSysCommand;
begin
if (Msg.CmdType = SC_CLOSE) then begin // X button clicked in
needs to be done >> end
otherwise doneelse
inherited; //inherited means to do what you would have
end;
"inherited;" on its own means here: call WMSysCommand(Msg) in the
ancestor class, but only if there is such a method in that class.
Otherwise, ignore the call.
In this case, it doesn't necessarily mean to call WMSysCommand.
Rather, it means to call the next-less-derived method that's also
marked with "message wm_SysCommand."
That is true for message handlers indeed. Not the name is searched, but
the same slot in the dynamic method table. But we can generally assume
it will also be called WMSysCommand, if people followed the tradition.
<g>
--
Rudy Velthuis http://rvelthuis.de
"RAM /abr./: Rarely Adequate Memory." -- From the Jargon File
.
- References:
- Inherited explained
- From: Anonymous
- Re: Inherited explained
- From: Rudy Velthuis
- Re: Inherited explained
- From: Rob Kennedy
- Inherited explained
- Prev by Date: Re: Delphi language support in CMake build system
- Next by Date: Re: Filername ?
- Previous by thread: Re: Inherited explained
- Index(es):