Replacing the RIGHT-CLICK menu! - Advanced Scripting
Thursday, March 1, 2007 by RomanDA | Discussion: DesktopX Tutorials
#7 - Replacing the Right-Click Menu
A series by RomanDA
Listing of other DX Tutorials:
This lesson is more
advanced then the previous ones I have posted.
This is not going to be a simple STEP-BY-STEP, I'm assuming if you are this advanced into DX, I don't need to explain how to get the script windows up, or edit properties! This is more like a SCRIPT example, not a step-by-step.
---- UPDATE - REVISED THE CODE and uploaded this as a widget for you to download and enjoy HERE
For this and all the Step-By-Step DX Tutorials you will need to purchase DesktopX for $14.95 from Stardock.
Lets get started.
|STEP 1 - RegisterController|
In order for DX to ignore
the built-in right-click menu, you have to work a little magic.
Its not that complex, but it has to be setup in order to work.
|STEP 2 - OnControl Function|
The OnControl function
handles clicks on the tray icon, as well as right clicks coming from
|STEP 3 - Adding the POPUP Menu|
The popup menu is the menu
you want to show up when you RIGHT-CLICK on the widget/tray when the
widget is not minimized, etc. (We will do the minimized version in a
I am not going to rip this all apart, there is another tutorial out there on making a right-click menu
|STEP 4 - Minimized (Tray icon) menu|
We are going to add a
minimized menu, so that we have a way to restore the widget back to
working order from minimized state. Its not going to have all the
functions of the main popup menu.
This menu will only be accessible with its minimized and from the tray icon.
|STEP 5 - Add Left-Click menu|
If you want you can also
make the popup menu show when you LEFT-CLICK on the object as well.
This is a simple bit of code to be added to the object.
This should all work, there
are a lot of options in the ONCONTROL function, as far as clicking
works, this shuts off the CLICK HIDE/CLICK RESTORE on the tray icon as
well, it has a way of messing things up.
This is not something i would recommend someone doing unless you really know DX.
One side effect of this is that you cant right-click on the main object anymore, it wont work, you will just get your menu (when editing things!!). AND you will not be able to right-click the DX TRAY icon to pick edit, etc. So just a warning.
I hope you have enjoyed this step into DX, and look forward to the next installment..
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!