LToggleButton is a PowerPlant class that implements a button. The graphic for the button needs to be stored as a resource of one of these types:
This class is very similar to LButton, except that you may specify five separate resource ID numbers, not just two resource ID numbers as an LButton would have.
Methods :
The methods in this class are:
Data Members:
The data members in this class are:
Operation:
You can use LToggleButton to make some simple animations that play when a button is clicked. For example, you could create a drop-down flag button, or a door that opens and closes when the button is clicked. In addition to the "on" and "off" states of the button that LButton uses, you also specify graphics for:
A click on a button that is already "on" A click on a button that is already "off," and A transition graphic that displays when the button is switching states. Source files:
Ancestors :
See also:
Purpose:
The constructor creates the objects from the passed-in parameters.
Access:
Prototype:
LToggleButton();
LToggleButton( const SPaneInfo &inPaneInfo,Parameters:
MessageT inClickedMessage,
OSType inGraphicsType,
ResIDT inOnID,
ResIDT inOnClickID,
ResIDT inOffID,
ResIDT inOffClickID,
ResIDT inTransitionID );
These constructors have the following parameters:
Purpose:
Draw the graphic for a the button. The Pane must already be focused before calling this method.
Access:
Prototype:
virtual void DrawGraphic( ResIDT inGraphicID );Parameters:
This method has the following parameter:
Return:
Purpose:
This method is an override of the base class method DrawSelf() in LPane. It draws the button.
Purpose:
This method is an override of the base class method HotSpotAction() in LControl. It causes the buttons to toggle between two graphics, depending on whether the mouse is inside or outside the button.
Purpose:
This method is an override of the base class method HotSpotResult() in LControl. It broadcasts a message to Listeners when the button is clicked.
Purpose:
This method is an override of the base class method PointIsInFrame() in LPane. It gives you information about whether a point lies within a given frame.
Purpose:
Specify the resources IDs for all states of the button.
Access:
Prototype:
virtual void SetGraphics( ResIDT inOnID,Parameters:
ResIDT inOnClickID,
ResIDT inOffID,
ResIDT inOffClickID,
ResIDT inTransitionID);
This method has the following parameters:
Return:
Purpose:
This method sets the value of the mGraphicsType data member.
Access:
Prototype:
virtual void SetGraphicsType(Parameters:
OSType inGraphicsType );
This method has the following parameter:
|
Purpose:
This method is an override of the base class method SetValue() in LControl. It sets the value of the button to on or off.
Purpose:
This method holds the resource type descriptor for the graphic elements of the button. It should be one of the following:
Prototype:
OSType mGraphicsType;
Purpose:
This data member holds the resource ID for the "on" button graphic.
Access:
Prototype:
ResIDT mOnID;
Purpose:
This data member holds the resource ID for the "clicked when on" button graphic.
Access:
Prototype:
ResIDT mOnClickID;
Purpose:
This data member holds the resource ID for the "off" button graphic.
Access:
Prototype:
ResIDT mOffID;
Purpose:
This data member holds the resource ID for the "clicked when off" button graphic.
Access:
Prototype:
ResIDT mOffClickID;
Purpose:
This data member holds the resource ID for the transition button graphic.
Access:
Prototype:
ResIDT mTransitionID;