LButton 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:
The methods in this class are:
Data Members:
The data members in this class are:
Operation:
When you create an object of this type, you provide two resource ID numbers. One is for the graphical element in its non-depressed state, and the other is for the depressed (user-pushed) state.
If you use the ICN# resource for the button, the Mac OS automatically picks the icon
family member that best matches the display settings of the monitor
on which it is rendered.
Although buttons are usually small, you can use a large PICT as a button. Note that ICON and ICN# resources describe images that are of Mac OS-standard, specific
dimensions.
When the user releases the mouse button with the cursor inside the button perimeter, the button sends a message to its Listeners.
Source files:
Ancestors:
Purpose:
The constructors create new objects from the passed-in parameters.
Access:
Prototype:
LButton();
LButton( const LButton &inOriginal );
LButton( const SPaneInfo &inPaneInfo,
MessageT inClickedMessage,
OSType inGraphicsType,
ResIDT inNormalID,
ResIDT inPushedID );
LButton( LStream *inStream );Parameters:
These constructors have the following parameters:
Purpose:
Draw the graphic for a button. The pane must already be focused; refer to LPane for more information.
Access:
Prototype:
virtual void DrawGraphic( ResIDT inGraphicID );Parameters:
The parameter for this method is:
Return:
Purpose:
This method is an override of the base class method DrawSelf() in LPane. It draws the normal graphic in 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:
Sets the graphic resources to use for drawing the button.
Access:
Prototype:
virtual void SetGraphics( ResIDT inNormalID,Parameters:
ResIDT inPushedID);
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 parameters:
|
Return:
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 normal button graphic.
Access:
Prototype:
ResIDT mNormalID;
Purpose:
This data member holds the resource ID for the pushed button graphic.
Access:
Prototype:
ResIDT mPushedID;