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

 

LListBox



Overview:

LListBox is a PowerPlant class that is used for wrapping the Mac OS List Manager functionality.

Methods :

The methods in this class are:

 

LListBox()  
~LListBox()  
ActivateSelf()  
BeTarget()  
ClickSelf()  
DeactivateSelf()  
DoNavigationKey()  
DoTypeSelection()  
DontBeTarget()  
DrawSelf()  
FindCommandStatus()  
FocusDraw()  
GetDescriptor()  
GetDoubleClickMessage()  
GetFocusBox()  
GetLastSelectedCell()  
GetMacListH()  
GetValue()  
HandleKeyPress()  
HideSelf()  
InitListBox()  
MakeCellVisible()  
MoveBy()  
ObeyCommand()  
ResizeFrameBy()  
RestorePlace()  
SavePlace()  
SelectAllCells()  
SelectOneCell()  
SetDescriptor()  
SetDoubleClickMessage()  
SetValue()  
ShowSelf()  
UnselectAllCells()  

Data Members:

The data members in this class are:

 

mMacListH  
mDoubleClickMessage  
mFocusBox  
mTextTraitsID  
mHasGrow  
 

Operation:

For detailed information on the workings of this class, refer to The PowerPlant Book.

Source files:

(Pane Classes)

LListBox.h

LListBox.cp

Ancestors:

LAttachable

LBroadcaster

LCommander

LPane

LListBox()

Purpose:

The constructor creates objects from the passed-in parameters.

Access:

Public

Prototype:

LListBox();

LListBox( const LListBox &inOriginal );

LListBox( const SPaneInfo &inPaneInfo,
Boolean inHasHorizScroll,
Boolean inHasVertScroll,
Boolean inHasGrow,
Boolean inHasFocusBox,
MessageT inDoubleClickMessage,
SInt16 inTextTraitsID,
SInt16 inLDEFid,
LCommander *inSuper );

LListBox( LStream *inStream );
Parameters:

The parameters for these constructors are:

 

const   LListBox&  
inOriginal  
The object to be copied.  
const   SPaneInfo&  
inPaneInfo  
The reference to the Superpane.  
Boolean  
inHasHorizScroll  
Set if horizontal scrolling.  
Boolean  
inHasVertScroll  
Set if vertical scrolling.  
Boolean  
inHasGrow  
Set if the box can grow.  
Boolean  
inHasFocusBox  
Set if it has a focus box.  
MessageT  
inDoubleClickMessage  
The double-click message.  
SInt16  
inTextTraitsID  
The resource ID for the text traits.  
SInt16  
inLDEFid  
The ID for the LDEF List Definition resource.  
LCommander*  
inSuper  
The pointer to the Supercommander.  
LStream*  
inStream  
The pointer to the stream object to read from.  

~LListBox()

Purpose:

The destructor destroys the object.

Access:

Virtual, Public

Prototype:

virtual ~LListBox();

ActivateSelf()

Purpose:

Activate the ListBox. The Toolbox shows the selection and scroll bars. This is an override of ActivateSelf() in LPane.

BeTarget()

Purpose:

ListBox is becoming the Target. This is an override of BeTarget() in LCommander.

ClickSelf()

Purpose:

Respond to Click inside an ListBox. This is an override of ClickSelf() in LPane.

DeactivateSelf()

Purpose:

Deactivate ListBox. The Toolbox hides the selection and scroll bars. This is an override of DeactivateSelf() in LPane.

DoNavigationKey()

Purpose:

Implements keyboard navigation by supporting selection change using the arrow keys, page up, page down, home, and end.

Access:

Virtual, Protected

Prototype:

virtual void DoNavigationKey(
const EventRecord &inKeyEvent );
Parameters:

The parameter for this method is:

 

const   EventRecord&  
inKeyEvent  
The event record for the key press.  

Return:

None

DoTypeSelection()

Purpose:

Change selection to the item beginning with the input characters.

Access:

Virtual, Protected

Prototype:

virtual void DoTypeSelection(
const EventRecord& inKeyEvent );
Parameters:

The parameter for this method is:

 

const   EventRecord&  
inKeyEvent  
The event record for the key press.  

Return:

None

DontBeTarget()

Purpose:

ListBox is no longer the Target. This is an override of DontBeTarget() in LCommander.

DrawSelf()

Purpose:

Draw ListBox. This is an override of DrawSelf() in LPane.

FindCommandStatus()

Purpose:

Pass back the status of a Command. This is an override of FindCommandStatus() in LCommander.

FocusDraw()

Purpose:

Focus drawing. This is an override to use the default Pen state and to set the TextTraits used by the ListBox. This is an override of FocusDraw() in LPane.

GetDescriptor()

Purpose:

Return the descriptor of a ListBox, which is the text of the first selected cell. The descriptor is an empty string if there are no selected cells. This method assumes that the cell data is text. This is an override of GetDescriptor() in LPane.

GetDoubleClickMessage()

Purpose:

Retrieve the double-click message.

Access:

Public

Prototype:

MessageT GetDoubleClickMessage() const;
Parameters:

None

Return:

Returns the message for the double-click.

GetFocusBox()

Purpose:

Retrieve the focus box from mFocusBox.

Access:

Inline, Public

Prototype:

LFocusBox* GetFocusBox();
Parameters:

None

Return:

Return the mFocusBox.

GetLastSelectedCell()

Purpose:

Pass back the last selected Cell in a ListBox.

Access:

Virtual, Public

Prototype:

virtual Boolean GetLastSelectedCell(Cell 
&outCell);
Parameters:

The parameter for this method is:

 

Cell&  
outCell  
The reference to the last selected Cell.  

Return:

Returns false if no cells are selected.

GetMacListH()

Purpose:

Retrieve the Mac OS list handle.

Access:

Public

Prototype:

ListHandle GetMacListH() const;
Parameters:

None

Return:

Returns the list handle.

GetValue()

Purpose:

Return the value of a ListBox.

The "value" of a ListBox is the row number of the first selected cell, with the first row being number 0 (the ListManager uses zero-based numbering). If no cells are selected, the value is -1. This "value" makes sense for a ListBox with one column, by far the most common case.

This is an override of GetValue() in LPane.

HandleKeyPress()

Purpose:

ListBox supports keyboard navigation and type selection. This is an override of HandleKeyPress() in LCommander.

HideSelf()

Purpose:

ListBox is becoming invisible. This is an override of HideSelf() in LPane.

InitListBox()

Purpose:

Private initializer

Access:

Private

Prototype:

void InitListBox(
Boolean inHasHorizScroll,
Boolean inHasVertScroll,
Boolean inHasGrow,
Boolean inHasFocusBox,
MessageT inDoubleClickMessage,
SInt16 inTextTraitsID,
SInt16 inLDEFid );
Parameters:

The parameters for these constructors are:

 

Boolean  
inHasHorizScroll  
Set if horizontal scrolling.  
Boolean  
inHasVertScroll  
Set if vertical scrolling.  
Boolean  
inHasGrow  
Set if the box can grow.  
Boolean  
inHasFocusBox  
Set if it has a focus box.  
MessageT  
inDoubleClickMessage  
The double-click message.  
SInt16  
inTextTraitsID  
The resource ID for the text traits.  
SInt16  
inLDEFid  
The ID for the LDEF List Definition resource.  

Return:

None

MakeCellVisible()

Purpose:

Scroll the ListBox as little as possible to move the specified Cell into view.

Access:

Virtual, Public

Prototype:

virtual void MakeCellVisible( Cell inCell );
Parameters:

The parameter for this method is:

 

Cell&  
inCell  
The reference to the Cell.  

Return:

None

MoveBy()

Purpose:

Move the location of the Frame by the specified amounts. Both PowerPlant and the List Manager store a location for the ListBox, so we must make sure that both locations are in synch. This is an override of MoveBy() in LPane.

ObeyCommand()

Purpose:

Respond to Command message. This is an override of ObeyCommand() in LCommander.

ResizeFrameBy()

Purpose:

Change the Frame size by the specified amounts. Both PowerPlant and the List Manager store a size for the ListBox, so we must make sure that both sizes are in synch. This is an override of ResizeFrameBy() in LPane.

RestorePlace()

Purpose:

Read size and location information stored in a Stream by the SavePlace() function.

Access:

Public

Prototype:

virtual void RestorePlace( LStream *inPlace );
Parameters:

The parameter for this method is:

 

LStream*  
inPlace  
Reference to the stream to read from.  

Return:

None

SavePlace()

Purpose:

Write size and location information to a Stream for later retrieval by the RestorePlace() function.

Access:

Public

Prototype:

virtual void SavePlace( LStream *outPlace );
Parameters:

The parameter for this method is:

 

LStream*  
outPlace  
The reference to the stream to write to.  

Return:

None

SelectAllCells()

Purpose:

Select all the cells in a ListBox.

Access:

Virtual, Public

Prototype:

virtual void SelectAllCells();
Parameters:

None

Return:

None

SelectOneCell()

Purpose:

Select the specified Cell and deselect all others.

Access:

Virtual, Public

Prototype:

virtual void SelectOneCell( Cell inCell );
Parameters:

The parameter for this method is:

 

Cell&  
inCell  
The reference to the Cell.  

Return:

None

SetDescriptor()

Purpose:

Set the descriptor of a ListBox, which is the text of the first selected cell. Nothing happens if there are no selected cells.

This function assumes that the cell data is text. This is an override of SetDescriptor() in LPane.

SetDoubleClickMessage()

Purpose:

Set the double click message.

Access:

Public

Prototype:

void SetDoubleClickMessage( MessageT inMessage);
Parameters:

The parameter for this method is:

 

MessageT  
inMessage  
The message to set for double click.  

Return:

None

SetValue()

Purpose:

Set the value of a ListBox.

The "value" of a ListBox is the row number of the first selected cell, with the first row being number 0 (the ListManager uses zero-based numbering). If no cells are selected, the value is -1.

This "value" makes sense for a ListBox with one column, by far the most common case.

This function selects the cell in row "inValue" and column 1, deselecting any previously selected cells. This is an override of SetValue() in LPane.

ShowSelf()

Purpose:

ListBox is becoming visible. This is an override of ShowSelf() in LPane.

UnselectAllCells()

Purpose:

Unselect all the cells in a ListBox.

Access:

Public

Prototype:

virtual void UnselectAllCells();
Parameters:

None

Return:

None

mMacListH

Purpose:

The Mac OS list handle.

Access:

Protected

Prototype:

ListHandle mMacListH;

mDoubleClickMessage

Purpose:

Storage for the double click message.

Access:

Protected

Prototype:

MessageT mDoubleClickMessage;

mFocusBox

Purpose:

Storage for the focus box.

Access:

Protected

Prototype:

LFocusBox *mFocusBox;

mTextTraitsID

Purpose:

The resource ID for the text traits.

Access:

Protected

Prototype:

ResIDT mTextTraitsID;

mHasGrow

Purpose:

Indicates whether the box can grow.

Access:

Protected

Prototype:

Boolean mHasGrow;

 


[ 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