'--- Function to handle the RIGHT-Click
Function
Object_OnRButtonUpEx(obj,x,y,dragged)
If Not dragged Then
'-- Do not do anything if someone is dragging the
widget
Object_OnRButtonUpEx = True
Call CreateSectionMenu()
'-- Call the Function that Shows the Menu
End If
End Function
'--- Right Click Menu Creation Function -------
Sub CreateSectionMenu()
Set mainmenu = nothing
Set mainmenu = DesktopX.CreatePopupMenu
'-- Create Main Menu
mainmenu.AppendMenu 0, 1, "About Player"
'-- First item in the menu
mainmenu.AppendMenu 0, 2, "Properties"
'-- Second item in the menu
mainmenu.AppendMenu 0, 3, "Exit"
'-- Third item in the menu (this can continue)
result = mainmenu.TrackPopupMenu(0, System.CursorX,
System.CursorY) '-- Save the results of mouse
movements
Call ExecuteSectionMenu(result,snum)
'-- Run the Function that handles the menu function
called
End Sub
'-- Function to handle the results of the right-click menu action
Sub
ExecuteSectionMenu(result,snum)
Select Case result
'-- Look thru the results to see what was selected
Case 1
'-- Look in the function above 0, 1, "About" - this
is the 1
desktopx.Object("About_Window").Visible = True
'--
show your custom ABOUT window
Case 2
'-- Look in the function above 0, 2, "Prop.." - this is the 2
widget.OpenProperties
'-- Open the Properties for the widget
Case 3
'-- Look in the function above 0, 3, "Exit.." - this is the 3
widget.Close
'-- Close the Widget
' Case 4
End Select
Set mainmenu = nothing
'-- clear the menu
End Sub |