Made good progress to bring an old 32bit DLL plugin for Notepad++ to Lazarus 64bit.
The code base for the demo i experiment with is from
"Notepad++ Plugin Template for Delphi & Lazarus"
https://bitbucket.org/rdipardo/delphiplugintemplate/src/default/After some beginner struggle it seems to work quite fine.
Regarding the gui there are only two major things left. The one i'd like to ask here, because i think it might be LCL related too.
Treeview (will need a bit additional work on custom paint here, no problem):
In my own component (based on custom treeview) now i had to notice heavy horrible flicker on mouse move.
Tried to find the reason: it is here:
TreeviewXY.Hottrack := true.
Without Hottrack no flicker. And, no flicker in 'normal' mode (light theme) too.
What's going on?
What i do assume is that there is a concurrent painting LCL vs. NPP themeing where both are disturbing and triggering each other, which results in a heavy flicker. Pls. note that i use myself extensively custom drawing without seeing such flicker.
I could reproduce simply by placing a shelltreeview onto a plugin demo docking form.
Hotrack on: heavy flicker in dark mode
Hotrack off: no flicker at all
Unfortunately i need the Hottrack for some reasons and won't like to switch it off.
Found the guilty line here:
//treeview.inc:
procedure TCustomTreeView.UpdateHotTrack(X, Y: Integer);
begin
...............
..............
Invalidate; // OOPS! This will repaint the whole control .....
end;
From my own code for 'mouse hover' i was used for such case:
- repaint the line where the mouse is over
- repaint/refresh the line the mouse pointer had left
That had been ugly enough, because i had been forced to duplicate the whole treeview paint code, only because there is not measure to override/influence the color of the background erasure at the beginning (i had posted a special forum's topic on this times ago). Anyhow.
My question to the LCL experts: is there a more granular approach possible, without engaging the massive cavalry of invalidating all?
If someone is interested to try a test project: i can provide one, which would only require:
Lazarus 3.x (up) Windows 64 bit
A notepad++ 64bit installation recent version (i mainly prefer portable versions)
Select "dark mode" in the NPP options
And adapt two paths in the project settings.
Edit: i assume that the Delphi users of the demo plugin template don't have this problem, as here the treeview is OS-based, not pure VCL object, differently to Lazarus.