.. default-domain:: http .. highlight:: json Toggle Group ============ .. _http-UI.ToggleGroup: .. rubric:: ToggleGroup A set of toggles of which only one can be checked at a time, which is what turns a set of :ref:`Toggle ` controls into radio buttons. Added to a :ref:`Canvas ` or a :ref:`Panel `. .. note:: A group does not contain its toggles, it only refers to them, so toggles can be grouped independently of how they are laid out. A column of radio buttons in a grid of them is one group, even though each row is laid out separately. A ``ToggleGroup`` object is passed and returned as its identifier, a number. A path that acts on an object takes it as ``(id)``. .. http:get:: /ui/toggle-group/(id)/rect-transform The rect transform for the UI object. :param id: The identifier of the :ref:`ToggleGroup ` object. :resjson UI.RectTransform value: .. http:get:: /ui/toggle-group/(id)/layout-element How much space the UI object asks a layout for. .. note:: Only has an effect when the object is in a panel that has a layout. A canvas is not inside a layout and does not have one. :param id: The identifier of the :ref:`ToggleGroup ` object. :resjson UI.LayoutElement value: .. http:get:: /ui/toggle-group/(id)/visible Whether the UI object is visible. .. note:: This is the object's own setting, which is what it was last set to. An object is only drawn when everything it is inside is visible as well, so an interface can be built with its parts visible, inside a panel that is not, and shown all at once by making that panel visible. :param id: The identifier of the :ref:`ToggleGroup ` object. :resjson bool value: .. http:put:: /ui/toggle-group/(id)/visible Whether the UI object is visible. .. note:: This is the object's own setting, which is what it was last set to. An object is only drawn when everything it is inside is visible as well, so an interface can be built with its parts visible, inside a panel that is not, and shown all at once by making that panel visible. :param id: The identifier of the :ref:`ToggleGroup ` object. :reqjson bool value: The new value. .. http:get:: /ui/toggle-group/(id)/selected The toggle in the group that is checked, or ``null`` if none of them are. :param id: The identifier of the :ref:`ToggleGroup ` object. :resjson UI.Toggle? value: .. http:get:: /ui/toggle-group/(id)/allow-switch-off Whether all of the toggles in the group are allowed to be unchecked at once. .. note:: When this is false, the user cannot clear the checked toggle, they can only check a different one. It does not stop a client setting :http:get:`/ui/toggle/(id)/checked`, which is obeyed either way. A group starts out with no toggle checked either way. :param id: The identifier of the :ref:`ToggleGroup ` object. :resjson bool value: .. http:put:: /ui/toggle-group/(id)/allow-switch-off Whether all of the toggles in the group are allowed to be unchecked at once. .. note:: When this is false, the user cannot clear the checked toggle, they can only check a different one. It does not stop a client setting :http:get:`/ui/toggle/(id)/checked`, which is obeyed either way. A group starts out with no toggle checked either way. :param id: The identifier of the :ref:`ToggleGroup ` object. :reqjson bool value: The new value. .. http:post:: /ui/toggle-group/(id)/remove Remove the UI object. :param id: The identifier of the :ref:`ToggleGroup ` object.