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

 

LTextButton



Overview:

LTextButton is a PowerPlant class that is used for managing buttons that have text instead of graphics in them. There is no standard Mac OS item that matches this class.

Methods :

The methods in this class are:

 

LTextButton()  
~LTextButton()  
DrawSelf()  
GetDescriptor()  
HotSpotAction()  
HotSpotResult()  
SetDescriptor()  
SetValue()  

Data Members:

The data members in this class are:

 

mText  
mTextTraitsID  
mSelectedStyle  
 

Operation:

Clicking an LTextButton toggles the button's state between on and off, like a radio button. The different state is represented visually by a change in the text style. The button style may become underline, bold, italic, outline, shadow, condensed, extended, or any combination of these style options.

When the user clicks the button, a message is sent to all the button's Listeners. In a typical scenario, you want some action to occur immediately when the user clicks a text button. You should specify a value message that uniquely identifies the button to any Listener.

Source files:

(Pane Classes)

LTextButton.h

LTextButton.cp

Ancestors:

The ancestors for this class are:

 

LAttachable  
LControl  
 
LBroadcaster  
LPane  
 

LTextButton()

Purpose:

The constructors create objects from the passed-in parameters.

Access:

Public

Prototype:

LTextButton();

LTextButton( LStream* inStream );
Parameters:

The stream constructor has the following parameter:

 

LStream*  
inStream  
A pointer to a stream object that contains the information to create the LTextButton object.  

~LTextButton()

Purpose:

The destructor destroys the object.

Access:

Virtual, Public

Prototype:

virtual ~LTextButton();

DrawSelf()

Purpose:

Draw this text in with appropriate text style for the selected status. This is an override of DrawSelf() in LPane.

GetDescriptor()

Purpose:

Return the text of the button. This is an override of GetDescriptor() in LPane.

HotSpotAction()

Purpose:

Toggle between highlighted and plain states, depending on mouse location. This is an override of HotSpotAction() in LControl.

HotSpotResult()

Purpose:

Update the value of the control and send a message to the Listeners. This is an override of HotSpotResult() in LControl.

SetDescriptor()

Purpose:

Reset the title and update region of the button. This is an override of SetDescriptor() in LPane.

SetValue()

Purpose:

Reset button value, update region, and send message. This is an override of SetValue() in LControl.

mText

Purpose:

This data member contains the text that is drawn in the button.

Access:

Protected

Prototype:

LStr255 mText;

mTextTraitsID

Purpose:

This data member contains the resource ID of the resource that contains the text traits information.

Access:

Protected

Prototype:

ResIDT mTextTraitsID;

mSelectedStyle

Purpose:

This data member contains the information that determines the style the button text will be drawn with.

Access:

Protected

Prototype:

SInt16 mSelectedStyle;

 


[ 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