YOUR FEEDBACK
Java Application Development wrote: Great Post..... Java Programmer...
AJAXWorld RIA Conference
$300 Savings Expire August 22
Register Today and SAVE!


2008 East
DIAMOND SPONSOR:
Data Direct
Frontiers in Data Access: The Coming Wave in Data Services
PLATINUM SPONSORS:
Red Hat
The Opening of Virtualization
Intel
Virtualization – Path to Predictive Enterprise
Green Hills
IT Security in a Hostile World
JBoss / freedom oss
Practical SOA Approach
GOLD SPONSORS:
Software AG
The Art & Science of SOA: How Governance Enables Adoption
PlateSpin
Effective Planning for Virtual Infrastructure Growth
Fujitsu
Automated Business Process Discovery & Virtualization Service
Ceedo
Workspace Virtualization
Click For 2007 West
Event Webcasts

2008 East
PLATINUM SPONSORS:
Appcelerator
Think Fast: Accelerate AJAX Development with Appcelerator
GOLD SPONSORS:
DreamFace Interactive
The Ultimate Framework for Creating Personalized Web 2.0 Mashups
ICEsoft
AJAX and Social Computing for the Enterprise
Kaazing
Enterprise Comet: Real–Time, Real–Time, or Real–Time Web 2.0?
Nexaweb
Now Playing: Desktop Apps in the Browser!
Sun
jMaki as an AJAX Mashup Framework
POWER PANELS:
The Business Value
of RIAs
What Lies Beyond AJAX?
KEYNOTES:
Douglas Crockford
Can We Fix the Web?
Anthony Franco
2008: The Year of the RIA
Click For 2007 Event Webcasts
SYS-CON.TV
POWERBUILDER LINKS YOU MUST CLICK ON


PowerBuilder 10.5: Revised Menus, Toolbars and New Icons
Contemporary Menus and Toolbars

One of the long awaited features introduced in PowerBuilder 10.5 is support for contemporary (aka Office XP) menus and toolbars. The first difference you'll notice is that the flat contemporary style and new icons are used extensively throughout the PowerBuilder IDE itself (Figure 1).

New Menu Options
The next thing you'll notice is a dizzying array of new options in a new "Appearance" tab page in the Properties pane for the top level menu item. What adds to the dizzying effect is that the menu options (Figure 2) and the toolbar options (Figure 6) are all combined on the same tab page. Perhaps they'll split those out onto separate tab pages before the product is released or in a later maintenance release.

There are two Menu Style options, ContemporaryMenu! and TraditionalMenu! If TraditionalMenu! is selected, all of the other menu options become disabled and the application menus will have the pre-10.5 look and feel. When the ContemporaryMenu! option is selected, you can choose the font name and size for the menu text, whether it is bolded, italics and/or underlined as well as its color, background color and highlight color.

The next few options could stand a bit of rearrangement as well. The TitleBackColor, MenuTitles and TitleGradient should be grouped together separately, just as the BitmapBackColor, MenuBitmaps and BitmapGradient should be. Figure 3 shows an example of a contemporary menu that will help illustrate what effect the various options have. The MenuTitles checkbox determines whether the first vertical band in the drop down menu appears at all. If that option is not selected, the TitleBackColor and TitleGradient options have no effect, because that band will not be visible. If the MenuTitles option is selected, the TitleBackColor will determine the color of the band. If the TitleGradient option is not selected, the same color is used for the entire band. If the TitleGradient option is selected, a gradient fill is used for the band. Note that the IDE does not allow you to select the second color for the gradient. Also note that enabling MenuTitles does not automatically mean text is assigned. That is a separate property on the individual child menu items.

In a similar manner, the MenuBitmaps option determines whether the second vertical band will appear and if not selected the BitmapBackColor and BitmapGradient options will have no effect. If the MenuBitmaps option is set, then the BitmapBackColor will set the color of the second band and the BitmapGradient option will determine if a gradient fill is used. Once again, you do not have an option to select the second color used for the gradient. And like the MenuTitles option, the selection of the MenuBitmaps option will not automatically cause bitmaps to appear in the band, even if there are toolbar bitmaps associated with the menu item. The image used for the menu (which can be in a number of formats, not just a bitmap) is a separate option from the toolbar image setting.

There are only a couple of new menu options on the child menu items (Figure 4). The MenuTitleText option is only enabled if MenuTitles has been checked on the root menu item. This is where the text is obtained for the drop down menu items when the MenuTitles option is enabled. The MenuAnimation option is only applicable if there is a MenuImage for the menu item. When enabled, the menu image is "shifted up" and a shadow is shown behind it when the menu item is selected (Figure 5). The users sees the menu image "rise" as the item is selected, hence the reference to animation.

The MenuImage can be provided in one of four different formats: BMP, GIF, ICO or JPG. It can also be provided in a number of different sizes, but the menu will only show the image as either 16x16 (if a 16x16 bitmap is provided) or 32x32 (if anything larger than a 16x16 is provided). As a result, 16x16 or 32x32 are the most appropriate sizes of images to use when specifying menu bitmaps. Otherwise the scaling that PowerBuilder does to fit the image to the supported size will usually result in some distortion.

Note: For testing menu and toolbar image support purposes I obtained the Common Toolbar Set (both Small and Large Editions) from glyFX (www.glyfx.com/free.html). They supply images in BMP, GIF, ICO and PNG format (the latter of which PowerBuilder does not support). In order to test the JPG format I converted several of the GIF images to JPG. Because of restrictions on redistribution of the icons, the sample code for this article does not contain those images. However, you can download the glyFX images from their website for free.

The ICO and GIF formats have native support for a transparency indicator. The BMP format does not, but PowerBuilder will treat any CommandButton color pixels in a BMP image as transparent. The JPG format does not support a transparency indicator, and PowerBuilder does not attempt to support it by treating another color as transparent. Therefore, if your images need to have a transparent background (particularly an issue if you are using a gradient for the menu image band) you should consider using the ICO or GIF formats first, the BMP format second, and the JPG format as a last resort. Between the ICO and GIF formats, I found that the GIF format gave a better appearance when used as a MenuImage, particularly for the 32x32 size.

New Toolbar Options
As indicated earlier, there are also new Toolbar Appearance options for the root menu item (Figure 6). As with the menu appearance, there are two options for the toolbar style (ContemporaryToolbar! and TraditionalToolbar!) and the TraditionalToolbar! setting renders the other options invalid and provides a pre-10.5 look and feel. When the ContemporaryToolbar! option is selected, you can specify the text color, back color and highlight color for the toolbar items. You can also indicate whether the toolbar back color should have a gradient fill applied, but as with the menus you do not have the option of specifying the second color used for the gradient fill.

There is also one new toolbar option on child menu items: ToolbarAnimation (Figure 7). It has the same effect of providing a raised image for the selected toolbar item as the MenuAnimation option discussed earlier has for menu images.

As with the menu images, you can supply the toolbar images in a number of formats and sizes. However, regardless of what image size you supply for a toolbar item, PowerBuilder will only display it in a 16x16 size. Therefore, you should consider using 16x16 icons for all your toolbar images. As discussed previously, the ICO and GIF format have native support for a transparency indicator and are the first choice if your images require some transparent areas. At the time of this writing, PowerBuilder was not supporting CommandButton as a transparency indicator for BMP files, so they should be considered with JPG as a last resort for toolbar icons. This may be an oversight that is corrected by the time the product is released or in a subsequent maintenance release, but GIF or ICO are still preferred. Also note that whereas ICO and GIF images appeared similarly when both were provided in 16x16 format, the quality of the toolbar icon displayed deteriorated much quicker with larger image sizes for GIF files than for ICO files. That is, although GIF seems to be the better choice for a menu image, ICO seems to be the better choice for a toolbar image.

Or, to summarize my menu and toolbar image recommendations, you should consider using:

On the other hand, you might also consider using some of the PowerBuilder system provided images as well. Sybase has reworked a large number of the more commonly used internal images to provide a contemporary look. In fact, the sample toolbar (Figure 8) is composed entirely of internal images.

Conclusion
The support for XP look and feel option introduced in PowerBuilder 9.0.1 was the first step in modernizing the appearance of PowerBuilder generated applications. The introduction of contemporary menus and toolbars goes a long ways towards completing that modernization. Hopefully, future versions will include additional contemporary user interface features such as larger icon sizes for toolbars and perhaps a rebar control (where user objects such as edit masks or drop down list boxes can be embedded in a toolbar).

About Bruce Armstrong
Bruce Armstrong is a development lead with Integrated Data Services (www.get-integrated.com). A 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.

PBDJ LATEST STORIES . . .
AJAX has dominated the web space so extensively that it needs no introduction. Connecting to a server via XMLHttpRequest and making a partial page refresh is what makes this technique so attractive. However, use of these AJAX requests, although very attractive, can pose dangers as well...
Red Hat CTO Brian Stevens, Citrix CTO Simon Crosby, Egenera CTO Pete Manca, Allen Stewart, Group Manager, Windows Virtualization at Microsoft, and Brian Duckering, Sr. Director of Products and Alliances at Symantec were the top industry executives who joined Jeremy Geelan in the 4th Fl...
Two of the biggest launches in Rich Internet Application history took place in 2007/2008 when Adobe launched AIR 1.0 in February '08 and Microsoft launched Silverlight (September '07). At the 6th International AJAXWorld RIA Conference & Expo in October SYS-CON Events is delighted to be...
Most new users of PowerBuilder start with SQL Anywhere as the back-end database engine (formerly Adaptive Server Anywhere or ASA, and before that Watcom). With growth, a need to shift and adapt to a wider database platform is thrust on developers by customers. A recent exercise in this...
The first is Borland. Originally known for their development tools (e.g., Delphi, JBuilder, C++ Builder), in February of 2006 Borland announced they were planning to sell off the Development Tools Group so that they could focus on Application Lifecycle Management (ALM) product offering...
Even the most sceptical observer would be hard pressed to argue that Sybase isn’t making some smart - or at least pretty interesting - moves right now. Bringing in the Sybase 365 division to position the company as the ‘database company with the unique focus on mobile communication...
SUBSCRIBE TO THE WORLD'S MOST POWERFUL NEWSLETTERS
SUBSCRIBE TO OUR RSS FEEDS & GET YOUR SYS-CON NEWS LIVE!
Click to Add our RSS Feeds to the Service of Your Choice:
Google Reader or Homepage Add to My Yahoo! Subscribe with Bloglines Subscribe in NewsGator Online
myFeedster Add to My AOL Subscribe in Rojo Add 'Hugg' to Newsburst from CNET News.com Kinja Digest View Additional SYS-CON Feeds
Publish Your Article! Please send it to editorial(at)sys-con.com!

Advertise on this site! Contact advertising(at)sys-con.com! 201 802-3021


SYS-CON FEATURED WHITEPAPERS

ADS BY GOOGLE
BREAKING POWERBUILDER / SYBASE NEWS

Guardium, the database security company, wil...