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

 

LDialogBox



Overview:

LDialogBox is a PowerPlant class that is used for creating dialog boxes in your program.

Methods :

The methods in this class are:

 

LDialogBox()  
~LDialogBox()  
FinishCreateSelf()  
HandleKeyPress()  
ListenToMessage()  
SetCancelButton()  
SetDefaultButton()  
 

Data Members:

The data members in this class are:

 

mDefaultButtonID  
mCancelButtonID  
mDefaultOutline  
 

Operation:

LDialogBox is a simple extension of the LWindow class, with the addition of button tracking for the default and cancel buttons. The data members that identify the default and cancel buttons are mDefaultButtonID and mCancelButtonID. You can set the buttons in the Constructor resource editor, or you can set them at runtime. You specify the button by its Pane ID number.

To learn more about using this class, refer to The PowerPlant Book.

Source files:

(Pane Classes)

LDialogBox.h

LDialogBox.cp

Ancestors:

LAttachable

LCommander

LListener

LModelObject

LPane

LView

LWindow

See Also:

LControl

LDefaultOutline

LDialogBox()

Purpose:

The constructors create objects from the passed-in parameters.

Access:

Public

Prototype:

LDialogBox();

LDialogBox( SWindowInfo &inWindowInfo );

LDialogBox( ResIDT inWINDid,
Uint32 inAttributes,
LCommander *inSuper );

LDialogBox( LStream *inStream );
Parameters:

The parameters for this constructor are:

 

SWindowInfo&  
inWindowInfo  
The reference to the window information for the SuperView.  
ResIDT  
inWINDid  
The accompanying `WIND' resource ID for this dialog box.  
Uint32  
inAttributes  
A value that specifies the attributes for the window.  
LCommander*  
inSuper  
A pointer to a SuperCommander.  
LStream*  
inStream  
A pointer to a stream object that contains the information to create the LDialogBox object.  

~LDialogBox()

Purpose:

The destructor destroys the object.

Access:

Public

Prototype:

virtual ~LDialogBox();

FinishCreateSelf()

Purpose:

Finish creation by linking the dialog box as a Listener to its default and cancel buttons. This is an override of FinishCreateSelf() in LPane.

HandleKeyPress()

Purpose:

This method handles keyboard equivalents for hitting the default and cancel buttons of the dialog box. The default button is Enter or Return. The cancel button is Escape or Command-Period. This is an override of HandleKeyPress() in LCommander.

ListenToMessage()

Purpose:

This method respond to messages from Broadcasters. The dialog box responds to the cmd_Close message by deleting itself. This method is an override of ListenToMessage() in LListener.

Remarks:

Negative message numbers are relayed to the ProcessCommand(). This allows subclasses of the dialog box to handle messages as commands. Or, if you don't want to subclass this dialog box, the SuperCommander of the dialog box will receive the messages as commands.

SetCancelButton()

Purpose:

Using this method you specify the Pane ID of the cancel button of the dialog box. The cancel button must be derived from LControl. This object is then added as a Listener.

Access:

Virtual, Public

Prototype:

virtual void SetCancelButton( PaneIDT inButtonID 
);
Parameters:

The parameter for this method is:

 

PaneIDT  
inButtonID  
The pane ID of the cancel button.  

Return:

None

Remarks:

Certain keyboard equivalents (Escape and Command-Period) simulate a click inside the cancel button.

SetDefaultButton()

Purpose:

Using this method you specify the Pane ID of the default button of the dialog box. The default button must be derived from LControl.

Access:

Virtual, Public

Prototype:

virtual void SetDefaultButton( PaneIDT 
inButtonID);
Parameters:

The parameter for this method is:

 

PaneIDT  
inButtonID  
The pane ID of the default button.  

Return:

None

Remarks:

The default button has a default outline around it and certain keyboard equivalents (Return and Enter) simulate a click inside it.

mDefaultButtonID

Purpose:

This data member stores the pane ID of the default button.

Access:

Protected

Prototype:

PaneIDT mDefaultButtonID;

mCancelButtonID

Purpose:

This data member stores the pane ID of the cancel button.

Access:

Protected

Prototype:

PaneIDT mCancelButtonID;

mDefaultOutline

Purpose:

This data mber stores the pointer to a LDefaultOutline.

Access:

Protected

Prototype:

LDefaultOutline *mDefaultOutline;

 


[ 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