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.
- TCommandControlState (TGUIBundleConnection * theConnectionToAlias, const TText & name, bool notifyOfSelectionChanged =false)
- TCommandControlState (TGUIBundleConnection * theConnectionToAlias, TLabel * nameLabelToAdopt, bool notifyOfSelectionChanged =false)
- TCommandControlState (TGUIBundle * theBundleToAlias, const TText & name, bool notifyOfSelectionChanged =false)
- TCommandControlState (TGUIBundle * theBundleToAlias, TLabel * nameLabelToAdopt, bool notifyOfSelectionChanged =false)
- TCommandControlState ()
Interface Category:
API.
Purpose:
- Creates a new command control state whose GUI bundle connection is the one specified, and whose regular command label is the one specified.
- Creates a new command control state whose GUI bundle connection is the one specified, and whose command label is the one specified.
- Creates a new command control state whose GUI bundle is the one specified, and whose regular command label is the one specified.
- Creates a new command control state whose GUI bundle is the one specified, and whose command label is the one specified.
- Default constructor.
Calling Context:
- Classes deriving from TCommandControlState can call this function directly.
- Classes deriving from TCommandControlState can call this function directly.
- Classes deriving from TCommandControlState can call this function directly.
- Classes deriving from TCommandControlState can call this function directly.
- Called by the stream-in operators.
Parameters:
- TGUIBundleConnection * theConnectionToAlias -The GUI bundle connection to associate with the new command control state.
- const TText & name -The regular command label for the new command control state.
- bool notifyOfSelectionChanged =false -Indicates whether or not the new control state should be notified when the selection changes.
- TGUIBundleConnection * theConnectionToAlias -The GUI bundle connection to associate with the new command control state.
- TLabel * nameLabelToAdopt -The label for the new command control state.
- bool notifyOfSelectionChanged =false -Indicates whether or not the new control state should be notified when the selection changes.
- TGUIBundle * theBundleToAlias -The GUI bundle to associate with the new command control state.
- const TText & name -The regular command label for the new command control state.
- bool notifyOfSelectionChanged =false -Indicates whether or not the new control state should be notified when the selection changes.
- TGUIBundle * theBundleToAlias -The GUI bundle to associate with the new command control state.
- TLabel * nameLabelToAdopt -The label for the new command control state.
- bool notifyOfSelectionChanged =false -Indicates whether or not the new control state should be notified when the selection changes.
- Takes no parameters.
Return Value:
None.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
The default constructor is protected.
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.
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.
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.
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:
- TSetOf < TInterest > & set -The set of interests to add to the existing set.
Return Value:
None.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
This function is protected.
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:
- TSetOf < TInterest > & set -The set of interests including those just added by AddInterests.
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.
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.
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:
- bool =true -Indicates whether or not the selection bound to this command will be set as the current selection after this command is executed.
Return Value:
None.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
None.
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.
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.
virtual TStream & operator <<= (TStream & fromwhere)
Interface Category:
API.
Purpose:
Stream-in operator.
Calling Context:
Called to stream in data.
Parameters:
- TStream & fromwhere -The object streams itself in from.
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.
virtual TStream & operator >>=(TStream & towhere) const
Interface Category:
API.
Purpose:
Stream-out operator.
Calling Context:
Called to stream out data.
Parameters:
- TStream & towhere -The object streams itself out to.
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.