voidPushButton(constchar*text,ButtonState*s,intv)voidPushButton(constchar*text,ButtonState*s,void*v)
Construct a button with text in the center and a polygon on the outside. The polygon is like a
rectangle, but with rounded corners. When chosen, the entire button is drawn with foreground and
background colors reversed.
voidRadioButton(constchar*text,ButtonState*s,intv)voidRadioButton(constchar*text,ButtonState*s,void*v)
Construct a button with a circle on the left and text on the right. When hit, a second circle is
drawn inside the first. When chosen, a filled circle is drawn inside the outer circle.
voidCheckBox(constchar*text,ButtonState*s,inton,intoff)voidCheckBox(constchar*text,ButtonState*s,void*on,void*off)
Construct a button with a rectangle on the left and text on the right. When hit, a second
rectangle is drawn inside the first. When chosen, two diagonal lines are drawn connecting the
opposite corners of the rectangle. When a checkbox is pressed the first time, it sets s to off if
the value is on and sets s to on otherwise. Subsequent presses swap the values of the checkbox
and s.
voidAttach(Button*)
Add to this button's list of associated buttons. These buttons are enabled when the button is
chosen and disabled when it is not chosen.
voidDetach(Button*)
Remove a button from this button's list of associated buttons.
voidDisable()
Stop listening to input events. Disabled buttons are typically ``grayed out'' by drawing a half-
filled rectangle in the background.
voidEnable()
Start listening to input events.
voidChoose()
Make the button as chosen, enabling any associated buttons.
voidHandle(Event&)
If the event type is DownEvent and the button is enabled, call Refresh and read events until an
UpEvent occurs. If the button is the target of the UpEvent, then call Press.
virtualvoidPress()
Take the appropriate action for the button being pressed. The default is to set the associated
state to the button's value, which will trigger all related buttons to update their display.
virtualvoidRefresh()
Update the button display.
voidSetDimensions(intwidth,intheight)
Specify the natural size of the button. The default size is a function of the size of the text.
This routine is obsolete; use Interactor::Reshape instead.
voidUnChoose()
Mark the button as not chosen, disabling any associated buttons.