OnCommandUI

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.

svUI = OnCommandUI()

Return Value

svUI.

Return Value

svUI is a string vector with one or more elements from the following list:

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.

Comment

The function name is identical to the OnCommand function name plus the added UI. The function is called by the framework.

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 "";
}

id-1012446