But the svgPath widget post mouseDown message with a string argument.
Code: Select all
post "mouseDown" with [the click button formatted as string]
for handling message from my own widget the handler must
Code: Select all
public handler OnMouseDown(/* args */) returns nothing
Code: Select all
public handler OnMouseDown(in pClickButton as String) returns nothing
Whole my test widget is below:
Code: Select all
widget com.livecode.marken.scriptdemo5
use com.livecode.engine
use com.livecode.canvas
use com.livecode.widget
use com.livecode.library.widgetutils
metadata title is "Script Demo5"
metadata author is "Marken"
metadata version is "1.0.0"
metadata preferredSize is "200,200"
private variable mInsideShape as Widget
public handler OnPaint()
variable tPath as Path
put rectangle path of my bounds into tPath
paintBorder(tPath)
end handler
private handler paintBorder(in pPath as Path)
set the stroke width of this canvas to 1
set the dashes of this canvas to [10, 10]
set the paint of this canvas to my border paint
stroke pPath on this canvas
end handler
public handler OnCreate() returns nothing
-- inside shape
put a new widget "com.livecode.widget.svgpath" into mInsideShape
set annotation "Name" of mInsideShape to "MyShape"
set the rectangle of mInsideShape to rectangle [0,0,100,100]
place mInsideShape
end handler
public handler OnMouseDown(/* args */) returns nothing
log "Parent Widget Mouse Down"
end handler
public handler OnMouseDown(in pClickButton as String) returns nothing
log "SVGPath Widget Mouse Down"
end handler
end widget