Sign in Join
Wiki copytemporary

How to add icons my package components: what changed

Revision 1 to 2. Removed lines have a minus sign; added lines have a plus sign.

OldNewLine
1-We have package "my_pkg" with components TComp1, TComp2 and want to add icons for components to IDE component pallete.
1+We have package "my_pkg" with components TComp1, TComp2 and want to add icons for components to IDE component pallete.
22
3-First we have to make .png 24x24 files: tcomp1.png, tcomp2.png. If you want to get them from Delphi package, you can use the free "XN Resource Editor" to export icons from .dcr files.
3+First we have to make .png 24x24 files: tcomp1.png, tcomp2.png. If you want to get them from Delphi package, you can use the free "XN Resource Editor" to export icons from .dcr files.
44
5-Now we need app "lazres". It's located in "tools" subfolder of IDE folder. Compile it under Windows: "c:\lazarus\tools\lazres.lpi" to lazres.exe. We use lazres.exe to create Lazarus resource file .lrs from .png files:
6-```
7-c:\lazarus\tools\lazres.exe my_icons.lrs *.png
8-```
5+Now we need app "lazres". It's located in "tools" subfolder of IDE folder. Compile it under Windows: "c:\lazarus\tools\lazres.lpi" to lazres.exe. We use lazres.exe to create Lazarus resource file .lrs from .png files:
96
10-Into package my_pkg we add file my_icons.lrs (tab "Add file", type LRS). At least one unit in package must have:
7+` c:\lazarus\tools\lazres.exe my_icons.lrs *.png`
118
12- * "initialization" in which we must write
9+Into package my_pkg we add file my_icons.lrs (tab "Add file", type LRS). At least one unit in package must have:
1310
14-```
15-{$I my_icons.lrs}
16-```
11+- "initialization" in which we must write
1712
18- * also "uses LResources" in this unit.
13+` {$I my_icons.lrs}`
1914
15+- also "uses LResources" in this unit.
16+
2017Compile and install the package, two icons must appear.
2118
2219---
23-*From the Free Pascal wiki, page "How to add icons my package components", as the Internet Archive kept it on 2025-02-19. Copyright stays with the author who wrote it, according to the old wiki's [[Licensing]] page. If you have concerns about this material, [message the admin](/wiki-contact).*
20+*From the Free Pascal wiki, page "How to add icons my package components", as it stood on 2015-07-26 after a change by Jwdietrich, out of the wiki's dump of 2024-05-26. Copyright stays with the author who wrote it, according to the old wiki's [[Licensing]] page. If you have concerns about this material, [message the admin](/wiki-contact).*
21+Category: Packages

Back to history