NCheckBoxprovides check box objects that have the look-and-feel of check boxes in the native window manager. A check box is a box with a title beside it. When the user clicks on the box, it becomes checked (selected); upon another click, it becomes deselected, and the check mark (or other indicator of a "checked" status) disappears.
NCheckBoxobject and initialize it. Upon being selected or deselected, the object generates a
DoCommandevent. However, this class does not use the commands set by
||Command produced at select time|
||Command produced at deselect time|
const CRect& theRegion,
const CStringRW theTitle = NULLString,
long theAttributes = 0L);
theEnclosureis a pointer to the subview that will contain the check box.
theRegionis a coordinate location, local to the enclosure, that is used to place the check box. Actually, only the top left portion of the region is used, and the width and height of the check box depend on the title of the control and the size definitions of the platform. This constructor also takes a title.
theControlAttributestakes a value from a set of XVT Portability Toolkit-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
NCheckBox(CSubview* theEnclosure, long theContainerId, long theId);
NCheckBox(const NCheckBox& theCheckBox);
NCheckBox& operator=(const NCheckBox& theCheckBox);
const CStringRW& theTitle = NULLString,
BOOLEAN isEnabled = TRUE,
long theDeselectCommand = NULLcmd,
long theSelectCommand = NULLcmd,
BOOLEAN isVisible = TRUE,
long theGlue = NULLSTICKY);
BOOLEANvalue specifying whether the check box is enabled to receive events, a visibility state, and a glue type. In addition it takes two parameters that are special to it:
theDeselectCommandis the command that is generated when the check box changes from a selected to a deselected state. Conversely,
theSelectCommandis generated when the check box changes from a deselected to a selected state.
virtual BOOLEAN IsSelected(void) const;
BOOLEANvalue indicating whether the check box is in a selected state (
TRUE) or a deselected state (
virtual void Select(void);
virtual void Deselect(void);
virtual long GetSelectCommand(void) const;
virtual void SetSelectCommand(long theNewSelectCommand);
virtual long GetDeselectCommand(void) const;
virtual void SetDeselectCommand(
virtual void DoHit(CONTROL_INFO theControlInfo);
CONTROL_INFO, which is defined by the XVT Portability Toolkit (see the XVT Portability Toolkit Guide). The check box responds by changing to the appropriate selection state and generating the appropriate command for indicating its new state.
virtual BOOLEAN ClassCanGetKeyFocus(void) const;
virtual void DoUpdateModel(long theControllerId,
long theCommand, const CModel* theModel);
virtual void DoCommand(long theCommand,
void* theData = NULL);