PowerBuilder in Action

Frederick Koh

Subscribe to Frederick Koh: eMailAlertsEmail Alerts
Get Frederick Koh via: homepageHomepage mobileMobile rssRSS facebookFacebook twitterTwitter linkedinLinkedIn

Related Topics: Enterprise Architecture, Enterprise Application Performance


New Features for the Win32 Target in PB12.5

Controls in DataWindow and outside converging in capabilities

With all the attention in PB12 focused on .NET and WPF, some of you may be wondering about the future of Win32 targets in what is now being called PB Classic. Those hoping to still continue to work with Win32 targets in PB Classic can rest assured, PB Classic is not going away and we are backing that statement up with the features we are going to introduce in PB12.5.

Controls in DataWindow and Outside Converging in Capabilities
In this major release you are going to find two long-asked-for features finally implemented:

  • Autowidth for the Grid DataWindow
  • Tab order, enabled, and focus rectangle for all controls in the DataWindow

The second of the two features is actually part of a more general effort to make controls in the DataWindow and controls outside the DataWindow converge in terms of capabilities. In PB12.5 you'll find the following features supported for controls outside the DataWindow:

  • Option for "transparent" as a background color for almost all controls (available in PB12 but not officially supported)
  • The transparency property - to control the translucency of the foregrounds of controls
  • The alpha channel of PNG bitmaps in picture controls respected (in PB12 and older, the implementation assumed no overlapping controls).

RichText, Images and Blobs
In the medium term (one or two major releases after PB12.5) we are aiming for parity and compatibility with the WPF DataWindow. The first feature you'll see (in PB12.5) as part of this effort is the port of the WPF DataWindow Tableblob control. This control displays RTF, image and XPF blobs in the DataWindow.

In the Classic Win32 version of this feature, the RTF blob is basically a response to the limitations of the RichText column - it has all the features of the RichText column minus the column size-related limitations.

Another limitation of the RichText column is that it requires a column and it has to be in the detail band. This limitation is addressed by two new expression functions for the Compute Expression property of Computed Field control. For this feature we are extending the idea behind the Bitmap expression function. The RichTextFile expression function takes the name of a RichText file as argument and renders its contents in the Computed Field. If the RichText is already available as a string, it can be passed directly to another expression function we are introducing - RichText. In either case, the autosize height property is respected.

Drawing in the DataWindow
We get requests for more drawing objects in the DataWindow, i.e., polygons, arrow tips, pie slices, etc. One approach would be to introduce more DataWindow graphic objects; however, this will not expose all the capabilities of the underlying graphics API we implement with. Today, we have a choice of:

  • GDI
  • GDI+ (Native C++ and Windows Forms)
  • WPF
  • Direct2D/DirectWrite.

There will always be something in the underlying API users want and that our implementation does not expose. Another approach is to introduce into the DataWindow what we already allow outside the DataWindow - drawing into the device context of a control.

We can do this without departing from the existing architecture - just extend (again) the idea behind the Bitmap expression function. In PB12.5 we introduce the Paint expression function (for the Compute Expression property of Computed Field control) that takes one argument - a call to a global user function that paints a computed field. This allows the user to paint inside a DW in a way that respects the position and z-order of other DW objects. The device context passed to the global user function is clipped to the bounds of the Computed Field (the bounding rectangle can therefore be retrieved using the Win32 API GetClipBox function; alternatively we provide expression functions to compute it). (See Figures 1 to 4.)

Something Very Useful from PB.NET
PB12 introduced ADO.NET connection sharing. With this feature, you can make an ADO.NET connection in C#/VB.NET code in an assembly and share this connection with PB code. You can also do the opposite - connect in PB and pass the connection to the assembly. This is done through two new functions introduced in the Transaction object - SetAdoConnection and GetAdoConnection. We have ported this feature to the Win32 target in PB12.5. The only difference being that the assembly has to be COM visible and accessed through COM.

In this and future releases of PB Classic, we are:

  • Making controls in the DataWindow and outside converge in terms of capabilities
  • Working toward parity and compatibility with the WPF DataWindow
  • Porting as many successful .NET features into the Win32 target as the platform will allow
  • Implementing feature requests from PB customers

And don't forget to participate in the beta.

More Stories By Frederick Koh

Frederick Koh is a Staff Engineer at Sybase, Inc., and has been a member of the PowerBuilder and DataWindow.NET development team since 2005. Frederick has over 14 years of IT industry experience.

Comments (0)

Share your thoughts on this story.

Add your comment
You must be signed in to add a comment. Sign-in | Register

In accordance with our Comment Policy, we encourage comments that are on topic, relevant and to-the-point. We will remove comments that include profanity, personal attacks, racial slurs, threats of violence, or other inappropriate material that violates our Terms and Conditions, and will block users who make repeated violations. We ask all readers to expect diversity of opinion and to treat one another with dignity and respect.