Recent

Author Topic: Can not add my icon to IDE menu item or Editor Toolbar  (Read 253 times)

avra

  • Hero Member
  • *****
  • Posts: 1685
    • Additional info
Can not add my icon to IDE menu item or Editor Toolbar
« on: July 06, 2019, 10:37:38 am »
I have tried to create some missing icons to Editor Toolbar. Analyzing Lazarus source, it looks like Editor Toolbar uses same icons as IDE menu items, so I tried to add an icon to item that was missing it. Following example explains my try to add icon to 'Procedure List' menu item.

Searching through the IDE sources I have found that item in lazarusidestrconsts.pas is defined as
Code: Pascal  [Select]
  1.   lisMenuProcedureList = 'Procedure List ...';

which lead me to TMainIDEBase.SetupSearchMenu in mainbase.pas:
Code: Pascal  [Select]
  1.     CreateMenuItem(ParentMI, itmSearchProcedureList, 'itmSearchProcedureList', lisMenuProcedureList);

After further analysis I though that changing that line to
Code: Pascal  [Select]
  1.     CreateMenuItem(ParentMI, itmSearchProcedureList, 'itmSearchProcedureList', lisMenuProcedureList, 'menu_search_procedure_list');

and then adding appropriate sized PNG icons to \lazarus\images\menu directory:
Quote
menu_search_procedure_list.png
menu_search_procedure_list_150.png
menu_search_procedure_list_200.png

and rebuilding IDE would be enough. Unfortunately it is not. What am I missing?
ct2laz - Conversion between Lazarus and CodeTyphon
bithelpers - Bit manipulation for standard types
pasettimino - Siemens S7 PLC lib

Ally

  • New member
  • *
  • Posts: 5
Re: Can not add my icon to IDE menu item or Editor Toolbar
« Reply #1 on: July 06, 2019, 12:39:38 pm »
Hello,

First you have to enter your icons in the file \ images \ laz_images_list.txt.
Then use laz_images.bat to recreate the laz_images.res file.
Then compile Lazarus.
The icons are now available in Lazarus.exe.
Unfortunately I can not answer how they are assigned to a menu item.

Greeting Roland

PS: Translated with Google Translator