Deleting/Adding/Cloning Application Objects

Deleting Application Objects

Sometimes you need to delete an Application Object. For example, you might start creating one type of Application Object, say a program, to run from a menu option and then decide you want to run a form from the option instead. Or, for whatever reason, you might just decide to start creating an Application Object over from scratch.

How you delete an Application Object depends upon whether the object is a Menu Object or a Called Object.

Ø To delete a Menu Object

1.   Object Editor: Click the menu option on the Object Builder that runs the object. VPM Enterprise displays the Object Editor.

2.   Delete Menu Command: Delete the contents of the Menu Command field on the Object Editor.  Click OK.

3.   VPM Enterprise displays the New Object Type dialog in case you want to create a different Application Object from the menu option immediately.  Select an object type or click Cancel to create a new object later.

4.   Project Manager: Select the Project Manager option on the VPM Enterprise Tools menu. VPM Enterprise displays the Visual FoxPro Project Manager for the application. 

5.   Remove: Highlight the object on the Project Manager and click the Remove button.

6.   The Project Manager asks whether you want to remove the Application Object file from the project or delete it from the disk. If you want to recreate the Application Object with the same file name, click Delete.

Ø To delete a Called Object

1.   Object Editor: Open the Object Editor of the object that calls the Called Object.

2.   Highlight the Called Object in the Called Objects list.

3.   Remove: Click the Remove button in the Called Objects box. Click OK on the Object Editor.

4.   Project Manager: Select the Project Manager option on the VPM Enterprise Tools menu. VPM Enterprise displays the Visual FoxPro Project Manager for the application. 

5.   Remove: Highlight the object on the Project Manager and click the Remove button.

6.   The Project Manager asks whether you want to remove the Application Object file from the project or delete it from the disk. If you want to recreate the Application Object with the same file name, click Delete.

Adding Application Objects

You may have an Application Object that you previously built for a VPM Enterprise application and now want to add to a new application. How you add the object to a new application depends on whether you’re adding the object as a Menu Object or a Called Object.

Important: Before you add the object to a new application, you must copy its file(s) to the appropriate project directory. You should also give it a new application-specific name using the new application prefix.

Ø To add a VPM Enterprise object to an application

1.   Follow the same procedure described in How to Begin Creating a New Application Object with the exceptions described below. The procedure differs between Menu and Called Objects.

2.   When you enter the Application Object’s name, enter the file name of the Application Object you’re adding to the application.

3.   VPM Enterprise displays a warning dialog informing you that there’s an existing object with the name you entered. VPM Enterprise asks if you would like to enter a different name. Click No.

4.   VPM Enterprise displays the Object Editor for the existing object, and the Application Object is now part of the application.

Cloning Application Objects

If you have an existing Application Object that you would like to use as the starting point for creating a new object of the same type, you can clone it.

Simply copy and rename the existing Application Object’s file(s) to the appropriate project directory and add the renamed copy to the application as described in the preceding section.

More:

Using the Visual FoxPro Project Manager