No worries. Truth is that time is so tight at the moment, that I probably wouldn't be able to update the code anyhow if someone made a request.Konne wrote:I didn't want to insult you or anything like that, I think it's a great peace of work. I was just wondering if you are still working on it, that's all.
And thanks fpr the code, but can I get clicks on Imagegadgets too?
As for mouse clicks:
Code: Select all
XIncludeFile "EasyVENT.pbi"
DisableExplicit
Declare.l MouseOver(*sender.PB_Sender)
Declare.l MouseDown(*sender.PB_Sender)
Declare.l MouseUp(*sender.PB_Sender)
myImage = LoadImage(#PB_Any, "icon.ico") ; Please use your own icon!
OpenWindow(0, 0, 0, 640, 480, "", #PB_Window_SystemMenu |#PB_Window_MinimizeGadget|#PB_Window_MaximizeGadget| #PB_Window_ScreenCentered|#PB_Window_Maximize)
CreateGadgetList(WindowID(0))
ImageGadget(1, 20,20, 300, 300, ImageID(myImage), #PB_Image_Border)
;Set event handlers.
SetEventHandler(GadgetID(1), #OnMouseOver, @MouseOver())
SetEventHandler(GadgetID(1), #OnMouseDown, @MouseDown())
SetEventHandler(GadgetID(1), #OnMouseUp, @MouseUp())
Repeat
Event = WaitWindowEvent()
Until Event = #PB_Event_CloseWindow
End
Procedure.l MouseOver(*sender.PB_Sender)
Debug "Mouse over image gadget!"
ProcedureReturn #PB_ProcessPureBasicEvents
EndProcedure
Procedure.l MouseDown(*sender.PB_Sender)
Debug "Mouse click over image gadget!"
ProcedureReturn #PB_ProcessPureBasicEvents
EndProcedure
Procedure.l MouseUp(*sender.PB_Sender)
Debug "Mouse up over image gadget!"
ProcedureReturn #PB_ProcessPureBasicEvents
EndProcedure