DCX - Dialog Control Xtension
v1.4.0
XPopup
This extension lets you build nice stylish popup menus to be used everywhere in your script including coloring mIRC's own popup menus.

Special Menus
There are two special reserved menu names in XPopup. They are for mIRC's regular popup menus mirc (channel, statusbar, query and nicklist) and mIRC's menubar popup menu mircbar (the menubar). Their appearance can be changed by XPopup and activated with the following command:

Syntax:
/mpopup [mirc|mircbar] [ENABLED]
Example:
/mpopup mirc 1

Both menus can have their style, colors and icons modified using the /xpopup command. The command switches -c/-d are disabled for these menus. You cant use /xpop to modify these menus either. To add icons the mIRCs popups menus (status, menubar, channel, query and nicklist) you need to add the icons the menu image lists using /xpopup -i/-j. The icon index number needs to be inserted in the mIRC popup menu syntax like this:

Syntax:
[$style()] [ICON] [VTAB] [TEXT] (TAB) (Accelerator Text) : [mIRC Command]
Parameters:
$style() mIRC's $style identifier.
ICON Icon index number. (You can use 0 for no icon).
VTAB mIRC $chr(11).
TEXT Menu item text.
TAB mIRC $chr(9). (Optional)
Accelerator Text Accelerator Text (Eg. Alt+S)
COMMAND mIRC menu command.
 
Note: Accelerator text is usually a shortcut key combination to the same command seen in the menu that which the text is right aligned in the menu item like the CTRL-H seen in the image below.

Remember that the same mIRC popup rules still apply. It is only the menu item text syntax that needs to be shaped for XPopup to interpret it correctly. If the [VTAB] element is not present, XPopup assumes that the item text is a regular item (no icon element).
You can also add $idents in your menu item text like mIRC has always permitted to create your own tri-state check system for example with the use of custom icons.

The image below is an example of a mIRC menubar popup menu skinned with XPopup which includes icons.

XPopup mIRC Colorful Iconed Menus
XPopup Item Path
The XPopup menus have an engine that parses the given item "path" data to know where to insert/delete/modify a given item in the menu structure. The parameters you supply are a space separated numerical token list of the menu submenus that lead to the menu item position:

Format:
N N N ... N
Example:
2 3

This position represents the 3rd menu item of the of the second menu item submenu as shown by the selected item in the picture below:

XPopup Item Path Example
Note:
  • If you specify a path that does not exist, parsing halts and an error is displayed.
  • You can use 0 for the last value when inserting a menu item to insert it at the end of the menu.
XPopup Events
Events are sent through mIRCs "ON SIGNAL" event with the signal name being xpopup-[MENU] where [MENU] is the menu name that sent the event. The $1 parameter is the supplied [ID] of the menu item. This is why it's important that this number be unique for all menu items. A returned value of 0 means no selection was made in the menu.

An example of the XPopup signal handler code is shown below:
ON *:SIGNAL:Xpopup-*: {
        ;// get the menu name from Xpopup-[MENUNAME]
        var %m $gettok($signal, 2-, 45)

        ;// nothing clicked
        if ($1 == 0) {
                return
        }

        if (%m == menu_open) {
                if ($1 == 1) { echo -a command 1 }
                else if ($1 == 2) { echo -a command 2 }
        }
        else if (%m == menu_help) {
                if ($1 == 1) { url http://dcx.scriptsdb.org }
                else if ($1 == 2) { echo -a command aboutbox }
        }
        else {
                echo -a unknown menu
        }
}
/xpopup Command
The /xpopup command is used to create/modify/destroy an XPopup menu.
/xpopup -b
This command lets you set the menu item background image in custom style.
Syntax:
/xpopup -b [MENU] (IMAGEFILE)
Example:
/xpopup -b mymenu mc.bmp
 
Note.
  • Please take note that the image is stretched to fit the menu item rectangle.
  • Only BMP images are supported through this command if GDI+ is not available.
  • If IMAGEFILE is not specified, then the current image will be removed.

/xpopup -c
This command lets you create an XPopup empty menu.
Syntax:
/xpopup -c [MENU] [STYLE]
Example:
/xpopup -c mymenu office2003rev
Parameters:
STYLE Image flags.
office2003 Office 2003 menu style.
office2003rev Office 2003 Reverse menu style.
officexp Office XP menu style.
icy Icy menu style.
icyrev Icy Reverse menu style.
grade Grade menu style.
graderev Grade Reverse menu style.
normal Normal Plain menu style.
vertical Vertically Gradient menu style.
verticalrev Vertically Gradient Reverse menu style.
custom Lets you apply a custom background item image (see /xpopup -b).
 
Note.
  • This command will fail if the menu already exists, use $xpopup().ismenu to check if the menu exists.
  • Some colors are not used in certain menu styles.

/xpopup -d
This command lets you destroy a XPopup menu.
Syntax:
/xpopup -d [MENU]
Example:
/xpopup -d mymenu

/xpopup -i
This command lets you add an icon to the menu image list.
Syntax:
/xpopup -i [MENU] [+FLAGS] [INDEX] [FILENAME]
Example:
/xpopup -i mymenu +g 113 shell32.dll
Parameters:
+FLAGS Icon flags
a Uses the icon associated with the given file (as shown in Windows Explorer).
Note: File must exist.
f Uses the icon associated with the given filetype.
Note: Filename is the extension (eg. BMP, PNG, AVI, etc).
g Convert to grayscale icon.
P If GDI+ is enabled, this will use GDI+ to extract the icon.
INDEX Icon index in icon archive
FILENAME Icon archive filename
 
Note. Use 0 if the file is a single icon file.

/xpopup -j
This command lets you clear the menu image list.
Syntax:
/xpopup -j [MENU]
Example:
/xpopup -j mymenu

/xpopup -l
This command lets you set the Nth color in the menu as given by the order listed in /xpopup -p.
Syntax:
/xpopup -l [MENU] [N] [COLOR]
Example:
/xpopup -l mymenu 2 $rgb(255,0,0)
 
Note. You can specify default in COLOR to reset it to the default value.

/xpopup -m
This command patches mIRC v6.20, allowing XPopup to work.
Syntax:
/xpopup -m [MENU]
Example:
/xpopup -m mymenu
 
Note.
  • After patching, mIRC will crash if /dll -u is used.
  • This will only apply to mIRC menus, so use mirc for MENU.

/xpopup -p
This command lets you set the whole menu color palette in one command where COLORS is a space separated list of RGB colors.
Syntax:
/xpopup -p [MENU] [COLOR1] [COLOR2] [COLOR...] [COLOR10]
Example:
/xpopup -p mymenu $rgb(255,0,0) $rgb(0,0,255) ... $rgb(0,255,0)
Parameters:
COLORS The colors in $rgb() format must be in this order:
1 Menu background color
2 Icon box color
3 Checkbox color
4 Disabled checkbox color
5 Disabled selection box color
6 Disabled text color
7 Selection box color
8 Selection box border color
9 Separator line color
10 Text color
11 Selected text color
 
Note.
  • If you are not using the checkbox style, this function can also change the state icon of an item. Be sure to insert the state icons before you use them.
  • You can specify default in COLORS to reset it to the default value.

/xpopup -s
This command lets you display a menu.
Syntax:
/xpopup -s [MENU] [+FLAGS] [X] [Y] (HWND)
Example:
/xpopup -s mymenu + 100 100
Parameters:
+FLAGS Menu display style flags.
b The menu is bottom aligned according to the Y value.
c The menu is center aligned according to the X value.
l The menu is left aligned according to the X value.
m The menu items are clickable only with the left mouse button. (default)
n The menu items are clickable only with the right mouse button.
r The menu is right aligned according to the X value.
t The menu is top aligned according to the Y value.
v The menu is vertically center aligned according to the Y valued.
X X coordinate where menu will popup in screen coordinates.
Y Y coordinate where menu will popup in screen coordinates.
HWND The popup coordinates will be displayed relative to this window.

/xpopup -t
This command lets you change the menu style.
Syntax:
/xpopup -t [MENU] [STYLE]
Example:
/xpopup -t mymenu officexp

/xpopup -x
This command lets you set the menu extended styles.
Syntax:
/xpopup -x [MENU] [+FLAGS]
Example:
/xpopup -x mymenu +dp
Parameters:
+FLAGS Flags to set the extended styles for the popup.
d Disabled items display a selection box.
i Icons have a 3D shadow effect when menu item is selected.
p Icons have a plain 3D effect when menu item is selected.

/xpopup -M
This command lets you set the marked text, which can contain any information.
Syntax:
/xpopup -M [MENU] (TEXT)
Example:
/xpopup -M mymenu additional information

/xpopup -R
This command lets you add more visual styles to your XPopup
Syntax:
/xpopup -R [MENU] [+FLAG] [ARGS]
Example:
/xpopup -R mymenu +r 1
/xpopup -R mymenu +a 150
Parameters:
MENU Name of the Xpopup you wish to style.
+FLAGS Menu display style flags.
r This gives the menu selection indicator a rounded look.
a This sets the menu alpha value. (2k+)
Variable parameters ARGS:
r
[1|0]
a
[VALUE]
VALUE The opacity to apply. Values range from 0 (transparent) to 255 (opaque).

$xpopup() Properties
The $xpopup identifier is a given mIRC alias that communicates with the XPopup DLL to extract information from XPopup menus.
$xpopup().alpha
This property retrieves the transparency value.
Syntax:
$xpopup(MENU).alpha
Example:
$xpopup(mymenu).alpha

$xpopup().color
This property retrieves Nth menu color (see /xpopup -p for the list).
Syntax:
$xpopup(MENU, N).color
Example:
$xpopup(mymenu, 3).color

$xpopup().colors
This property retrieves the menu colors as one line (see /xpopup -p for the list).
Syntax:
$xpopup(MENU).colors
Example:
$xpopup(mymenu).colors

$xpopup().exstyle
This property retrieves the menu extended styles.
Syntax:
$xpopup(MENU).exstyle
Example:
$xpopup(mymenu).exstyle

$xpopup().ismenu
This property retrieves if a menu exists.
Syntax:
$xpopup(MENU).ismenu
Example:
$xpopup(mymenu).ismenu

$xpopup().isPatched
This determines if mIRC 6.20 has been patched for special menus to work.
Syntax:
$xpopup(MENU).isPatched
Example:
$xpopup(mymenu).isPatched

$xpopup().isrounded
Is the rounded style enabled?
Syntax:
$xpopup(MENU).isrounded
Example:
$xpopup(mymenu).isrounded

$xpopup().marked
This property lets you set the marked text.
Syntax:
$xpopup(MENU).marked
Example:
$xpopup(mymenu).marked

$xpopup().style
This property retrieves the menu style.
Syntax:
$xpopup(MENU).style
Example:
$xpopup(mymenu).style

/xpop Command
The /xpop command is used to add/modify/remove menu items in XPopup menus.
/xpop -a
This command lets you add a menu item.
Syntax:
/xpop -a [MENU] [PATH] [TAB] [+FLAGS] [ID] [ICON] (TEXT)
Example:
/xpop -a mymenu 2 1 $chr(9) + 1 1 Menu Item 1
Parameters:
+FLAGS Menu item flags.
c Item is checked.
g Item is disabled/grayed.
s An empty submenu is created for the item ready for menu items.
ID Menu item ID as returned on the event handler.
ICON Menu item icon index. (Use 0 for no icon)
TEXT Menu item text. It can contain mIRC $identifiers that will be evaluated the first time the menu is being displayed.
 
Note.
  • If the item text is meant to be dynamic, you will need to reset the text using /xpop -t
  • ID must be unique.
  • A menu item that has a checkmark AND an icon, it displays the icon instead of the checkmark.
  • Remember to use mIRCs $eval($idents, 0) or $!idents to prevent the mIRC evaluation of the $idents that your text contains.

/xpop -c
This command lets you create a submenu on a menu item.
Syntax:
/xpop -c [MENU] [PATH]
Example:
/xpop -c mymenu 2 1
 
Note. If the item already has a submenu, it is destroyed. This can be used to clear a submenu instead of deleting the whole menu item.

/xpop -d
This command lets you destroy a submenu on a menu item.
Syntax:
/xpop -d [MENU] [PATH]
Example:
/xpop -d mymenu 2 1

/xpop -f
This command lets you delete a menu item.
Syntax:
/xpop -f [MENU] [PATH]
Example:
/xpop -f mymenu 2 1

/xpop -i
This command lets you change the icon on a menu item.
Syntax:
/xpop -i [MENU] [PATH] [TAB] [ICON]
Example:
/xpop -i mymenu 2 1 $chr(9) 3

/xpop -s
This command lets you change the state flags on an item (see /xpop -a for the switches)
Syntax:
/xpop -s [MENU] [PATH] [TAB] [+FLAGS]
Example:
/xpop -s mymenu 2 1 $chr(9) +cg

/xpop -t
This command lets you change a menu item text.
Syntax:
/xpop -t [MENU] [PATH] [TAB] [TEXT]
Example:
/xpop -t mymenu 2 1 $chr(9) $eval($me, 0)
 
Note. Remember to use mIRCs $eval(expression,0) to prevent the mIRC evaluation of the $idents that your text contains.

$xpop Identifier
The $xpop identifier is a given mIRC alias that communicates with the XPopup DLL to extract information in XPopup menu items.
$xpop().enabled
This property retrieves if a menu item is enabled or disabled.
Syntax:
$xpop(MENU, PATH).enabled
Example:
$xpop(mymenu, 2 5).enabled

$xpop().icon
This property retrieves the menu item icon index number.
Syntax:
$xpop(MENU, PATH).icon
Example:
$xpop(mymenu, 2 5).icon

$xpop().num
This property retrieves the number of menu items in a submenu.
Syntax:
$xpop(MENU, PATH).num
Example:
$xpop(mymenu, 2 5).num
 
Note. PATH can be root to find the number of items on the root menu.

$xpop().submenu
This property retrieves if a menu item has a submenu or not.
Syntax:
$xpop(MENU, PATH).submenu
Example:
$xpop(mymenu, 2 5).submenu

$xpop().text
This property retrieves the menu item text.
Syntax:
$xpop(MENU, PATH).text
Example:
$xpop(mymenu, 2 5).text

Contact 2005-2007 Last Updated: 25th December, 07

Valid XHTML 1.0 Transitional Valid CSS!