NRadioButtonprovides radio button objects (belonging to a group) that have the look-and-feel of radio buttons in the native window manager. By definition, radio buttons must be grouped together. Unlike check boxes, which can be multiply selected, radio buttons can only be selected one at a time. Selecting one radio button means to deselect another. The helper class
CRadioGroupserves as a grouper.
NRadioButtonis a public class that you can instantiate directly, it is more desirable to create a radio button grouper (
CRadioGroup) and use either the
AddButtonsmethod to create new buttons in the group.
If you call
CWindowand pass in the resource ID of the first radio button, you will get a handle to the
CRadioGroup, not the first radio button in the group.Then, to get a handle to the first radio button in the group, you can call the
FindResourceViewmethod, using the resource ID of the first radio button.
||A pointer to the group containing the radio button|
const CRect& theRegion,
long theAttributes = 0L,
const CStringRW& theTitle = NULLString);
theEnclosureis a pointer to the subview that will contain the radio button.
theRegionis a coordinate location, local to the enclosure, that is used to place the radio button.
theRadioGroupis a pointer to the group that is to contain the radio button.
theAttributestakes a value from a set of XVT-provided attributes that you can give to native views. You can OR together the appropriate control flag constants into an attribute value. For a listing of the possible control flags for
theAttributes, refer to the table in the description of
CNativeView's protected constructor
. Finally, this constructor takes a character string for its title,
long theContainerId, long theId);
NRadioButton(const NRadioButton& theButton);
NRadioButton& operator= (
const NRadioButton& theButton);
const CStringRW& theTitle = NULLString,
BOOLEAN isEnabled = TRUE,
long theCommand = NULLcmd,
BOOLEAN isVisible = TRUE,
long theGlue = NULLSTICKY);
BOOLEANspecifying whether the radio button is enabled to receive events, the number of the command that is generated when the button is clicked, a visibility state, and a glue type.
virtual void DoHit(CONTROL_INFO controlInfo);
CONTROL_INFO, which is defined by XVT in the XVT Portability Toolkit Guide. The button responds by informing its group, which takes care of the proper selection. In addition, a
DoCommandmessage is sent.
Sets the sizing of a radio button to
TRUEso that the button can be sized or to
FALSEso that it cannot be sized. Currently, radio buttons cannot be sized. It is a non-portable behavior to size radio buttons, which are usually a fixed size according to the native look-and-feel.
virtual BOOLEAN ClassCanGetKeyFocus(void) const;