Right Click Menu (Context Menu)

Is it possibel to make a Context Menu (Right click)
in a Widget where I can place some Properties or something?
4,739 views 4 replies
Reply #2 Top
I cant find anything there to
make my own Context Menu for a Widget
Reply #3 Top
The following, inserted in the script for your object, will display a context menu on right mouse click. The "DesktopX" option will allow the default context menu to come up (different depending on the host environment for your object/widget).



Function Object_OnRButtonUp(x,y,dragged)
If Not dragged Then
Dim menu
Set menu = DesktopX.CreatePopupMenu
menu.AppendMenu 0, 1, "Options 1"
menu.AppendMenu 0, 2, "Options 2"
menu.AppendMenu 0, 99, "DesktopX"
Dim rtn
rtn = menu.TrackPopupMenu(0, System.CursorX, System.CursorY)
Select Case rtn
Case 1
'Do something
Case 2
'Do something else
End Select
Set menu = nothing
If rtn <> 99 Then
Object_OnRButtonUp=True
End If
End If
End Function
Reply #4 Top

I want to do something like this,

Function Object_OnRButtonUp(x,y,dragged)

If Not dragged Then

close. my.gadget

End If

End Function

I want to perform the same action as the "close" does on the default right-click menu of an executable gadget. But I don't want a menu poping up. What would the correct syntax be to do this? Thanks.