Page 1 of 1

Triple mouse-click to select entire line of text

Posted: Mon Apr 29, 2024 5:32 pm
by Ats
The double-click to select an entire word is already implemented. Is it possible to add a triple-click to select an entire paragraph? I'm not sure if this requires custom programming or if it's an option in the ZDesigner project settings. I'll take a look at the source code.

In the meantime, we can click anywhere in the code editor and type at this position. So I'm not sure if there are real newlines to ensure a proper selection of a paragraph :?

Re: Triple mouse-click to select entire line of text

Posted: Mon Apr 29, 2024 9:30 pm
by Kjell
Hi Ats,
Ats wrote: Mon Apr 29, 2024 5:32 pmIs it possible to add a triple-click to select an entire paragraph?
The regular TSynEdit control doesn't support this ( which is what ZGameEditor uses ) .. but apparently it was added to TSynEdit-2 in 2020.

Article: https://blogs.embarcadero.com/syntax-hi ... n-windows/
Code: https://github.com/pyscripter/SynEdit-2 ... .pas#L2027

K

Re: Triple mouse-click to select entire line of text

Posted: Tue Apr 30, 2024 7:38 am
by Ats
Thanks. So I tried to replace included SynEdit by the new one, but it's not that simple :lol:

Here's what I did:
  • Install Delphi RADStudio
  • Download ZGameEditor: https://github.com/VilleKrumlinde/zgameeditor
  • Fix drive letter in the project:
  • ZDesigner.dproj line 67: <DCC_DcuOutput>t:\temp\zge</DCC_DcuOutput>[/*]
  • Delete files in zgameeditor-master\tools\ZDesigner\3rdparty thar are starting with the name Syn.
    WARNING: SynHighlighterZc.pas is a custom file, keep it!
  • Install last version of SynEdit:
    Last depot for SynEdit: https://github.com/TurboPack/SynEdit
    Install SynEdit using: Delphi / Tools / Getit Package Manager / Search SynEdit
From there, it's try and repeat... :roll:
  • Compiler can't find Highlighters files... So I copied files from
    C:\Users\User\Documents\Embarcadero\Studio\23.0\CatalogRepository\SynEdit-12\Source\Highlighters
    to
    C:\Users\User\Documents\Embarcadero\Studio\23.0\CatalogRepository\SynEdit-12\Source
    (But there has to be another way...)
Then I don't know what to do with SynHighlighterZc.pas
I tried moving it to C:\Users\User\Documents\Embarcadero\Studio\23.0\CatalogRepository\SynEdit-12\Source
But the compiler isn't happy. So I started replacing SynHighlighterZc in ZEditor source files by another one (like SynHighlighterST), just to try out.

But afterward I get an error from frmXmlEdit.pas, line 46: SynEdit.MaxScrollWidth := 4096;
And I can't comment it out, as I get a lot of new errors. So I stopped there.

Re: Triple mouse-click to select entire line of text

Posted: Tue Apr 30, 2024 8:02 am
by VilleK
Ats wrote: Tue Apr 30, 2024 7:38 am Thanks. So I tried to replace included SynEdit by the new one, but it's not that simple :lol:
It seems that dialects of TSynEdit diverged into several different directions that are not compatible with existing projects. I had similar issues in the Mac branch of ZGE and I don't think I got the highlighter working there either.

Re: Triple mouse-click to select entire line of text

Posted: Tue Apr 30, 2024 9:00 am
by Kjell
Hi guys,

It might be easier to see how TSynEdit-2 has implemented triple-click and only add that .. instead of swapping to the entire fork.

K

Re: Triple mouse-click to select entire line of text

Posted: Wed May 01, 2024 12:16 pm
by Ats
It was just an idea to improve the UX. If it's much more complicated than simply updating an external library, forget about it :lol: