[ First ]  [ Previous ]  [ Next ]  [ Last ]  [ Manuals ]

 

LStdRadioButton



Overview:

LStdRadioButton is a PowerPlant class that is used for managing Mac OS radio buttons.

Methods :

The methods in this class are:

 

LStdRadioButton()  
HotSpotResult()  
SetValue()  
 

Data Members:

There are no data members in this class.

Operation:

This class is a very simple extension of LStdControl. A click on a radio button sets the value to one. The button then broadcasts a message that it has been clicked. The broadcast message includes a pointer to the button object that was clicked.

Source files:

(Pane Classes)

LStdControl.h

LStdControl.cp

Ancestors:

The ancestors this class derives from are:

 

LAttachable  
LControl  
LStdControl  
LBroadcaster  
LPane  
 

See Also:

LRadioGroup

LStdRadioButton()

Purpose:

The constructor creates objects from the passed-in parameters.

Access:

Public

Prototype:

LStdRadioButton();

LStdRadioButton( const SPaneInfo &inPaneInfo,
MessageT inValueMessage,
SInt32 inValue,
ResIDT inTextTraitsID,
Str255 inTitle );

LStdRadioButton( const SPaneInfo &inPaneInfo,
MessageT inValueMessage,
SInt32 inValue,
ResIDT inTextTraitsID,
ControlHandle inMacControlH );

LStdRadioButton(const LStdRadioButton 
&inOriginal);

LStdRadioButton( LStream *inStream );
Parameters:

These constructors have the following parameters:

 

const   SPaneInfo&  
inPaneInfo  
A reference to the SPaneInfo object that is the super view.  
MessageT  
inValueMessage  
The message sent when the control is interacted with.  
ResIDT  
inMENUid  
The resource ID of the menu items.  
SInt16  
inValue  
The value to set for the control, must be 1 or 0. One means the control is on, zero means off.  
ResIDT  
inTextTraitsID  
The resource ID of the resource containing the traits to apply to text strings.  
Str255  
inTitle  
The text string to display next to the radio button.  
ControlHandle  
inMacControlH  
This is the Mac OS control handle for the radio button.  
LStream*  
inStream  
A pointer to a stream object that contains the information to create the LControl object.  

HotSpotResult()

Purpose:

Respond to a click in a the radio button. This method is an override of HotSpotResult() in LStdControl. It calls SetValue() with the Button_On value.

In the Mac interface, clicking on a radio button always turns it on (or leaves it on). The standard way to turn off a radio button is to turn on another one in the same radio group. A radio group will normally be a Listener of a radio button.

SetValue()

Purpose:

Set the value of the radio button. This method is an override of SetValue() in LStdControl. It first calls the base class method, then broadcasts a message so that other buttons in the radio group (if present) can be turned off.

 


[ First ]  [ Previous ]  [ Next ]  [ Last ]  [ Manuals ]

Visit the Metrowerks website at: http://www.metrowerks.com
For assistance contact Metrowerks Technical Support at: cw_support@metrowerks.com
Copyright © 2000, Metrowerks Corp. All rights reserved.

Last updated: July 21, 2000