Skip to content
This repository has been archived by the owner on Dec 20, 2021. It is now read-only.

selectRadioButton()

Mammad900 edited this page Feb 28, 2021 · 1 revision

selectRadioButton(page, i, draw)

Summary

Selects a radio-button, as if it was clicked.

Note: If another radio-button with the same group number as the given one was already checked, that one will be unchecked.

Parameters

  1. Page (int) : The number of the page which contains the radio-button
  2. I (int) : Radio-button index in the page
  3. Draw (bool) Optional : Pass false if it is not in the selected page. Default: true

Returns

Nothing

Example

int selected=0;
#define RADIO_BUTTON_COUNT 4
void onDownButtonPressed(){
    // ...

    if(CurrentPage==3) {
        selected++;
        if(selected==RADIO_BUTTON_COUNT){
            selected=0;
        }
        selectRadioButton(3, selected);
    }

    // ...
}

void onUpButtonPressed(){
    // ...

    if(CurrentPage==3) {
        selected--;
        if(selected==-1){
            selected=RADIO_BUTTON_COUNT-1;
        }
        selectRadioButton(3, selected);
    }

    // ...
}

Output

The selected radio-button is changed when up or down button is pressed.

Clone this wiki locally