C# Class 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.
Afficher le fichier Open project: prime31/Nez

Méthodes publiques

Méthode Description
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)}.

Method Details

ButtonGroup() public méthode

public ButtonGroup ( ) : System
Résultat System

add() public méthode

public add ( ) : void
Résultat void

add() public méthode

public add ( Button button ) : void
button Button
Résultat void

canCheck() public méthode

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.
Résultat bool

clear() public méthode

public clear ( ) : void
Résultat void

getAllChecked() public méthode

public getAllChecked ( ) : List
Résultat List

getButtons() public méthode

public getButtons ( ) : List
Résultat List

getChecked() public méthode

The first checked button, or null.
public getChecked ( ) : Button
Résultat Button

getCheckedIndex() public méthode

The first checked button index, or -1
public getCheckedIndex ( ) : int
Résultat int

remove() public méthode

public remove ( ) : void
Résultat void

remove() public méthode

public remove ( Button button ) : void
button Button
Résultat void

setChecked() public méthode

Sets the first {@link TextButton} with the specified text to checked.
public setChecked ( string text ) : void
text string Text.
Résultat void

setMaxCheckCount() public méthode

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.
Résultat void

setMinCheckCount() public méthode

Sets the minimum number of buttons that must be checked. Default is 1.
public setMinCheckCount ( int minCheckCount ) : void
minCheckCount int Minimum check count.
Résultat void

setUncheckLast() public méthode

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.
Résultat void

uncheckAll() public méthode

Sets all buttons' {@link Button#isChecked()} to false, regardless of {@link #setMinCheckCount(int)}.
public uncheckAll ( ) : void
Résultat void