|
User objects are objects that you build to perform processing that you use frequently in your applications. You can use these objects in windows and in other user objects the same way you use the PowerBuilder controls.
User objects usually perform generalized processing. When you use the user object, you build scripts for the object to make the processing specific to your application. For example, if a user object displays a list of files and you use the same user object in a window in an inventory control application, you might build a script for the user object that would limit the displayed files to inventory files.
TIP: In an application, you can use any user object that is in the current application library search path. To make all user objects available to all applications, save them in a common library and include the library in the library search path for each application.
Types
In PowerBuilder, you can build four types of user objects in the User Object Painter :
Custom user objects can contain multiple objects that have events, functions, structures, and scripts. When you build a custom user object, you can include only PowerBuilder controls and previously defined user objects in the user object. After you build a custom user object, the user object and the controls you placed in it become a unit and you can only change the contents of the user object in the User Object Painter.
External user objects contain controls from the underlying windowing system (external objects). Standard user objects are standard PowerBuilder controls that you have modified to perform processing that is specific to your applications.
Using User Objects
After you build and save a user object, you can use it as you would use a PowerBuilder control. You can place it in a window or in other user objects, and you can size it, change its style, and build scripts for its events.
You can also build new user objects that inherit attributes, events, structures, and functions from an existing user object.
|