Base sample with scintilla
![Post Post](./styles/prosilver/imageset/icon_post_target.gif)
Hello,
I am trying to use scintilla in my program to syntax highlight, but it have no lucky...
Help?
I am trying to use scintilla in my program to syntax highlight, but it have no lucky...
- Code: Select all Expand view
- #include "FiveWin.ch"
#include "Scintilla.ch"
function Main()
LOCAL cIni, oWnd, nBits
DEFINE WINDOW oWnd TITLE "TLPosWin - EtiW"
cIni := MemoRead("test.ini")
oWnd:oClient := TScintilla():New( 0, 0, 10,10,oWnd,RGB(0,0,0), RGB(255,255,255),SCLEX_PROPERTIES)
oWnd:oClient:AddText(cIni)
//oWnd:oClient:Setup()
nBits := oWnd:oClient:Send( SCI_GETSTYLEBITSNEEDED, 0, 0 ) // 8
oWnd:oClient:Send( SCI_SETSTYLEBITS, Max( 5, nBits ) )
oWnd:oClient:Send( SCI_SETLEXER, SCLEX_PROPERTIES,0 )
oWnd:oClient:AddText(cIni)
oWnd:oClient:StyleSetFont( "Lucida Console" )
oWnd:oClient:Send( SCI_STYLESETFONT,STYLE_DEFAULT, "Lucida Console" )
oWnd:oClient:Send(SCI_STYLESETFORE, SCE_PROPS_DEFAULT , RGB(0, 0, 0))
oWnd:oClient:Send(SCI_STYLESETFORE, SCE_PROPS_COMMENT , RGB(128, 128, 128))
oWnd:oClient:Send(SCI_STYLESETFORE, SCE_PROPS_SECTION , RGB(0, 0, 255))
oWnd:oClient:Send(SCI_STYLESETFORE, SCE_PROPS_ASSIGNMENT, RGB(0, 128, 0))
oWnd:oClient:Send(SCI_STYLESETFORE, SCE_PROPS_DEFVAL , RGB(0, 0, 128))
oWnd:oClient:Send(SCI_STYLESETFORE, SCE_PROPS_KEY , RGB(255, 0, 0))
oWnd:oClient:SetColourise()
//*/
ACTIVATE WINDOW oWnd
return 0
Help?