Your DesktopX Documentation Resource Guide

Documentation Home

Quick Start

User's Guide

Developer's Guide

Resources

Tutorials


By now you should realize just w

Scriptable popup menu

You can create simple popup menus and replace the default system tray menus for DesktopX and widgets with scripting.
To create a popup menu use DesktopX.CreatePopupMenu.
I.e.

Dim menu
Set menu = DesktopX.CreatePopupMenu
menu.AppendMenu 0, 1, "Item1"
menu.AppendMenu 0, 2, "Item2"
Dim result
res = m.TrackPopupMenu(0, System.CursorX, System.CursorY)

Note: popup menus cannot be used by scripts that run in a separated thread.

Syntax as follow:

AppendMenu

AppendMenu flags, ID, text

ID is the item identifier. When the menu is shown and the user selects an item, TrackPopupMenu will return the ID of the item.
Text is simply the text.
Flags let you specify the following options you can combine:
&H00000800 – Menu separator
&H00000001 – Grayed
&H00000002 – Disabled
&H00000008 – Checked
&H00000010 – Popup
&H00000020 – Menu bar break
&H00000040 – Menu break
&H00000080 – Hilite

Popup (&H00000010) let you add a submenu. You can do like this:

Dim submenu
Set submenu = DesktopX.CreatePopupMenu
submenu.AppendMenu 0, 1, "Item in submenu"
Dim menu
Set menu = DesktopX.CreatePopupMenu
menu.AppendMenu &H00000010, submenu.MenuID, "Sub menu"
menu.AppendMenu 0, 2, "Item in main menu"

TrackPopupMenu

Result = TrackPopupMenu(flags, posx, posy)

It let you open the menu. It returns the ID of the selected item.
Posx and posy are the screen coordinates where the menu should open.
Flags let you specify some options:
&H00000004 – Center align
&H00000008 – Right align
&H00000010 – Vertical center align
&H00000020 – Bottom align

Example:

res = m0.TrackPopupMenu(0, System.CursorX, System.CursorY)
 


7/29 

SkinStudio 6.2 Released

7/25 

A God Has Fallen - New Demigod Trailer Released

7/24 

Sins of a Solar Empire v1.1 Beta has Arrived

7/23 

Stardock Releases New WindowBlinds 6.2 Update

7/22 

Stardock Releases The Political Machine v1.04 with New Characters

7/22 

Stardock Releases MyColors 2.5

7/17 

DesktopX 3.5 Officially Released

7/11 

Corel WinDVD 9 and Painter X Now Available on Impulse!