EnableExplicit
OpenWindow(0, 0, 0, 400, 400, "Test")
TreeGadget(0, 0, 0, 400, 400)
AddGadgetItem(0, -1, "This is an incredibly long string, and it'll most likely get cut off at some point in the very near future. I'm still uncertain if this is a PB bug or a Windows one, although I have seen certain listboxes do the exact same thing so I'm beginning to wonder if it actually is a Windows thing.", 0, 0)
SetGadgetState(0, 0)
SetActiveGadget(0)
Repeat : Until WaitWindowEvent(1) = #PB_Event_CloseWindow
At least on Windows using a screen reader, the text gets cut off around the word "wonder". Has anyone hit this, and if so is there a way around it?
Thanks!
EnableExplicit
Global NewList Book.s()
Global *tmp, *tmp2, Item
OpenWindow(0, 0, 0, 400, 400, "Test")
TreeGadget(0, 0, 0, 400, 400)
*tmp = AddElement(Book())
Book() = "This is an incredibly long string, and it'll most likely get cut off at some point in the very near future. I'm still uncertain if this is a PB bug or a Windows one, although I have seen certain listboxes do the exact same thing so I'm beginning to wonder if it actually is a Windows thing."
AddGadgetItem(0, 0, Book() , 0, 0)
SetGadgetItemData(0 , 0 , *tmp)
SetGadgetState(0, 0)
SetActiveGadget(0)
Repeat
Select WaitWindowEvent()
Case #PB_Event_Gadget
Select EventGadget()
Case 0
If EventType() = #PB_EventType_LeftClick
Item = GetGadgetState(0)
; If Item <> -1
*tmp = GetGadgetItemData(0, Item)
; *tmp2 = SelectElement(Book(), Item) ; in this case the list index Book() and TreeGadget must match
ResetList(Book())
Repeat
*tmp2 = NextElement(Book())
If Not *tmp2
Break
EndIf
If *tmp2 = *tmp
Debug Book()
EndIf
ForEver
; EndIf
EndIf
EndSelect
Case #PB_Event_CloseWindow
CloseWindow(0)
End
EndSelect
ForEver
Last edited by AZJIO on Sat Dec 23, 2023 6:10 pm, edited 1 time in total.
EnableExplicit
Define item,Quit
Dim tgtext.s(10)
OpenWindow(0, 0, 0, 400, 400, "Test",#PB_Window_SystemMenu|#PB_Window_ScreenCentered)
TreeGadget(0, 0, 0, 400, 400)
AddGadgetItem(0, -1, "This is an incredibly long string, and it'll most likely get cut off at some point in the very near future. I'm still uncertain if this is a PB bug or a Windows one, although I have seen certain listboxes do the exact same thing so I'm beginning to wonder if it actually is a Windows thing.", 0, 0)
AddGadgetItem(0, -1, "This for test")
For item = 0 To CountGadgetItems(0)
tgtext(item) = GetGadgetItemText(0,item)
Next
SetGadgetState(0, 0)
SetActiveGadget(0)
Repeat
Select WaitWindowEvent(1)
Case #PB_Event_CloseWindow
Quit = 1
Case #PB_Event_Gadget
Select EventGadget()
Case 0
Select EventType()
Case #PB_EventType_LeftClick
Debug tgtext(GetGadgetState(0))
EndSelect
EndSelect
EndSelect
Until Quit = 1
Displays a short string and returns a long one. In your example, the text for the array is taken from TreeGadget. In this case, why add it to the array if it already remains intact.