Class: TCommandControlStateOn

Declaration: GUICompoundDocumentCommand.h

Taxonomy Categories:

Member Functions:


Interface Category:

API.

Inherits From:

TCommandControlState

Inherited By:

TStandardCanvasFillColorSelectionState TStandardCanvasFrameColorSelectionState TStandardCanvasLineWidthSelectionState

Purpose:

TCommandControlStateOn derives from TCommandControlState and is a class template that generates momentary control state derived classes. TCommandControlStateOn template classes are parameterized by the same class of target used by the TCommandOn template classes that they accept. An instance of one of the derived classes can execute a command against a document by getting the current document component selection from the TGUIBundle and dynamically casting its model selection to the right kind of target. If this fails, then the presenter state selection is dynamically cast to the target. TCommandControlStateOn's responsibilities are to bind the current selection to the command and give it to the document to execute. TCommandControlStateOn expects to be told when to send the command (when Select is called), and to be given the Bundle, a command instance that will be used as a template for all subsequent commands, an undo/redo label.

Instantiation:

Allocate on the heap or the stack.

Deriving Classes:

None provided.

Concurrency:

Not multithread safe.

Resource Use:

No special requirements.

Member Function: TCommandControlStateOn::TCommandControlStateOn

  1. TCommandControlStateOn (TGUIBundleConnection * theConnetionToAlias, const TText & name, TCommandOn < ATarget > * theCommandTemplateToAdopt, bool notifyOfSelectionChanged =false)
  2. TCommandControlStateOn (TGUIBundleConnection * theConnetionToAlias, TLabel * nameLabelToAdopt, TCommandOn < ATarget > * theCommandTemplateToAdopt, bool notifyOfSelectionChanged =false)
  3. TCommandControlStateOn (TGUIBundle * theBundleToAlias, const TText & name, TCommandOn < ATarget > * theCommandTemplateToAdopt, bool notifyOfSelectionChanged =false)
  4. TCommandControlStateOn (TGUIBundle * theBundleToAlias, TLabel * nameLabelToAdopt, TCommandOn < ATarget > * theCommandTemplateToAdopt, bool notifyOfSelectionChanged =false)
  5. TCommandControlStateOn ()

Interface Category:

API.

Purpose:

  1. Creates a new command control state whose GUI bundle connection is the one specified, and whose regular command label is the one specified.
  2. Creates a new command control state whose GUI bundle connection is the one specified, and whose regular command label is the one specified.
  3. Creates a new command control state whose GUI bundle is the one specified, and whose regular command label is the one specified.
  4. Creates a new command control state whose GUI bundle is the one specified, and whose regular command label is the one specified.
  5. Default constructor.

Calling Context:

  1. Call this function directly.
  2. Call this function directly.
  3. Call this function directly.
  4. Call this function directly.
  5. Called by the stream-in operators.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TCommandControlStateOn::~TCommandControlStateOn

virtual ~ TCommandControlStateOn ()

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: TCommandControlStateOn::HandleAddInterests

virtual void HandleAddInterests (TSetOf < TInterest > & set) const

Interface Category:

API.

Purpose:

Handles the addition of notification interests to the existing set.

Calling Context:

Called from AddInterests.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

This function overrides TCommandControlState's pure virtual function of the same name.

Member Function: TCommandControlStateOn::HandleCanDo

virtual bool HandleCanDo () const

Interface Category:

API.

Purpose:

Determines if the command bound to this control state can be done.

Calling Context:

Called from IsEnabled.

Parameters:

Return Value:

Returns true if the target is acceptable to the command, and the command's CanDo function returns true.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

This function overrides TCommandControlState's pure virtual function of the same name.

Member Function: TCommandControlStateOn::HandleCreateCommandBinding

virtual MGUIDocumentComponentCommandBinding * HandleCreateCommandBinding ()

Interface Category:

API.

Purpose:

Creates a binding containing the command and the target to be executed.

Calling Context:

Called from Select.

Parameters:

Return Value:

MGUIDocumentComponentCommandBinding * -A command binding containing a copy of the templated command, and the current selection as target.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

This function overrides TCommandControlState's pure virtual function of the same name.
Click the icon to mail questions or corrections about this material to Taligent personnel.
Copyright©1995 Taligent,Inc. All rights reserved.