Author Topic: LRS Explorer  (Read 1464 times)

CM630

  • Hero Member
  • *****
  • Posts: 1788
  • Не съм сигурен, че те разбирам.
    • http://sourceforge.net/u/cm630/profile/
LRS Explorer
« on: August 11, 2026, 11:33:24 pm »
I found no thread about LRS Explorer so I start this one.
The tool is not updates for a very long time, so I did some changes.
The source is attached.
First of all, it refused to compile with Lazarus 4.8, after fixing that here is the changelog:

Quote
ver. 1.0.0.2
1. Added drag and drop for files.
2. Added Select All keyboard shortcut for the tree control.
3. Added a DEL key shortcut for the tree control.
4. Added Open recent in main menu.
5. Localisation:
  5.1. Added Bulgarian and Spanish (from https://sourceforge.net/p/lrsexplorer/patches/1/).
  5.2. Last used language is restored on startup.
  5.3. Some fixes for compatibility with current gettext regulations.
  5.4. Some mess with dialogue boxes fixed.
6. Icon for the main form added.
7. Settings are now stored and loaded.

I do not intend to make more changes, but in case I see something, I might take care.

« Last Edit: August 11, 2026, 11:35:28 pm by CM630 »
Лазар 4,8 32 bit (sometimes 64 bit); FPC3,2,2

Xenno

  • Full Member
  • ***
  • Posts: 200
    • BS Programs
Re: LRS Explorer
« Reply #1 on: August 14, 2026, 10:04:01 am »
Hello,

I failed to compile as seen in attachment. Win 10, Laz v4.6. What should I adjust?

Thanks,
Lazarus 4.6, Windows 10, Website, YouTube channel
If I want to share, I give. If I want money, I sell. I don't set traps.

wp

  • Hero Member
  • *****
  • Posts: 13665
Re: LRS Explorer
« Reply #2 on: August 14, 2026, 01:55:51 pm »
@Xenno: Comment out the {$R manifest.rc} line in the project file (lpr), and check "Use manifest resource" (and "Use LCL scaling") in the Project Options (Application Settings).

@CM630: Your language files contain a lot of duplicate resource strings. This is due to the setting of the "Extract translatable strings from the form when saving its LFM file" (in Laz/main, or: "Create/update .po file when saving a lfm file" in release versions) because it extracts translatable strings from the form file and adds them to the pot template. You do not need this since you have all your UI strings in a resource string unit. Uncheck this box. You also do not need unit LCLTranslator because having "Translations.TranslateUnitResourceStrings" in the code makes sure that the resource strings are translated and your ReloadFormControlsCaptions transfers the translated strings to the UI controls.

I am attaching a modified version of your project (including a debug build mode, and a German translation).

BTW, in the debug build mode it can be seen that there is a memory leak after an lrs file has been loaded.

Xenno

  • Full Member
  • ***
  • Posts: 200
    • BS Programs
Re: LRS Explorer
« Reply #3 on: August 14, 2026, 02:06:25 pm »
Confirmed compiles and runs, @wp. Thank you,
Lazarus 4.6, Windows 10, Website, YouTube channel
If I want to share, I give. If I want money, I sell. I don't set traps.

CM630

  • Hero Member
  • *****
  • Posts: 1788
  • Не съм сигурен, че те разбирам.
    • http://sourceforge.net/u/cm630/profile/
Re: LRS Explorer
« Reply #4 on: August 14, 2026, 03:23:52 pm »

@CM630: Your language files contain a lot of duplicate resource strings. This is due to the setting of the "Extract translatable strings from the form when saving its LFM file" (in Laz/main, or: "Create/update .po file when saving a lfm file" in release versions)

Do you mean “Create/update .po file when saving a lfm file” in Project OptionsI18n ?
Does not sound the same to me, but I know no other possible place to search it. These things are inherited, I mostly updated the language menu, since it expected some obsolete tags.

... and a German translation).
Thanks, I guess you have kept it in a secret place for many years until taking it out today. “Open recent” is not translated.

BTW, in the debug build mode it can be seen that there is a memory leak after an lrs file has been loaded.
It can be seen from the ones with vision, I am from the others.

Also, there was some letter case discrepancy in the .LPI file, causing two “release” folders in Linux, but this seems fixes in what you uploaded.

Edit: Something is wrong, the .POT file is not generated at all.

Maybe this is related:
...I am attaching a modified version of your project (including a debug build mode...
The path to the language files is changed from release\languages to debug\languages in your files.
« Last Edit: August 14, 2026, 03:48:42 pm by CM630 »
Лазар 4,8 32 bit (sometimes 64 bit); FPC3,2,2

wp

  • Hero Member
  • *****
  • Posts: 13665
Re: LRS Explorer
« Reply #5 on: August 14, 2026, 04:02:45 pm »
Do you mean “Create/update .po file when saving a lfm file” in Project OptionsI18n ?
Yes.

“Open recent” is not translated.
Since LCLTranslator is removed in my version, every string must be reassigned manually after translation (this is what you are doing in TfrmMain.ReloadFormControlsCaptions). The menu item with the "Open recent" caption (miOpenRecent) is not handled there. Add it, and it will be translated like the others:

Code: Pascal  [Select][+][-]
  1. procedure TfrmMain.ReloadFormControlsCaptions;
  2. begin
  3.   MIFile.Caption   := MIFileCaption;
  4.   miOpenRecent.caption := AOpenRecent;  // <--- ADDED
  5.   ANewLRS.Caption  := ANewLRSCaption;
  6.   ...
And the resource string AOpenRecent is not present in the strings unit, uLanguages:
Code: Pascal  [Select][+][-]
  1. resourcestring
  2.   ...
  3.   AOpenLRSHint        = 'Open LRS-file';
  4.   AOpenRecent         = 'Open recent';  // <--- ADDED
  5.   ...

Edit: Something is wrong, the .POT file is not generated at all.
When I do "Run" > "Build" the pot file is updated for sure, because this is where I noticed that the missing AOpenRecent resourcestring had been fixed.

BTW, in the debug build mode it can be seen that there is a memory leak after an lrs file has been loaded.
It can be seen from the ones with vision, I am from the others.
Sorry, I don't understand. I activate debug build mode (which has the -gh compiler option for leak detection), compile, run, load some lrs file, close the project --> There is a not too lengthy heap dump:
Code: [Select]
Heap dump by heaptrc unit of D:\...\LRS Explorer\debug\LRS_Explorer.exe

14158 memory blocks allocated : 5732210/5778592
14157 memory blocks freed     : 5732190/5778568
1 unfreed memory blocks : 20
True heap size : 1245184 (128 used in System startup)
True free heap : 1244928
Should be : 1244936
Call trace for block $06532A58 size 20

  $0043241F  ViewAsPicture,  line 1122 of sources/umain.pas
  $00432A46  ViewResource,  line 1198 of sources/umain.pas
  $00430A3F  TreeViewResSelectionChanged,  line 789 of sources/umain.pas
  $0054DFC4
  $0055207D
  $0055264B
  $00546981
  $00431332  OpenLRSfile,  line 909 of sources/umain.pas
  $0042E128  RecentItemClick,  line 242 of sources/umain.pas
  $0052D940
  $0052DFCF
  $0040E021
  $004E9782
  $0059AE95
  $76BF9283
  $76BE846D

Xenno

  • Full Member
  • ***
  • Posts: 200
    • BS Programs
Re: LRS Explorer
« Reply #6 on: August 16, 2026, 04:01:09 pm »
#Welcome Back, forum

LRS Explorer is really helpful. Then, I studied the code and learned how to work with an LRS file.

Now, I have created from scratch an app that (hopefully) have many features like LRS Explorer has. No code is copied from LRS Explorer; only studied it and write my own. If I want to post my app in this forum, do I need to have GNU GPL License as LRS Explorer states? It would be distributed as a Freeware with Source.
Lazarus 4.6, Windows 10, Website, YouTube channel
If I want to share, I give. If I want money, I sell. I don't set traps.

Thaddy

  • Hero Member
  • *****
  • Posts: 19805
  • Glad to be alive.
Re: LRS Explorer
« Reply #7 on: August 16, 2026, 04:41:29 pm »
If your code inherits from GPL, it means it IS GPL.
Maybe you can get away with a linker exception, but since you intend to distribute the sourcecode: once GPL'd code is used, all code is GPL.
There is another way around that, though, the two way street:
- refer to the GPL'd sources as dependencies with links to the code, but do not include any of it!
- distribute your own sources under any license you want (suggest M.I.T).

Users of your code are still required to GPL their full application if any source is redistributed, apart from yours and your referrals.
Any "programmer" that knows only one programming language is not a programmer

Xenno

  • Full Member
  • ***
  • Posts: 200
    • BS Programs
Re: LRS Explorer
« Reply #8 on: August 16, 2026, 04:52:58 pm »
Thank you very much, @Thaddy.
Then, I guess I cancel to distribute it. It will be for my private use only.
Anyway, I attached its screenshots.
Lazarus 4.6, Windows 10, Website, YouTube channel
If I want to share, I give. If I want money, I sell. I don't set traps.

CM630

  • Hero Member
  • *****
  • Posts: 1788
  • Не съм сигурен, че те разбирам.
    • http://sourceforge.net/u/cm630/profile/
Re: LRS Explorer
« Reply #9 on: August 16, 2026, 06:24:30 pm »
...If your code inherits from GPL, it means it IS GPL...

...I have created from scratch an app...
Does not sound like your code ihnerits GPL or anything else. The way I understand it, generally you cannot apply a less restrictive licence if you use somebody else's more restrictive code. The opposite is sometimes possible.
Previously I did not understand that you created a brand new app, I thought that you updated LRS Explorer. IMHO, in this case you should better start a new thread for it.

If I want to post my app in this forum
You can upload your app whenever you want: Sourceforge, Git*, Bitbucket, Codeberg... if you take a look you will see, that all kind of SW is announced here, not only FOSS.
It would be nice if you leave a backdoor for keeping your code alive once/if you abandon it.

...Since LCLTranslator is removed in my version, every string must be reassigned manually after translation (this is what you are doing in TfrmMain.ReloadFormControlsCaptions)...
If I get you right, you mean that LCLTranslator is just no good? I like that GUI components are handled automatically.
What bothers you in some duplicated entries? Too much disk space is occupied (btw, the .exe of the original LRS Explorer is 0,5 MB, I have it compiled to 2,5 MB in Lazarus 4.8 ) or more useless work for the translators?
« Last Edit: August 16, 2026, 06:28:39 pm by CM630 »
Лазар 4,8 32 bit (sometimes 64 bit); FPC3,2,2

Xenno

  • Full Member
  • ***
  • Posts: 200
    • BS Programs
Re: LRS Explorer
« Reply #10 on: August 16, 2026, 07:27:54 pm »
Yes, @CM630, thank you for the insight. The only matter I studied in LRS Explorer is about the content of the third parameter in LazarusResources.Add. After I knew it is just a binary coded as string (and compose like Base64) then I started writing an app named LRS Editor. I don't copy any code from LRS Explorer at all. I create a small class for it and linked it to the TListItem. The binary is kept as TMemoryStream. A newbie's way.

Code: Pascal  [Select][+][-]
  1.   TResourceData = class
  2.   private
  3.     FResContent: TMemoryStream;
  4.     FResName: String;
  5.     FResType: String;
  6.     function GetResSize: Int64;
  7.   public
  8.     constructor Create;
  9.     destructor Destroy; override;
  10.     function FncDecodeContent: String;
  11.     procedure PrcEncodeContent(const PrmStr: String);
  12.     property ResContent: TMemoryStream read FResContent;
  13.     property ResName: String read FResName write FResName;
  14.     property ResSize: Int64 read GetResSize;
  15.     property ResType: String read FResType write FResType;
  16.   end;

However, I intend to give away this app with source uploaded to this forum as a grateful one for the amazing FreePascal, Lazarus, and all intelligent people here. There is no backdoor, it is wide open. The app surely have bugs that I might not found, yet. It is fully handcoded. If one found it is not useful, I am sorry. At least, I use it to edit LRS files.

If I can't give away this app in this forum, sure. I will be fully understand. No broken heart.

Thanks,
Lazarus 4.6, Windows 10, Website, YouTube channel
If I want to share, I give. If I want money, I sell. I don't set traps.

CM630

  • Hero Member
  • *****
  • Posts: 1788
  • Не съм сигурен, че те разбирам.
    • http://sourceforge.net/u/cm630/profile/
Re: LRS Explorer
« Reply #11 on: September 03, 2026, 10:47:12 pm »
Code: Pascal  [Select][+][-]
  1. procedure TfrmMain.ReloadFormControlsCaptions;
  2. begin
  3.   MIFile.Caption   := MIFileCaption;
  4.   miOpenRecent.caption := AOpenRecent;  // <--- ADDED
  5.   ANewLRS.Caption  := ANewLRSCaption;
  6.   ...
I removed ReloadFormControlsCaptions and the Resourcestrings that it uses. I see no non-negative side of it.
There are still duplicated strings, because a TActionList is used in the app, I do not intend to make something about getting rid of it.

A new version is uploaded:
1. Fix: Select all not working properly in the resource list.
2. New: Added search box for the resurcelist.
3. Some localisation issues fixed (still some more are to be fixed).


Лазар 4,8 32 bit (sometimes 64 bit); FPC3,2,2

 

TinyPortal © 2005-2018