when i pasted a 10000 lines text in the editor Gadget it takes about 5 seconds to appear in the editor gadget, in comparison with (other basic) it is displayed instantaneously in a texBox, this is just a show case i don't use other basic. is it possible to decrease the time in purebasic , the gadget should have vertical and horizontal scroll bars
use the text from here http://www.gutenberg.org/ebooks/100 download the file Plain Text UTF-8 5.5 MB, open it and search for the words " Away, my Thetis! " line 10000 copy the text from it up to the top and paste it in the editor gadget here, (i don't want to load the file just copy and paste text)
(what other possible gadgets alternatives to display big text)
thank you
tested with 5.70 LTS in XP/32b
Code: Select all
Declare DoSomething()
Enumeration
#Edit = 0
#Button
EndEnumeration
Global txt.s
If OpenWindow(0,0,0,800,600,"Test",#PB_Window_SystemMenu|#PB_Window_ScreenCentered|#PB_Window_SizeGadget)
CreatePopupMenu(0)
MenuItem(0, "Cut")
MenuItem(1, "Copy")
MenuItem(2, "Paste")
EditorGadget(#Edit, 3, 3, 750, 550)
SetGadgetColor(#Edit, #PB_Gadget_BackColor, RGB(248,236,190))
ButtonGadget(#Button , 756,20,45,40,"RUN")
LoadFont(1,"Tahoma",12)
SetGadgetFont(0,FontID(1))
i=0
Repeat
Select WaitWindowEvent()
Case #PB_Event_CloseWindow
Break
Case #PB_Event_Gadget
Select EventGadget()
Case #Button
DoSomething()
EndSelect
Case #PB_Event_Menu
Select EventMenu()
Case 0
SendMessage_(GadgetID(0), #WM_CUT, 0, 0)
Case 1
SendMessage_(GadgetID(0), #WM_COPY, 0, 0)
Case 2
SendMessage_(GadgetID(0), #WM_PASTE, 0, 0)
EndSelect
Case #WM_RBUTTONDOWN
If EventGadget() = 0
DisplayPopupMenu(0, WindowID(0))
EndIf
EndSelect
ForEver
Else
Debug "Could not Open Window!"
EndIf
End
Procedure DoSomething()
txt = GetGadgetText(0)
For k = 1 To 2000
Debug StringField(txt, k, #CRLF$)
Next
EndProcedure