Class: TCommandControlState

Declaration: GUICompoundDocumentCommand.h

Taxonomy Categories:

Member Functions:


Interface Category:

API.

Inherits From:

MMomentaryControlState, MGUIBundle

Inherited By:

TCommandControlStateOn TUpdateLinkControlState

Purpose:

TCommandControlState derives from MMomentaryControlState and is an abstract base class that invokes a command.

Instantiation:

Abstract base class; do not allocate.

Deriving Classes:

Provided classes include TCommandControlStateOn. Classes deriving from TCommandControlState must override the pure virtual functions HandleAddInterests, HandleCanDo, and HandleCreateCommandBinding.

Concurrency:

Not multithread safe.

Resource Use:

No special requirements.

Member Function: TCommandControlState::TCommandControlState

  1. TCommandControlState (TGUIBundleConnection * theConnectionToAlias, const TText & name, bool notifyOfSelectionChanged =false)
  2. TCommandControlState (TGUIBundleConnection * theConnectionToAlias, TLabel * nameLabelToAdopt, bool notifyOfSelectionChanged =false)
  3. TCommandControlState (TGUIBundle * theBundleToAlias, const TText & name, bool notifyOfSelectionChanged =false)
  4. TCommandControlState (TGUIBundle * theBundleToAlias, TLabel * nameLabelToAdopt, bool notifyOfSelectionChanged =false)
  5. TCommandControlState ()

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 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 command label is the one specified.
  5. Default constructor.

Calling Context:

  1. Classes deriving from TCommandControlState can call this function directly.
  2. Classes deriving from TCommandControlState can call this function directly.
  3. Classes deriving from TCommandControlState can call this function directly.
  4. Classes deriving from TCommandControlState can 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:

The default constructor is protected.

Member Function: TCommandControlState::~TCommandControlState

virtual ~ TCommandControlState ()

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: TCommandControlState::Select

virtual void Select ()

Interface Category:

API.

Purpose:

Selects this command control state. Selection typically causes the command to be executed (provided that it's enabled).

Calling Context:

Called when the user clicks on the GUI component representing this command control state.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TCommandControlState::IsEnabled

virtual bool IsEnabled () const

Interface Category:

API.

Purpose:

Determines whether or not this command control state is enabled.

Calling Context:

Call this function directly.

Parameters:

Return Value:

Returns true if this command control state is enabled; false otherwise.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TCommandControlState::AddInterests

virtual void AddInterests (TSetOf < TInterest > & set)

Interface Category:

API.

Purpose:

Adds the specified notification interests to the existing set. Classes deriving from TCommandControlState should not override this function to modify behavior when adding notification interests; rather they should override HandleAddInterests instead.

Calling Context:

Derived classes can call this function directly.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

This function is protected.

Member Function: TCommandControlState::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 is a pure virtual function and must be overridden by classes deriving from TCommandControlState.

Member Function: TCommandControlState::HandleCanDo

virtual bool HandleCanDo () const

Interface Category:

API.

Purpose:

Determines is the command owned by this control state can be done. Must be overridden by derived classes.

Calling Context:

Called from IsEnabled.

Parameters:

Return Value:

Returns true if command can be done.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

This function is a pure virtual function and must be overridden by classes deriving from TCommandControlState.

Member Function: TCommandControlState::HandleCreateCommandBinding

virtual MGUIDocumentComponentCommandBinding * HandleCreateCommandBinding ()

Interface Category:

API.

Purpose:

Creates the command binding to be executed with this state is selected.

Calling Context:

Called from Select.

Parameters:

Return Value:

MGUIDocumentComponentCommandBinding * The binding to be executed.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

This function is a pure virtual function and must be overridden by classes deriving from TCommandControlState.

Member Function: TCommandControlState::GetNameLabel

TLabel * GetNameLabel ()

Interface Category:

API.

Purpose:

Returns the name label for the command.

Calling Context:

Called when the name label is required.

Parameters:

Return Value:

Returns the name label for the command.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TCommandControlState::GetUpdateCurrentSelection

bool GetUpdateCurrentSelection () const

Interface Category:

API.

Purpose:

Returns whether the current selection should be updated from the selection bound to this command when the command is executed.

Calling Context:

Called by the GUI Compound Document framework to determine if the current selection should be updated from the selection bound to this command.

Parameters:

Return Value:

Returns true if current selection should be updated; false otherwise.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TCommandControlState::SetUpdateCurrentSelection

void SetUpdateCurrentSelection (bool =true)

Interface Category:

API.

Purpose:

Sets whether the current selection should be updated from the selection bound to this command when the command is executed.

Calling Context:

Called by the command creator.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TCommandControlState::AdoptNameLabel

void AdoptNameLabel (TLabel *)

Interface Category:

API.

Purpose:

Adopt a name label to be used as the label for the control state. This label is also used to present the undo menu for the command.

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: TCommandControlState::GetLabel

virtual const TLabel * GetLabel () const

Interface Category:

API.

Purpose:

Override of MMomentaryControlState allowing the label to be used as the controls label.

Calling Context:

Called by control framework.

Parameters:

Return Value:

const TLabel * -The label for this control state.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TCommandControlState::operator<<=

virtual 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: TCommandControlState::operator>>=

virtual 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.
Click the icon to mail questions or corrections about this material to Taligent personnel.
Copyright©1995 Taligent,Inc. All rights reserved.