I have a file menu to which I add newly opened filenames
And the Onclick method (e.g openfile) assigned to the TmenuItem, can then open the file
I can then extract the filename from this in the method
But I also want to make direct calls to this Method.
I have always done this by creating a temporary 'object' to pass as 'Sender', e.g to save testing a TMenuItem.
Is there a neater way?
Steve [The sane]: Delphi a feersum engin indeed.
And the Onclick method (e.g openfile) assigned to the TmenuItem, can then open the file
Code:
Submenu.Onclick := OpenFile;
Submenu.caption := Filename;
I can then extract the filename from this in the method
Code:
procedure OpenFile(Sender: Tobject);
FName: TFilename;
begin
FName := (Sender As TMenuItem).Caption;
etc..
end;
But I also want to make direct calls to this Method.
I have always done this by creating a temporary 'object' to pass as 'Sender', e.g to save testing a TMenuItem.
Is there a neater way?
Steve [The sane]: Delphi a feersum engin indeed.