|
|
YOUR FEEDBACK
Did you read today's front page stories & breaking news?
SYS-CON.TV SYS-CON.TV WEBCASTS |
POWERBUILDER LINKS YOU MUST CLICK ON PB 10.5
Other PB 10.5 Enhancements
An overview
By: Bruce Armstrong
Mar. 19, 2006 02:00 PM
Digg This!
In addition to the other new features in PowerBuilder 10.5 that we've covered in this issue, there are a number that do bear mentioning but aren't significant enough to merit a separate article. I've grouped them together in this "miscellaneous" enhancements discussion. I'm going to look at a few of those, pretty much in alphabetical order.
When the DataWindow is previewed, you can see how the group header band expands to accommodate the large text block (see Figure 2). In addition, the property is now modifiable at runtime via a Modify command. In the sample, I allow you to toggle the AutoSize for the group header band as follows:
string ls_autosize
Byte Data Type Another area where it is particularly important is interfacing with the Windows API. Up through PowerBuilder 9.0, the char data type was essentially synonymous with the byte data type because in an ANSI environment a char is a single byte. That meant that any time a byte field was specified in a Windows API call, a char could be used instead. That all changed with Unicode support in PowerBuilder 10. A Unicode char is two bytes, and so the mapping of a char for a byte that worked so well in previous versions suddenly broke. With the introduction of the byte data type, it's not only possible to make those calls now, but to make them with a data type more representative of the underlying data. With the char mapping, you still have to convert the data from a char to an integer data type. With the byte data type, no conversion is needed anymore. We're going to look at implementing a Windows API call to demonstrate the use of the new byte data type. PowerBuilder provides a number of system functions that implement the Microsoft Common Dialogs Control (e.g., File Open, File Save, Setup Printer, Choose Color, etc.). One that PowerBuilder does not implement is the Choose Font dialog (see Figure 3). That dialog is invoked through the ChooseFont Windows API call, which takes a CHOOSEFONT structure as an argument. One of the attributes of the CHOOSEFONT structure is a pointer to a LOGFONT structure, and many of the attributes of the LOGFONT structure (e.g., italic, underline, etc.) are byte values, which is where the new byte data type comes in. We'll need to declare a local external function reference for the ChooseFont Windows API call and some additional Windows API calls used to manage memory during the call (see Listing 2). We'll also need PowerBuilder structure definitions for the LOGFONT (see Listing 3) and CHOOSEFONT (see Listing 4) structures. We then call the function using the code from Listing 5.
DatePicker Control The DataWindow already supported a TimePicker edit mask by setting the spin control attribute (see Figure 8). Added in PowerBuilder 10.5 is the dropdown Calendar option for a date edit mask (see Figure 7).
PBNI Changes PowerBuilder 10.5 adds the capability to "import" the PBNI extensions directly from the DLL or PBX file into an existing PBL (including the PBNI system extensions supplied with PowerBuilder such as SoapConnection or PBDOM). This means the PBD files are no longer required at development, no longer have to be deployed, and can't confuse build systems or require registration with source control systems. To import the PBNI extension, right-click on the PBL you want to import them into and select the new "Import PB Extension..." menu option (see Figure 9). After selecting the PBNI extension file, PowerBuilder "imports" (creates wrapper objects for) all of the objects and functions from the extension file. If you don't require all of them, simply delete the wrapper objects back out of the PBL that you don't need. The syntax for such a wrapper object is shown in Listing 6. It contains a reference to the extension file (which still needs to be deployed), the object name, and the methods it exports. Note that it's pretty standard PowerBuilder code, but there is a "native <extensionfilename>" suffix on the declaration of the object that indicates that it's a wrapper for a PBNI extension.
Conclusion PBDJ LATEST STORIES . . .
SUBSCRIBE TO THE WORLD'S MOST POWERFUL NEWSLETTERS SUBSCRIBE TO OUR RSS FEEDS & GET YOUR SYS-CON NEWS LIVE!
|
SYS-CON FEATURED WHITEPAPERS MOST READ THIS WEEK BREAKING POWERBUILDER / SYBASE NEWS
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||