Class: MDropDownListControlState

Declaration: DropDownTextControl.h

Taxonomy Categories:

Member Functions:


Interface Category:

API.

Inherits From:

MCollectible

Inherited By:

TStandardDropDownListControlState

Purpose:

The MDropDownListControlState is an abstract class for classes such as TStandardDropDownTextControlState classes. MDropDownListControlState derives from MCollectible, and provides virtual functions for handling internal lists for the classes that are derived from it. As virtual functions, they must be filled in by the derived classes.

Instantiation:

Allocate on the heap or the stack.

Deriving Classes:

Derive to create TStandardDropDownListControlState for using a TSequenceOf<TText> as internal list.

Concurrency:

Multithread safe.

Resource Use:

No special requirements.

Other Considerations:

None.

Member Function: MDropDownListControlState::MDropDownListControlState

  1. MDropDownListControlState ()
  2. MDropDownListControlState (const MDropDownListControlState &)

Interface Category:

API.

Purpose:

  1. Default constructor.
  2. Copy constructor.

Calling Context:

  1. Called by the stream-in operators and derived classes.
  2. Called to copy an object.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Multithread safe.

Other Considerations:

None.

Member Function: MDropDownListControlState::~MDropDownListControlState

virtual ~ MDropDownListControlState ()

Interface Category:

API.

Purpose:

Destructor.

Calling Context:

Called to destroy an object.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Multithread safe.

Other Considerations:

None.

Member Function: MDropDownListControlState::operator=

MDropDownListControlState & operator =(const MDropDownListControlState &)

Interface Category:

API.

Purpose:

Assignment operator.

Calling Context:

Called when an object is assigned to another compatible object.

Parameters:

Return Value:

A non-const reference to the left-hand side object.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Multithread safe.

Other Considerations:

None.

Member Function: MDropDownListControlState::operator>>=

virtual TStream & operator >>=(TStream &) const

Interface Category:

API.

Purpose:

Stream-out operator.

Calling Context:

Called to stream out data.

Parameters:

Return Value:

Returns a reference to the stream the object streams itself out to.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Multithread safe.

Other Considerations:

None.

Member Function: MDropDownListControlState::operator<<=

virtual TStream & operator <<= (TStream &)

Interface Category:

API.

Purpose:

Stream-in operator.

Calling Context:

Called to stream in data.

Parameters:

Return Value:

Returns a reference to the stream the object streams itself in from.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Multithread safe.

Other Considerations:

None.

Member Function: MDropDownListControlState::GetItemFromIndex

virtual bool GetItemFromIndex (unsigned long index, TText & textToFill) const

Interface Category:

API.

Purpose:

Gets an item by its index value.

Calling Context:

Called by derived classes.

Parameters:

Return Value:

Returns true if the item was found successfully; otherwise, returns false.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Multithread safe.

Other Considerations:

As this is a pure virtual function, it must be defined by the derived classes.

Member Function: MDropDownListControlState::GetIndexFromItem

virtual unsigned long GetIndexFromItem (const TText & item) const

Interface Category:

API.

Purpose:

Gets the index value for a given item.

Calling Context:

Called by derived classes.

Parameters:

Return Value:

Returns the index value.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Multithread safe.

Other Considerations:

As this is a pure virtual function, it must be defined by the derived classes.

Member Function: MDropDownListControlState::GetSelectedIndex

virtual unsigned long GetSelectedIndex () const

Interface Category:

API.

Purpose:

Gets the selected list item's index value.

Calling Context:

Called by derived classes.

Parameters:

Return Value:

Returns the index value of the selected list item.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Multithread safe.

Other Considerations:

As this is a pure virtual function, it must be defined by the derived classes.

Member Function: MDropDownListControlState::GetItemCount

virtual unsigned long GetItemCount () const

Interface Category:

API.

Purpose:

Gets the count of the number of items in the list.

Calling Context:

Called by derived classes.

Parameters:

Return Value:

Returns the number of items in the list.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Multithread safe.

Other Considerations:

As this is a pure virtual function, it must be defined by the derived classes.

Member Function: MDropDownListControlState::GetItemsMaximumSize

virtual TGPoint GetItemsMaximumSize () const

Interface Category:

API.

Purpose:

Gets the maximum size--the maximum width and height--of the item in the list.

Calling Context:

Called by derived classes.

Parameters:

Return Value:

Returns the TGPoint object that describes the width and height dimensions for the item.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Multithread safe.

Other Considerations:

As this is a pure virtual function, it must be defined by the derived classes.

Member Function: MDropDownListControlState::CanChangeList

virtual bool CanChangeList () const

Interface Category:

API.

Purpose:

Returns the Boolean value that indicates whether the control state can adopt or orphan a list.

Calling Context:

Called by derived classes.

Parameters:

Return Value:

Returns true if the control state has the ability to adopt and orphan a list; otherwise, returns false.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Multithread safe.

Other Considerations:

Default is true to allow control state the ability to adopt and orphan a list. Derived classes should override this method when different behavior is needed.

Member Function: MDropDownListControlState::AdoptList

virtual void AdoptList (TSequenceOf < TText > * listToAdopt)

Interface Category:

API.

Purpose:

Adopts the referenced list control state and incorporates its items into the drop-down list display. This enables customizing of the object.

Calling Context:

Called by derived classes.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Multithread safe.

Other Considerations:

As this is a pure virtual function, it must be defined by the derived classes.

Member Function: MDropDownListControlState::OrphanList

virtual TSequenceOf < TText > * OrphanList ()

Interface Category:

API.

Purpose:

Orphans, or frees, the current adopted list sequence.

Calling Context:

Called by derived classes.

Parameters:

Return Value:

Returns a pointer to the just orphaned list sequence.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Multithread safe.

Other Considerations:

As this is a pure virtual function, it must be defined by the derived classes.

Member Function: MDropDownListControlState::CreateIterator

virtual TDropDownTextControlIterator * CreateIterator (const TAllocationHeap & whichHeap) const

Interface Category:

API.

Purpose:

Creates an iterator, which gives the creator the ability to iterate through a list of items.

Calling Context:

Called by derived classes.

Parameters:

Return Value:

Returns a pointer to the TDropDownTextControlIterator iterator.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Multithread safe.

Other Considerations:

As this is a pure virtual function, it must be defined by the derived classes.

Member Function: MDropDownListControlState::IsEnabled

virtual bool IsEnabled () const

Interface Category:

API.

Purpose:

Returns a Boolean value that indicates whether the control is enabled. Note that the control can present a different look when it is enabled from when it is not enabled.

Calling Context:

Called by derived classes.

Parameters:

Return Value:

Returns true if the control is enabled, which is the default; otherwise, returns false.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Multithread safe.

Other Considerations:

None.

Member Function: MDropDownListControlState::CreateInterests

virtual void CreateInterests (TCollectionOf < TInterest > & collection) const

Interface Category:

API.

Purpose:

Establishes a notification connection for changes to the control state. This function is called by the control so that it receives notification of changes. If this function returns one or more interests, then a member function connection is made with the control's StateChanged function.

Calling Context:

Called by derived classes.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Multithread safe.

Other Considerations:

Derived classes should define this function to provide notification connection.

Member Function: MDropDownListControlState::HandleReturnKeyEvent

virtual bool HandleReturnKeyEvent ()

Interface Category:

API.

Purpose:

Processes the user's input of the Enter and Return keys.

Calling Context:

Called by derived classes.

Parameters:

Return Value:

Returns true if the Enter or Return key was pressed by the user and the action was handled.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Multithread safe.

Other Considerations:

Derived classes should define this function to handle return key input if necessary.
Click the icon to mail questions or corrections about this material to Taligent personnel.
Copyright©1995 Taligent,Inc. All rights reserved.