Class: TMomentaryMenuActionControlState

Declaration: ActionControlStates.h

Taxonomy Categories:

Member Functions:


Interface Category:

API.

Inherits From:

TMomentaryActionControlState

Inherited By:

None.

Purpose:

TMomentaryMenuActionControlState is used for momentary menus to generate actions. Its Select member function generates a menu action.

Instantiation:

Always allocate on the heap.

Deriving Classes:

Derive from this class if you want to add information to the momentary action or do some other behavior in addition to posting the action. When plugged into a momentary menu item, it is called like any other MMomentaryControlState. When Select is called, it sends a menu action that contains the semantic message passed in at construction.

Concurrency:

Not multithread safe.

Resource Use:

No special requirements.

Other Considerations:

None.

Member Function: TMomentaryMenuActionControlState::TMomentaryMenuActionControlState

  1. TMomentaryMenuActionControlState (TViewHandle targetView, MMenuItem * itemToAlias, const TSemanticActionType & message =TStandardActions :: kDefaultMessage)
  2. TMomentaryMenuActionControlState (TMenu * targetToAlias, MMenuItem * itemToAlias, const TSemanticActionType & message =TStandardActions :: kDefaultMessage)
  3. TMomentaryMenuActionControlState (const TMomentaryMenuActionControlState & copy)
  4. TMomentaryMenuActionControlState ()

Interface Category:

API.

Purpose:

  1. Constructs a TMomentaryMenuActionControlState object for the specified TView.
  2. Constructs a TMomentaryMenuActionControlState object for the specified TMenu.
  3. Copy constructor.
  4. Default constructor.

Calling Context:

  1. Called to create a TMomentaryMenuActionControlState for a TView.
  2. Called to create a TMomentaryMenuActionControlState for a TMenu.
  3. Called to copy an object.
  4. Called by the stream-in operators or when there are not enough of the requisite parameters for the first constructor.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TMomentaryMenuActionControlState::operator=

TMomentaryMenuActionControlState & operator =(const TMomentaryMenuActionControlState & assign)

Interface Category:

API.

Purpose:

Assignment operator.

Calling Context:

Called when an object is assigned to another compatible object.

Parameters:

Return Value:

A reference to the left-hand side object.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TMomentaryMenuActionControlState::~TMomentaryMenuActionControlState

virtual ~ TMomentaryMenuActionControlState ()

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: TMomentaryMenuActionControlState::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 to which the object streams itself.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TMomentaryMenuActionControlState::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 from which the object streams itself.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TMomentaryMenuActionControlState::GetMenuItem

MMenuItem * GetMenuItem ()

Interface Category:

API.

Purpose:

Gets the menu item that will be used in generated actions.

Calling Context:

Called to find out the menu item that this object will use when creating actions.

Parameters:

Return Value:

An alias to the menu item that this object holds.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TMomentaryMenuActionControlState::SetMenuItem

virtual void SetMenuItem (MMenuItem * itemAlias)

Interface Category:

API.

Purpose:

Changes the menu item associated this object. It is this menu item that will be included in the actions this object generates.

Calling Context:

Called to set the menu item for generated actions. 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: TMomentaryMenuActionControlState::Select

virtual void Select ()

Interface Category:

API.

Purpose:

Creates an instance of TMenuAction and queues it for propagation. The initial view for the propagation is the menu associated with the item that owns the control state. If the action is not handled by the menu, it is passed up the view hierarchy for the menu. If the top if the hierarchy is reached and the action still has not been handled, it is passed up the menu hierarchy, if one exists, otherwise it is forwarded to the presenter that owns the menu. The action type is TStandardControlActions::kSelect.

Calling Context:

Called by the menu item that references or owns the TMomentaryMenuActionControlState to handle the control being selected when the menu item is selected. You could override this to do some more work, then call inherited Select to let it post the action.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

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