Recent

Author Topic: organisation of images and code and ressources  (Read 210 times)

Nicole

  • Hero Member
  • *****
  • Posts: 634
organisation of images and code and ressources
« on: December 02, 2022, 07:56:55 pm »
I tried many things and re-wrote a lot.
It would be great to ask for 2 things,

1)
List, which images / icons / bitmap of which list are used where and which not

2)
Give me the use of methods
Do I have methods, my project does not call anywhere?

Thank you for hints, tips or tools.

Zvoni

  • Hero Member
  • *****
  • Posts: 1604
Re: organisation of images and code and ressources
« Reply #1 on: December 02, 2022, 09:10:07 pm »
Didn’t understand a single thing.

Btw: nicole, if it‘s easier for you to write in german, send me a pm
One System to rule them all, One Code to find them,
One IDE to bring them all, and to the Framework bind them,
in the Land of Redmond, where the Windows lie
---------------------------------------------------------------------
Code is like a joke: If you have to explain it, it's bad

KodeZwerg

  • Hero Member
  • *****
  • Posts: 952
  • Fifty shades of code.
    • Delphi & FreePascal
Re: organisation of images and code and ressources
« Reply #2 on: December 02, 2022, 09:40:43 pm »
Didn’t understand a single thing.
:D
My try would be to find out first of all if Nicole is talking about permanent things or movable.
For permanent I would simply create a .rc file to compile a .res file to include it inside of compiled binary, depending about how many data it is, thinking to export those into a resource library (dll on windows).
Naming them in a logical way etc...

Does that makes any sense?
« Last Edit: Tomorrow at 31:76:97 by KodeZwerg »

wp

  • Hero Member
  • *****
  • Posts: 10483
Re: organisation of images and code and ressources
« Reply #3 on: December 02, 2022, 10:09:32 pm »
If you mean images used by the IDE you should know that these images are available in a global imagelist, LCLGlyphs (unit imgList), and you can pick a specific image by specifying its name in the GetImageIndex method. The available images can be found in the folder lcl/images of the Lazarus installation; the resource name needed by GetImageIndex is equal to the basic file name:
Code: Pascal  [Select][+][-]
  1. procedure TForm1.FormCreate(Sender: TObject);
  2. begin
  3.   BitBtn1.Images := LCLGlyphs;
  4.   BitBtn1.ImageIndex := LCLGlyphs.GetImageIndex('sortasc');
  5.  
  6.   BitBtn2.Images := LCLGlyphs;
  7.   BitBtn2.ImageIndex := LCLGlyphs.GetImageIndex('btn_ignore');
  8.  
  9.   BitBtn3.Images := LCLGlyphs;
  10.   BitBtn3.ImageIndex := LCLGlyphs.GetImageIndex('btn_ok');
  11. end;

 

TinyPortal © 2005-2018