| By Brad Wery | Article Rating: |
|
| May 9, 2005 12:00 PM EDT | Reads: |
21,461 |
PowerBuilder contains so many features and capabilities that it's hard to fully understand and learn all of them when you're caught up in the "daily grind." A good way to deal with this is to create a skill-developing challenge. In most cases, I try to do something that I figure can't be done in PowerBuilder.
My latest challenge was to create an XP style listbar similar to the one in the Windows XP Control Panel (see Figure 1). I think it's a sharp-looking control that provides an efficient way to navigate an application. Could it be done in PowerBuilder? With enough time and creativity anything can be done.
XP Style Listbar
When duplicating a control, one of the most important things you should do is document its behavior. If you play with the listbar in the Windows XP Control Panel you will observe four things:
- When you click on the group header when the group is expanded, the group collapses.
- When you click on the group header when the group is collapsed, the group expands.
- The pointer changes to a hyperlink hand when you move it over an item.
- The list resizes when a scrollbar appears due to the window resizing.
Creating the DataObject
You can design the DataObject two ways: as an external DataWindow or one that retrieves from a database. You would retrieve from a database if you needed to provide the user with the flexibility of creating custom lists. In this case, to keep the example simple, an external tabular DataWindow will be created.
The DataObject will need several columns. Some columns display information and some control the behavior of the listbar. Refer to Table 1 for the names, data types, lengths and use of each column. Once created, remove all objects from the DataObject and set the header height to 0.
The column item_type will be used to control most of the behavior in the DataObject. The codes that will be stored in item_type and used in many expressions are as follows:
- HE: Expanded group
- HC: Collapsed group
- C: Child item
- S: Space, the area between groups
- F: Filler; used for looks, added to the end of each group
Each text object plays a vital role in the listbar's overall appearance. Those roles are described as follows:
- T_child_bkgrnd: Provides the appearance of the light blue box around the child items.
- T_header_bkgrnd: Displays a white background for the header text.
- T_space: Creates space between groups.
- T_filler: Adds to the look of the light blue box around the child items, usually used at the end of a group.
- T_header_filler: Creates space between the header text and the first child item.
Published May 9, 2005 Reads 21,461
Copyright © 2005 SYS-CON Media, Inc. — All Rights Reserved.
Syndicated stories and blog feeds, all rights reserved by the author.
About Brad Wery
Brad Wery is the President of Werysoft Inc. (www.werysoft.com) and the creator of www.PowerToTheBuilder.com, a site dedicated to helping PowerBuilder developers create visually appealing user interfaces. He has been a member of TeamSybase since 2006 and is an active participant in the PowerBuilder Newsgroups.
- Ulitzer vs. Ning - a Quick Review
- First Time with AJAX.NET
- Make Your Design Ideas Speak: Using UML in PowerBuilder Projects
- A Review of Key PDF and Font Concepts
- PowerBuilder 12 CTP Launch and Code Camp
- New Features in PowerBuilder 11.5
- Sybase iAnywhere Broadens Support of Mobile Device Management Solution
- Consuming a SQL Anywhere Native Web Service Using a .NET Client
- PowerBuilder 11.5 Top Feature Picks
- PowerBuilder Developer's Journal: Legacy Isn't a Dirty Word
- Sybase to Present at Virtualization Conference & Expo
- How to Circumvent the Seven Deadly Biases
- iPhone Able to Be Adopted by Enterprise Businesses
- SAP & Sybase: Transforming Today's Mobile Workforce
- PowerBuilder's .NET Strategy
- Ulitzer vs. Ning - a Quick Review
- SYS-CON Launches "PBDJ 2009" Website for PowerBuilder Developer's Journal
- First Time with AJAX.NET
- Make Your Design Ideas Speak: Using UML in PowerBuilder Projects
- Sybase Reports All-Time Best Ever Quarter and Year
- PowerBuilder History - How Did It Evolve?
- Custom Common Dialogs Using SetWindowsHookEx
- Book Excerpt: Sybase Adaptive Server Anywhere
- OLE - Extending the Capabilities of PowerBuilder
- DataWindow.NET How To: Data Entry Form
- Sybase ASE 12.5 Performance and Tuning
- DDDW Tips and Tricks
- Working with SOA & Web Services in PowerBuilder
- Office 2003 Toolbar: A New Look For Your Old PowerBuilder App
- Dynamically Creating DataWindow Objects






































