Page 7 sur 7

Re: EPB V2.64

Publié : sam. 01/juil./2017 6:35
par Micoute
Génial

Re: EPB V2.64

Publié : sam. 01/juil./2017 11:17
par JohnJohnsonSHERMAN
:o Wooooow ! Exellent ca... C'est bien LA fonctionnalité qui manque gravement à l'IDE conventionnel :P

Re: EPB V2.64

Publié : sam. 01/juil./2017 11:21
par Zorro
et pourtant c'est si facile a mettre en oeuvre !! :)

il suffit d'ajouter ces lignes de code au moment de la creation du scintilla editeur :

Code : Tout sélectionner

; Set Additional Caret and Selection
ScintillaSendMessage(#editor, #SCI_SETADDITIONALCARETFORE, RGB(157, 64, 41))
ScintillaSendMessage(#editor, #SCI_SETADDITIONALCARETSBLINK, 1)
ScintillaSendMessage(#editor, #SCI_SETADDITIONALSELALPHA, 100)
ScintillaSendMessage(#editor, #SCI_SETADDITIONALSELBACK, RGB(255, 160, 136))
ScintillaSendMessage(#editor, #SCI_SETADDITIONALSELFORE, RGB(200, 200, 200))
; Enable multi cursor editing
ScintillaSendMessage(#editor, #SCI_SETRECTANGULARSELECTIONMODIFIER, #SCMOD_ALT) ; select rectangle range by holding down the ALT key while dragging with the mouse
ScintillaSendMessage(#editor, #SCI_SETMULTIPLESELECTION, 1)                     ; select multiple ranges by holding down the CTRL or CMD key while dragging with the mouse
ScintillaSendMessage(#editor, #SCI_SETMULTIPASTE, #SC_MULTIPASTE_EACH)
ScintillaSendMessage(#editor, #SCI_SETADDITIONALSELECTIONTYPING, 1)



voila c'est tout !! Merci Eddy ;)
http://www.purebasic.fr/english/viewtop ... 12&t=60931

exemple :

Code : Tout sélectionner

EnableExplicit
InitScintilla()

#MENU_EXTEND_SELECTION=10
Define txt$, txtLen, marginWidth

Procedure MakeUTF8Text(text.s)
   Static buffer.s
   buffer=Space(StringByteLength(text, #PB_UTF8))
   PokeS(@buffer, text, -1, #PB_UTF8)
   ProcedureReturn @buffer
EndProcedure

Procedure ExtendScintillaSelection()
   Protected mainSel, selStart, selEnd
   mainSel=ScintillaSendMessage(0, #SCI_GETMAINSELECTION)
   selStart=ScintillaSendMessage(0, #SCI_GETSELECTIONNSTART, mainSel)
   selEnd=ScintillaSendMessage(0, #SCI_GETSELECTIONNEND, mainSel)
   
EndProcedure

txt$="Scintilla is a free source code editing component. It comes with "+#CR$+
     "complete source code and a license that permits use in any project "+#CR$+
     "or product personal or commercial. The license may be viewed here. "+#CR$+
     "The source code, as well as the library documentation may be found "+#CR$+
     "on the Scintilla Homepage. From the Scintilla Homepage : As well As "+#CR$+
     "features found in standard text editing components, Scintilla includes "+#CR$+
     "features especially useful when editing And debugging source code."+#CR$+
     "These include support For syntax styling, error indicators, code "+#CR$+
     "completion And call tips.The selection margin can contain markers "+#CR$+
     "like those used in debuggers To indicate breakpoints and the current "+#CR$+
     "line.Styling choices are more open than With many editors, allowing the"+#CR$+
     " use of proportional fonts, bold And italics, multiple foreground "+#CR$+
     "and background colors And multiple fonts."+#CR$
txtLen=StringByteLength(txt$, #PB_UTF8)

OpenWindow(100, 0, 0, 600, 400, "Editing with Multi cursor (like eclipse or sublimetext)", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)

ScintillaGadget(0, 0, 0, WindowWidth(100), WindowHeight(100), 0)
; Set Text Mode
ScintillaSendMessage(0, #SCI_SETWRAPMODE, #SC_WRAP_NONE)
ScintillaSendMessage(0, #SCI_SETCODEPAGE, #SC_CP_UTF8)
ScintillaSendMessage(0, #SCI_SETVIRTUALSPACEOPTIONS, #SCVS_RECTANGULARSELECTION | #SCVS_USERACCESSIBLE) ; allow cursor and rect selection to move beyond end of line
; Set Current Line Highlighting
ScintillaSendMessage(0, #SCI_SETCARETLINEVISIBLE, 1)
ScintillaSendMessage(0, #SCI_SETCARETLINEVISIBLEALWAYS, 1)
ScintillaSendMessage(0, #SCI_SETCARETLINEBACKALPHA, 50)
ScintillaSendMessage(0, #SCI_SETCARETLINEBACK, RGB(100, 252, 195))
; Set Text style
ScintillaSendMessage(0, #SCI_STYLESETFONT, #STYLE_DEFAULT, MakeUTF8Text("Courier New")) ; rectangle selection works better with mono-width font
ScintillaSendMessage(0, #SCI_STYLESETBACK, #STYLE_DEFAULT, RGB(70, 78, 85))
ScintillaSendMessage(0, #SCI_STYLESETFORE, #STYLE_DEFAULT, RGB(195, 213, 255))
ScintillaSendMessage(0, #SCI_STYLECLEARALL)
; Set Margin size and style
ScintillaSendMessage(0, #SCI_STYLESETFONT, #STYLE_LINENUMBER, MakeUTF8Text("Arial"))
ScintillaSendMessage(0, #SCI_STYLESETBACK, #STYLE_LINENUMBER, RGB(53, 55, 57))
ScintillaSendMessage(0, #SCI_STYLESETFORE, #STYLE_LINENUMBER, RGB(200, 200, 200))
marginWidth=ScintillaSendMessage(0, #SCI_TEXTWIDTH, #STYLE_LINENUMBER, MakeUTF8Text("_999"))
ScintillaSendMessage(0, #SCI_SETMARGINTYPEN, 0, #SC_MARGIN_NUMBER)
ScintillaSendMessage(0, #SCI_SETMARGINWIDTHN, 0, marginWidth)
marginWidth=0
ScintillaSendMessage(0, #SCI_SETMARGINMASKN, 2, #SC_MASK_FOLDERS)
ScintillaSendMessage(0, #SCI_SETMARGINWIDTHN, 2, marginWidth)
ScintillaSendMessage(0, #SCI_SETMARGINSENSITIVEN, 2, #True)
; Set Main Caret and Selection
ScintillaSendMessage(0, #SCI_SETCARETSTICKY, 1) ;make always visible
ScintillaSendMessage(0, #SCI_SETCARETWIDTH, 3)  ;make thicker
ScintillaSendMessage(0, #SCI_SETCARETFORE, RGB(255, 160, 136))
ScintillaSendMessage(0, #SCI_SETSELALPHA, 100)
ScintillaSendMessage(0, #SCI_SETSELBACK, 1, RGB(255, 160, 136))
ScintillaSendMessage(0, #SCI_SETSELFORE, 1, RGB(200, 200, 200))
; Set Additional Caret and Selection
ScintillaSendMessage(0, #SCI_SETADDITIONALCARETFORE, RGB(157, 64, 41))
ScintillaSendMessage(0, #SCI_SETADDITIONALCARETSBLINK, 1)
ScintillaSendMessage(0, #SCI_SETADDITIONALSELALPHA, 100)
ScintillaSendMessage(0, #SCI_SETADDITIONALSELBACK, RGB(255, 160, 136))
ScintillaSendMessage(0, #SCI_SETADDITIONALSELFORE, RGB(200, 200, 200))
; Enable multi cursor editing
ScintillaSendMessage(0, #SCI_SETRECTANGULARSELECTIONMODIFIER, #SCMOD_ALT) ; select rectangle range by holding down the ALT key while dragging with the mouse
ScintillaSendMessage(0, #SCI_SETMULTIPLESELECTION, 1)                     ; select multiple ranges by holding down the CTRL or CMD key while dragging with the mouse
ScintillaSendMessage(0, #SCI_SETMULTIPASTE, #SC_MULTIPASTE_EACH)
ScintillaSendMessage(0, #SCI_SETADDITIONALSELECTIONTYPING, 1)
; Enable hotkey for selection auto extension CTRL + D
AddKeyboardShortcut(100, #PB_Shortcut_Control | #PB_Shortcut_D, #MENU_EXTEND_SELECTION)
BindEvent(#PB_Event_Menu, ExtendScintillaSelection())

; Change text
ScintillaSendMessage(0, #SCI_SETTEXT, 0, MakeUTF8Text(txt$))
ScintillaSendMessage(0, #SCI_GOTOPOS, txtLen)
SetActiveGadget(0)

Repeat: Until WaitWindowEvent()=#PB_Event_CloseWindow 

; IDE Options = PureBasic 5.60 (Windows - x86)
; CursorPosition = 19
; Folding = -
; EnableXP
; EnableAdmin
; CompileSourceDirectory
; Compiler = PureBasic 5.60 (Windows - x86)

a ce propos dans mon editeur EPB , il faut bien aussi remplacer la dll Scintilla par celle que je fourni dans mon archive
(c'est celle de Purebasic 5.60) car avant ça ne marchait pas ce truc !!

Re: EPB V2.64

Publié : sam. 01/juil./2017 11:27
par JohnJohnsonSHERMAN
Merci de la précision Zorro :)

Eh bien je continue a penser que Scintilla est un énorme bordel incompréhensible ;) M'enfin faudrait que je m'y replonge un de ces jours :)

Re: EPB V2.64

Publié : jeu. 06/juil./2017 19:35
par Zorro
Pour info

mise a jour de EPB , quelques corrections concernant le tabulateur .. :)
et l'onglet "Proc" qui pouvais dans certains cas ne pas repertorier les procedures du listing ...

Re: EPB V2.64

Publié : jeu. 06/juil./2017 20:04
par Micoute
Merci pour le partage.

Re: EPB V2.64

Publié : jeu. 06/juil./2017 20:31
par Zorro
pour toi micoute, tu peux seulement remplacer EPB.exe par celui de l'archive et le fichier "Scintilla.dll"
je n'ai pas changer autre chose :)

Re: EPB V2.64

Publié : ven. 07/juil./2017 7:53
par Micoute
Merci pour le bon conseil, même si je suis en confiance avec toi, j'ai préfèré la prudence et j'ai supprimé et recréé le dossier, EPB n'est pas si difficile à réinitialiser, 2 précautions valent mieux qu'une.