Author Topic: LazResourceEditor: A New Tool for Managing Lazarus Resource Files  (Read 2288 times)

Xenno

  • Full Member
  • ***
  • Posts: 201
    • BS Programs
Hello, everyone!

I am excited to introduce LRS Editor, a native desktop utility designed to simplify how we view, manage, and edit Lazarus Resource (.lrs) files.

While .lrs files are essential for embedding resources directly into component source code, handling multiple resources within a single file can sometimes be cumbersome. LRS Editor provides a clean, dedicated workspace to inspect, extract, and modify these resources efficiently without manually digging through Pascal source files.

LRS Editor features a clean, native desktop layout designed for a seamless workflow, featuring a top toolbar, a resource list on the middle-left, and a dual content view for image and code.

Managing your files is straightforward through the menus, which lets you create a New file, Open existing ones, Reopen recent files, Revert file from disk, and save your progress via Save or Save As. The Resource menu gives you full control over individual entries, allowing you to Add, Delete, Rename, and Save As LRS, alongside flexible extraction options including Extract, Extract Selected, and Extract All. For handling code, it provides standard utility actions like Copy and Select All, while there is also a Dark Mode toggle for comfortable, low-light editing.

Under the Hood

When you add a resource, you can select any file on your system, which LRS Editor automatically encodes into the required string value for the Lazarus Resource format. Beneath the surface, the actual binary content of the file is kept efficiently in memory using a TMemoryStream, which ensures lossless fidelity so it can always be extracted back to its exact original file format.

In the user interface, the resource list is implemented using a standard TListView component containing a TListItem for each individual resource. To keep things clean and maintainable, every TListItem is directly linked to an instance of a class called TResourceData, which encapsulates all the necessary metadata alongside the underlying TMemoryStream binary content.

For editing and interface polish, the app leverages powerful components from SynEdit for syntax handling and BS Controls for custom UI styling.

Freeware with Source & Licensing

I am releasing LRS Editor as a complete giveaway—freeware with full source code included. To maintain consistency with my other work like BS Controls, I am applying the zlib License.

This is simply my way of giving back and expressing my deepest gratitude for the amazing Free Pascal and Lazarus ecosystem, and the brilliant, helpful people in this community.

I would love to hear your thoughts, feedback, or suggestions as you try it out!


Cheers,
« Last Edit: August 19, 2026, 05:55:37 am by Xenno »
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.

dseligo

  • Hero Member
  • *****
  • Posts: 1699
Re: LRS Editor: A New Tool for Managing Lazarus Resource Files
« Reply #1 on: August 17, 2026, 11:29:37 am »
Here is link to BSControls you need to compile LRS Editor: https://forum.lazarus.freepascal.org/index.php/topic,74785.msg588786.html#msg588786

Xenno

  • Full Member
  • ***
  • Posts: 201
    • BS Programs
Re: LRS Editor: A New Tool for Managing Lazarus Resource Files
« Reply #2 on: August 17, 2026, 12:35:53 pm »
Yes, it is. Thank you, @dseligo.
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.

Soner

  • Sr. Member
  • ****
  • Posts: 334
Re: LRS Editor: A New Tool for Managing Lazarus Resource Files
« Reply #3 on: August 17, 2026, 02:10:15 pm »

Xenno

  • Full Member
  • ***
  • Posts: 201
    • BS Programs
Re: LRS Editor: A New Tool for Managing Lazarus Resource Files
« Reply #4 on: August 17, 2026, 05:55:42 pm »
Thanks, @Soner
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 Editor: A New Tool for Managing Lazarus Resource Files
« Reply #5 on: August 18, 2026, 07:29:37 am »
Thanks for sharing your tool!
I took a glimpse. Some issues:
1. How to switch to normal menu?
2. JPG files added as resources are not shown in the preview.
3. I added a JPG with a Cyrillic name, but instead its filename, underscores were displayed.
4. I tried to rename the resource to a Cyrillic and I got “Invalid resource name”. Gemini says Cyrillic should be fine.
5. Even spaces are converted to underscores :o
Лазар 4,8 32 bit (sometimes 64 bit); FPC3,2,2

Xenno

  • Full Member
  • ***
  • Posts: 201
    • BS Programs
Re: LRS Editor: A New Tool for Managing Lazarus Resource Files
« Reply #6 on: August 18, 2026, 08:01:57 am »
Hi, @CM630
Quote
1. How to switch to normal menu?
It does not have normal menu (menu bar). It is replace with Menu button. Do you still need menu bar?
Quote
2. JPG files added as resources are not shown in the preview.
3. I added a JPG with a Cyrillic name, but instead its filename, underscores were displayed.
4. I tried to rename the resource to a Cyrillic and I got “Invalid resource name”. Gemini says Cyrillic should be fine.
5. Even spaces are converted to underscores :o
Sharp! Currently, it only accepts numbers, letter, and underscore. I assume resource item's name rules same with variable name. I don't have enough information about resource naming convention, but I just checked to the same Gemini, LRS Editor does correctly. Is there any resource naming convetion doc I can refer?
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 Editor: A New Tool for Managing Lazarus Resource Files
« Reply #7 on: August 18, 2026, 08:39:41 am »
It does not have normal menu (menu bar). It is replace with Menu button. Do you still need menu bar?
Quote
Recently I played a little to make a routine to switch menu from normal to hamburger.
The concept is: create a normal menu in the IDE , and according the setting it is either shown as it is, or converted to a popup menu during runtime. The popup menu is shown when the hamburger button (invisible in normal menu mode) is pressed. The code was not big, most likely I have lost it.


...Currently, it only accepts numbers, letter, and underscore. I assume resource item's name rules same with variable name. I don't have enough information about resource naming convention, but I just checked to the same Gemini, LRS Editor does correctly. Is there any resource naming convetion doc I can refer?
No idea if such a document exists, I do not use resources every year. But I tried to use a resource named like “btn icon Проба” and it worked fine.
Лазар 4,8 32 bit (sometimes 64 bit); FPC3,2,2

Thaddy

  • Hero Member
  • *****
  • Posts: 19805
  • Glad to be alive.
Re: LRS Editor: A New Tool for Managing Lazarus Resource Files
« Reply #8 on: August 18, 2026, 08:51:27 am »
Only convention I know is for resourcestrings: prefix rs.
Any "programmer" that knows only one programming language is not a programmer

Xenno

  • Full Member
  • ***
  • Posts: 201
    • BS Programs
Re: LRS Editor: A New Tool for Managing Lazarus Resource Files
« Reply #9 on: August 18, 2026, 09:16:59 am »
Recently I played a little to make a routine to switch menu from normal to hamburger.

Yes, it is doable. I have implement such feature in BS.CSV as seen in attached screenshots. Most users prefer no menu bar. Nonetheless, thank you for good input.

Quote
No idea if such a document exists, I do not use resources every year. But I tried to use a resource named like “btn icon Проба” and it worked fine.

Noted. I will continue searching.
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 Editor: A New Tool for Managing Lazarus Resource Files
« Reply #10 on: August 18, 2026, 11:05:45 am »
...Most users prefer no menu bar. Nonetheless, thank you for good input....

Gemini told me:
Quote
Based on global user experience (UX/UI) research and desktop usage patterns:
Desktop OS Navigation Preferences
Traditional (Standard) Menu: ~80% – 85% of desktop users prefer a visible horizontal navigation bar or standard top bar menus (e.g., File, Edit, View).
Hamburger Menu (☰): Only ~15% – 20% of users prefer or interact seamlessly with a collapsed menu on a large display.
I asked explicitly about desktop.

ChatGPT told me:
Quote
| Desktop navigation          | Best evidence-based estimate |
| --------------------------- | ---------------------------: |
| **Visible / normal menu**   |       **~70–85% preference** |
| **Hamburger / hidden menu** |       **~15–30% preference** |

There also some researches for productivity, which are also in favour of normal menu.
Also, I have no idea how hamburger menu would work in MacOS.
Лазар 4,8 32 bit (sometimes 64 bit); FPC3,2,2

Xenno

  • Full Member
  • ***
  • Posts: 201
    • BS Programs
Re: LRS Editor: A New Tool for Managing Lazarus Resource Files
« Reply #11 on: August 18, 2026, 11:14:25 am »
Hello, everyone!

I made an update to LRS Editor to version 1.1.1, bringing powerful new import/export capabilities, enhanced resource editing, and a much smoother drag-and-drop workflow.

Here is a breakdown of what has changed:
  • Full RES File Import & Export: You can now seamlessly export your project resources into standard Windows .res files or import existing .res files directly back into the editor for complete round-trip flexibility.
  • Precise Resource Type Preservation: Unlike generic packaging tools that flatten everything into RT_RCDATA, LRS Editor preserves and respects custom resource type tags (such as PNG, JPG, or custom identifiers) across all imports and exports.
  • Granular Name & Type Editing: Editing resource items now gives you full control to explicitly define and modify both the item's name and its custom resource type directly in the UI.
  • Smart Numeric ID Handling: Imported .res files that use integer-based resource identifiers (dtID) are handled cleanly with automatic collision checking to prevent duplicate name conflicts in your workspace.
  • Refined Drag-and-Drop Workflow: Dragging and dropping files directly from Windows Explorer into the application now instantly adds them as new resource items rather than opening a brand new project workspace, making batch-asset integration faster than ever.

lazres Test

An attachment shows the export result where lr1.res was produced by lazres.exe and lr2.res was produced by LRS Editor. Both RES files are identical. Note: All the resource types in LRS Editor need to be set as RT_RCDATA.

Freeware with Source

LRS Editor remains free and open source, built with Lazarus, SynEdit, and BS Controls, and is distributed under the zlib License (with full source code).

I hope these new features make managing your Lazarus resources smoother and more efficient. As always, feedback and contributions are warmly welcomed!


Cheers,
« Last Edit: August 18, 2026, 11:18:38 am by Xenno »
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.

Xenno

  • Full Member
  • ***
  • Posts: 201
    • BS Programs
Re: LRS Editor: A New Tool for Managing Lazarus Resource Files
« Reply #12 on: August 18, 2026, 02:08:36 pm »
Got it, @CM630. Noted. Perhaps most users in Microsoft Store use Microsoft Surface or other devices with touch screen.

...
Also, I have no idea how hamburger menu would work in MacOS.

This is a serious issue. Would you please explain more?
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 Editor: A New Tool for Managing Lazarus Resource Files
« Reply #13 on: August 18, 2026, 10:38:34 pm »
Got it, @CM630. Noted. Perhaps most users in Microsoft Store use Microsoft Surface or other devices with touch screen.
Microsoft Store sounds in my ear like something for Nokia. :P

...
This is a serious issue. Would you please explain more?...
Trabants are more common than Macs where I live, so I have little experience with them. The menus is MacOS are not placed on the forms, there is a dedicated bar on the top of the screen, it switches its contents depending on which form is active.
So maybe every form has a menu bar, and probably when you use a hamburger you will have an empty menu bar plus a hamburger button.
I guess it might look very peculiar.
« Last Edit: August 18, 2026, 10:41:50 pm by CM630 »
Лазар 4,8 32 bit (sometimes 64 bit); FPC3,2,2

wp

  • Hero Member
  • *****
  • Posts: 13667
Re: LRS Editor: A New Tool for Managing Lazarus Resource Files
« Reply #14 on: August 19, 2026, 01:18:24 am »
Full RES File Import & Export
I had wanted to suggest this feature, now it is here. But the application name is misleading now. An "LRS Editor" is expected to allow editing of LRS files, I would not think that it can handle RES files, too. Maybe rename it to LazResourceEditor?

 

TinyPortal © 2005-2018