CCKit2
    Preparing search index...

    Class CCMenuItem

    Stores information about a single menu item.

    Index

    Constructors

    • Creates a new menu item for a separator.

      Returns CCMenuItem

    • Creates a new menu item for an action.

      Parameters

      • title: string

        The title for the action

      • action: () => void

        The function to call when the action is triggered

      • OptionalkeyCombo: CCKeyCombo

        A key combo that will trigger the action, if desired

      Returns CCMenuItem

    • Creates a new menu item for a radio action.

      Parameters

      • title: string

        The title for the action

      • action: () => void

        The function to call when the action is triggered

      • keyCombo: CCKeyCombo | undefined

        A key combo that will trigger the action, if desired

      • radioGroup: string

        The ID of the group the item is in

      Returns CCMenuItem

    • Creates a new menu item for a checkbox action.

      Parameters

      • title: string

        The title for the action

      • action: (checked?: boolean) => void

        The function to call when the action is triggered

      • keyCombo: CCKeyCombo | undefined

        A key combo that will trigger the action, if desired

      • checked: boolean

        Whether the checkbox is initially checked

      Returns CCMenuItem

    • Creates a new menu item for a submenu.

      Parameters

      • title: string

        The title for the submenu

      • menu: CCMenu

        The menu to display under this item

      Returns CCMenuItem

    Accessors

    • get action(): ((checked?: boolean) => void) | undefined

      The function to call when this action is triggered.

      Returns ((checked?: boolean) => void) | undefined

    • set action(value: ((checked?: boolean) => void) | undefined): void

      Parameters

      • value: ((checked?: boolean) => void) | undefined

      Returns void

    • get checkbox(): boolean | undefined

      If not nil, whether the item's checkbox is checked.

      Returns boolean | undefined

    • set checkbox(value: boolean | undefined): void

      Parameters

      • value: boolean | undefined

      Returns void

    • get isEnabled(): boolean

      Whether the item is enabled.

      Returns boolean

    • set isEnabled(value: boolean): void

      Parameters

      • value: boolean

      Returns void

    • get radioGroup(): string | undefined

      A string that groups radio items together.

      Returns string | undefined

    • set radioGroup(value: string | undefined): void

      Parameters

      • value: string | undefined

      Returns void

    • get title(): string | undefined

      The title of the menu item.

      Returns string | undefined

    • set title(value: string | undefined): void

      Parameters

      • value: string | undefined

      Returns void

    Methods

    • Triggers an incoming action on this item or a nested subitem.

      Parameters

      • key: string

        The key of the item that was triggered

      Returns boolean

      Whether an item triggered an action