In my program i have the EnableExplicit activated.
I wanted to use netmastro's code, but i need to know the variable declation i must write in the procedure.
Can someone help me please ?
Code: Select all
EnableExplicit
Procedure Callback(hwnd, msg, wparam, lparam)
Protected result.l
Protected pt.point
result = #PB_ProcessPureBasicEvents
If msg=#WM_COMMAND
If IsGadget(1)
If lparam = GadgetID(1)
If wparam >> 16 = 1024 ; EN_UPDATE
SendMessage_(GadgetID(1), #EM_GETSCROLLPOS, 0, @pt.point)
SendMessage_(GadgetID(0), #EM_SETSCROLLPOS, 0, @pt)
EndIf
EndIf
EndIf
result = 0
EndIf
ProcedureReturn result
EndProcedure
Global a.b
If OpenWindow(0, 0, 0, 322, 150, "EditorGadget", #PB_Window_SystemMenu | #PB_Window_ScreenCentered) And CreateGadgetList(WindowID(0))
SetWindowCallback(@Callback())
ContainerGadget(2,5,5,50,133)
EditorGadget(0, 5, 5, 65, 133)
CloseGadgetList()
EditorGadget(1, 60, 10, 250, 133)
For a = 0 To 20
AddGadgetItem(0, a, Str(a))
AddGadgetItem(1, a, "Line "+Str(a))
Next
Repeat : Until WaitWindowEvent()=#WM_CLOSE
EndIf
End