Pure Scintilla Extensions
Posted: Thu Dec 10, 2009 5:27 am

- supported version PB 4.40
- based scintillaGadget
- purebasic commands supported (addgadgetitem, setgadgetcolor...)
Todo :
- regex styling engine
- more purebasic commands
- cross-platform ( probably but I didn't test it)
help links:
- goscintilla : http://www.purebasic.fr/english/viewtop ... 14&t=40088
- custom gadget : http://www.purebasic.fr/english/viewtop ... lit=custom
Code: Select all
OpenWindow(0, 0, 0, 600, 300, "Pure Scintilla", #PB_Window_SizeGadget | #PB_Window_ScreenCentered | #PB_Window_SystemMenu)
PureScintillaGadget(1, 5, 5, 590, 290)
SetGadgetColor(1, #PBSCI_GADGET_CARETLINEBACKCOLOR, $EEEEEE)
SetGadgetColor(1, #PBSCI_GADGET_SELECTIONBACKCOLOR, $CEE3FF)
;set text
text$=";{"+#CRLF$
text$+"; GoScintilla."+#CRLF$
text$+"; By Stephen Rodriguez."+#CRLF$
text$+";}"+#CRLF$+#CRLF$
text$+"#MyConstant$ = "+Chr(34)+"Version = 1.0"+Chr(34)+" + #TAB$"+#CRLF$+#CRLF$
text$+"Procedure.i MyFunction(a, b, *ptr.Integer)"+#CRLF$
text$+#TAB$+"Protected Dim MyArray.POINT(0)"+#CRLF$
text$+#TAB$+"If a$="+Chr(34)+""+Chr(34)+" : result = 0.5 * 1. - a + b * *ptr\i / 'a' : EndIf ;Calculate "+#CRLF$
text$+#TAB$+"ProcedureReturn result"+#CRLF$
text$+"EndProcedure"+#CRLF$+#CRLF$
text$+"Debug "+Chr(34)+"Result = "+Chr(34)+" + Str(MyFunction(10 & %011, $20, @val))"+#CRLF$
text$+"End"
text$+"XXXXXXXXXXXXXXX REMOVE ITEM XXXXXXXXXXXXXXXXXX"
SetGadgetText(1, text$)
AddGadgetItem(1, 0, ";// Prepended Text ∞")
AddGadgetItem(1, -1, ";// Appended Text ∞")
RemoveGadgetItem(1, 15)
MessageRequester(GetGadgetItemText(1, 0, 14), GetGadgetText(1))