Delphi/Lazarus plugin template - update info about probs with Lazarus
-
@Ekopalypse @rdipardo
Ekopalypse, as you took part of the discussion in
https://community.notepad-plus-plus.org/topic/22772/new-cross-platform-plugin-template-for-delphi-developers
this is for your info:
About some issues mentioned when using with Lazarus (3.6 64bit)- GDB needed as external installation?
No. One might choose, in project settings, Debugger, as debugger backend “GDB (GNU debugger” from the dropdown list - Could not start Debug:
Reason: in the HelloWrld.lpi there is the line: <Runnable Value=“False”/>
When setting the options within the IDE, it’s in project settings, Miscellaneous, “Project runnable?” (or similar)
Must be true for using the debugger. - The compiler output must be defined for the correct place, and this is not obvious:
Given, Npp is installed or unzipped into some <npp-dir>.
Npp expects the plugin dll to exist in <npp-dir>\plugins<plugin-name>
So the compiler option ‘Target-filename (-o)’ must be set to <npp-dir>\plugins<plugin-name>$NameOnly($(ProjFile))
Otherwise one might debug and step through, but he is in the wrong room.
It’s not enough to define ‘host application’ etc. For to be able to debug, it’s a Must
to set such path within IDE: project settings >> compiler settings >> Paths.
Would be good to have such within the documentation.
Now the reason for the ‘issue when shrinking the number of plugin’s submenu items’ could be found
(= when removing some items, NPP might start next with showing the plugin’s About box).
Reason: HelloWorldPlugin.pas:const /// menu index of the dockable form //DlgMenuId = 2; DlgMenuId = 0; // When shrinking the menu it might be 0 ! }
A more understandable variable (instead of a constant) name would have helped when modifying the menu. Maybe with a defaulting.
constructor THelloWorldPlugin.Create; ... begin inherited; self.PluginName := 'Hello &World'; DlgMenuId := 2; // That was the original value valid before shrinking the menu // With defaulting and using a speaking variable name it could be something like: // DlgMenuIdDockingForm := DlgMenuIdDockingFormDefault; // --- Now shrking the menu: { PSk := MakeShortcutKey(true, false, true, $48); // CTRL + SHIFT + H self.AddFuncItem('&Insert "Hello, World!"', _FuncHelloWorld, PSk); PSk := MakeShortcutKey(false, true, true, $48); // ALT + SHIFT + H self.AddFuncItem('&Replace "Hello, World!"', _FuncHolaMundo, PSk); } self.AddFuncItem('Load Docking &Form', _FuncHelloWorldDocking); DlgMenuId := 0; // menu index of the dockable form is here now 0, not 2 !! First item! // DlgMenuIdDockingForm := 0; // More understandable name
@rdipardo probably i’ll make an item in your new wiki later.
- GDB needed as external installation?
-
-
@rdipardo , It’s in status ‘submitted’ (not visible within the list, as not ackknowledged) since two days; did went something wrong?
-
The topic is on a very goood way.
With the information given above it’s sufficiently possible to debug (Lazarus internal GDB debugger).
With the help of some custom drawing i made good steps forward in gui adpations
and meanwhile rdipardo updated the demo to show treeview theme painting too.
Details within the issue thread mentioned.
The template looks very promising!