- Home
- General Usage
- DCX Controls
- DCX Features
- About DCX
|
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:
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 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:
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() Properties |
The $xpopup identifier is a given mIRC alias that communicates with the XPopup DLL to extract information from XPopup menus. |
/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 |
|