Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members

FXRadioButton Class Reference

#include <FXRadioButton.h>

Inheritance diagram for FXRadioButton:

FXLabel FXFrame FXWindow FXDrawable FXId FXObject List of all members.

Public Methods

 FXRadioButton (FXComposite *p, const FXString &text, FXObject *tgt=NULL, FXSelector sel=0, FXuint opts=RADIOBUTTON_NORMAL, FXint x=0, FXint y=0, FXint w=0, FXint h=0, FXint pl=DEFAULT_PAD, FXint pr=DEFAULT_PAD, FXint pt=DEFAULT_PAD, FXint pb=DEFAULT_PAD)
 Construct new radio button.

virtual FXbool canFocus () const
 Returns true because a radio button can receive focus.

virtual FXint getDefaultWidth ()
 Get default width.

virtual FXint getDefaultHeight ()
 Get default height.

void setCheck (FXbool s=TRUE)
 Set radio button state (TRUE, FALSE or MAYBE).

FXbool getCheck () const
 Get radio button state (TRUE, FALSE or MAYBE).

void setRadioButtonStyle (FXuint style)
 Change radio button style.

FXuint getRadioButtonStyle () const
 Return current radio button style.

FXColor getRadioColor () const
 Get the radio background color.

void setRadioColor (FXColor clr)
 Set the radio background color.

virtual void save (FXStream &store) const
 Save radio button to a stream.

virtual void load (FXStream &store)
 Load radio button from a stream.


Detailed Description

A radio button is a tri-state button. Normally, it is either TRUE or FALSE; a third state MAYBE may be set to indicate that no selection has been made yet by the user, or that the state is ambiguous. When pressed, the radio button sets its state to TRUE and sends a SEL_COMMAND to its target, and the message data set to the state of the radio button, of the type FXbool. If the radio button is contained inside a group box, the other radio buttons in the group box will be set to FALSE and will send a message as well.