GoScintilla - 2.7 (Purebasic 4.5 onwards)

Developed or developing a new product in PureBasic? Tell the world about it.
drgolf
Enthusiast
Enthusiast
Posts: 106
Joined: Tue Mar 03, 2009 3:40 pm
Location: france

Re: GoScintilla - 2.2 (Purebasic 4.5 only)

Post by drgolf »

Thanx, that works...
Very good is goscintilla !

merry christmas
User avatar
dobro
Enthusiast
Enthusiast
Posts: 766
Joined: Sun Oct 31, 2004 10:54 am
Location: France
Contact:

Re: GoScintilla - 2.2 (Purebasic 4.5 only)

Post by dobro »

this sample :

Code: Select all

;/////////////////////////////////////////////////////////////////////////////////
;***Go-Scintilla 2***
;*=================
;*
;*©nxSoftWare (www.nxSoftware.com) 2010.
;*======================================
;*    
;*  Commented demo program.
;/////////////////////////////////////////////////////////////////////////////////


; IncludePath "C:\Dobro\Purebasic_4_51\Include\"
XIncludeFile "GoScintilla.pbi"


;Initialise the Scintilla library for Windows.
CompilerIf  #PB_Compiler_OS = #PB_OS_Windows 
    InitScintilla()
CompilerEndIf
Enumeration
    #window
    #editeur
EndEnumeration

If OpenWindow(#window, 100, 200, 600, 600, "GoScintilla demo!", #PB_Window_SystemMenu | #PB_Window_MinimizeGadget | #PB_Window_ScreenCentered)
    RemoveKeyboardShortcut(#window, #PB_Shortcut_Tab) ;Required for the tab key to function correctly when the Scintilla control has the focus.
    ;Create our Scintilla control. Note that we do not specify a callback; this is optional for GoSctintilla.
    GOSCI_Create( #editeur, 10, 10, 580, 580, 0, #GOSCI_AUTOSIZELINENUMBERSMARGIN)
    ;Set the padding added to the width of the line-number margin.
    GOSCI_SetAttribute ( #editeur, #GOSCI_LINENUMBERAUTOSIZEPADDING, 10) ; numeros de ligne
    
    ;Set folding symbols margin width.
    GOSCI_SetMarginWidth( #editeur, #GOSCI_MARGINFOLDINGSYMBOLS,12) ; le symbole de folding
    
    ;Set the back color of the line containing the caret.
    GOSCI_SetColor( #editeur, #GOSCI_CARETLINEBACKCOLOR, $B4FFFF) ; ligne selectionnée
    
    ;Set font.
    GOSCI_SetFont( #editeur, "Comic Sans MS", 10,#PB_Default)
    
    ;Set tabs. Here we use a 'hard' tab in which a tab character is physically inserted. Set the 3rd (optional) parameter to 1 to use soft-tabs.
    GOSCI_SetTabs( #editeur, 8,#PB_Default) ; mise en forme !!
    
    ;Set styles for our syntax highlighting.
    ;=======================================
    ;First define some constants to identify our various styles.
    ;You can name these as we wish.
    Enumeration
        #STYLES_COMMANDS = 1
        #STYLES_COMMENTS
        #STYLES_LITERALSTRINGS
        #STYLES_NUMBERS
        #STYLES_CONSTANTS
        #STYLES_FUNCTIONS
EndEnumeration

    ;Set individual styles for commands.
GOSCI_SetStyleFont( #editeur, #STYLES_COMMANDS, "", -1, #PB_Font_Bold)
GOSCI_SetStyleColors( #editeur, #STYLES_COMMANDS, $800000,#PB_Default)  ;We have omitted the optional back color.

    ;Set individual styles for comments.
GOSCI_SetStyleFont( #editeur, #STYLES_COMMENTS, "", -1, #PB_Font_Italic)
GOSCI_SetStyleColors( #editeur, #STYLES_COMMENTS, $006400,#PB_Default)  ;We have omitted the optional back color.

    ;Set individual styles for literal strings.
GOSCI_SetStyleColors( #editeur, #STYLES_LITERALSTRINGS, #Gray,#PB_Default)  ;We have omitted the optional back color.

    ;Set individual styles for numbers.
GOSCI_SetStyleColors( #editeur, #STYLES_NUMBERS, #Red,#PB_Default)  ;We have omitted the optional back color.

    ;Set individual styles for constants.
GOSCI_SetStyleColors( #editeur, #STYLES_CONSTANTS, $2193DE,#PB_Default)  ;We have omitted the optional back color.

    ;Set individual styles for functions.
GOSCI_SetStyleColors( #editeur, #STYLES_FUNCTIONS, #Blue,#PB_Default)  ;We have omitted the optional back color.

  ;Set delimiters and keywords for our syntax highlighting.
  ;========================================================
    ;Delimiters.
    ;First set up a ; symbol to denote a comment. Note the use of #GOSCI_DELIMITTOENDOFLINE.
    ;Note also that this symbol will act as an additional separator.
GOSCI_AddDelimiter( #editeur, ";", "", #GOSCI_DELIMITTOENDOFLINE, #STYLES_COMMENTS)
    ;Now set up quotes to denote literal strings.
    ;We do this by passing the beginning and end delimiting characters; in this case both are quotation marks. Note the use of #GOSCI_DELIMITBETWEEN.
    ;Note also that a quote will subsequently act as an additional separator.
GOSCI_AddDelimiter( #editeur, Chr(34), Chr(34), #GOSCI_DELIMITBETWEEN, #STYLES_LITERALSTRINGS)
    ;Now set up a # symbol to denote a constant. Note the use of #GOSCI_LEFTDELIMITWITHOUTWHITESPACE.
GOSCI_AddDelimiter( #editeur, "#", "", #GOSCI_LEFTDELIMITWITHOUTWHITESPACE, #STYLES_CONSTANTS)
    ;Now set up a ( symbol to denote a function. Note the use of #GOSCI_RIGHTDELIMITWITHWHITESPACE.
GOSCI_AddDelimiter( #editeur, "[", "", #GOSCI_RIGHTDELIMITWITHWHITESPACE, #STYLES_FUNCTIONS)
    ;We arrange for a ) symbol to match the coloring of the ( symbol.
GOSCI_AddDelimiter( #editeur, "]", "", 0, #STYLES_FUNCTIONS)

    ;Basic command keywords.
GOSCI_AddKeywords( #editeur, "Debug End If ElseIf Else EndIf For To Next Step Protected ProcedureReturn", #STYLES_COMMANDS,#PB_Default,#PB_Default)

    ;Add some folding keywords.
GOSCI_AddKeywords( #editeur, "Procedure Macro", #STYLES_COMMANDS, #GOSCI_OPENFOLDKEYWORD,#PB_Default)
GOSCI_AddKeywords( #editeur, "EndProcedure EndMacro", #STYLES_COMMANDS, #GOSCI_CLOSEFOLDKEYWORD,#PB_Default)

  ;Additional lexer options.
  ;=========================
    ;The lexer needs to know what separator characters we are using.
GOSCI_SetLexerOption( #editeur, #GOSCI_LEXEROPTION_SEPARATORSYMBOLS, @"=+-*/%()[],.") ;You would use GOSCI_AddKeywords() to set a style for some of these if required.
    ;We can also set a style for numbers.
GOSCI_SetLexerOption( #editeur, #GOSCI_LEXEROPTION_NUMBERSSTYLEINDEX, #STYLES_NUMBERS)
      
  ;Set some initial text.
  ;======================
text$ = "; GoScintilla 2.0." + #CRLF$
text$ + "; By Stephen Rodriguez." + #CRLF$ + #CRLF$
text$ + "#MyConstant$ = " + Chr(34) + "Version = 1.0" + Chr(34) + #CRLF$ + #CRLF$
text$ + "Procedure.i AddIntegers(a, b)" + #CRLF$
text$ + #TAB$ + "Protected result" + #CRLF$
text$ + #TAB$ + "result = a + b  ; Calculate the sum of the 2 integers." + #CRLF$
text$ + #TAB$ + "ProcedureReturn result" + #CRLF$
text$ + "EndProcedure" + #CRLF$ + #CRLF$
text$ + "Debug " + Chr(34) + "The sum of 10 and 20 is " + Chr(34) + " + Str(AddIntegers(10, 20))" + #CRLF$ + #CRLF$
text$ + "End" + #CRLF$
    
GOSCI_SetText( #editeur, text$,#PB_Default)
;Debug GOSCI_GetText(#editeur)


Repeat
    eventID = WaitWindowEvent()
    Select eventID
        Case #PB_Event_Gadget
            Select EventGadget()
            EndSelect
    EndSelect
Until eventID = #PB_Event_CloseWindow 

  ;Free the Scintilla gadget.
  ;This needs explicitly calling in order to free resources used by GoScintilla.
GOSCI_Free( #editeur)
EndIf


; IDE Options = PureBasic 4.51 RC 2 (Windows - x86)
; CursorPosition = 93
; FirstLine = 85
; EnableXP
; Executable = t.exe
work in Japbe editor ( F5 or F6 )

but no work in Exe !! (Pb 4.51) and Goscintilla V 2.2
the Gadget editor don't appear :cry:
Image
Windows 98/7/10 - PB 5.42
■ sites : http://michel.dobro.free.fr/
User avatar
skywalk
Addict
Addict
Posts: 4211
Joined: Wed Dec 23, 2009 10:14 pm
Location: Boston, MA

Re: GoScintilla - 2.2 (Purebasic 4.5 only)

Post by skywalk »

This happened to me also.
; Final exe requires Scintilla.dll in same folder
; Or put in c:\windows\system32\scintilla.dll
The nice thing about standards is there are so many to choose from. ~ Andrew Tanenbaum
User avatar
dobro
Enthusiast
Enthusiast
Posts: 766
Joined: Sun Oct 31, 2004 10:54 am
Location: France
Contact:

Re: GoScintilla - 2.2 (Purebasic 4.5 only)

Post by dobro »

hooo yees !! :oops: :lol: Thanks !
Image
Windows 98/7/10 - PB 5.42
■ sites : http://michel.dobro.free.fr/
User avatar
dobro
Enthusiast
Enthusiast
Posts: 766
Joined: Sun Oct 31, 2004 10:54 am
Location: France
Contact:

Re: GoScintilla - 2.2 (Purebasic 4.5 only)

Post by dobro »

chm file that comes with Go_scintilla
do not scroll on my computer (1024x600)
and blocks the complete reading of the help pages

this seems to come from the "<Style>" (overflow) of each HTML page for help
Image
(no elevator scroll-bar! )

until this is corrected
I did another quick .. chm
available here:

http://michel.dobro.free.fr/Forum_PB/go ... ntilla.chm
Image
Windows 98/7/10 - PB 5.42
■ sites : http://michel.dobro.free.fr/
User avatar
dobro
Enthusiast
Enthusiast
Posts: 766
Joined: Sun Oct 31, 2004 10:54 am
Location: France
Contact:

Re: GoScintilla - 2.2 (Purebasic 4.5 only)

Post by dobro »

Chm corrected! :)



Image






:)
Last edited by dobro on Tue Mar 29, 2011 10:44 am, edited 1 time in total.
Image
Windows 98/7/10 - PB 5.42
■ sites : http://michel.dobro.free.fr/
srod
PureBasic Expert
PureBasic Expert
Posts: 10589
Joined: Wed Oct 29, 2003 4:35 pm
Location: Beyond the pale...

Re: GoScintilla - 2.2 (Purebasic 4.5 only)

Post by srod »

The original CHM file works fine here.
I may look like a mule, but I'm not a complete ass.
User avatar
dobro
Enthusiast
Enthusiast
Posts: 766
Joined: Sun Oct 31, 2004 10:54 am
Location: France
Contact:

Re: GoScintilla - 2.2 (Purebasic 4.5 only)

Post by dobro »

srod wrote:The original CHM file works fine here.
no in my Samsung NC10 !
1024x600 no Scroll ! :shock: :? strange
Image
Windows 98/7/10 - PB 5.42
■ sites : http://michel.dobro.free.fr/
User avatar
dobro
Enthusiast
Enthusiast
Posts: 766
Joined: Sun Oct 31, 2004 10:54 am
Location: France
Contact:

Re: GoScintilla - 2.2 (Purebasic 4.5 only)

Post by dobro »

do not waste your time on this, I make a little help
with PureHelper of Gnozal ;)


http://michel.dobro.free.fr/Forum_PB/go ... ntilla.zip

Image

:)

Thanks for Go_scintilla :D
Image
Windows 98/7/10 - PB 5.42
■ sites : http://michel.dobro.free.fr/
User avatar
dobro
Enthusiast
Enthusiast
Posts: 766
Joined: Sun Oct 31, 2004 10:54 am
Location: France
Contact:

Re: GoScintilla - 2.2 (Purebasic 4.5 only)

Post by dobro »

Hello,

Hello, Srod

I program an Purebasic editor whith your PureBasic library

I have a problem with Go_scintilla

some files like this:
http://michel.dobro.free.fr/Forum_PB/go ... _Punch.zip

refuse to load line by line in the go_scintilla editor
they appear on one line in the go_scintilla editor !!

while most other files are displayed well (multiline)

bug ? :?


I stuck ..


my procedure load

Code: Select all

Procedure Load_Pb(num)
    ;num=numero de l'editeur
  
    lineIndex=0
    NomFichier_load$ = OpenFileRequester("Ouvrir", NomFichier_load$, "Purebasic|*.pb;*.pbi", 0 )
    If ReadFile(0,  NomFichier_load$)  ; Si le fichier peut être lu , on continue...
        While Eof(0) = 0           ; Boucle tant que la fin du fichier n'est pas atteinte. (Eof = 'End Of File') 
            Ligne$=ReadString(0)  ; Affiche ligne par ligne le contenu du fichier
             ; lineIndex=lineIndex+1
            GOSCI_InsertLineOfText(num, -1,Ligne$ ) 
        Wend
        CloseFile(0) ; Ferme le fichier précédemment ouvert
        ;GOSCI_SetText(#Editor,  Ligne$, clearUndoStack=#False)
        Ligne$=""
    Else
        MessageRequester("Information","Impossible d'ouvrir le fichier!")
    EndIf 
EndProcedure

Image
Windows 98/7/10 - PB 5.42
■ sites : http://michel.dobro.free.fr/
srod
PureBasic Expert
PureBasic Expert
Posts: 10589
Joined: Wed Oct 29, 2003 4:35 pm
Location: Beyond the pale...

Re: GoScintilla - 2.2 (Purebasic 4.5 only)

Post by srod »

Both your procedure and your file work fine here.
I may look like a mule, but I'm not a complete ass.
User avatar
dobro
Enthusiast
Enthusiast
Posts: 766
Joined: Sun Oct 31, 2004 10:54 am
Location: France
Contact:

Re: GoScintilla - 2.2 (Purebasic 4.5 only)

Post by dobro »

:shock: :shock:

Strange ! ....
I continue ...
I'll see later .. Thank you for your test
Image
Windows 98/7/10 - PB 5.42
■ sites : http://michel.dobro.free.fr/
User avatar
dobro
Enthusiast
Enthusiast
Posts: 766
Joined: Sun Oct 31, 2004 10:54 am
Location: France
Contact:

Re: GoScintilla - 2.2 (Purebasic 4.5 only)

Post by dobro »

sorry to insist, but there is indeed a bug!
Image

in this image:
blue in the listing as it appears in the editor PureBasic

in red the bug!
in the editor Go_scintilla
whole structure is on a single line, and Inverted !
while the rest of the listing is correct

in Green, proof by the debugger that the lines
however, are well read!

what makes me say that the editor Go_scintilla does not seem stable! :?
Image
Windows 98/7/10 - PB 5.42
■ sites : http://michel.dobro.free.fr/
User avatar
dobro
Enthusiast
Enthusiast
Posts: 766
Joined: Sun Oct 31, 2004 10:54 am
Location: France
Contact:

Re: GoScintilla - 2.2 (Purebasic 4.5 only)

Post by dobro »

However, it seems that if I start to insert
lines of code from line 2 of the publisher Go_scintilla it corrects the problem :)

my code does not work:

Code: Select all

Procedure Load_Pb(num)
	;num=numero de l'editeur
	
	lineIndex=0
	NomFichier_load$ = OpenFileRequester("Ouvrir", NomFichier_load$, "Purebasic|*.pb;*.pbi", 0 )
	If ReadFile(0,  NomFichier_load$)  ; Si le fichier peut être lu , on continue...
		
		While Eof(0) = 0           ; Boucle tant que la fin du fichier n'est pas atteinte. (Eof = 'End Of File') 
			Ligne$=ReadString(0)  ; Affiche ligne par ligne le contenu du fichier
			;lineIndex=lineIndex+1
			
			GOSCI_InsertLineOfText(num, -1,Ligne$ ) 
		Wend
		CloseFile(0) ; Ferme le fichier précédemment ouvert
		;GOSCI_SetText(#Editor,  Ligne$, clearUndoStack=#False)
		Ligne$=""
	Else
		MessageRequester("Information","Impossible d'ouvrir le fichier!")
	EndIf 
	nom$=GetFilePart(NomFichier_load$) 
	nom_onglet_panel(#Panel, nom$)
	
EndProcedure

my code works ..

Code: Select all

Procedure Load_Pb(num)
	;num=numero de l'editeur
	
	lineIndex=0
	NomFichier_load$ = OpenFileRequester("Ouvrir", NomFichier_load$, "Purebasic|*.pb;*.pbi", 0 )
	If ReadFile(0,  NomFichier_load$)  ; Si le fichier peut être lu , on continue...
		GOSCI_InsertLineOfText(num, -1,"" )  ; ------------------ SROD HERE  !! insert in the number one line  !!  :)
		While Eof(0) = 0           ; Boucle tant que la fin du fichier n'est pas atteinte. (Eof = 'End Of File') 
			Ligne$=ReadString(0)  ; Affiche ligne par ligne le contenu du fichier
			;lineIndex=lineIndex+1
			
			GOSCI_InsertLineOfText(num, -1,Ligne$ ) 
		Wend
		CloseFile(0) ; Ferme le fichier précédemment ouvert
		;GOSCI_SetText(#Editor,  Ligne$, clearUndoStack=#False)
		Ligne$=""
	Else
		MessageRequester("Information","Impossible d'ouvrir le fichier!")
	EndIf 
	nom$=GetFilePart(NomFichier_load$) 
	nom_onglet_panel(#Panel, nom$)
	
EndProcedure
Image
Windows 98/7/10 - PB 5.42
■ sites : http://michel.dobro.free.fr/
srod
PureBasic Expert
PureBasic Expert
Posts: 10589
Joined: Wed Oct 29, 2003 4:35 pm
Location: Beyond the pale...

Re: GoScintilla - 2.2 (Purebasic 4.5 only)

Post by srod »

Can you send me that particular file and I may need all of your source as well.
I may look like a mule, but I'm not a complete ass.
Post Reply