Page 1 of 1

[v2] Scintilla Edit control class

Posted: 24 Mar 2019, 11:49
by kczx3
I wanted to use the Scintilla edit control in a SQLite Database Viewer application but there's not much out there for AHK v2. I liked the elegance of the implementation by RaptorX for AHK v1.1 but wanted to eliminate the globals and just make use of class methods, not hidden functions in the global namespace with a prefix.

I used the modified version of the class that Alguimist uses in AutoGUI. Thanks to both RaptorX and Alguimist for giving me that start I needed!

This is what I ended up with for now. Built and tested using AHK v2.0-a100-52515e2 and 64-bit SciLexer.dll. Code and a pretty simple example is hosted on GitHub - https://github.com/kczx3/Scintilla

Appreciate any comments and suggestions.

Re: [v2] Scintilla Edit control class

Posted: 24 Mar 2019, 15:03
by freakkk
Thank you for the improvements you've made to this! I was planning on using this control in something in the next month or so already, so I'll definitely be using this recently refreshed library to start from when I do.

Re: [v2] Scintilla Edit control class

Posted: 26 Mar 2019, 09:53
by BGM
Does anyone have the link for the scintilla control for version 1 autohotkey?

Re: [v2] Scintilla Edit control class

Posted: 27 Mar 2019, 07:39
by kczx3
Updated example script to show how one can implement Multiple Documents utilizing a single Scintilla control instead of creating a separate control instance for each document.

Re: [v2] Scintilla Edit control class

Posted: 28 Mar 2019, 14:16
by Helgef
The example looks great, very well done :clap:

Cheers, thanks for sharing!

Re: [v2] Scintilla Edit control class

Posted: 28 Mar 2019, 14:59
by kczx3
Thanks! Means a lot coming from you :thumbsup:

Re: [v2] Scintilla Edit control class

Posted: 28 Mar 2019, 19:15
by kczx3
Helgef wrote:
28 Mar 2019, 14:16
The example looks great, very well done :clap:

Cheers, thanks for sharing!
Realized the deleteDoc function in the example wasn't quite working properly and fixed that.
Added in showing how a single document can be shared between two Scintilla instances.

Re: [v2] Scintilla Edit control class

Posted: 29 Mar 2019, 14:38
by kczx3
Improved the document splitting code and you can now unsplit documents.
The split document (right side) always is synced to the current document in the main (left side) control.

Re: [v2] Scintilla Edit control class

Posted: 20 Feb 2020, 16:35
by oif2003
Thanks for posting this. I needed a simple editor control so I took portions of your code to build this minimalist demo and updated it for the lastest v2 (2.0-a108-a2fa0498). Maybe this will be useful to others as well.
Spoiler

Re: [v2] Scintilla Edit control class

Posted: 20 Feb 2020, 19:43
by kczx3
Thanks! Glad it inspired you!