[Lazarus] How do I add the "View | Leaks and Traces" as button at the toolbar?

Balázs Székely getmem1 at gmail.com
Fri Sep 2 08:36:32 CEST 2016


Hi silvioprog,

Open unit $(LazarusDir)/components/leakview/heaptrcview.pas . Replace
Register procedure with:

procedure Register;
var
  IDEShortCutX: TIDEShortCut;
  IDECommandCategory: TIDECommandCategory;
  IDECommand: TIDECommand;
  IDEButtonCommand: TIDEButtonCommand;
begin
  RegisterIDEMenuCommand(itmViewMainWindows, 'mnuLeakView', rsLeakView,
nil, @IDEMenuClicked);

  IDEShortCutX := IDEShortCut(VK_UNKNOWN, [], VK_UNKNOWN, []);
  IDECommandCategory :=
IDECommandList.FindCategoryByName(CommandCategoryViewName);
  if IDECommandCategory <> nil then
  begin
    IDECommand := RegisterIDECommand(IDECommandCategory, rsLeakView,
rsLeakView, IDEShortCutX, nil, @IDEMenuClicked);
    if IDECommand <> nil then
      IDEButtonCommand := RegisterIDEButtonCommand(IDECommand);
  end;
end;

Alternatively you can apply the attached patch.

regards,
Balázs
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20160902/57901c6c/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: heaptrcview.patch
Type: application/octet-stream
Size: 1275 bytes
Desc: not available
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20160902/57901c6c/attachment.obj>


More information about the Lazarus mailing list