Something davido posted caught my eye and as I was thinking about mk-soft`s question and playing with davido`s code I came across this. Now I`m sure some of you guys would know or it would be a challenge for you to sort the answer out. ( probably my misunderstanding as usual )
In the code below: the canvasgadget messages are received ie: 65538 - #pb_eventtype _mousemove and 65539.#pb_eventtype_mouseleave. Not 65587 #pb_eventtype_mouseenter.
Should it not be mouseenter and mouseleave ? also messages are only returned when entering the canversgadget from the right. nothing from left, up, down. As I`ve said probably me being thick but i`m still learning in my defense.
Zebuddi. :
Code: Select all
CompilerIf #PB_Compiler_Unicode
#XmlEncoding = #PB_UTF8
CompilerElse
#XmlEncoding = #PB_Ascii
CompilerEndIf
#Dialog = 0
#Xml = 0
Global XML$, Event.i
Runtime Enumeration Windows
#WinMain
EndEnumeration
Runtime Enumeration Gadgets
#CanvasCDrop
EndEnumeration
;---- Zebuddi......
Runtime Procedure setup()
EnableGadgetDrop(#CanvasCDrop, #PB_Drop_Text, #PB_Drag_Copy)
EndProcedure
Runtime Procedure gettext()
Debug "GadgetID: " + Str(EventGadget()) + " eventtype: " + Str(EventType())
If ((EventGadget() = #CanvasCDrop) And (EventDropType() = #PB_Drop_Text))
MessageRequester(Str(EventGadget()), EventDropText())
Else
Debug "nope"
EndIf
EndProcedure
;-----------------
XML$ = "<dialogs>"+
" <window id='#WinMain' name='CTest' text='CTest Drop' minwidth='auto' minheight='auto' flags='#PB_Window_ScreenCentered |"+
" #PB_Window_SystemMenu | #PB_Window_SizeGadget'>" +
" <canvas id='#CanvasCDrop' width='200' height='200' onevent='gettext()'/>"+
" </window>"+
"</dialogs>"
If CatchXML(#Xml, @XML$, StringByteLength(XML$), 0, #XmlEncoding) And XMLStatus(#Xml) = #PB_XML_Success
If CreateDialog(#Dialog) And OpenXMLDialog(#Dialog, #Xml, "CTest")
setup()
;---- Zebuddi......
BindGadgetEvent(#CanvasCDrop, @gettext(), #PB_EventType_LeftClick)
;-----------------
Repeat
Event = WaitWindowEvent() : Until Event = #PB_Event_CloseWindow
Else
Debug "Dialog error: " + DialogError(#Dialog)
EndIf
Else
Debug "XML error: " + XMLError(#Xml) + " (Line: " + XMLErrorLine(#Xml) + ")"
EndIf