An important part of reuse is making the classes easily available to other developers. Builder Xcessory enables you to store and share classes with other Builder Xcessory users.
When you make a class, the class is added automatically to the Project Classes group at the bottom of the Palette. Classes in the Project Classes group are saved with your project, allowing other developers to access those classes. To use the class in other projects, or move it to the Private or Public Classes group, you must save it to a separate file.
Before you can share a class, you must save the class UIL file separately from the rest of the project. This separates the class definition from any given interface.
You can also share a library of classes among a group of users.
1. Generate code for your classes and build your library.
2. After generating the class files, deselect the Generate Class toggle (Resource Editor:Component) for each class in your library and save the classes into separate files using Save Class (Browser:File:Class).
3. Move the classes to the Public Classes group.
4. Move the header files and library to the desired location. Save the source files to preserve any user code blocks for future modifications.
Now, when you use the class in an application, Generate Code is deselected by default. You still need to do a couple of things:
1. If you are generating C++ and included the BX-generated UIComponent in your library, deselect the Class Tree Root toggle button in the File Names tab (Browser:Options:Code Generation Settings).
2. Add the include path for the class header files and library containing the class to the application Makefile and select the Don't Include Ungenerated Class Files toggle button on the Makefile tab (Browser:Options:Code Generation Settings).
Once you save the class, you can drag the class from the Project Classes group to either the Private or Public Class section on the Palette.
· If you leave the class in the Project Class group, the class appears on the Palette when the project file is loaded.
· If you move the class into the Private Class group, the class is saved into the .builderXcessory directory in your home directory and appears on the Palette each time you start Builder Xcessory.
· If moved into the Public Class group, the class is saved into the {BX}/xcessory/classes system directory and appears on the Palette of all Builder Xcessory users in your organization.
You can read classes that you or other developers saved. To read a class, follow these steps:
1. Select Read Class from the Class menu of the Browser File menu. A file selection dialog is displayed ( File Selection Dialog ).
Each class can have its own set of include files, which can be specified from the Resource Editor when Builder Xcessory is in Classes view. When the class is selected, the Resource Editor includes a section labeled Class File Include Information that in turn includes two subsections: Base Class Includes and Derived Class Includes (see Class Includes Sections ).
| Up | Previous | Next |