I have a Canvas… and in the MouseDown I have “If IsContextualClick Then return false”
This calls of course, ConstructContextualMenu
HOWEVER… The first line checks the contents of a variable… basically “did the user right click inside a specific rectangle?”
if index_CONTROL<0 then return false
If index_CONTROL>=0 then it is supposed to display the menu (which it does)…
If the user selected DELETE from the menu… the rectangle area is removed, and index_Control is set to -1
BUT if the user “right clicks” again… the menu displays AGAIN… BUT IT DOES BAIL when it hits the check above
meaning the rest of the ConstructContextualMenu doesn’t execute again… but the menu still displays
Here is the entire code for ConstructContextualMenu
#pragma Unused x
#pragma Unused y
Dim m As MenuItem
debug "Enter CC="+ str(index_CONTROL)
if index_CONTROL<0 then return false // <====== IT DOES EXIT HERE, but menu still displays
//
//
//
m=New MenuItem("Delete",cmd_DELETE)
base.Append m
m=New MenuItem("Lock Position",cmd_Lock)
base.Append m
base.Append(New MenuItem(MenuItem.TextSeparator))
m=New MenuItem("Duplicate Control",cmd_DUPCTRL)
base.Append m
m=New MenuItem("Duplicate Screen",cmd_DUPSCRN)
m.Enabled=false
base.Append m
//
//
//
debug "Show CC="+ str(index_CONTROL) // <======= THIS LINE DOES NOT SHOW UP WHEN BOGUS MENU IS DISPLAYED!!
Return True