Mattias Gaertner ha scritto:
Thanks a lot. Now it works.On Fri, 16 Jun 2006 12:37:10 +0200 Giuliano Colla <[EMAIL PROTECTED]> wrote:Mattias Gaertner ha scritto:On Thu, 15 Jun 2006 18:59:51 +0200 Giuliano Colla <[EMAIL PROTECTED]> wrote: I have a number of custom components which I've installed on an "Extra" tab on the IDE toolbar. I've tried the method described in the /components/custom directory, and many variations on the theme, but the net result is always the same: only the default icon is shown, so that all my components look the same. Could someone point me on the right direction? The method described /components/custom/README is obsolete and not supported. Please create a package instead and add your components. The only thing, that is still valid is the text, how to add an icon. The IDE uses as icon the lazarus resource of the classname. For example it searches a resource named 'tbutton' for TButton. The resource can be a xpm or bmp. You create the resource with the lazres tool. The lazres tool creates an include files. 1. open a paint program and create an icon (up to 23x23), say tyourcomponent.xpm. 2. Use lazres tool: /path/to/lazatus/tools/lazres yourchoice.lrs tyourcomponent.xpm. 3. include yourchoice.lrs in an initialization section: {$I yourchoice.lrs}. Thanks. Some more questions, to avoid fiddling too much. My package includes four components, and four units. Should I have a registration procedure in each unit and include an individual .lrs file in the initialization section of each unit, or should I have another unit which does registration and includes the resources for all of them?Your choice. I've finally realized my mistake: my .xpm files were named after the *unit* name, and not form the *class* name, and so the resource was named accordingly! Then I had tried all possible variations, without double checking the .lrs file, but of course none was possibly working. Giuliano _________________________________________________________________ To unsubscribe: mail [EMAIL PROTECTED] with "unsubscribe" as the Subject archives at http://www.lazarus.freepascal.org/mailarchives |
- Re: [lazarus] unable to get custom component icons on IDE... Mattias Gaertner
- Re: [lazarus] unable to get custom component icons o... Giuliano Colla
