DCX - Dialog Control Xtension
 
XMenuBar
XMenuBar is a command implemented to replace the mIRC menubar using XPopup menus.

XMenuBar Marking and Callback
Just like with XDialog, you must "mark" the mIRC menubar prior to using XMenuBar.
To mark the mIRC menubar, use /xmenubar -M and specify a callback function of your choice.

The callback function will only be passed 1 parameter, and that is the MENU_ID. The menu ID is sent to the callback function to allow customisation of event flow. To stop mIRC from processing the menu command, return $true from the callback alias.

An example of a simple callback function would be:
alias xmenubar_cb {
    ;// Prevent user from accessing Help -> Contents
    if ($1 == 190) return $true
}
Special Menus and Menu IDs
The callback parses menu clicks before mIRC gets a chance to process them. If the custom XPopupMenu has an ID which matches the ID of an existing mIRC menu item, it can be used to call the mIRC functionality.
For example, the menu ID for the mIRC Options dialog is 159. If you used /xpop -a and specified the ID 159 and added the XPopup menu to the XMenuBar, the item will open up the mIRC Options dialog when clicked.

Additionally, there is a special menu called the scriptpopup menu. This allows you to add the original mIRC scriptable popup menu on your XMenuBar. The usage of the other special menus (mirc and mircbar) has been disabled for the XMenuBar.

Note: For custom menu commands which are specific to only your script, it is advised you use an ID starting from 15000. This is to prevent any clashes in existing IDs and XPopup menu items.

Please do not create confusing or misleading menus!

Below is a list of special menu IDs for those wishing to redesign mIRC's menubar.
Note: The list was compiled from mIRC v6.31.

File
Special IDDescription
101Connect
102Disconnect
104Select Server (Alt+E)
105Exit
View
Special IDDescription
110Menubar
111Toolbar
112Switchbar
210Treebar
131Notify List (Alt+N)
132Urls List (Alt+U)
133Colors (Alt+K)
134Font
Favorites
Special IDDescription
141Add to Favorites
142Organize Favorites (Alt+J)
Tools
Special IDDescription
150Channels List (Alt+L)
203Scripts Editor (Alt+R)
151Send File (Alt+S)
152Chat (Alt+C)
154Received Files
155Log Files
156Address Book (Alt+B)
157Online Timer (Alt+I)
159Options (Alt+O)
Window
Special IDDescription
170Tile Horizontal
171Tile Vertical
172Cascade
173Arrange Icons
174Group
175Order
176Close (Alt+Z)
Help
Special IDDescription
190Contents (F1)
191Search (Shift+F1)
192Latest News
193Message Board
194About mIRC
195Register
/xmenubar Commands
The /xmenubar command is used to replace the mIRC menubar.
/xmenubar -a
This command adds a menu to the XMenuBar.
Syntax:
/xmenubar -a [MENU] [LABEL]
Example:
/xmenubar -a xpMenuName DCX Menu
/xmenubar -a scriptpopup Custom
Parameters:
MENU This is be either the name of the XPopup menu or scriptpopup.
LABEL The label to display for this menu on the XMenuBar.

/xmenubar -d
This command removes a menu from the XMenuBar.
Syntax:
/xmenubar -d [MENU]
Example:
/xmenubar -d xpMenuName

/xmenubar -g
This command replaces the mIRC menubar with an empty XMenuBar.
Syntax:
/xmenubar -g
Example:
/xmenubar -g

/xmenubar -l
This command allows you to change the XMenuBar label for a specific menu.
Syntax:
/xmenubar -l [MENU] [NEW_LABEL]
Example:
/xmenubar -l xpMenuName Something Else

/xmenubar -r
This command resets the original mIRC menubar.
Syntax:
/xmenubar -r
Example:
/xmenubar -r

/xmenubar -s
This command simulates a menu item click by sending the menu item ID to be processed.
Syntax:
/xmenubar -s [MENU_ID]
Example:
/xmenubar -s 159
 
Note. This should only be used to access mIRCs original menu functionality if you have replaced it.

/xmenubar -M
This command marks the menubar and defines a callback function.
Syntax:
/xmenubar -M (CALLBACK)
Example:
/xmenubar -M xmenubar_cb
 
Note. If CALLBACK is not specified, this will reset the mIRC menubar.

$xmenubar Properties
The $xmenubar identifier is used to retrieve information about the DCX XMenuBar implementation.
$xmenubar().menu
Returns the name of the menu added to the XMenuBar.
Syntax:
$xmenubar(N).menu
Example:
$xmenubar(3).menu
Parameters:
N The index of the menu.
 
Note. If N is 0, this property retrieves the total number of menus in the XMenuBar.

Contact � 2005-2009 Last Updated: 12th July, 09

Valid XHTML 1.0 Transitional Valid CSS!