Si tu utilises la version 64bits de PB, alors tu dois avoir dans le dossier de ton programme le fichier SciLexer.dll en version 64 bits.
Comtois utilise des codes couleurs pas tres contrastés et je te propose d'essayer le code suivant dans lequel les couleurs des balises sont plus contrastés.
Important : (Oui je me répete :p) le SciLexer.dll doit être dans le même dossier que ton programme ou dans un dossier dont tu indiqueras le chemin.
Code : Tout sélectionner
EnableExplicit
Enumeration
#Mainform
#Editor
EndEnumeration
Global StyleWindows.l=#PB_Window_SystemMenu | #PB_Window_ScreenCentered | #PB_Window_SizeGadget
;Attention : SciLexer.dll doit etre present dans le meme dossier que votre programme
;ou bien dans un dossier dont vous aurez indiqué le chemin.
InitScintilla("SciLexer.dll")
Procedure SetScintillaProperties(Gadget)
;# Init Lexer
ScintillaSendMessage(Gadget, #SCI_SETLEXER, #SCLEX_HTML)
;# Default
ScintillaSendMessage(Gadget, #SCI_STYLESETFORE, #STYLE_DEFAULT, #Black)
ScintillaSendMessage(Gadget, #SCI_STYLESETBACK, #STYLE_DEFAULT, $EAFEFE)
ScintillaSendMessage(Gadget, #SCI_STYLESETFONT,#STYLE_DEFAULT,@"Verdana")
ScintillaSendMessage(Gadget, #SCI_STYLESETSIZE, #STYLE_DEFAULT, 12)
;# Margin Line Number
ScintillaSendMessage(Gadget, #SCI_SETMARGINTYPEN, 0, #SC_MARGIN_NUMBER)
ScintillaSendMessage(Gadget, #SCI_SETMARGINWIDTHN, 0, 40)
;# Margin Mask Folder
ScintillaSendMessage(Gadget, #SCI_SETMARGINMASKN, 2, #SC_MASK_FOLDERS)
ScintillaSendMessage(Gadget, #SCI_SETMARGINWIDTHN, 2, 15)
;# Set Active Line
ScintillaSendMessage(Gadget, #SCI_SETCARETLINEVISIBLE, #True)
ScintillaSendMessage(Gadget, #SCI_SETCARETLINEBACK, $C4FBFA)
;# Use Tabs
ScintillaSendMessage(Gadget, #SCI_SETUSETABS, 1)
ScintillaSendMessage(Gadget, #SCI_STYLECLEARALL)
;# Tags (Balise)
ScintillaSendMessage(Gadget, #SCI_STYLESETFORE, #SCE_H_TAG, #Red)
;# Unknown Tags
ScintillaSendMessage(Gadget, #SCI_STYLESETFORE, #SCE_H_TAGUNKNOWN, RGB($00, $00, $80))
;# Attributes
ScintillaSendMessage(Gadget, #SCI_STYLESETFORE, #SCE_H_ATTRIBUTE, #Blue)
; # Unknown Attributes
ScintillaSendMessage(Gadget, #SCI_STYLESETFORE, #SCE_H_ATTRIBUTEUNKNOWN, RGB($00, $80, $80))
; # Numbers
ScintillaSendMessage(Gadget, #SCI_STYLESETFORE, #SCE_H_NUMBER, #Red)
; # Double quoted strings
ScintillaSendMessage(Gadget, #SCI_STYLESETFORE, #SCE_H_DOUBLESTRING, RGB(120, 120, 120))
; # Single quoted strings
ScintillaSendMessage(Gadget, #SCI_STYLESETFORE, #SCE_H_SINGLESTRING, RGB(120, 120, 120))
; # Other inside tag
ScintillaSendMessage(Gadget, #SCI_STYLESETFORE, #SCE_H_OTHER, RGB($80, $00, $80))
; # Comment
ScintillaSendMessage(Gadget, #SCI_STYLESETFORE, #SCE_H_COMMENT, #Green)
EndProcedure
Procedure MainFormShow()
OpenWindow(#MainForm, #PB_Ignore, #PB_Ignore, 800, 600, "HTML Editor", StyleWindows)
ScintillaGadget(#Editor, 10, 10, 790, 590, 0)
RemoveKeyboardShortcut(#Mainform, #PB_Shortcut_Tab)
;Desactivation des combinaisons de touches à caractères spéciaux.
AddKeyboardShortcut(#Mainform, #PB_Shortcut_Control+#PB_Shortcut_B, 0)
AddKeyboardShortcut(#Mainform, #PB_Shortcut_Control+#PB_Shortcut_G, 0)
AddKeyboardShortcut(#Mainform, #PB_Shortcut_Control+#PB_Shortcut_E, 0)
AddKeyboardShortcut(#Mainform, #PB_Shortcut_Control+#PB_Shortcut_R, 0)
AddKeyboardShortcut(#Mainform, #PB_Shortcut_Control+#PB_Shortcut_O, 0)
AddKeyboardShortcut(#Mainform, #PB_Shortcut_Control+#PB_Shortcut_P, 0)
AddKeyboardShortcut(#Mainform, #PB_Shortcut_Control+#PB_Shortcut_Q, 0)
AddKeyboardShortcut(#Mainform, #PB_Shortcut_Control+#PB_Shortcut_S, 0)
AddKeyboardShortcut(#Mainform, #PB_Shortcut_Control+#PB_Shortcut_F, 0)
AddKeyboardShortcut(#Mainform, #PB_Shortcut_Control+#PB_Shortcut_H, 0)
AddKeyboardShortcut(#Mainform, #PB_Shortcut_Control+#PB_Shortcut_K, 0)
AddKeyboardShortcut(#Mainform, #PB_Shortcut_Control+#PB_Shortcut_W, 0)
AddKeyboardShortcut(#Mainform, #PB_Shortcut_Control+#PB_Shortcut_N, 0)
SetActiveGadget(#editor)
EndProcedure
Procedure MainFormResize()
ResizeGadget(#Editor, #PB_Ignore, #PB_Ignore, WindowWidth(#MainForm)-30, WindowHeight(#Mainform)-30)
EndProcedure
MainFormShow()
SetScintillaProperties(1)
Repeat
Select WaitWindowEvent()
Case #PB_Event_Gadget
Case #PB_Event_SizeWindow
MainFormResize()
Case #PB_Event_CloseWindow
End
EndSelect
ForEver
Je n'ai pas testé avec PB 64Bits car je n'ai pas SciLexer.dll en version 64 bits. (La version 64 Bits existe t'elle ?)