method queryCmdEnabled

bool queryCmdEnabled(string cmd);

Argumente

Zurückgegebener Wert

This method will check to see if a given command is enabled for this activeX control. For a list of all available command strings please see the execCmd function.
function updateItems()
{
    var cut   = scene.getBoxById("menubar_cut");
    var copy  = scene.getBoxById("menubar_copy");
    var paste = scene.getBoxById("menubar_paste");

    if (cut && copy && paste)
    {
        var savedFocusedBox = scene.savedFocusedBox;
        if (savedFocusedBox && savedFocusedBox.boxType == "object")
        {
            // cut
            cut.disabled (savedFocusedBox.queryCmdEnabled("cut")) ? false : true;

            // copy
            copy.disabled = (savedFocusedBox.queryCmdEnabled("copy")) ? false : true;

            // paste
            paste.disabled = (savedFocusedBox.queryCmdEnabled("paste")) ? false : true;
        }
        else
        {
            // if the savedFocusedBox is not a object box, disalbe all items in edit menu.
            cut.disabled = true;
            copy.disabled = true;
            paste.disabled = true;
        }
    }
}