Hello everybody,
I hope you are safe and fine.
I need to synchronize movements (up and down) of two scintillas gadgets (in the same way that Winmerge do the job)
Thank you in advance,
Kanter
[SOLVED] Synchronize two gadgets
-
- User
- Posts: 84
- Joined: Mon Sep 06, 2010 3:05 pm
[SOLVED] Synchronize two gadgets
Last edited by Maitre_Kanter on Fri Apr 17, 2020 9:26 pm, edited 1 time in total.
-
- Always Here
- Posts: 6426
- Joined: Fri Oct 23, 2009 2:33 am
- Location: Wales, UK
- Contact:
Re: Synchronize two gadgets
Not the specific solution you need but interesting:
https://www.purebasic.fr/english/viewto ... 41&start=0
https://www.purebasic.fr/english/viewto ... 41&start=0
IdeasVacuum
If it sounds simple, you have not grasped the complexity.
If it sounds simple, you have not grasped the complexity.
Re: Synchronize two gadgets
Code: Select all
EnableExplicit
InitScintilla()
Procedure ScintillaCallBack(gadget, *sciNotify.SCNotification)
Protected firstVisible
Select *sciNotify\nmhdr\code
Case #SCN_UPDATEUI
firstVisible = ScintillaSendMessage(gadget, #SCI_GETFIRSTVISIBLELINE)
If gadget = 0
ScintillaSendMessage(1, #SCI_SETFIRSTVISIBLELINE, firstVisible)
Else
ScintillaSendMessage(0, #SCI_SETFIRSTVISIBLELINE, firstVisible)
EndIf
EndSelect
EndProcedure
OpenWindow(0, 0, 0, 770, 480, "", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
ScintillaGadget(0, 0, 0, WindowWidth(0) / 2, WindowHeight(0) - 20, @ScintillaCallback())
ScintillaGadget(1, GadgetX(0) + GadgetWidth(0), 0, WindowWidth(0) / 2, WindowHeight(0) - 20, @ScintillaCallback())
Define i, txt.s, *txt
For i = 1 To 400
txt + "Line " + Str(i) + Chr(10)
Next
*txt = UTF8(txt)
ScintillaSendMessage(0, #SCI_SETTEXT, 0, *txt)
ScintillaSendMessage(1, #SCI_SETTEXT, 0, *txt)
FreeMemory(*txt)
Repeat : Until WaitWindowEvent() = #PB_Event_CloseWindow
-
- User
- Posts: 84
- Joined: Mon Sep 06, 2010 3:05 pm
Re: Synchronize two gadgets
Thank you very much !
Amazing !!!! Youpi !
Kanter
Amazing !!!! Youpi !
Kanter