Compartir a través de


Microsoft Agent Utility Foundation Class

This class gives you access to Microsoft Agent API routines so that you can integrate agents (similar to Office Assistants) such as Peedy the parakeet into your application.

Category

System Utilities

Default Catalog

Visual FoxPro Catalog\Foundation Classes\Utilities

Class

_agent

Base Class

Custom

Class Library

_agent.vcx

Parent Class

_custom

Sample

...\Samples\Solution\Ffc\Agent.scx

Remarks

To use, drop the class on a project or form or, from the Component Gallery Item shortcut menu, select Add to Project or Add to Form. When you add the class to a form, Visual FoxPro places the class icon on the form. You can specify the appropriate property values and provide any necessary input and output objects. When you drop the class on a project, you can choose between adding the class or creating a subclass.

See Guidelines for Using Visual FoxPro Foundation Classes for more information on using foundation classes.

Properties, Events, Methods

Description

ActiveAgent property

Provides a pointer to the active Agent character object.

Default: .F.

AgentControl property

Provides a pointer to the agent object.

Default: .F.

ErrorOccurred property

Set to True (.T.) when an error occurs on LOAD.

Default: .F.

ErrorState property

Always set to LOAD.

GestureAt method

Causes the active agent to gesture at a given point.

Syntax: GestureAt(tnX, tnY, tnCoords, toObj)

Return: .F. if there is no ActiveAgent.

Arguments: tnX specifies x coordinate.tnY specifies y coordinate.tnCoords whether coordinates are local or world.toObj specifies the object reference for LocalToWorld conversion.

Hide method

Hides the active agent.

Syntax: Hide( )

Return: .F. if there is no ActiveAgent.

Arguments: none

Interrupt method

Interrupts an animation.

Syntax: Interrupt(toRequest)

Return: .F. if there is no ActiveAgent.

Arguments: toRequest specifies request object.

Load method

Loads an agent character from the specified location (can be a file or URL).

Syntax: Load(tcAgentName, tcAgentLocation)

Return: .F. if an error occurred.

Arguments: tcAgentName specifies name of agent.tcAgentLocation specifies the agent file.

LocalToWorld method

Converts local coordinates to world coordinates.

Syntax: LocalToWorld(tnAxis, tnPos, toObj)

Return: converted value of tnPos.

Arguments: tnAxis specifies the axis.tnPos specifies axis coordinate.toObj specifies object to which conversion is relative.

MoveBy method

Moves the active agent by the passed values in the x or y direction.

Syntax: MoveBy(tnX, tnY, tnCoords, toObj)

Return: .F. if there is no ActiveAgent.

Arguments: tnX specifies x coordinate.tnY specifies y coordinate.tnCoords specifies whether coordinates are local or world.toObj object reference for LocalToWorld conversion.

MoveTo method

Moves the default agent or agent passed to the location specificed.

Syntax: MoveTo(tnX, tnY, tnCoords, toObj)

Return: .F. if there is no ActiveAgent.

Arguments: tnX specifies x coordinate.tnY specifies y coordinate.tnCoords specifies whether coordinates are local or world.toObj object reference for LocalToWorld conversion.

Play method

Causes the active agent to play an animation.

Syntax: Play(tcAnimation)

Return: .F. if there is no ActiveAgent or a Request Object reference.

Arguments: tcAnimation specifies animation to play.

SetActiveAgent method

Sets the active agent to the agent with the passed name.

Syntax: SetActiveAgent(tcAgentName)

Return: .T. if ActiveAgent is set.

Arguments: tcAgentName specifies the name of the agent.

Show method

Displays the active agent.

Syntax: Show(tnX, tnY, tnCoords, toObj)

Return: .F. if there is no ActiveAgent.

Arguments: tnX specifies x coordinatetnY specifies y coordinatetnCoords specifies whether coordinates are local or world.toObj object reference for LocalToWorld conversion.

Speak method

Causes the active agent to speak the passed phrase.

Syntax: Speak(tcText)

Return: .F. if there is no ActiveAgent or a Request Object reference.

Arguments: tcText specifies text to speak.

Stop method

Stops a looping animation.

Syntax: Stop( )

Return: .F. if there is no ActiveAgent.

Arguments: none

Wait method

Waits for a request to complete.

Syntax: Wait(toRequest)

Return: .F. if there is no ActiveAgent.

Arguments: toRequest specifies the requesting object.

See Also

Concepts

Guidelines for Using Visual FoxPro Foundation Classes

Reference

Visual FoxPro Foundation Classes A-Z

Other Resources

Foundation Class Samples