- •Using the Object Repository: Overview
- •Sharing items within a project
- •-Adding items to the Object Repository
- •Sharing objects in a team environment
- •Using an Object Repository item in a project
- •Copying an item
- •Inheriting an item
- •Using project templates
- •Modifying shared items
- •Specifying a default project, new form, and main form
- •Developing the application user interface: Overview
- •Controlling application behavior
- •Working at the application level
- •Using the main form
- •Hiding the main form
- •Adding forms
- •Managing layout
- •Using forms
- •Creating modeless forms such as windows
- •Creating a form instance using a local variable
- •Passing additional arguments to forms
- •Retrieving data from forms
- •Creating and using component templates
- •Working with frames
- •Merging menus
- •Assigning a speed button's glyph
- •Common controls and xp themes
- •1. Answer the questions:
- •8.1 Text viewing controls
- •8.2 Specialized input controls
- •8.3 Track bars
- •Cool bars (vcl only)
- •Combo boxes
- •Tree views
- •Date-time pickers and month calendars
- •Scroll boxes
- •Tab controls
Using the Object Repository: Overview
The Object Repository (Tools|Repository) makes it easy share forms, dialog boxes, frames, and data modules. It also provides templates for new projects and wizards that guide the user through the creation of forms and projects. The Repository is maintained in DELPHI32.DRO (by default in the BIN directory), a text file that contains references to the items that appear in the Repository and New Items dialogs.
Sharing items within a project
You can share items within a project without adding them to the Object Repository. When you open the New Items dialog box (File|New|Other), you'll see a page tab with the name of the current project. This page lists all the forms, dialog boxes, and data modules in the project. You can derive a new item from an existing item and customize it as needed.
-Adding items to the Object Repository
You can add your own projects, forms, frames, and data modules to those already available in the Object Repository. To add an item to the Object Repository,
If the item is a project or is in a project, open the project.
For a project, choose Project|Add To Repository. For a form or data module, right-click the item and choose Add To Repository.
Type a description, title, and author.
Decide which page you want the item to appear on in the New Items dialog box, then type the name of the page or select it from the Page combo box. If you type the name of a page that doesn't exist, the Object Repository creates a new page.
Choose Browse to select an icon to represent the object in the Object Repository.
Choose OK.
Sharing objects in a team environment
You can share objects with your workgroup or development team by making a repository available over a network. To use a shared repository, all team members must select the same Shared Repository directory in the Environment Options dialog:
Choose Tools|Environment Options.
On the Preferences page, locate the Shared Repository panel. In the Directory edit box, enter the directory where you want to locate the shared repository. Be sure to specify a directory that's accessible to all team members.
Using an Object Repository item in a project
To access items in the Object Repository, choose File|New|Other. The New Items dialog appears, showing all the items available. Depending on the type of item you want to use, you have up to three options for adding the item to your project: copy, inherit, use.
Copying an item
Choose Copy to make an exact copy of the selected item and add the copy to your project. Future changes made to the item in the Object Repository will not be reflected in your copy, and alterations made to your copy will not affect the original Object Repository item.
Inheriting an item
Choose Inherit to derive a new class from the selected item in the Object Repository and add the new class to your project. When you recompile your project, any changes that have been made to the item in the Object Repository will be reflected in your derived class, in addition to changes you make to the item in your project: Changes made to your derived class do not affect the shared item in the Object Repository.