.. highlightlang:: us .. index:: OnCommandUI .. index:: UI .. _oncommandui: OnCommandUI =========== .. us.tag OnCommandUI ENGLISH Menu New300 :ref:`OnCommandUI` is used here as a placeholder for a function that is called when a user clicks a button on the user toolbar or selects a function from a menu. .. function:: svUI = OnCommandUI() .. us.return **Return Value** *svUI*. .. us.return **Return Value** *svUI* is a string vector with one or more elements from the following list: .. list-table:: :header-rows: 1 * - Value - Meaning * - ``""`` - The menu item is enabled. * - ``"@g"`` or ``"@grayed"`` - The menu item is disabled. * - ``"@h"`` or ``"@hide"`` - The menu item is hidden. * - ``"@c"`` or ``"@checked"`` - Places a check mark next to or removes a check mark from a menu item. * - ``"text"`` - ``"text"`` is the text that is displayed as the menu item. .. us.comment **Comment** The function name is identical to the :ref:`OnCommand` function name plus the added **UI**. The function is called by the framework. .. us.example **Example** The following "UI" function checks if the **OnXY_Fit** is loaded. If the function is not loaded the menu item will not be displayed. :: def OnXY_FitUI() { if (!IsFunctionLoaded("OnXY_Fit")) { return "@hide"; } return ""; } .. seealso:: :ref:`overview-menus`, :ref:`OnCommand` :sub:`id-1012446`