RadioButton Demo and Documentation

Display sketch code: RadioButtonDemo.pde. The code for RadioButton is in Clickable.pde

class RadioButton
extends CircleButton
which extends Button
which extends Clickable

Creates a button that looks like a traditional radio button. The circle is black when checked. It is same as a CircleButton but has a simplified setup.

Fields x and y represent the center of the circle. w is the horizontal radius while h is the vertical radius. By default, w = h but this is not required.

** RadioButton(int centerX, int centerY, String theLabel)
- A special two state button that looks and acts like a radio button. There is a small circle that blackens when checked. The label appears to the right of the box. It is the same as a CircleButton but has a simplified setup. It can be used as a radio button in a ButtonGroup controlled by setSelectedItemNum(int b).

Method use codes:

** This constructor or method is designed to be called in the user sketch.

* This method is normally not called in the user's sketch unless the Clickable item was not been included in a ClickableGroup. ClickableGroup automatically uses the method as needed. Exception: This method may be needed if the user is extending Clickable with a new class.

# This constructor or method is rarely used in the user program. In Java, it would probably marked "private". Clickable, ScrollBar, and some other abstract constructors would never be called directly by the user sketch because they do nothing useful unless the user is extending a class.


Inherited from CircleButton

Constructors
CircleButton, CircleButton, CircleButton

Methods
display, isOver


Inherited from Button

Constructors
Button, Button, Button

Methods
display, isOver, nextState, toggle


Inherited from Clickable

Fields
NOTHING_CLICKED, COMBO_BUTTON, DISABLED_COLOR, borderColor, c, clicked, clickedItemNum, colorState, enabled, h, label, over, overC, scrollable, selected, selectedItemNum, visible, w, x, y

Constructors
Clickable

Methods
checkForClick, display, doNotSelect, getClickedItemNum, getColorState, getH, getItem, getLabel, getSelected, getSelectedItem, getSelectedItemLabel, getSelectedItemNum, getW, getX, getY, hasBeenClicked, hideSomething, isOver, setBorderColor, setColorState, setH, setLabel, setScrollable, setSelected, setSelectedItemNum, setEnabled, setVisible, setW, setX, setY, sX, sY

Return to the top of the page

Revised: 04/11/2014