Anyhow, this seems to do the trick...
Code: Select all
Global OldScintillaProc
Procedure ScintillaCharCallback(hwnd,uMsg,wParam,lParam)
If uMsg=#WM_KEYDOWN
If wParam=#VK_BACK
pos=ScintillaSendMessage(#Scintilla,#SCI_GETCURRENTPOS)-1
If pos>=0
style=ScintillaSendMessage(#Scintilla,#SCI_GETSTYLEAT,pos)&$ff
If style&$80
Select style&$7f
Case #Style_Title
Beep_(600,100)
ProcedureReturn 0
Case #Style_Grid
Beep_(600,200)
ProcedureReturn 0
EndSelect
EndIf
EndIf
EndIf
EndIf
ProcedureReturn CallWindowProc_(OldScintillaProc,hwnd,uMsg,wParam,lParam)
EndProcedure
Procedure SetupScintilla(gadget,readonly=#True)
result=ScintillaGadget(gadget,0,0,400,300,@ScintillaCallback())
If result
OldScintillaProc=SetWindowLongPtr_(result,#GWL_WNDPROC,@ScintillaCharCallback())
.
.
style=#Style_Title|$80
ScintillaSendMessage(gadget,#SCI_STYLESETSIZE,style,11)
ScintillaSendMessage(gadget,#SCI_STYLESETBOLD,style,#True)
ScintillaSendMessage(gadget,#SCI_STYLESETITALIC,style,#False)
ScintillaSendMessage(gadget,#SCI_STYLESETUNDERLINE,style,#False)
;ScintillaSendMessage(gadget,#SCI_STYLESETHOTSPOT,style,#True)
ScintillaSendMessage(gadget,#SCI_STYLESETCHANGEABLE,style,#False) ; <--- also important
ScintillaSendMessage(gadget,#SCI_STYLESETEOLFILLED,style,#True)
.
.