Welcome!

Search Authors: Shelly Palmer, Max Katz, Sandi Mappic, Jnan Dash, Alex Forbes

Related Topics: PowerBuilder

PowerBuilder: Article

New Features in PowerBuilder 11.5 – Part 2

A look at the improvements in GUI functionality

This is the second part of an ongoing series about the new features that were added in PowerBuilder 11.5. In the first part, we looked at the Federal Desktop Core Configuration (FDCC) and the impact it had on developers. In this part, we're going to look at a number of the improvements in GUI functionality. We'll start that by comparing a couple of screenshots of images in DataWindows (Figure 1 and Figure 2) that demonstrate a number of these new functions.

Support for PNG Files
The first thing you may notice is that the image type (in both images) is a Portable Network Graphics (PNG) file. The PNG file format was introduced to overcome limitations of the GIF file format, most notably:

  • The compression algorithm used in GIF files is patented.
  • GIF images are limited to a 256 color depth

PNG images actually provide greater compression than GIF and provide better support for transparency. The main advantage that GIF maintains is support for animation. PNG also has advantages over JPG in that it has lossless compression and transparency support. JPG was particularly designed for photographs, and so PNG tends to render better with non-photographic material (e.g., line art, text).

PowerBuilder 11.5 adds support for PNG files in DataWindow picture controls and in standard Picture controls as well as menus, treeview controls, and toolbars.

Transparency Support
In Figure 1, you'll also notice the "Make Color Transparent" option on the popup menu. This allows you to support transparency when the underlying image format doesn't support transparency, or when the picture you're using isn't transparent in the region you want it to be.  The latter is the case here, as the background of this PNG file has been set to black. I right clicked on the background, chose "Make Color Transparent" and every occurrence of that color in the image was re-rendered as transparent.

You can also set the color manually through the Transparent Color option you see on the property tab on the right of Figure 1, or at runtime by manipulating that property.  You'll also notice the Transparency Setting  on the right property tab of Figure 1. That option is unrelated to the Transparent Color option, what it controls is the opacity of the entire image.  Setting it higher make it possible to see the control or window background behind the picture through the picture.

Gradient/Picture Backgrounds
You'll notice in Figure 2 that now that the picture has a transparent background, what is showing through is a gradient color, not a solid background. That's because PowerBuilder 11.5 adds support for specifying a gradient or picture background for the DataWindow bands. The new Brush Mode property you can see in Figure 2 controls the background, and you have an option between Solid (old style), 5 different gradient styles or the Picture option. For both Gradients and Picture backgrounds, there is a section each of the Background properties tab for controlling a wide variety of options for how they are displayed (see Figure 3 and Figure 4). In fact, it's a bit confusing at first because those areas of the property pane appear continuously, no matter which option you have selected for the Brush Mode.  But you will only see the options that you have specified in the Gradient section applied if you pick one of the Gradient brush styles, and similarily none of the Picture properties settings have any effect until you select a Picture brush style.

Tooltips
Take a look at the properties pane in Figure 5, and you'll see the new Tooltips options for DataWindow controls. Figure 6 shows what the tooltip looks like at runtime. You'll notice that you have a lot of control over how the tooltip displays through the properties, all of which are adjustable via runtime properties as well. Note also how many of them support expressions, as indicated by the small equals sign button to the right of the property. Any property with such an icon can be specified through an expression, so that the attribute can be dynamically driven by data within the DataWindow.

Improved 3D Rendering of Graphs
Figure 7 and Figure 8 help illustrate the next new feature, improved 3D rendering of graphs. The improvement is implemented through DirectX, so there are some runtime ramifications.  One of them is that you'll need to install DirectX on the development machine and ensure that it's also available on the machines you are deploying to.  For the development machine, Sybase provides an installer for DirectX in the Program Files\Sybase\Shared\PowerBuilder\dxre directory.  It also means that some of your older machine may not have graphics cards capable of supporting the new graph styles.  Fortunately, when that is the case the display degrades gracefully to the previous 3D format.

Rich Text Edit Control
Last but not least, PowerBuilder 11.5 introduces a new edit style called the Rich Text Edit style (see Figure 9). No longer will you have to use SELECTBLOB/UPDATEBLOB and a separate RichText control to display rich text to the end user. You can select textual data (up to the limits imposed by your database driver) in the normal datawindow select and allow the user to edit it and store it in RTF format.

Some observations.  First, see Figure 10, which shows the edit style selected in the DataWindow painter.  Note that you don't have a lot of the options for the edit style that you do for the normal Rich Text windows control.

The second, shown in Figure 11, is a Rich Text Edit Style related property that appears for the DataWIndow Control, not the DataWindow Object.  The RichText Toolbar Activiation Mode determine when the toolbar for the edit control appears.  The choices are essentially:

  • Always - display the toolbar all the time, whether the rich text edit column has focus or not
  • On Edit - only display the toolbar when the rich text edit column has focus
  • Never - don't display the toolbar, even when the rich text edit column has focus

The last option is useful either when you don't have room to show the toolbar, or if you want to implement your own toolbar. The latter is possible because of a number of methods that have been added to the DataWindow that allow you to interact with the rich text edit masked column. This option would be the path you might take in order to show a fixed toolbar. Note in Figure 7 that the toolbar is floating. There is currently no option in the rich edit control style to make the toolbar fixed to the top of the edit area. Instead, the toolbar will remember the last location it was displayed at, and the end-user can move it around as needed when it's visible.

One caveat mentioned earlier bears repeating. The rich column edit style is limited to the amount of text that your target database allows you to select in a normal SQL statement.  For some databases, this can be a rather small amount compared to the amount of data required for RTF data. RTF has a very verbose syntax.  The single paragraph shown in Figure 9 required over 40K of RTF formatted data.  When a single bitmap was included, the size mushroomed to over 400K. Currently you either need to work with a database that allows direct access to very large text data fields, or you'll need to place tight limits on the amount of data used.  Perhaps future enhancements in this area will address this limitation.

That's all for Part Two. Watch for Part Three, where we'll cover even more new functionality.

More Stories By Bruce Armstrong

Bruce Armstrong is a development lead with Integrated Data Services (www.get-integrated.com). A charter member of TeamSybase, he has been using PowerBuilder since version 1.0.B. He was a contributing author to SYS-CON's PowerBuilder 4.0 Secrets of the Masters and the editor of SAMs' PowerBuilder 9: Advanced Client/Server Development.

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.