GoScintilla - 2.7 (Purebasic 4.5 onwards)

Developed or developing a new product in PureBasic? Tell the world about it.
Peyman
Enthusiast
Enthusiast
Posts: 203
Joined: Mon Dec 24, 2007 4:15 pm
Location: Iran

Re: GoScintilla - 2.0 (beta 4)

Post by Peyman »

:D :D Many Thanks Srod for your time, now Works very good.
is this possible in future we add these with GOSCI_AddDelimiter (support more than one character) ?
Sorry for my bad english.
srod
PureBasic Expert
PureBasic Expert
Posts: 10589
Joined: Wed Oct 29, 2003 4:35 pm
Location: Beyond the pale...

Re: GoScintilla - 2.0 (beta 4)

Post by srod »

Peyman wrote::D :D Many Thanks Srod for your time, now Works very good.
is this possible in future we add these with GOSCI_AddDelimiter (support more than one character) ?
Adding that kind of support natively will really slow GoScintilla down for those cases where only single delimiters/separators are required and so I will not consider doing that no. The user-defined line styling functions are there for this kind of thing anyhow and whilst they are a bit fiddly to use, you soon get used to them. You have to accept that Scintilla, in terms of syntax highlighting etc, is not an easy thing to use regardless. :)

You must also keep in mind that I wrote GoScintilla firstly for my own use and I have no need for multiple-character delimiters! :wink:
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 - 2.1 (Purebasic 4.5 only)

Post by srod »

GoScintilla 2.1 - 22nd July 2010

Purebasic 4.5 only.

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.
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 - 2.1 (Purebasic 4.5 only)

Post by ts-soft »

:D
Thanks, i will test it on this weekend.

Greetings
Thomas
Peyman
Enthusiast
Enthusiast
Posts: 203
Joined: Mon Dec 24, 2007 4:15 pm
Location: Iran

Re: GoScintilla - 2.1 (Purebasic 4.5 only)

Post by Peyman »

thanks srod for your time. :D
Sorry for my bad english.
cybergeek
User
User
Posts: 33
Joined: Sat Jul 03, 2010 11:11 am

Re: GoScintilla - 2.1 (Purebasic 4.5 only)

Post by cybergeek »

i want to add c++ comments delimieter .. that is "//"
but goscintilla doesnt seem to allow this.. i think delimieters are only single charred...

plus i also want to use "/" in my #STYLES_Operators list ..

GOSCI_AddDelimiter(1, "//", "", #GOSCI_DELIMITTOENDOFLINE|#GOSCI_NONSEPARATINGDELIMITER, #STYLES_COMMENTS)

can u help me with adding // delimieters to add commenting style for c++ code?
PUREBASIC is AWSUM
srod
PureBasic Expert
PureBasic Expert
Posts: 10589
Joined: Wed Oct 29, 2003 4:35 pm
Location: Beyond the pale...

Re: GoScintilla - 2.1 (Purebasic 4.5 only)

Post by srod »

You are correct, GoScintilla allows only single character separators/delimiters. You need to use a user-defined line styling function.

Have a look at the "BlockCommentStylerII.pb" demo which implements c-style block comments and // delimited line comments.

Demos\AdvancedDemos\BlockComments\BlockCommentStylerII.pb
I may look like a mule, but I'm not a complete ass.
cybergeek
User
User
Posts: 33
Joined: Sat Jul 03, 2010 11:11 am

Re: GoScintilla - 2.1 (Purebasic 4.5 only)

Post by cybergeek »

thx................

another question:
how can i make "public" or "private" or "protected" highlighted when they combine with ":" operator in a class definition

e.g

class person
{
public: // public is not highlighted with ":"

}
Image
PUREBASIC is AWSUM
srod
PureBasic Expert
PureBasic Expert
Posts: 10589
Joined: Wed Oct 29, 2003 4:35 pm
Location: Beyond the pale...

Re: GoScintilla - 2.1 (Purebasic 4.5 only)

Post by srod »

Either declare : as a separator or some kind of delimiter or add Public: (with the colon) to the keyword list etc.
I may look like a mule, but I'm not a complete ass.
cybergeek
User
User
Posts: 33
Joined: Sat Jul 03, 2010 11:11 am

Re: GoScintilla - 2.1 (Purebasic 4.5 only)

Post by cybergeek »

this worked

GOSCI_SetLexerOption(1, #GOSCI_LEXEROPTION_SEPARATORSYMBOLS, @"=+-*/%()[],.:")
PUREBASIC is AWSUM
cybergeek
User
User
Posts: 33
Joined: Sat Jul 03, 2010 11:11 am

Re: GoScintilla - 2.1 (Purebasic 4.5 only)

Post by cybergeek »

have u debugged GOSCI_CopyLexerFromExistingControl(ID, sourceID)

it returns invalid memory access error :| :|
PUREBASIC is AWSUM
srod
PureBasic Expert
PureBasic Expert
Posts: 10589
Joined: Wed Oct 29, 2003 4:35 pm
Location: Beyond the pale...

Re: GoScintilla - 2.1 (Purebasic 4.5 only)

Post by srod »

Works fine here.

What version of PB are you using?

GoScintilla 2.1 requires PB 4.5 (as made clear at the nxSoftware site); although the function you are trying to use will only work with PB 4.51 RC 2.
I may look like a mule, but I'm not a complete ass.
cybergeek
User
User
Posts: 33
Joined: Sat Jul 03, 2010 11:11 am

Re: GoScintilla - 2.1 (Purebasic 4.5 only)

Post by cybergeek »

srod wrote:Works fine here.

What version of PB are you using?

GoScintilla 2.1 requires PB 4.5 (as made clear at the nxSoftware site); although the function you are trying to use will only work with PB 4.51 RC 2.

pb 4.50 x86

cant me made to work on 4.50 ?
PUREBASIC is AWSUM
srod
PureBasic Expert
PureBasic Expert
Posts: 10589
Joined: Wed Oct 29, 2003 4:35 pm
Location: Beyond the pale...

Re: GoScintilla - 2.1 (Purebasic 4.5 only)

Post by srod »

Nope. A bug with PB 4.50 prevents that.

Either upgrade or do not use the copying lexer function. To be honest, I really see no need for the function anyhow since you can just use a function which does the job of adding all keywords etc. Just call the function for each Scintilla control you wish to utilise.
I may look like a mule, but I'm not a complete ass.
cybergeek
User
User
Posts: 33
Joined: Sat Jul 03, 2010 11:11 am

Re: GoScintilla - 2.1 (Purebasic 4.5 only)

Post by cybergeek »

yes i have made an AddLexer function

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

i have encountered a really mysterious problem (i think it is)

i have PMed u the code

Run the code - goto File -> Open - select any source file
it will create a new tab with that filename and try to load it with source code but that doesnt work at all .. i cant figure it out!
PUREBASIC is AWSUM
Post Reply