Page 13 of 20
Re: GoScintilla - 2.1 (Purebasic 4.5 only)
Posted: Wed Aug 25, 2010 12:44 pm
by srod
I am sorry, but I have spent enough time for now on your problems; including rummaging through your pm'd code once before, even though I did not request it.
If there is a bug with GoScintilla then I will fix it, but I require a bug report with something I can reproduce and not your entire application sent to me. Problems with your application are, quite honestly, not my concern. Post in the coding forums and if I have time then I shall take a look. Others might also be tempted to take a look as well.
Re: GoScintilla - 2.1 (Purebasic 4.5 only)
Posted: Wed Sep 01, 2010 12:58 am
by gedumer
I just discovered GoScintilla. Looks great.
Thanks srod...
Re: GoScintilla - 2.1 (Purebasic 4.5 only)
Posted: Tue Sep 07, 2010 3:14 am
by Peyman
hi srod,
i find something but i dont know this is a bug or have some work for every lang:
for statement in lua is ended with do but is a statement for examp :
do statement :
for statement :
Code: Select all
for i=0, 10 do
-- Do Something
end
so when i write a for statement in GoScintilla, it search for two end for folding instead of one, i think because of for and do in one line if not what is problem ?
thanks for your time.
Re: GoScintilla - 2.1 (Purebasic 4.5 only)
Posted: Tue Sep 07, 2010 9:11 am
by srod
Not a bug, a limitation. GoScintilla allow's for multiple open-fold / close-fold keywords on the same line etc.
You would have to remove either the keyword 'do' or 'for' from code folding and then use a user-defined line styling function to deal with the removed keyword etc.
Re: GoScintilla - 2.1 (Purebasic 4.5 only)
Posted: Tue Sep 07, 2010 10:22 am
by srod
@Peyman : I have updated GoScintilla 2 (version 2.2) to offer you a part solution for your predicament which means that you may not have to resort to a user-defined line styling function.
I have added 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.
This should solve your problem.
I say 'should' because GoScintilla does not respect line separators such as the ':' symbol which we can use with Purebasic. This means that, for example, in the following line :
Code: Select all
for i=0, 10 do : do
-- Do Something
end : end
if 'do' is marked as a #GOSCI_OPENFOLDKEYWORDNOPRECEDING keyword then the 2nd 'do' on the first line will not contribute an additional open-fold even though it is (because of the : ) essentially on a new line etc.
Course I do not know if LUA supports this kind of thing anyhow!
I will probably modify GoScintilla at some point so that it does recognise line separators, but it is not something I am in need of right now.
I hope this helps?
@ALL : new version of GoScintilla 2 is available... as described above! 
Re: GoScintilla - 2.2 (Purebasic 4.5 only)
Posted: Tue Sep 07, 2010 2:18 pm
by Peyman
@srod : Thanks many times, this new flag very can help,
and yea in lua this possible with ';' so code is
Code: Select all
for i=0, 10 do ; do
-- Do Something
end ; end
Another time thanks.
Re: GoScintilla - 2.2 (Purebasic 4.5 only)
Posted: Sun Sep 12, 2010 7:33 pm
by Szafir
How to make a block with the comment:
Rem
comment
comment
comment
EndRem
Sorry my bad English.
Re: GoScintilla - 2.2 (Purebasic 4.5 only)
Posted: Mon Sep 13, 2010 10:10 am
by srod
You need a user-defined line styling function.
See the AdvancedDemos\BlockComments\BlockCommentStyler.pb demo.
This one uses c-style block comments. Should be easy to alter to give what you are after.
Re: GoScintilla - 2.2 (Purebasic 4.5 only)
Posted: Tue Sep 14, 2010 10:03 am
by Szafir
It will be difficult. It is a pity that there is no ready-made functions.
Re: GoScintilla - 2.2 (Purebasic 4.5 only)
Posted: Tue Sep 14, 2010 10:14 am
by srod
Szafir wrote:It will be difficult. It is a pity that there is no ready-made functions.
Scintilla is a complicated beastie and the business of syntax styling and the like is... not easy! At the end of the day there are only so many functions and so much functionality I can add to GoScintilla before it becomes just as difficult to use as Scintilla itself and GoScintilla cannot possibly cater for every possible situation etc. I think it does okay in its present form.
Beside's, with a user-defined line styling function there is literally nothing you cannot do. You just have to roll your sleeves up and study the demos which use such functions. You may even need to read up a little on the Scintilla api as well, but that's the price of being a developer I'm afraid.
Treat it as a learning experience.

Re: GoScintilla - 2.2 (Purebasic 4.5 only)
Posted: Tue Sep 14, 2010 10:58 am
by Szafir
GoScintilla is really easy, it is better not to complicate it too much.
I am using GoScintilla write a small project: BMIde - Mini BlitzMax Editor.

Re: GoScintilla - 2.2 (Purebasic 4.5 only)
Posted: Tue Sep 14, 2010 11:00 am
by srod
Looks nice - well done.
Re: GoScintilla - 2.2 (Purebasic 4.5 only)
Posted: Tue Dec 07, 2010 12:08 am
by eddy
download link: http://pbsci.svn.sourceforge.net/viewvc ... z?view=tar
here is a PB syntax advanced demo.
- Hex number style
- Binary number style
- .Structure style
- Procedure style
- Procedure region highlighting
- Custom code folding between ;{ and ;} markers
I used two custom functions :
Code: Select all
Procedure GOSCI_SetLineHighlightColor(id, color)
Procedure GOSCI_SetLineHighlighted(id, lineIndex, flag=#True)

how to detect scn_modified
Posted: Thu Dec 23, 2010 3:08 pm
by drgolf
Hello,
Sorry if my question is already solved :
How can i know if the text in my scintilla gadget is modified ?
Re: how to detect scn_modified
Posted: Thu Dec 23, 2010 3:17 pm
by ts-soft
drgolf wrote:Hello,
Sorry if my question is already solved :
How can i know if the text in my scintilla gadget is modified ?
Code: Select all
ProcedureDLL ScintillaCallBack(Gadget, *scinotify.SCNotification)
Select *scinotify\nmhdr\code
Case #SCN_MODIFIED
Debug "modified"
EndSelect
EndProcedure
Greetings - Thomas