.. default-domain:: c .. highlight:: c Toggle Group ============ .. type:: krpc_UI_ToggleGroup_t A set of toggles of which only one can be checked at a time, which is what turns a set of :type:`krpc_UI_Toggle_t` controls into radio buttons. Added to a :type:`krpc_UI_Canvas_t` or a :type:`krpc_UI_Panel_t`. .. 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. .. function:: krpc_error_t krpc_UI_ToggleGroup_RectTransform(krpc_connection_t connection, krpc_UI_RectTransform_t * returnValue, krpc_UI_ToggleGroup_t instance) The rect transform for the UI object. .. function:: krpc_error_t krpc_UI_ToggleGroup_LayoutElement(krpc_connection_t connection, krpc_UI_LayoutElement_t * returnValue, krpc_UI_ToggleGroup_t instance) 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. .. function:: krpc_error_t krpc_UI_ToggleGroup_Visible(krpc_connection_t connection, bool * returnValue, krpc_UI_ToggleGroup_t instance) .. function:: krpc_error_t krpc_UI_ToggleGroup_set_Visible(krpc_connection_t connection, krpc_UI_ToggleGroup_t instance, bool value) 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. .. function:: krpc_error_t krpc_UI_ToggleGroup_Selected(krpc_connection_t connection, krpc_UI_Toggle_t * returnValue, krpc_UI_ToggleGroup_t instance) The toggle in the group that is checked, or ``nullptr`` if none of them are. .. function:: krpc_error_t krpc_UI_ToggleGroup_AllowSwitchOff(krpc_connection_t connection, bool * returnValue, krpc_UI_ToggleGroup_t instance) .. function:: krpc_error_t krpc_UI_ToggleGroup_set_AllowSwitchOff(krpc_connection_t connection, krpc_UI_ToggleGroup_t instance, bool value) 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 :func:`krpc_UI_Toggle_Checked`, which is obeyed either way. A group starts out with no toggle checked either way. .. function:: krpc_error_t krpc_UI_ToggleGroup_Remove(krpc_connection_t connection, krpc_UI_ToggleGroup_t instance) Remove the UI object.