LListBox is a PowerPlant class that is used for wrapping the Mac OS List Manager functionality.
Methods :
The methods in this class are:
Data Members:
The data members in this class are:
Operation:
For detailed information on the workings of this class, refer to The PowerPlant Book.
Source files:
Ancestors:
Purpose:
The constructor creates objects from the passed-in parameters.
Access:
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:
Purpose:
The destructor destroys the object.
Access:
Prototype:
virtual ~LListBox();
Purpose:
Activate the ListBox. The Toolbox shows the selection and scroll bars. This is an override of ActivateSelf() in LPane.
Purpose:
ListBox is becoming the Target. This is an override of BeTarget() in LCommander.
Purpose:
Respond to Click inside an ListBox. This is an override of ClickSelf() in LPane.
Purpose:
Deactivate ListBox. The Toolbox hides the selection and scroll bars. This is an override of DeactivateSelf() in LPane.
Purpose:
Implements keyboard navigation by supporting selection change using the arrow keys, page up, page down, home, and end.
Access:
Prototype:
virtual void DoNavigationKey(Parameters:
const EventRecord &inKeyEvent );
The parameter for this method is:
Return:
Purpose:
Change selection to the item beginning with the input characters.
Access:
Prototype:
virtual void DoTypeSelection(Parameters:
const EventRecord& inKeyEvent );
The parameter for this method is:
Return:
Purpose:
ListBox is no longer the Target. This is an override of DontBeTarget() in LCommander.
Purpose:
Draw ListBox. This is an override of DrawSelf() in LPane.
Purpose:
Pass back the status of a Command. This is an override of FindCommandStatus() in LCommander.
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.
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.
Purpose:
Retrieve the double-click message.
Access:
Prototype:
MessageT GetDoubleClickMessage() const;Parameters:
Return:
Returns the message for the double-click.
Purpose:
Retrieve the focus box from mFocusBox.
Access:
Prototype:
LFocusBox* GetFocusBox();Parameters:
Return:
Return the mFocusBox.
Purpose:
Pass back the last selected Cell in a ListBox.
Access:
Prototype:
virtual Boolean GetLastSelectedCell(Cell &outCell);Parameters:
The parameter for this method is:
Return:
Returns false if no cells are selected.
Purpose:
Retrieve the Mac OS list handle.
Access:
Prototype:
ListHandle GetMacListH() const;Parameters:
Return:
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.
Purpose:
ListBox supports keyboard navigation and type selection. This is an override of HandleKeyPress() in LCommander.
Purpose:
ListBox is becoming invisible. This is an override of HideSelf() in LPane.
Purpose:
Access:
Prototype:
void InitListBox(Parameters:
Boolean inHasHorizScroll,
Boolean inHasVertScroll,
Boolean inHasGrow,
Boolean inHasFocusBox,
MessageT inDoubleClickMessage,
SInt16 inTextTraitsID,
SInt16 inLDEFid );
The parameters for these constructors are:
Return:
Purpose:
Scroll the ListBox as little as possible to move the specified Cell into view.
Access:
Prototype:
virtual void MakeCellVisible( Cell inCell );Parameters:
The parameter for this method is:
Return:
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.
Purpose:
Respond to Command message. This is an override of ObeyCommand() in LCommander.
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.
Purpose:
Read size and location information stored in a Stream by the SavePlace() function.
Access:
Prototype:
virtual void RestorePlace( LStream *inPlace );Parameters:
The parameter for this method is:
Return:
Purpose:
Write size and location information to a Stream for later retrieval by the RestorePlace() function.
Access:
Prototype:
virtual void SavePlace( LStream *outPlace );Parameters:
The parameter for this method is:
Return:
Purpose:
Select all the cells in a ListBox.
Access:
Prototype:
virtual void SelectAllCells();Parameters:
Return:
Purpose:
Select the specified Cell and deselect all others.
Access:
Prototype:
virtual void SelectOneCell( Cell inCell );Parameters:
The parameter for this method is:
Return:
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.
Purpose:
Access:
Prototype:
void SetDoubleClickMessage( MessageT inMessage);Parameters:
The parameter for this method is:
Return:
Purpose:
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.
Purpose:
ListBox is becoming visible. This is an override of ShowSelf() in LPane.
Purpose:
Unselect all the cells in a ListBox.
Access:
Prototype:
virtual void UnselectAllCells();Parameters:
Return:
Purpose:
Access:
Prototype:
ListHandle mMacListH;
Purpose:
Storage for the double click message.
Access:
Prototype:
MessageT mDoubleClickMessage;
Purpose:
Access:
Prototype:
LFocusBox *mFocusBox;
Purpose:
The resource ID for the text traits.
Access:
Prototype:
ResIDT mTextTraitsID;
Purpose:
Indicates whether the box can grow.
Access:
Prototype:
Boolean mHasGrow;