Class: TMenuAction

Declaration: StandardControlActions.h

Taxonomy Categories:

Member Functions:


Interface Category:

API.

Inherits From:

TViewAction

Inherited By:

TBooleanMenuAction

Purpose:

TMenuAction adds the notion of a menu item to a view action, so that particular action handlers can find out which particular item generated the action. The usual event type specified in a menu action is TStandardControlActions::kSelect.

Instantiation:

This class is usually allocated on the heap so that it can be posted in a request.

Deriving Classes:

Use TMenuAction to derive classes that have additional information associated with them. For example, the provided class TBooleanMenuAction is for menu items that have a Boolean state associated with them.

Concurrency:

Not multithread safe.

Resource Use:

No special requirements.

Other Considerations:

None.

Member Function: TMenuAction::TMenuAction

  1. TMenuAction ()
  2. TMenuAction (const TEventType & eventType, const TViewHandle & viewHandle, MMenuItem * itemAlias, const TSemanticActionType & semanticMessage =TStandardActions :: kDefaultMessage)
  3. TMenuAction (const TMenuAction &)

Interface Category:

API.

Purpose:

  1. Default constructor.
  2. Creates a TMenuAction initialized with the specified event, view, menu item ID, and semantic message.
  3. Copy constructor.

Calling Context:

  1. Called by the stream-in operators.
  2. Called to create a TMenuAction initialized with the passed parameters.
  3. Called to copy an object.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TMenuAction::operator=

TMenuAction & operator =(const TMenuAction &)

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:

Not multithread safe.

Other Considerations:

None.

Member Function: TMenuAction::~TMenuAction

virtual ~ TMenuAction ()

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:

Not multithread safe.

Other Considerations:

None.

Member Function: TMenuAction::GetMenuItem

MMenuItem * GetMenuItem ()

Interface Category:

API.

Purpose:

Returns the menu item that generated this action.

Calling Context:

Call this function directly.

Parameters:

Return Value:

A pointer to the MMenuItem menu item ID.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TMenuAction::SetMenuItem

virtual void SetMenuItem (MMenuItem * itemAlias)

Interface Category:

API.

Purpose:

Associates the specified menu item with this action.

Calling Context:

Call this function directly.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TMenuAction::operator>>=

TStream & operator >>=(TStream & toWhere) 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:

Not multithread safe.

Other Considerations:

None.

Member Function: TMenuAction::operator<<=

TStream & operator <<= (TStream & fromWhere)

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:

Not multithread safe.

Other Considerations:

None.

Member Function: TMenuAction::Dispatch

virtual bool Dispatch (MActionTarget & target)

Interface Category:

API.

Purpose:

Dispatches the action to the specified target. First attempts to dynamically cast the target to an MMenuActionHandler, and then dispatches the action to the MMenuActionHandler. If no MMenuActionHandler exists, or it doesn't handle the action, then Dispatch calls the inherited TViewAction Dispatch function, which tries to dispatch the action to an MViewActionHandler

Calling Context:

Called to dispatch this action.

Parameters:

Return Value:

Returns true if the action was successfully dispatched, false otherwise.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

Overrides inherited TViewAction function.
Click the icon to mail questions or corrections about this material to Taligent personnel.
Copyright©1995 Taligent,Inc. All rights reserved.