Called Objects

The VPM Enterprise Object Editors organize the development of Called Objects. A “Called Object” is an Application Object called by another Application Object. For example, if a form calls a program from a command button Click event, that program is a Called Object.

An Application Object’s Object Editor contains a list box in which you can enter the names of the Application Objects it calls. When you select a Called Object on the list, you access the Object Editor for that Application Object.

Normally, you work on an Application Object and the Application Objects it calls at the same time. VPM Enterprise’s Called Objects feature provides a way for you to link called and calling objects so you can easily access them together.

Every Application Object’s Object Editor shows you the objects that it calls. In turn, a Called Object’s Object Editor can list objects that it calls directly. There is no limit to the depth to which Called Objects can be stacked through the Object Editors.

Tip - You Don’t Have to Use It: The VPM Enterprise Called Objects facility is nothing more than a device to make it easy for you to find and work on your Application Objects. You don’t have to use the Called Objects facility. However, we recommend you use it. ProMatrix users tell us that it’s a great organizational device.

Called Objects Command Buttons

The Called Object command buttons have the following functions:

·       Select

   When you want to edit an Application Object in the Called Objects list, highlight it and click the Select button. VPM Enterprise displays the object’s Object Editor.

   You can also double-click an entry in the Called Object’s list to access its Object Editor.

   When you finish editing the Called Object, click the Calling Object button on the Object Editor to return to the Object Editor of the calling object.

·       New

   Click the New button to begin creating a new Called Object. See the “How to Begin Creating a New Application Object” section earlier in this chapter for the steps to begin creating a new Called Object.

·       Remove

   If you want to remove an entry from the Called Objects list, highlight it and click the Remove button. This will only remove the Application Object from the Called Objects list. Remove does not delete the Application Object’s files or remove it from the Visual FoxPro Project Manager.

·       Add

   Click Add to add an existing Application Object to the Called Objects list. ProMatrix displays the Add Object dialog. 

    

   On the Add Object dialog, select the type of Application Object you’re adding and enter the object’s file name. For a form, the file name is the name of the .SCX file. 

   You can click the ellipsis (…) button to locate the Application Object’s file name.

   When would you want to add an existing Application Object to another object’s Called Object’s list? Here’s an example. Let’s say your application will have a program that will be called by several Application Objects. You would create the program from the Object Editor of one of the objects that calls it. Then, you would add the program to the Called Objects list of the other objects that call it. As a result:

·       The Object Editor of every Application Object that calls the program will show that the object calls the program. At first glance this might sound like a minor benefit, but if you’re building a complex application, you’ll come to appreciate a readily visible list of the objects an Application Object calls.

·       You’ll be able to modify the program from the Object Editor of any Application Object that calls it. This can be a great time saver if you find you’re modifying the program a great deal to accommodate the special needs of the objects that call it.

Calling Commands

You must create a command to call a Called Object and enter the command somewhere in the calling object.

Where you enter the command is up to you. It depends on the context of the Application Object you’re creating.

For help in creating calling commands see the “Commands” section of the Menus chapter in the Technical Reference manual.

More:

How to Test Application Objects