Embedded SDK
Embedded SDK
Loading...
Searching...
No Matches
nbgl_contentRadioChoice_t Struct Reference

This structure contains a list of names to build a list of radio buttons (on the right part of screen), with for each a description (names array) The chosen item index is provided is the "index" argument of the callback. More...

#include <nbgl_content.h>

Public Attributes

union { 
   const char *const *   names 
 array of strings giving the choices (nbChoices) More...
}; 
bool localized
 if set to true, use nameIds and not names
uint8_t nbChoices
 number of choices
uint8_t initChoice
 index of the current choice
uint8_t token
 the token that will be used as argument of the callback
tune_index_e tuneId
 if not NBGL_NO_TUNE, a tune will be played when selecting a radio button)
bool vertical
const nbgl_icon_details_t * selectionIcon
const char * title
 Nano only and used in the horizontal flow (i.e. vertical is false): per-content header text shown above the choice label, e.g. "Keyboard layout". When NULL the SDK falls back to context.home.appName (the app name) or context.content.title depending on the use case.

Detailed Description

This structure contains a list of names to build a list of radio buttons (on the right part of screen), with for each a description (names array) The chosen item index is provided is the "index" argument of the callback.

Note
On touchscreen devices, when the list doesn't fit in a single page and is automatically split by the use case (e.g. nbgl_useCaseGenericConfiguration), the "index" argument of the callback is the index of the choice within the current page (restarting from 0 on each page), not the index in the names array. The application must reconstruct the absolute index itself, for example:
absoluteIndex = page * nbgl_useCaseGetNbChoicesInPage(nbChoices, choicesList, 0, true) + index;
uint8_t nbgl_useCaseGetNbChoicesInPage(uint8_t nbChoices, const nbgl_contentRadioChoice_t *choicesList, uint8_t startIndex, bool withNav)
uint8_t nbChoices
number of choices
where "page" is the page of the callback, relative to the first page of this list. The result must be checked against nbChoices before being used. On Nano devices, "index" is always the index in the names array.

Definition at line 347 of file nbgl_content.h.

Member Data Documentation

◆ [union]

◆ initChoice

uint8_t nbgl_contentRadioChoice_t::initChoice

index of the current choice

Definition at line 356 of file nbgl_content.h.

◆ localized

bool nbgl_contentRadioChoice_t::localized

if set to true, use nameIds and not names

Definition at line 354 of file nbgl_content.h.

◆ names

const char* const* nbgl_contentRadioChoice_t::names

array of strings giving the choices (nbChoices)

Definition at line 349 of file nbgl_content.h.

◆ nbChoices

uint8_t nbgl_contentRadioChoice_t::nbChoices

number of choices

Definition at line 355 of file nbgl_content.h.

◆ selectionIcon

const nbgl_icon_details_t* nbgl_contentRadioChoice_t::selectionIcon

Nano only and used in the horizontal flow (i.e. vertical is false): optional small icon drawn underneath the choice label on the page corresponding to initChoice, so the user can tell which item is currently selected. NULL (default) means no marker.

Definition at line 365 of file nbgl_content.h.

◆ title

const char* nbgl_contentRadioChoice_t::title

Nano only and used in the horizontal flow (i.e. vertical is false): per-content header text shown above the choice label, e.g. "Keyboard layout". When NULL the SDK falls back to context.home.appName (the app name) or context.content.title depending on the use case.

Definition at line 375 of file nbgl_content.h.

◆ token

uint8_t nbgl_contentRadioChoice_t::token

the token that will be used as argument of the callback

Definition at line 357 of file nbgl_content.h.

◆ tuneId

tune_index_e nbgl_contentRadioChoice_t::tuneId

if not NBGL_NO_TUNE, a tune will be played when selecting a radio button)

Definition at line 359 of file nbgl_content.h.

◆ vertical

bool nbgl_contentRadioChoice_t::vertical

Nano only: if true, render as a vertical menu list with radio buttons (all choices visible) instead of the default one-choice-per-page horizontal flow. Default false preserves existing behaviour.

Definition at line 361 of file nbgl_content.h.


The documentation for this struct was generated from the following file: