.. default-domain:: cpp .. highlight:: cpp .. namespace:: krpc::services::UI Dropdown ======== .. class:: Dropdown A control for choosing one of a list of options, which are shown when it is clicked. Added to a :class:`Canvas` or a :class:`Panel`. | Base class: :class:`InputControl` .. container:: inherited-members .. rubric:: Inherited Members * From :class:`InputControl`: :func:`changed `, :func:`set_changed ` * From :class:`Control`: :func:`interactable `, :func:`set_interactable `, :func:`color `, :func:`set_color `, :func:`tooltip `, :func:`set_tooltip ` * From :class:`Object`: :func:`rect_transform `, :func:`layout_element `, :func:`visible `, :func:`set_visible `, :func:`remove ` .. function:: std::vector options() .. function:: void set_options(std::vector value) The options that the dropdown offers. .. note:: Setting the options resets the selection to the first of them, or to nothing when the list is empty. .. function:: int32_t selected_index() .. function:: void set_selected_index(int32_t value) The position in :func:`Dropdown::options` of the option that is chosen. .. note:: Zero while the dropdown has no options, as there is nothing to choose.