| By Bruce Armstrong | Article Rating: |
|
| December 1, 2003 12:00 PM EST | Reads: |
15,802 |
Chapter 5 of PowerBuilder 9: Advanced Client/Server Development included a discussion on how to add items to the New dialog within the PowerBuilder IDE. This article will review that information and look at a couple of additional techniques for extending the PowerBuilder IDE
Adding Items to the New Dialog
All versions of PowerBuilder 7 and beyond allow you to add items to the New Dialog by adding entries to the registry. First navigate to:
HKEY_LOCAL_MACHINE\SOFTWARE\Sybase\PowerBuilder\X.0
where X is the major version of PowerBuilder that you are creating the new item for (7, 8, or 9). Under that key create a new subkey called "CLSID" that all the new items will be located under (see Figure 1).
For each new item you want to add, create another new subkey under the CLSID key named with a globally unique identifier (GUID). A GUID is a 32-character value used within the Windows operating system to uniquely reference objects and has a format of {AAAAAAAA-BBBB-CCCC-DDDD-EEEEEEEEEEEE}. There are a number of different ways to generate GUIDs, including:
Once you've generated the first GUID for the first dialog item, you might want to just use sequential values from that point on (refer to Figure 1 again).
After the CSLID entry has been created, you need to modify the default string value and create three new ones:
-Wizard (addressed below)
-An Internet shortcut (http://, ftp://, or mailto:)
-The name of one of the PowerBuilder painters or dialogs (Application://, Database://, DataWindow://, DBProfile://, DataPipeline://, Debug://, FileEdit://, Function://, Library://, Menu://, Project://, Query://, Report://, RunReport://, RunWindow://, Structure://, UserObject://, or Window://)
The URL syntax follows the standard for Internet URLs in that the URL can be prefixed with username/password information and suffixed by a "?", followed by any arguments in a name/value combination. Arguments to painters can include "action" (where action can be "new," "inherit," "run," "runonly," and "open"), "path" (indicates the path to the PBL containing the object), and "entry" (indicates the name of the object).
-WorkspaceTool for the Workspace tabpage
-StartTool for the Target tabpage
-ObjectTool for the Object tabpage
-WebTool for the Web tabpage
-DataWindowTool for the DataWindow tabpage
-DataBaseTool for the DataBase tabpage
-ProjectTool for the Project tabpage
-Tool for the Tool tabpage
Listing 1 is a portion of a PowerBuilder utility, available in the source code, that will create these registry entries for you.
The results are shown in Figure 6. Note that there does not appear to be any way to control the position of the new icon. Interestingly enough, they're added to the front of the dialog, not at the end, as I would have expected.
Also note that the URLs indicated here will work in the custom toolbar icon dialogs as well. The main advantage of adding items to the New Dialog over the toolbar is that the toolbar doesn't allow you to use icons other than those provided with PowerBuilder.
Creating Custom Wizards
You may not realize it, but a number of the PowerBuilder system DLLs in the Shared/PowerBuilder directory are not actually DLLs. They're PBDs (compiled PowerBuilder libraries) that have simply been renamed. If you rename the extension on a copy of them to PBL and add the PBDs to a target, you can examine the object listing and even open the objects in the PowerBuilder IDE, but you won't be able to view the source for any scripts. In particular, the PBADD90.DLL appears to contain the many items provided with PowerBuilder on the tools tab of the new dialog (migration assistant, DataWindow syntax, profiling tools, PFC extender, etc.). The PBGEN90.DLL file appears to be the PowerBuilder objects used during template target generation. Finally, the PBWIZ90.DLL and PBWZP90.DLL files appear to be the PowerBuilder objects that serve as a basis for many of the wizards that appear with the PowerBuilder IDE.
This illustrates the next method of extending the PowerBuilder IDE. It's possible to create objects within PowerBuilder that can then be used as wizards within the IDE. Once you've created the objects and compiled the library that contains them to a PBD, let the PowerBuilder IDE know about them through a couple of registry entries. First, navigate to HKEY_LOCAL_MACHINE\SOFTWARE\Sybase\PowerBuilder\X.0 again, and this time create a subkey called "WizardLibraries." Under that new subkey create new string values for each PBD you want to be able to use the objects from. The name of the string values must be a sequential number, and the value will point to the PBD file.
Now that the objects are available to the PowerBuilder IDE, create a new dialog icon or custom toolbar icon that runs them, using the "wizard" keyword mentioned above. The "wizard" keyword syntax is as follows:
wizard:?entry=<name of window>
where <name of window> is the window you want the PowerBuilder IDE to run when the option is selected (without the brackets).
The source code for this article includes a small utility for creating the WizardLibraries entry for you. Listing 2 provides the most relevant section of that application.
Figure 7 illustrates a custom wizard running from within the PowerBuilder IDE. The sample code for this wizard is also included in the sample code for the article.
Published December 1, 2003 Reads 15,802
Copyright © 2003 Ulitzer, Inc. — All Rights Reserved.
Syndicated stories and blog feeds, all rights reserved by the author.
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.
- Whatever the Apple iPad Is, It Apparently Leaks Like a Sieve
- Six Enterprise Megatrends to Watch in 2010
- Java vs C++? Really?
- Microsoft WebsiteSpark: Get New Business Leads to Grow Your Business
- Cloud Economics – Amazon, Microsoft, Google Compared
- iPad on Ulitzer - I’ll Buy iPad. But What For?
- The Cloud Storage Wars: Windows Azure vs. Google
- Adobe Flash on the Road to Nowhere
- Cloud Computing Bootcamp Returns to Cloud Expo in New York April 20, 2010
- Apple and Emotional Discussions Around Adobe Flash Player
- Novell Named 'Bronze Sponsor' of Cloud Expo 2010 East in New York City
- Getting Started with Cloud Computing
- Whatever the Apple iPad Is, It Apparently Leaks Like a Sieve
- Six Enterprise Megatrends to Watch in 2010
- The Importance of Abstraction in Cloud Computing
- Microsoft’s First Step Toward Cloud Computing
- Java vs C++? Really?
- Microsoft WebsiteSpark: Get New Business Leads to Grow Your Business
- Five Gadgets That I Can’t Wait to See in 2010
- Technology Predictions for 2010
- My Personal 2010 Predictions
- Cloud Economics – Amazon, Microsoft, Google Compared
- Cloud Computing Instrumental in IT Recovery for 2010
- iPad on Ulitzer - I’ll Buy iPad. But What For?
- SYS-CON Media Readers Cast More Than 4,000 Votes In First Week Of Voting
- SYS-CON Media Opens Its Eighth Annual "Readers' Choice Awards" Polls
- SYS-CON Media Readers' Choice Awards Polls Will Close on December 31, 2005
- The Top 150 Players in Cloud Computing
- Aspect.NET: Aspect-Oriented Programming for Microsoft.NET in Practice
- SYS-CON Opens Its Eighth Annual "Readers' Choice Awards" Polls, Often Referred To As "The Oscars of the Software Industry"
- Kindle 2 vs Nook
- Microsoft .NET Developers Launch KatrinaSafe.com
- Rich Content Rotator for ASP.NET
- Microsoft Is Not Dead, It Just Has A Flu
- Customizing the PB IDE
- .NETDJ Editor Jon Box Responds To Calvin Austin in His Blog





























Ulitzer content is offered under Creative Commons "Attribution Non-Commercial No Derivatives" License.
For any reuse or distribution, you must make clear to others the license terms of this work.
The best way to do this is with a link to this web page.
Any of the above conditions can be waived if you get written permission from Ulitzer, Inc., the copyright holder.
Nothing in this license impairs or restricts the author's moral rights.