I'm looking for suggestions on how to make a gadget containing the letters A-Z, which would provide an event to indicate which letter has been clicked on.
Standard TextGadgets don't give PB events, so maybe using a callback routine? Also, I would prefer to use just one gadget, not 26 separate ones, if possible.
Is there a way to create a sort of "image map"? It would give an event when clicked, and have an simple way to get the mouse coordinates to determine which letter was clicked.
Thanks for any help,
Eric
Suggestions for Clickable TextGadget
-
FloHimself
- Enthusiast

- Posts: 229
- Joined: Wed May 14, 2003 3:38 pm
- Location: Lüneburg - Germany
Re: Suggestions for Clickable TextGadget
Hello Eric,
i know it's not really what you've searching for, but maybe a simple workaround...
i know it's not really what you've searching for, but maybe a simple workaround...
Code: Select all
#BS_FLAT = $8000
#Window_0 = 0
#Char_Gadget_Base = 65
Procedure Open_Window_0()
If OpenWindow(#Window_0, 271, 72, 495, 50, #PB_Window_SystemMenu | #PB_Window_TitleBar, "Char Button Test")
If CreateGadgetList(WindowID())
For i = 0 To 25
ButtonGadget(#Char_Gadget_Base + i, i * 19, 10, 20, 20, Chr(65 + i), #BS_FLAT)
Next
EndIf
EndIf
EndProcedure
Open_Window_0()
Repeat
Event = WaitWindowEvent()
Select Event
Case #PB_EventGadget
For i = 0 To 25
If EventGadgetID() = #Char_Gadget_Base + i
MessageRequester("Pressed Char:", Chr(#Char_Gadget_Base + i), 0)
EndIf
Next
EndSelect
Until Event = #PB_EventCloseWindow
End