Radiobox

A radiobox is similar to checkbox, except only one in a group can be selected at a time.

Constructors

this
this(RadioboxGroup group, bool isChecked)

Create a new radiobox.

Members

Classes

Extra
class Extra
Undocumented in source.

Functions

drawImpl
void drawImpl(Rectangle outer, Rectangle inner)
Undocumented in source. Be warned that the author may not have intended to support it.
isChecked
bool isChecked()
Undocumented in source. Be warned that the author may not have intended to support it.
isChecked
bool isChecked(bool value)
Undocumented in source. Be warned that the author may not have intended to support it.
press
void press()

Check this radiobox.

select
void select()

Check this radiobox.

Mixins

__anonymous
mixin enableInputActions
Undocumented in source.

Variables

group
RadioboxGroup group;

Group this radiobox belongs to. In a single group, only one radiobox can be selected.

Inherited Members

From Checkbox

__anonymous
mixin enableInputActions
Undocumented in source.
Extra
class Extra

Additional features available for checkbox styling.

size
Vector2 size;

Size of the checkbox.

isChecked
bool isChecked()
bool isChecked(bool value)

If true, the box is checked.

resizeImpl
void resizeImpl(Vector2 space)
Undocumented in source. Be warned that the author may not have intended to support it.
drawImpl
void drawImpl(Rectangle outer, Rectangle inner)
Undocumented in source. Be warned that the author may not have intended to support it.
getTexture
TextureGC* getTexture(Style style)

Get checkmark texture used by this checkbox.

toggle
void toggle()
press
void press()

Toggle the checkbox.

toString
string toString()
Undocumented in source. Be warned that the author may not have intended to support it.

Examples

// Radioboxes are similar to checkboxes, except that only one in a group
// can be checked at a time
auto group = new RadioboxGroup;
auto box1 = radiobox(group);
auto box2 = radiobox(group);

box1.select();

assert(box1.isChecked);

// Checking the other box will uncheck the previous one
box2.select();

assert(!box1.isChecked);
assert(box2.isChecked);

Meta