Forum > Packages and Libraries

Modified LazResExplorer example program

(1/1)

dsiders:
I hope this is the correct sub-forum.

I modified the files in examples/lazresexplorer. I added image viewing for generic resource types (like PNG, JPG, etc.), icons, and cursors. It populates the binary tab for recognized image types, so you can view the image or the binary content.

For anyone interested, I am attaching a .zip archive with the modified files. I've been using it on Windows with no issues. I'm not a graphics guru, so suggestions to improve the code are welcomed.

avra:
You should provide a patch against trunk and publish it in bugtracker so once it is accepted everyone benefits. If you have trouble extracting diff info from git/svn then you might use a tool like https://winmerge.org which can extract diff info and create a patch based on a simple directory comparison.

dsiders:

--- Quote from: avra on July 13, 2021, 08:26:36 am ---You should provide a patch against trunk and publish it in bugtracker so once it is accepted everyone benefits.

--- End quote ---

That is my plan. I was hoping for some feedback before I did that. I did the "simplest thing that works", but possibly not the "right thing". :)

JuhaManninen:

--- Quote from: dsiders on July 13, 2021, 08:38:03 am ---That is my plan. I was hoping for some feedback before I did that. I did the "simplest thing that works", but possibly not the "right thing". :)

--- End quote ---
Hold on with a patch. We need a resource explorer in the tools directory of Lazarus sources. Now there is only a half-baked glazres with support for the old resource format. I had a plan to combine its functionality and more with the exact same example project that you found.
A new improved version should go to the GitLab repo under tools directory.

Your version works well also under Linux.
For some reason the "Save resource ..." feature is always disabled. The fileSave: TAction is not disabled anywhere. Strange.

dsiders:

--- Quote from: JuhaManninen on July 13, 2021, 09:05:59 am ---
--- Quote from: dsiders on July 13, 2021, 08:38:03 am ---That is my plan. I was hoping for some feedback before I did that. I did the "simplest thing that works", but possibly not the "right thing". :)

--- End quote ---
Hold on with a patch. We need a resource explorer in the tools directory of Lazarus sources. Now there is only a half-baked glazres with support for the old resource format. I had a plan to combine its functionality and more with the exact same example project that you found.
A new improved version should go to the GitLab repo under tools directory.

--- End quote ---

I'm in no rush.


--- Quote from: JuhaManninen on July 13, 2021, 09:05:59 am ---Your version works well also under Linux.

--- End quote ---

That's good to know. The platform defs for the readers was already in place. So I didn't break it.


--- Quote from: JuhaManninen on July 13, 2021, 09:05:59 am ---For some reason the "Save resource ..." feature is always disabled. The fileSave: TAction is not disabled anywhere. Strange.

--- End quote ---

The FileSave action has DisableIfNoHandler set. And there is no OnExecute handler on the action or the action list.

It appears that there were intentions to make it a general purpose resource editor. But never realized. I just added image viewing for the unsupported image resource types. There are other resource types that are not explicitly supported, and use display as binary as the fallback.

Navigation

[0] Message Index

Go to full version