It is currently Thu Nov 21, 2019 8:33 pm

All times are UTC + 1 hour




Post new topic Reply to topic  [ 1 post ] 
Author Message
 Post subject: Please add EventGadget() support for more gadgets
PostPosted: Fri Sep 27, 2019 5:26 pm 
Offline
Addict
Addict

Joined: Sat Jun 30, 2007 8:04 pm
Posts: 3362
It didn't occur to me until today when I tried to use #PB_EventType_RightClick with an ImageButtonGadget() that I realized that this isn't supported. While #PB_EventType_LeftClick does seem to work for both ButtonGadget() and ImageButtonGadget(), it's not listed as supported in either the gadget documentation or for EventGadget().

Code:
OpenWindow(#PB_Any,0,0,130,70,"",#PB_Window_SystemMenu|#PB_Window_ScreenCentered)

GadgetButton=ButtonGadget(#PB_Any,38,10,48,48,"")

Repeat
  Event=WaitWindowEvent()
 
  Select Event
  Case #PB_Event_Gadget
    If EventGadget()=GadgetButton
      Select EventType()
      Case #PB_EventType_LeftClick
        Debug "Click with left mouse button"
      Case #PB_EventType_RightClick
        Debug "Click with right mouse button"
      Case #PB_EventType_LeftDoubleClick
        Debug "Double-click with left mouse button"
      Case #PB_EventType_RightDoubleClick
        Debug "Double-click with right mouse button"
      EndSelect
    EndIf
  EndSelect
Until Event=#PB_Event_CloseWindow


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 1 post ] 

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 4 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  

 


Powered by phpBB © 2008 phpBB Group
subSilver+ theme by Canver Software, sponsor Sanal Modifiye