[Résolu] ScintillaGadget : Colorer une colonne d'information
Publié : jeu. 01/févr./2018 14:38
Avec le GadgetScintilla() on peut afficher et colorer la colonne de numérotation des lignes.
On peut aussi afficher une autre colonne pour afficher par exemple les infos de pliage de code.
■ Par contre je n'arrive pas à trouver l'info pour colorer cette colonne.
Voici le code réduit à son stricte minimum.merci de votre aide
■ Solution
On peut aussi afficher une autre colonne pour afficher par exemple les infos de pliage de code.
■ Par contre je n'arrive pas à trouver l'info pour colorer cette colonne.
Voici le code réduit à son stricte minimum.
Code : Tout sélectionner
EnableExplicit
Enumeration Form
#mf
EndEnumeration
Enumeration Gadget
#Editor
EndEnumeration
;-Plan de l'application
Declare Start()
Declare MainFormShow()
Declare MainFormResize()
Declare MainFormClose()
Declare ScintillaCallBack(Gadget, *scinotify.SCNotification)
Declare ScintillaProperties(Gadget)
Start()
Procedure Start()
OpenWindow(#mf, 0, 0, 1024, 768, "Test", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
If InitScintilla()
ScintillaGadget(#Editor, 0, 0, WindowWidth(#mf), WindowHeight(#mf), @ScintillaCallBack())
ScintillaProperties(#Editor)
SetActiveGadget(#Editor)
EndIf
BindEvent(#PB_Event_CloseWindow, @MainFormClose())
Repeat : WaitWindowEvent(10) : ForEver
EndProcedure
Procedure ScintillaCallBack(Gadget, *scinotify.SCNotification)
EndProcedure
Procedure MainFormClose()
End
EndProcedure
Procedure ScintillaProperties(Gadget)
;Line numbering column
ScintillaSendMessage(Gadget, #SCI_SETMARGINTYPEN, 0, #SC_MARGIN_NUMBER)
ScintillaSendMessage(Gadget, #SCI_SETMARGINWIDTHN, 0, 50)
ScintillaSendMessage(Gadget, #SCI_STYLESETBACK, #STYLE_LINENUMBER, RGB(154, 205, 50))
ScintillaSendMessage(Gadget, #SCI_STYLESETFORE, #STYLE_LINENUMBER, RGB(82, 86, 111))
;Code folding (How to colour this column ?)
ScintillaSendMessage(Gadget, #SCI_SETMARGINMASKN, 2, #SC_MASK_FOLDERS)
ScintillaSendMessage(Gadget, #SCI_SETMARGINWIDTHN, 2, 20)
ScintillaSendMessage(Gadget, #SCI_SETMARGINSENSITIVEN, 2, #True)
EndProcedure
■ Solution
Code : Tout sélectionner
ScintillaSendMessage(Gadget, #SCI_SETFOLDMARGINCOLOUR, 2, RGB(107, 142, 35))
ScintillaSendMessage(Gadget, #SCI_SETFOLDMARGINHICOLOUR, 2, RGB(107, 142, 35))