Before you try your application in a client browser, you can test it in PowerBuilder by defining a main window that opens the child window.
To test your PowerBuilder window ActiveX application:
In PowerBuilder, create a new window object whose type is main (the default).
Write a script for the Open event that opens the child window:
Open(w_child)
For convenience, you can set appropriate window sizes in the Window painter:
Make the main window large enough to display the child
Position the child window in the upper-left corner (you set the position on the Position tab of the property sheet)
Run the test window by clicking the Run Window icon.
Debugging in PowerBuilder To use the PowerBuilder debugger, you need to run an application instead of a single window. Define an Application object with a script that opens the main window. Then you can use the Run or Debug commands to test the application.
In the Web environment, file size is important. Clients are downloading your application each time they run it (unless it happens to be cached because they ran it recently).
Before you build your application, use the Library painter to organize the objects your application uses in PBLs, which are the sources for the PowerBuilder window ActiveX application’s PBDs. To minimize file size, include only objects the application uses. Remove any objects that are not needed. You must:
Include any objects that are dynamically created, such as DataWindows used in DataStores or assigned dynamically to DataWindow controls and Proxy objects
Include ancestor objects
Several controls can use external files for images. These include PictureListBox, TreeView, Picture, and PictureButton controls, pointers, and bitmap objects in DataWindow objects. If your application uses external files for the images, it is unlikely that the client has the same images on the same system path.
Instead of finding some way to install the pictures on client machines, you can use one or more PowerBuilder resource (PBR) files so that the images are built into the PBDs. The resulting PBDs are larger but self-contained.
Because you are building a PBD, not an executable, you do not need to include DataWindow objects in the resource file. All PowerBuilder objects in the source PBL are included in the resulting PBD.
Images and other resources on a network Instead of building the files into the PBD, you can put the files in a generally accessible network directory, but the path to the files must be identical to the path named in the PowerBuilder objects. In the Windows environment, this means each client must use the same drive letter to map the network drive (or you can specify the server name in the path).
To define a PBR file:
Open the File Editor (Shift+F6) or some other text editor and create a new file with the extension PBR.
List each image or other resource on its own line. List the path and file name exactly as they are shown in the object’s Properties view or script.
Save the file.
If your application includes several PBLs, each with objects using their own resources, you should create a PBR file for each PBL. The PBR file lists file names for resources that are used in one PBL.
Build your dynamic libraries (PBDs) using the System Tree or the Project or Library painter. Do the following:
Deselect Machine code Your PowerBuilder window ActiveX application must have PBDs, not machine code DLLs.
Specify a PBR file for each PBD If the objects in the PBL use resources that you have listed in a PBR file, put the PBR name in the Resource File Name text box.
For instructions on defining a PBR file and building your dynamic libraries (PBDs), see the chapter on creating executables in the User’s Guide.