Example of the Procedure Browser panel. (PB 6.20 b1 on Windows 10)

A related reply.
viewtopic.php?p=632217#p632217
When you run this code, can your screen reader program read the button text?Quin wrote: Sun Dec 15, 2024 3:19 pm The text is needed for screen readers, but I'm really not sure if there's a better way. I was told that calling SetGadgetText() doesn't even show the text...guess that was incorrect and we may need to call out to underlying accessibility APIs.
I did open a feature request about this, just FYI.
Code: Select all
If OpenWindow(0, 0, 0, 200, 60, "ButtonImageGadget", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
If LoadImage(0, #PB_Compiler_Home + "examples/sources/Data/CDPlayer.ico")
hwnd = ButtonGadget(0, 10, 10, 180, 40, "This text shows over the image :(", #BS_ICON)
SendMessage_(hwnd, #BM_SETIMAGE, #IMAGE_ICON, ImageID(0))
EndIf
Repeat : Until WaitWindowEvent() = #PB_Event_CloseWindow
EndIf
Yes, it can. I run it and press tab and hear: "This text shows over the imagebreeze4me wrote: Sun Dec 15, 2024 3:25 pmWhen you run this code, can your screen reader program read the button text?Quin wrote: Sun Dec 15, 2024 3:19 pm The text is needed for screen readers, but I'm really not sure if there's a better way. I was told that calling SetGadgetText() doesn't even show the text...guess that was incorrect and we may need to call out to underlying accessibility APIs.
I did open a feature request about this, just FYI.
Code: Select all
If OpenWindow(0, 0, 0, 200, 60, "ButtonImageGadget", #PB_Window_SystemMenu | #PB_Window_ScreenCentered) If LoadImage(0, #PB_Compiler_Home + "examples/sources/Data/CDPlayer.ico") hwnd = ButtonGadget(0, 10, 10, 180, 40, "This text shows over the image :(", #BS_ICON) SendMessage_(hwnd, #BM_SETIMAGE, #IMAGE_ICON, ImageID(0)) EndIf Repeat : Until WaitWindowEvent() = #PB_Event_CloseWindow EndIf
Code: Select all
ProcedureBrowser.pb
Issues.pb
CompilerOptions.pb
Code: Select all
CompilerIf #CompileWindows
Space = 3
Width = 28
Height = 28
CompilerElse
Space = 6 ; looks better on Linux/OSX with some more space
CompilerEndIf
Code: Select all
<buttonimage id="#GADGET_Option_AddTarget" />
<buttonimage id="#GADGET_Option_CopyTarget" />
<buttonimage id="#GADGET_Option_EditTarget" />
<buttonimage id="#GADGET_Option_RemoveTarget" />
<buttonimage id="#GADGET_Option_TargetUp" />
<buttonimage id="#GADGET_Option_TargetDown" />
Code: Select all
If OpenWindow(0, 0, 0, 200, 60, "ButtonImageGadget", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
If LoadImage(0, #PB_Compiler_Home + "examples/sources/Data/CDPlayer.ico")
hwnd = ButtonImageGadget(0, 10, 10, 180, 40, ImageID(0), #BS_BITMAP)
; set a dummy image.
CreateImage(1, 1, 1, 24, GetSysColor_(#COLOR_BTNFACE))
SendMessage_(hwnd, #BM_SETIMAGE, #IMAGE_BITMAP, ImageID(1))
SetGadgetText(0, "This text shows over the image :(")
EndIf
Repeat : Until WaitWindowEvent() = #PB_Event_CloseWindow
EndIf
Code: Select all
Common.pb
CompilerOptions.pb
Issues.pb
ProcedureBrowser.pb