Scintilla, static, and with full features

Got an idea for enhancing PureBasic? New command(s) you'd like to see?
User avatar
Tenaja
Addict
Addict
Posts: 1959
Joined: Tue Nov 09, 2010 10:15 pm

Scintilla, static, and with full features

Post by Tenaja »

After some wrangling with InitScintilla(), I found that it does not permit changing of standard Scintilla lexers. I do not know if this is a bug, or the version is merely limited. Using InitScintillaStaticFull(), the feature started working. I also had success with OpenLibrary:
OpenLibrary(#PB_Any, "SciLexer.dll")

Unfortunately, I cannot use InitScintillaStaticFull() since it is not "sustainable". (i.e. part of the compiler, or open source.)

I would like to request a full version of Scintilla (with and without the lexers), with Native PB commands, statically linked for all OS's.

BTW, I am currently using Win7, 32-bit, in case it is a bug.

Thank you!
User avatar
Tenaja
Addict
Addict
Posts: 1959
Joined: Tue Nov 09, 2010 10:15 pm

Re: Scintilla, static, and with full features

Post by Tenaja »

This is the code that demonstrates that it is either a bug or a missing feature:

Code: Select all

     If OpenWindow(0, 0, 0, 320, 90, "ScintillaGadget", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
     
         If InitScintilla()     ; change to InitScintillaStaticFull() and it works.
            ScintillaGadget(0, 10, 10, 300, 70, #Null)
            Debug ScintillaSendMessage(0, #SCI_GETLEXER)
            ScintillaSendMessage(0, #SCI_SETLEXER, #SCLEX_CPP, 0)
            Debug ScintillaSendMessage(0, #SCI_GETLEXER)
           
            ; Output set to red color
            ScintillaSendMessage(0, #SCI_STYLESETFORE, 0, RGB(255, 0, 0))
           
            ; Set the initial text to the ScintillaGadget
            ScintillaSendMessage(0, #SCI_SETTEXT, 0, @"This is a simple ScintillaGadget with text...")
           
            ; Adding a second line of text with linebreak before
            Text$ = Chr(10) + "Second line"
            ScintillaSendMessage(0, #SCI_APPENDTEXT, Len(Text$), @Text$)
         EndIf
         
         Repeat : Until WaitWindowEvent() = #PB_Event_CloseWindow
      EndIf
User avatar
Bisonte
Addict
Addict
Posts: 1305
Joined: Tue Oct 09, 2007 2:15 am

Re: Scintilla, static, and with full features

Post by Bisonte »

ähem

is InitScintillaStaticFull() from gnozals userlib ?
PureBasic 6.21 (Windows x64) | Windows 11 Pro | AsRock B850 Steel Legend Wifi | R7 9800x3D | 64GB RAM | RTX 5080 | ThermaltakeView 270 TG ARGB | build by vannicom​​
English is not my native language... (I often use DeepL.)
User avatar
Tenaja
Addict
Addict
Posts: 1959
Joined: Tue Nov 09, 2010 10:15 pm

Re: Scintilla, static, and with full features

Post by Tenaja »

Bisonte wrote:ähem
is InitScintillaStaticFull() from gnozals userlib ?
Yes, exactly. And that is why I am requesting it from PB; so it can be a native part of PB.

I cannot use gnozals libs, because they are not properly sustainable. They are not open source, they are not on all platforms, and they are not as "reliable" as PB from a longevity standpoint. For me to use a library, it must meet that criteria.

It is out of no disrespect to gnozal, but if he gets hit by a bus, or catches the C flu, then the lib gets frozen in time, with no more bugfixes, no more updates, etc.

I stated this all in my original post, so I guess I do not understand what your "ahem" was about. I merely used his library to demonstrate how the lexers are lacking in PB's library. As it is, I have to use a DLL within Windows, and when I begin porting the project to Linux and Mac, it seems safe to presume the missing features will still be missing.
xorc1zt
Enthusiast
Enthusiast
Posts: 276
Joined: Sat Jul 09, 2011 7:57 am

Re: Scintilla, static, and with full features

Post by xorc1zt »

just use InitScintilla("SciLexer.dll")
User avatar
Tenaja
Addict
Addict
Posts: 1959
Joined: Tue Nov 09, 2010 10:15 pm

Re: Scintilla, static, and with full features

Post by Tenaja »

xorc1zt wrote:just use InitScintilla("SciLexer.dll")
Sure, for windows. But not Mac or Linux...
User avatar
ts-soft
Always Here
Always Here
Posts: 5756
Joined: Thu Jun 24, 2004 2:44 pm
Location: Berlin - Germany

Re: Scintilla, static, and with full features

Post by ts-soft »

the static lib from linux should full featured, with lexers!
PureBasic 5.73 | SpiderBasic 2.30 | Windows 10 Pro (x64) | Linux Mint 20.1 (x64)
Old bugs good, new bugs bad! Updates are evil: might fix old bugs and introduce no new ones.
Image
X
Enthusiast
Enthusiast
Posts: 311
Joined: Tue Apr 04, 2006 6:27 am

Re: Scintilla, static, and with full features

Post by X »

Plus that userlib is not 64bit so it's no good for modern OSes :( I give a +1 to this request.
Post Reply