Request

Response

    Autodesk.Viewing.UI

    SettingsPanel

    new SettingsPanel(parentContainer, id, title, options)

    UI panel specifically designed for application settings.

    The user can add new options to each of the tabs.

    Parameters

    Expand all
    parentContainer*
    HTMLElement
    The container for this panel.
    id*
    string
    The id to assign this panel.
    title*
    string
    The title of this panel.
    options
    object
    An optional dictionary of options.
    width
    number
    Override panel’s minimum width
    heightAdjustment
    number
    Override panel’s extra content height, to account for non-scrolling elements.
    * Required

    Methods

    setVisible(show)

    Sets the new visibility state of this SettingsPanel.

    Parameters

    show*
    boolean
    The desired visibility state.
    * Required

    addTab(tabId, tabTitle, options)

    Adds a new tab to the panel.

    Parameters

    tabId*
    string
    id for the tab (DOM element will have an extended ID to ensure uniqueness).
    tabTitle*
    string
    options
    object
    optional parameter that allows for additional options for the tab:tabClassName - class name for the Dom elementsminWidth - min width for the tabindex - index if the tab should be inserted instead of added at the end.
    * Required

    Returns

    typedescription
    boolean True if the tab was added to the panel, false otherwise.

    removeTab(tabId)

    Removes the given tab from the panel.

    Parameters

    tabId*
    string
    Tab to remove.
    * Required

    Returns

    typedescription
    boolean True if the tab was successfully removed, false otherwise.

    hasTab(tabId)

    Returns true if a tab with given id exists.

    Parameters

    tabId*
    string
    Tab id.
    * Required

    Returns

    typedescription
    boolean True if the tab with given id exists, false otherwise.

    selectTab(tabId)

    Makes a given tab visible and hides the other ones.

    Parameters

    tabId*
    string
    Tab to select.
    * Required

    Returns

    typedescription
    boolean True if the tab was selected, false otherwise.

    isTabSelected(tabId)

    Returns true if the given tab is selected (visible).

    Parameters

    tabId*
    string
    Tab to check.
    * Required

    Returns

    typedescription
    boolean True if the tab is selected, false otherwise.

    addLabel(tabId, name)

    Adds a label to the panel.

    Parameters

    tabId*
    string
    Id of the tab that will contain the button.
    name*
    string
    User facing text.
    * Required

    Returns

    typedescription
    object the label control

    addButton(tabId, label)

    Adds a button to the panel.

    Parameters

    tabId*
    string
    Id of the tab that will contain the button.
    label*
    string
    User facing text.
    * Required

    Returns

    typedescription
    string ID of a new control.

    addCheckbox(tabId, caption, initialState, onchange, options)

    Creates a checkbox control and adds it to a given tab.

    Parameters

    Returns

    typedescription
    string ID of a new control.

    addSlider(tabId, caption, min, max, initialValue, onchange, options)

    Creates a slider control and adds it to a given tab.

    Parameters

    Returns

    typedescription
    string ID of a new control.

    addRopDownMenu(tabId, caption, items, initialItemIndex, onchange, options)

    Parameters

    Returns

    typedescription
    string ID of a new control.

    addControl(tabId, control, options)

    Adds a new control to a given tab.

    Parameters

    Returns

    typedescription
    string ID of the added control.

    removeButton(buttonId)

    Removes a given button from the settings panel.

    Parameters

    Returns

    typedescription
    boolean True if the button was removed, false otherwise.

    removeCheckbox(checkboxId)

    Removes a given checkbox from the settings panel.

    Parameters

    Returns

    typedescription
    boolean True if the checkbox was removed, false otherwise.

    removeSlider(sliderId)

    Removes a given slider from the settings panel.

    Parameters

    Returns

    typedescription
    boolean True if the slider control was removed, false otherwise.

    removeDropdownMenu(dropdownMenuId)

    Removes a given dropdown menu from the settings panel.

    Parameters

    Returns

    typedescription
    boolean true if the dropdown was removed, false if the dropdown was not removed.

    removeControl(controlId)

    Removes a given control from the settings panel.

    Parameters

    Returns

    typedescription
    boolean true if the control was removed, false if the control was not removed.

    getControl(controlId)

    Returns a control with a given id.

    Parameters

    controlId*
    string
    Checkbox id to return.
    * Required

    Returns

    typedescription
    object Control object if found, null otherwise.

    getContentSize()

    Returns the width and height to be used when resizing the panel to the content.

    Returns

    typedescription
    object {height: number, width: number}.

    sizeToContent(container)

    Resizes panel vertically to wrap around the content. It will always leave some room at the bottom to display the toolbar.

    Parameters

    container*
    HTMLElement
    parent container of settings panel
    * Required