As part of our Section 508 (Disability Act) compliance effort, I am developing a
utility that will parse the source code in PowerBuilder Libraries (PBL) and
pullout all visual objects and controls on those objects. The utility will then
display the various properties, including the accessibility properties in a grid
for all controls on visual objects. The utility also provides the ability to
programmatically or manually set and modify properties and then apply them back
into the source code (PBLs) .
I have the following 2 questions:
1) I am using the LibraryExport function to extract the objects out of PBLs.
This function exports all supported objects such as Windows, DataWindows,
UserObjects, Functions, Menus, etcÂ However, the LibraryImport function, which I
will use to save the modified source code back to the PBL only support
DataWindow objects. I found this very limiting. You can export all objects, but
only import DW? Is there a way to programmatically import other objects back
into a PBL? I can do it manually by creating source code files and then right
clicking on the PBL to import, but that just seems archaic.
2) This utility will also provide the ability to preview the objects as they
appear at design time. For DataWindows, this is fairly easy, because I can use
the source code syntax along with the Create() method to build the datawindow
object. However, I have not seen a way to generate a Window or UserObject based
on the source code. It would be similar to what PowerBuilder does when you
preview a Window at design time through the IDE.
Thanks for any help.
Hopefully, when I finish this utility I will be able to provide it to the user
community and it might save someone a headache.
X-Newsreader: AspNNTP 1.50 (JodoHost)
Subject: LibraryImport a Window Object
Content-Type: text/plain; charset="us-ascii"
Date: 30 Jan 2009 07:54:18 -0800
X-Trace: forums-1-dub 1233330858 10.22.241.152 (30 Jan 2009 07:54:18 -0800)
X-Original-Trace: 30 Jan 2009 07:54:18 -0800, vip152.sybase.com
Xref: forums-1-dub sybase.public.powerbuilder.general:220528
Article PK: 671081
User-Agent: Thunderbird 22.214.171.124 (Windows/20081209)
Subject: Re: LibraryImport a Window Object
Content-Type: text/plain; charset=windows-1252; format=flowed
Date: 30 Jan 2009 08:05:08 -0800
X-Trace: forums-1-dub 1233331508 10.22.241.152 (30 Jan 2009 08:05:08 -0800)
X-Original-Trace: 30 Jan 2009 08:05:08 -0800, vip152.sybase.com
Xref: forums-1-dub sybase.public.powerbuilder.general:220529
Article PK: 671083
1) LibraryImport() only supports DataWindows because all other objects
are stored as both source text and binary object information. Every time
you save an object, it gets compiled. LibraryImport() doesn't compile
anything (nor could it). You might use OrcaScript instead.
2) The easiest method I can think of to accomplish this is to add the
"inspected" library to your tool's library path. Then, you have access
to open and use every object within it, provided that you also have
access to all of the objects' dependencies.