GoScintilla - 2.7 (Purebasic 4.5 onwards)

Developed or developing a new product in PureBasic? Tell the world about it.
srod
PureBasic Expert
PureBasic Expert
Posts: 10589
Joined: Wed Oct 29, 2003 4:35 pm
Location: Beyond the pale...

GoScintilla - 2.7 (Purebasic 4.5 onwards)

Post by srod »

GoScintilla 2.7 - 11th Aug 2012

GoScintilla 2.7 adds a targeted search facility as well as a facility for highlighting error lines (typically those which generate compiler errors etc).

The history.txt file lists the detailed changes as of course does the .chm help manual.

In terms of error markers; GoScintilla can highlight any lines deemed to contain errors in much the same way that the PB IDE highlights lines which generate compiler errors.

Please note that error markers are implemented by means of a suitable Scintilla marker and share the same margin as GoScintilla bookmarks. For this reason, it is very important that you read the relevant parts of the GoScintilla user manual if using both bookmarks and error markers with the same document etc.

There is a demo showing the error markers in use.

Please see the nxSoftware site for the download.

===============================================


GoScintilla 2.6 - 16th June 2012

GoScintilla 2.6 fixes yet another problem with code folding! Doh!

Please see the post on page 18 of this thread which gives a tip in using the 'reStyle' parameter introduced to some functions in version 2.5.

Please see the nxSoftware site for the download.

===============================================


GoScintilla 2.5 - 5th May 2012

GoScintilla 2.5 adds an optional parameter (restyle = #True) to certain functions which can be used to stop GoScintilla redrawing a control's contents whilst we set/reset individual style parameters. Useful if you are altering styles after loading text into a control, otherwise every single alteration will result in the entire document being restyled which can result in some serious delays if there is a lot of text loaded into the control.

You can of course use the GOSCI_SetState() function to restyle the entire document when you are done making alterations.

No existing code will be broken by these changes.

The help manual has been updated.

Thanks to Tenaja.

Please see the nxSoftware site for the download.

===============================================


GoScintilla 2.4 - 3rd May 2012

GoScintilla 2.4 fixes a massive bug with code folding.

Please see the nxSoftware site for the download.

===============================================


GoScintilla 2.3 - 4th Apr 2011

GoScintilla 2.3 fixes a bug with GOSCI_InsertLineOfText(). Thanks to Dobro.

Please see the nxSoftware site for the download.

===============================================


GoScintilla 2.2 - 7th Sep 2010

GoScintilla 2.2 adds a new keyword style : #GOSCI_OPENFOLDKEYWORDNOPRECEDING. This marks a keyword (or multiple keywords) as an open-fold keyword with the proviso that it will only open a new fold on any given line if this symbol is not preceded by any other open-fold keyword. That is, if the line is not already marked as being the start of a new fold etc.

Please see the nxSoftware site for the download.

===============================================


GoScintilla 2.1 - 22nd July 2010

GoScintilla 2.1 fixes some bugs, adds a new state option (#GOSCI_RESTYLEDOCUMENT to force a complete restyle of the underlying document) and the ability to copy all lexer settings from one control to another.

The new function GOSCI_CopyLexerFromExistingControl() copies all lexer settings (well, most of them anyhow) from one control to another. This is a hard-copy (by-value) in that a snapshot is taken of the source lexer and copied across to the destination lexer. Any future alterations made to the source lexer will not be subsequently copied across to the destination lexer etc. (unless you use this function again). I have no intention, at this stage, of adding a facility to allow multiple controls to effectively use the same lexer (by reference) as this will force me down a path of 'reference counting' and I don't want to get into that with this library.

It remains to be seen how useful this function will be since it would probably be just as easy to use a generic function to set-up a lexer for your GoScintilla controls anyhow.

The function will copy the following components of a styling lexer :
  • all keywords, call-tips, delimiters, separators etc.
  • lexer state settings (e.g. #GOSCI_LEXERSTATE_ENABLECODEFOLDING). This means that, for example, if the source lexer has code-completion enabled, then the destination lexer will then inherit this setting.
  • user-defined line styling functions.
  • style indexes and style definitions (even the default style and line number styling etc).
    This includes font definitions, colours and so on.
The function will not copy information on markers or bookmarks. This means, for example, that any colours set for folding markers or bookmarks will not be copied across.

Please see the nxSoftware site for the download.

===============================================


GoScintilla 2.0 (beta 4) - 18th May 2010

GoScintilla 2 beta 4 adds a few more demo programs showing how to make use of user-defined line styling functions (demos are taken from this forum thread) and adds a new lexer state bit : #GOSCI_LEXERSTATE_ENABLECLICKANYWHERECODEFOLDING.

This new lexer state (following a suggestion from LCD) allows for code folding regions which can be collapsed by clicking any part of the folding margin etc. The default bit : #GOSCI_LEXERSTATE_ENABLECODEFOLDING requires the user to specifically click the appropriate folding marker.

Please see the nxSoftware site for the download.

===============================================


GoScintilla 2.0 (beta 3) - 11th May 2010

GoScintilla 2, beta 3 fixes a bug reported by Helpy (page 7 of this thread).

Please see the nxSoftware site for the download.

===============================================


GoScintilla 2.0 (beta 2) - 11th May 2010

GoScintilla 2, beta 2 (read, attempt 2!) represents a significant improvement over beta 1 which of course was my first attempt to bring some much needed functionality to the original GoScintilla. We now have code-completion, nested call-tips, bookmarks and auto-indentation.

Beta 1 fell apart (as demonstarted by that swine ts-soft! :wink: ) on call-tips and my original implementation fell way short of being useful. Beta 2 corrects that and addresses all of the immediate shortcomings highlighted by that cursed ts-soft! Beta 2 also comes with a completely updated manual (though it may be a little rough around the edges at this moment!)

However, whereas GoScintilla 2 beta 1 would break some existing GoScintilla applications, beta 2 has gone three steps further in that regard and breaks all existing GoScintilla apps! As much a pain for myself as anyone else, so all complaints in this respect will be duly ignored! :wink:

GoScintilla 2 is now, effectively, a completely different animal to the original GoScintilla and whilst most existing apps can be converted across quite easily, I have expended absolutely no effort within the new manual (or anywhere else for that matter) discussing how you might best proceed with any such upgrades. Instead, I point you to the numerous demo programs, some of which I had to upgrade myself etc.

GoScintilla 2 has been tested on XP, Vista (x86) and, courtesy of that swine ts-soft, also tested on Ubuntu 10.04 x64. Most of the new facilities offered by GoScintilla 2 will not work under MacOS.

See the "History.txt" file for a complete list of changes that underpin GoScintilla 2.

Please see the nxSoftware site for the download.

===============================================


GoScintilla 2.0 (beta 1) - 3rd May 2010

GoScintilla 2 is a huge upgrade over the original GoScintilla helper library and is perhaps what GoScintilla should have been in the first place. :wink: My thanks to Peyman for kicking me where it hurts in order to provide the incentive to finally get around to adding some much needed functionality, and for providing some example code.

GoScintilla 2 offers the following improvements :
  • Automatic code-completion.
  • Automatic nested call-tips (code-tips).
  • Bookmarks.
  • Auto-indentation.
  • Numerous minor improvements.
This has been a lot of work and so I release this in beta form and without an up to date manual. The manual will be brought up to date asap, but in the meantime GoScintilla 2 is available for testing etc. The "History.txt" file should be the first port of call for those interested in rummaging through this new version, quickly followed by the new demo programs.

And now for the bad news... :wink:
  1. GoScintilla 2 is for Purebasic 4.5 (onwards) only.
    I took advantage of some of PB 4.5's new facilities to simplify GoScintilla 2 somewhat and, considering the complexity of GoScintilla now, I do not intend supporting two different versions etc.
  2. Some (but not all) existing code designed for the original GoScintilla will not work with GoScintilla 2. Such breakages were inevitable considering the nature of this upgrade. I have removed some functions/flags and moved things around a little. All of GoScintilla's original functionality remains intact, it is just that you may need to modify your existing code slightly.

    Please see the "History.txt" file for a complete list of changes.
In addition, I will point out that Scintilla (not GoScintilla) does have a few quirks where code-completion and call-tips are concerned (especially call-tips!) In particular, please do not compare Scintilla's code-completion facilities with those of the Purebasic IDE. The IDE does not make use of Scintilla's code-completion. Instead, Freak rolled his sleeves up and rolled his own long before the IDE made use of Scintilla at all. :)

Please see the nxSoftware site for the download.

===============================================


Version 1.0 - 7th January 2010

Fixed a bug with the Lexer and have included a second version of the "block comments" advanced demo program (as requested by Justin).

Please see the nxSoftware site for the download.

===============================================


Version 1.0 beta 4 - 30th November 2009

This update has been motivated by a desire to allow for automatic code folding of multi-word keywords such as "Function" and "End Function" etc.
GoScintilla's lexer will only work with single word keywords and thus cannot natively support combinations such as "End Function" as representing a close-fold terminal.

Extending GoScintilla's lexer to allow this is not an option as it will slow things down (in my judgement) too much. Instead, we can make use of a user-defined line styling function to supplement the lexer's capabilities.
  • Added functions : GOSCI_DecFoldLevel(id) and GOSCI_IncFoldLevel(id) to be used within a user-defined line styling function only.
  • Added an additional demo program "Multiword" to demonstrate how to use a very simple user-defined line styling function together with the new functions to implement code folding on the aforementioned "Function" and "End Function" etc.
Please see the nxSoftware site for the download.

===============================================


Version 1.0 beta 2 - 27th November 2009

Having just integrated GoScintilla into an existing project, I found myself making the following changes ;
  • Fixed a bug with GOSCI_Create() (it wasn't returning any value!)
  • Added function : GOSCI_ReplaceSelectedText(id, text$, blnScrollCaretIntoView=#False).
  • Modified the GOSCI_SetText() function by the addition of an optional parameter; clearUndoStack (default #False).
    Set to non-zero to have the undo stack cleared so that this operation cannot be undone.
  • Added a new get/set attribute : #GOSCI_WRAPLINES. Turn wrapping lines on/off.
  • Added a new get/set attribute : #GOSCI_WRAPLINESVISUALMARKER. Give wrapped lines a visual marker.
  • By default, all delimiter characters are also regarded as separators. This can now be over-ruled when adding delimiter keywords by using the new #GOSCI_NONSEPARATINGDELIMITER flag.

    This was added to allow one type of delimiter to be styled as part of another delimiter.

    E.g. imagine the situation with Purebasic syntax in which we may opt to declare both the # and $ symbols as delimiters in order to style constants and string variables appropriately.

    What happens then with the symbol #StringConstant$ ?

    The first version of GoScintilla would apply one style to #StringConstant and another style to $ !

    By making the $ symbol a non-separating delimiter, however, #StringConstant$ would now be styled correctly as befitting a constant.

Please see the nxSoftware site for the download.

===============================================


Purebasic 4.4 only.

Hi,

GoScintilla is a freely available wrapper around some of the Scintilla API offering easy access to the kinds of functions we would expect from an editing component; adding lines of text, setting fonts, retrieving text etc.

More importantly, however, is the fact that GoScintilla comes with a powerful lexer which can easily be configured for just about any kind of syntax styling and/or code folding. The lexers made available by the developer(s) of the Scintilla library are very specific in that they are configured (in most cases) for a single language syntax only. GoScintilla's lexer is generic and very configurable (and very easy to configure). Those parts of the Scintilla API dealing with syntax styling and code-folding are quite fiddly (and quirky!) and thus I found myself in need of a tool like GoScintilla to make things easier.

A quick screenshot of GoScintilla in action styling some PB type code :

Image

The download package includes the full source, a couple of demos and a full .chm user manual.

Getting the most out of GoScintilla does require a careful read through the manual and, for advanced uses, careful study of the advanced demos. :)

Please visit the nxSoftware site for more details and the full download.
Last edited by srod on Sat Aug 11, 2012 1:15 pm, edited 23 times in total.
I may look like a mule, but I'm not a complete ass.
User avatar
ts-soft
Always Here
Always Here
Posts: 5756
Joined: Thu Jun 24, 2004 2:44 pm
Location: Berlin - Germany

Re: GoScintilla

Post by ts-soft »

:D
Very usefull!

Greetings
Thomas
Little John
Addict
Addict
Posts: 4519
Joined: Thu Jun 07, 2007 3:25 pm
Location: Berlin, Germany

Re: GoScintilla

Post by Little John »

Srod, there is only 1 remaining question: How do you manage to work 24/7 without any sleep? Incredible. :D
I'm going to download your latest masterstroke.

Regards, Little John
Marco2007
Enthusiast
Enthusiast
Posts: 638
Joined: Tue Jun 12, 2007 10:30 am
Location: not there...

Re: GoScintilla

Post by Marco2007 »

@PB-Team: Correct Rank for Srod:
Image

Now it`s time to try Scintilla for the first time :D

thx
PureBasic for Windows
srod
PureBasic Expert
PureBasic Expert
Posts: 10589
Joined: Wed Oct 29, 2003 4:35 pm
Location: Beyond the pale...

Re: GoScintilla

Post by srod »

Thanks.

Please download again. I inadvertently commented out the line that populates the control in the C syntax demo. Either download again or find the offending line and uncomment it.

Doh!

:)
I may look like a mule, but I'm not a complete ass.
User avatar
ts-soft
Always Here
Always Here
Posts: 5756
Joined: Thu Jun 24, 2004 2:44 pm
Location: Berlin - Germany

Re: GoScintilla

Post by ts-soft »

srod wrote:Please download again. I inadvertently commented out the line that populates the control in the C syntax demo. Either download again or find the offending line and uncomment it.

Doh!

:)
I have found this mistake for two hours, so no new download required :mrgreen:
srod
PureBasic Expert
PureBasic Expert
Posts: 10589
Joined: Wed Oct 29, 2003 4:35 pm
Location: Beyond the pale...

Re: GoScintilla

Post by srod »

Two hours and you didn't report it!!! Why you little...

Note to self, remove ts-soft from Xmas card list and replace with the good looking woman across the road...

:)
I may look like a mule, but I'm not a complete ass.
srod
PureBasic Expert
PureBasic Expert
Posts: 10589
Joined: Wed Oct 29, 2003 4:35 pm
Location: Beyond the pale...

Re: GoScintilla

Post by srod »

ts-soft wrote:
srod wrote:Please download again. I inadvertently commented out the line that populates the control in the C syntax demo. Either download again or find the offending line and uncomment it.

Doh!

:)
I have found this mistake for two hours, so no new download required :mrgreen:
Ah you didn't find the bug with the close bracket symbol in the C-syntax demo now did you? :wink:

You'll have to download again; my apologies!
I may look like a mule, but I'm not a complete ass.
User avatar
ts-soft
Always Here
Always Here
Posts: 5756
Joined: Thu Jun 24, 2004 2:44 pm
Location: Berlin - Germany

Re: GoScintilla

Post by ts-soft »

srod wrote: You'll have to download again; my apologies!
Will do, but wait only until you have added the German translation of the help :mrgreen:
srod
PureBasic Expert
PureBasic Expert
Posts: 10589
Joined: Wed Oct 29, 2003 4:35 pm
Location: Beyond the pale...

Re: GoScintilla

Post by srod »

ts-soft wrote:
srod wrote: You'll have to download again; my apologies!
Will do, but wait only until you have added the German translation of the help :mrgreen:
No problem. You will have to wait for me to learn the German language, however. Shouldn't take more than a few decades!

Don't suppose you wish to translate the manual do you? It will take a while as it is quite big.
I may look like a mule, but I'm not a complete ass.
User avatar
ts-soft
Always Here
Always Here
Posts: 5756
Joined: Thu Jun 24, 2004 2:44 pm
Location: Berlin - Germany

Re: GoScintilla

Post by ts-soft »

srod wrote: Don't suppose you wish to translate the manual do you? It will take a while as it is quite big.
No problem. You will have to wait for me to learn the English language, however. Shouldn't take more than a few decades! :twisted:
srod
PureBasic Expert
PureBasic Expert
Posts: 10589
Joined: Wed Oct 29, 2003 4:35 pm
Location: Beyond the pale...

Re: GoScintilla

Post by srod »

:lol:

When you're done, you can translate it into Welsh as well. That should definitely take a few thousand decades.
I may look like a mule, but I'm not a complete ass.
User avatar
flaith
Enthusiast
Enthusiast
Posts: 704
Joined: Mon Apr 25, 2005 9:28 pm
Location: $300:20 58 FC 60 - Rennes
Contact:

Re: GoScintilla

Post by flaith »

Thanks a lot, added to my huge programs directory called "srod" :wink:
“Fear is a reaction. Courage is a decision.” - WC
Perkin
Enthusiast
Enthusiast
Posts: 504
Joined: Thu Jul 03, 2008 10:13 pm
Location: Kent, UK

Re: GoScintilla

Post by Perkin »

Run a simple script on list of English strings

remove all vowels
replace all single l's with two
randomly add c's and w's

BINGO!
Welsh translation. :lol:
(I'm sure they're reall isn't a Welsh language, they just speak lots of nonsense so they can laugh their asses off at our confused looks.)
%101010 = $2A = 42
rsts
Addict
Addict
Posts: 2736
Joined: Wed Aug 24, 2005 8:39 am
Location: Southwest OH - USA

Re: GoScintilla

Post by rsts »

Just when folks convinced me I needed to learn scintilla, srod shows up with a solution.

You da man!

cheers

(that's American slang for "You rule")
Post Reply