Was wondering if the Scintilla gadget supports line number on the left side?
As in:
1: Blah blah
2: Blah blah
3: Same, etc...
All I could find was this post and it didn't seem to answer it fully. https://www.purebasic.fr/english/viewto ... ne+numbers
Or is there an alternative to use for instead. I am sure that most likely has been asked before but, I could not find the answer.
Regards,
-M
Scintilla gadget (Line numbering) [Solved]
Scintilla gadget (Line numbering) [Solved]
Last edited by mocitymm on Wed Apr 01, 2020 12:39 am, edited 1 time in total.
Re: Scintilla gadget (Line numbering)
The following example displays a yellow line number area for two digits (tested successfully on Windows 10 x64 V1809 with PB 5.71 x86 and x64):mocitymm wrote:Was wondering if the Scintilla gadget supports line number on the left side?
Code: Select all
OpenWindow(0, 100, 100, 320, 110, "ScintillaGadget")
If InitScintilla()
ScintillaGadget(0, 10, 10, 300, 90, 0)
*Text = UTF8("<= With 2-digit line numbers")
ScintillaSendMessage(0, #SCI_SETTEXT, 0, *Text)
FreeMemory(*Text)
; ----- Set line number margin to display 2 digits
; (Default width 0: invisible)
ScintillaSendMessage(0, #SCI_SETMARGINWIDTHN, 0, 20)
; ----- Set background color of line number margin to yellow
ScintillaSendMessage(0, #SCI_STYLESETBACK, #STYLE_LINENUMBER, #Yellow)
; ----- Hide non-folding symbol margin (default width 16)
ScintillaSendMessage(0, #SCI_SETMARGINWIDTHN, 1, 0)
Repeat
Until WaitWindowEvent() = #PB_Event_CloseWindow
EndIf
Re: Scintilla gadget (Line numbering)
Yes, it does. It supports all of the scintilla commands within the given scintilla version. (Not typically the newest.)mocitymm wrote:Was wondering if the Scintilla gadget supports line number on the left side?
As in:
1: Blah blah
2: Blah blah
3: Same, etc...
All I could find was this post and it didn't seem to answer it fully. https://www.purebasic.fr/english/viewto ... ne+numbers
Or is there an alternative to use for instead. I am sure that most likely has been asked before but, I could not find the answer.
Regards,
-M
Find the command list here:
https://www.scintilla.org/ScintillaDoc.html
If a command is not valid, look at the scintilla history file and verify it wasn't added after the PB version.
Re: Scintilla gadget (Line numbering)
Shardik and Tenaja,
Thank you both, exactly what I needed! Much appreciated.
Regards,
-M
Thank you both, exactly what I needed! Much appreciated.
Regards,
-M
Re: Scintilla gadget (Line numbering) [Solved]
If you look for the GoScintilla library in the forum, you will find not only a great library, but also most of the constants defined. (Which is helpful if you just want a simple or focused application.)