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.
파일 보기 프로젝트 열기: prime31/Nez

공개 메소드들

메소드 설명
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