This section describes how you can add a new menu item to menus you have already created.
This section discusses the ability to add a menu item to an
already existing menu or submenu. Menu items are used to execute procedures
that will open dialog boxes. This is the primary way that you will
access your GUI for your UDF. Once you have created a menu and submenu
for your GUI, you must create a menu item in order to open it. Use
the cx-add-item
macro, to add a menu item
to an existing menu or submenu.
Note: The dialog box that the menu item references must be defined in Fluent before the menu item can be created. If the menu item is created before the dialog box, the menu item will not show up in the menu after that interface is read into Fluent.
(cx-add-item menu item mnemonic hotkey test callback)
Argument | Type | Description |
---|---|---|
menu | string | The name of the menu or submenu that you are adding the menu item to |
item | string | The name of the item you are adding to the menu or submenu |
mnemonic | char | This is a placeholder. The only mnemonic is Alt + F for the File menu. |
hotkey | char | This is a placeholder. |
test | function | The name of a function that must return #t for the GUI to open |
callback | function | The name of the procedure, in Scheme, of the dialog box that will open when you click this menu item |
Note: The hotkey and mnemonic fields are just placeholders; use #f
in
place of these fields.
Note: The test
parameter is designed
for those who only want the menu item to be used if a specific condition
is met. In this case, since we want the GUI to open when the menu
item is clicked regardless of what else is happening in Fluent,
we can simply substitute #t
for the name
of a function that would return #t
.
Since all of the menu macros are best shown and implemented together, see Example Menu Added to the Right of the Ribbon Tabs for examples of menus being added to the right of the Fluent ribbon tabs.