C# Класс Nez.UI.ButtonGroup

Manages a group of buttons to enforce a minimum and maximum number of checked buttons. This enables "radio button" functionality and more. A button may only be in one group at a time. The {@link #canCheck(Button, boolean)} method can be overridden to control if a button check or uncheck is allowed.
Показать файл Открыть проект

Открытые методы

Метод Описание
ButtonGroup ( ) : System
add ( ) : void
add ( Button button ) : void
canCheck ( Button button, bool newState ) : bool

Called when a button is checked or unchecked. If overridden, generally changing button checked states should not be done from within this method.

clear ( ) : void
getAllChecked ( ) : List
getButtons ( ) : List
getChecked ( ) : Button

The first checked button, or null.

getCheckedIndex ( ) : int

The first checked button index, or -1

remove ( ) : void
remove ( Button button ) : void
setChecked ( string text ) : void

Sets the first {@link TextButton} with the specified text to checked.

setMaxCheckCount ( int maxCheckCount ) : void

Sets the maximum number of buttons that can be checked. Set to -1 for no maximum. Default is 1.

setMinCheckCount ( int minCheckCount ) : void

Sets the minimum number of buttons that must be checked. Default is 1.

setUncheckLast ( bool uncheckLast ) : void

If true, when the maximum number of buttons are checked and an additional button is checked, the last button to be checked is unchecked so that the maximum is not exceeded. If false, additional buttons beyond the maximum are not allowed to be checked. Default is true.

uncheckAll ( ) : void

Sets all buttons' {@link Button#isChecked()} to false, regardless of {@link #setMinCheckCount(int)}.

Описание методов

ButtonGroup() публичный Метод

public ButtonGroup ( ) : System
Результат System

add() публичный Метод

public add ( ) : void
Результат void

add() публичный Метод

public add ( Button button ) : void
button Button
Результат void

canCheck() публичный Метод

Called when a button is checked or unchecked. If overridden, generally changing button checked states should not be done from within this method.
public canCheck ( Button button, bool newState ) : bool
button Button Button.
newState bool New state.
Результат bool

clear() публичный Метод

public clear ( ) : void
Результат void

getAllChecked() публичный Метод

public getAllChecked ( ) : List
Результат List

getButtons() публичный Метод

public getButtons ( ) : List
Результат List

getChecked() публичный Метод

The first checked button, or null.
public getChecked ( ) : Button
Результат Button

getCheckedIndex() публичный Метод

The first checked button index, or -1
public getCheckedIndex ( ) : int
Результат int

remove() публичный Метод

public remove ( ) : void
Результат void

remove() публичный Метод

public remove ( Button button ) : void
button Button
Результат void

setChecked() публичный Метод

Sets the first {@link TextButton} with the specified text to checked.
public setChecked ( string text ) : void
text string Text.
Результат void

setMaxCheckCount() публичный Метод

Sets the maximum number of buttons that can be checked. Set to -1 for no maximum. Default is 1.
public setMaxCheckCount ( int maxCheckCount ) : void
maxCheckCount int Max check count.
Результат void

setMinCheckCount() публичный Метод

Sets the minimum number of buttons that must be checked. Default is 1.
public setMinCheckCount ( int minCheckCount ) : void
minCheckCount int Minimum check count.
Результат void

setUncheckLast() публичный Метод

If true, when the maximum number of buttons are checked and an additional button is checked, the last button to be checked is unchecked so that the maximum is not exceeded. If false, additional buttons beyond the maximum are not allowed to be checked. Default is true.
public setUncheckLast ( bool uncheckLast ) : void
uncheckLast bool Uncheck last.
Результат void

uncheckAll() публичный Метод

Sets all buttons' {@link Button#isChecked()} to false, regardless of {@link #setMinCheckCount(int)}.
public uncheckAll ( ) : void
Результат void