DX Controller Scripts... Please help!
Thursday, October 6, 2005 by ExodusCrow | Discussion: DesktopX
|
Sub Object_OnScriptEnter desktopx.RegisterController Object.Name End Sub Function OnControl(lType, lCode) msgbox (lType & " " & lCode) End function |
Also, the documentation states that I can create a custon right click menu for my widget.
| For instance you can replace the right click or systray widget menu by returning true to 1 / 1 notification and provide your own menu as described in the preceding chapter. |
How do I return true? and where would I place the code for the new menu?
Thanks in advance for the help.
Confused,
ExodusCrow
Reply #2 Friday, October 7, 2005 12:41 AM

Reply #3 Friday, October 7, 2005 7:35 AM
Reply #4 Friday, October 7, 2005 11:32 AM
Reply #5 Friday, October 7, 2005 1:10 PM
Reply #6 Saturday, October 8, 2005 8:08 AM
Reply #7 Monday, November 28, 2005 6:24 AM
Please login to comment and/or vote for this skin.
Welcome Guest! Please take the time to register with us.
There are many great features available to you once you register, including:
- Richer content, access to many features that are disabled for guests like commenting on the forums and downloading skins.
- Access to a great community, with a massive database of many, many areas of interest.
- Access to contests & subscription offers like exclusive emails.
- It's simple, and FREE!







Reply #1 Friday, October 7, 2005 12:40 AM
The control messages are only sent for right-clicks on the widget, and for both right and left clicks on the widget's system tray icon. The type and code arguments seem to be as advertised.
As for your question about a custom right-click menu, here's an example:
Note: This one is set up to just handle the right click on the object, but you could use the same contents for the OnControl notification, as long as you made sure it was for the event you wanted.
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
End If
If rtn <> 99 Then
Object_OnRButtonUp=True ' Here's where we return True so DesktopX won't respond further
End If
End Function
This is covered in the documentation under "Scriptable Popup Menus".