[Classes] [Prev] [Next] [Methods]

CRadioGroup

Methods Index

Heritage
Description
Usage
Friends
Private Data Members
Public Methods
Grouper Utilities
Example
Border Space for Button Placement
Protected Methods
Private Methods

CRadioGroup


Heritage

Superclass: CSubview

Subclasses: None


Description

CRadioGroup is a class that groups radio buttons. By definition, radio buttons must be grouped together. Unlike check boxes, which allow the user to select multiple options by checking more than one box at a time, radio buttons within a group can be selected only one at a time. Selecting one radio button means to deselect another.


Usage

Although you can instantiate radio buttons directly, it is more desirable to create a group and then add radio buttons to it. The group's size is automatically increased as new buttons are added to it.

If you call FindResourceView in a CWindow and 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 CRadioGroup::FindResourceView method, using the resource ID of the first radio button.

Friends

friend class CResourceWindow;


Private Data Members

long itsSelectedId; The ID of selected button
int itsBorderSpace; Spacing between buttons and grouper
BOOLEAN itHasBorder; Whether to draw a border


Public Methods

CRadioGroup(CSubview *theEnclosure, 
const CPoint& theTopLeft,
BOOLEAN hasBorder = FALSE);
CRadioGroup(CSubview *theEnclosure, long theContainerId,
long theId);
CRadioGroup(const CRadioGroup& theGroup);
CRadioGroup& operator= (const CRadioGroup& theGroup);
virtual ~CRadioGroup(void);
BOOLEAN IRadioGroup(BOOLEAN hasBorder		= FALSE,
BOOLEAN isVisible = TRUE,
GLUETYPE theGlue = NULLSTICKY);

Grouper Utilities

virtual long AddButton(const CPoint &aPoint, 
const CStringRW& theButtonTitle = NULLString,
long theCommand = NULLcmd,
long theAttributes = 0L,
GLUETYPE theGlue = NULLSTICKY);
virtual long AddButtons(long theFirstResourceId, 
int theNumberOfButtons,
int theFirstCommand,
long theAttributes = 0L,
int theSelectedButton = 0,
UNITS theSeparation = 0,
DIRECTION theDirection = VERTICAL);

Example

virtual void RemoveButton(long theButtonId);
virtual long FindResButtonId(long theContainerId, long theId);
virtual void SetSelectedButton(long id);
virtual long GetSelectedButton(void) const;
virtual void Draw(const CRect& theClippingRegion);

Border Space for Button Placement

virtual void SetBorderSpace(int thePixelSpace);
virtual int GetBorderSpace(void) const;

Protected Methods

virtual void AddResourceButtonInternal(
long theContainerId, long theId);

Private Methods

long AddButtonInternal(const CPoint &aPoint,
const CStringRW& theButtonTitle = NULLString,
long theCommand = NULLcmd,
long theAttributes = 0L,
GLUETYPE theGlue = NULLSTICKY);
void CopyButtons(const CRadioGroup &theRadioGroup);


[Classes] [Prev] [Next] [Methods]

support@xvt.com


Visit our online help desk for tech support

Copyright © 2009, Providence Software Solutions Inc. All rights reserved.