[Lazarus] How to get access to TKeyCommandRelationList via the IDE Interfaces?

Graeme Geldenhuys mailinglists at geldenhuys.co.uk
Thu Feb 23 00:53:54 CET 2017


On 2017-02-22 23:45, Mattias Gaertner via Lazarus wrote:
> uses IDECommands;
> 
>   Cmd:=IDECommandList.FindCommandByName('name');
>   ExecuteIDECommand(Sender,Cmd.Command);

Umm, that's exactly what I tried, but in never finds the command.

The code is as follows:

===============================
  cmd := IDECommandList.FindCommandByName('jcfAbout');
  if Assigned(cmd) then
  begin
    writeln('PASS: We found the JCF About command');
    ExecuteIDECommand(self, cmd.Command);
  end
  else
    writeln('FAIL: Unable to find JCF About command');
===============================


I have the Jedi Code Formatter package installed, and the menus are
there in the IDE. I looked at the JCF package to see what the names are
of the commands it registers. Just as a test, I'm trying to get the JCF
About dialog to pop up, which was registered wit the 'jcfAbout' command
name.

But as I said, it never finds that command.

Oh, and the above code is only triggered when I save a unit - so at that
point the IDE is fully loaded.

Regards,
  Graeme

-- 
fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal
http://fpgui.sourceforge.net/

My public PGP key:  http://tinyurl.com/graeme-pgp


More information about the Lazarus mailing list