The PowerBuilder environment

When you start PowerBuilder for the first time, the Welcome to PowerBuilder dialog box lets you create a new workspace/solution with or without targets/projects:


When PowerBuilder starts, it opens in a window that contains a menu bar and the PowerBar at the top and the System Tree and Clip window on the left. The remaining area will display the painters and editors you open when you start working with objects.


The System Tree

The System Tree provides an active resource of programming information you use while developing targets/projects. It lets you not only get information, but also drag objects into painter views (such as the Script editor or Layout view) for immediate use.

The System Tree displays by default when you start PowerBuilder for the first time. You can hide or display the System Tree using the System Tree button on the PowerBar or by selecting Window>System Tree.

Using the Workspace/Solution tab page

The System Tree has a single tab page that provides a view of the current workspace/solution. The Workspace/Solution tab page displays the current workspace/solution and all its targets/projects. Most targets/projects display the library list for the target/project and all the objects in each library. The Workspace/Solution tab page in the System Tree works like a tree view in the Library painter, but you can keep it open all the time to serve as the control center of the development environment.

You can set the root of the Workspace/Solution page to your computer's root directory, the current selection, or any directory or library, as well as to the current workspace/solution.

Working with targets/projects

To see the pop-up menu that lets you perform operations on a target/project such as search, build, and migrate, you must set the root of the System Tree to the current workspace/solution.

The following illustration shows a workspace with two targets.


Current target/project

The target/project is bold, indicating it is the current target/project, which means that it is the default target/project used in the New dialog box and for Run and Debug. The current target/project is set whenever you:

  • Invoke an action in the System Tree, Library painter, or main menu that affects a target/project or a child of a target/project, such as Build, Migrate, Run, or Debug. Some actions, such as Search and Migrate, display a dialog box. If you cancel the action by clicking the Cancel button in the dialog box, the current target/project is not changed.

  • Open an object painter.

  • Change the active object painter.

If you prefer to set the current target/project explicitly using the Set as Current Target/Project pop-up menu item for the target/project in the System Tree or the File>Set Current Target/Project menu item, clear the Automatically Set Current Target/Project check box on the Workspace/Solution tab page in the System Options dialog box. To open the System Options dialog box, select Tools>System Options from the main menu.

Actions in the System Tree

You can use the Workspace/Solution page as the hub of your PowerBuilder session. Pop-up menus let you build and deploy targets/projects and open and edit any object. Double-clicking an event or function in the System Tree opens its script in the Script view. Events with scripts have a different icon and are listed before events without scripts.

The following table lists the actions you can take on each item that displays on the Workspace/Solution page. You can also set properties for each item, choose which object types display in the tree view, change the root of the Workspace/Solution page, and reset the root to the current workspace/solution.

Item

Menu action items

Workspace/Solution

New (opens New dialog box), Add Target/Project, Convert Workspace to Solution, Convert & Add Target, Open Workspace/Solution, Close, Incremental Build, Full Build, PowerScript Build, Deploy, Export Build File, Run, Debug, Add to Source Control, Show, Open Containing Folder, Copy Full Path, Copy Name, Properties.

Convert & Add Target and PowerScript Build are available only for solution.

Convert Workspace to Solution is available only for workspace.

Target/Project

New, Search, Set as Current Target/Project, Remove Target/Project, Library List, Migrate, Incremental Build, Full Build, PowerScript Build, Deploy, Build & Deploy, Export Build File, Run, Debug, Show, Open Containing Folder, Copy Full Path, Copy Name, Properties.

PowerScript Build is available only for project.

PBL

Search, Delete, Remove Library, Import, Import PB Extension, Import From Library, Optimize, Build Runtime Library, Print Directory, Show, Open Containing Folder, Copy Full Path, Copy Name, Properties.

Import From Library is available only for PBL folder.

Optimize and Properties are available only for PBL file.

PBD

Search, Delete, Remove Library, Print Directory, Show, Open Containing Folder, Copy Full Path, Copy Name, Properties

Application project object

Edit, Search, Deploy, Run, Export Build File, Copy, Move, Delete, Regenerate, Export, Print, Open Containing Folder, Copy Full Path, Copy Name, Properties

PowerServer project object

Edit, Search, Build & Deploy, Deploy, Undeploy, Run, Export Build File, Copy, Move, Delete, Regenerate, Export, Print, Open Containing Folder, Copy Full Path, Copy Name, Properties

PowerClient project object

Edit, Search, Build & Deploy, Deploy, Undeploy, Run, Export Build File, Copy, Move, Delete, Regenerate, Export, Print, Open Containing Folder, Copy Full Path, Copy Name, Properties

.NET DataStore project object

Edit, Search, Generate, Run, Copy, Move, Delete, Regenerate, Export, Print, Open Containing Folder, Copy Full Path, Copy Name, Properties

PowerBuilder object

Edit, Edit Source, Search, Inherit from, Run/Preview, Copy, Move, Delete, Regenerate, Export, Print, Open Containing Folder, Copy Full Path, Copy Name, Properties.

Edit Source is not available for project and proxy objects. Inherit from and Run/Preview are available only for some object types. Source control items are available only if source control information is associated with the target/project.

Functions and events

Edit, Edit Source, Search, Copy, Move, Delete, Regenerate, Export, Print, Open Containing Folder, Copy Full Path, Copy Name, Properties.

The Properties dialog box shows the prototype of the function or event and its "signature." The signature is a string that represents the argument types, return types, and passing style. You use this string when you write a PBNI extension that calls the function or event. For more information, see PowerBuilder Native Interface Programmers Guide and Reference.


The PowerBar

Like the System Tree, the PowerBar provides a main control point for building PowerBuilder applications and deploying the application as the native client/server app. From the PowerBar1 you can create new objects and applications, open existing objects, and debug and run the current application.

PainterBar1 provides buttons for creating, building and deploying the PowerClient or PowerServer projects. PainterBar1 is provided only in the CloudPro or Professional edition of PowerBuilder 2019 R3 or later.

PainterBar1 for a PowerClient project (available in the CloudPro or Professional edition of PowerBuilder 2019 R3 or later):


PainterBar1 for a PowerServer project (available in the CloudPro edition of PowerBuilder 2021 or later):


While you are getting used to using PowerBuilder, you can display a label on each button in a toolbar to remind you of its purpose. To do so, right-click any toolbar button and select Show Text from the pop-up menu.

The following table lists the buttons from left to right on the PowerBar1.


PowerBar1 button

What you can use it for

New

Create new objects.

Inherit

Create new windows, user objects, and menus by inheriting from an existing object.

Open

Open existing objects.

Run/Preview

Run windows or preview DataWindows.

System Tree

Work in the System Tree window, which can serve as the hub of your development session. For more information see The System Tree.

Output Window

Examine the output of a variety of operations (migration, builds, deployment, project execution, object saves, and searches). See The Output window.

Next Error, Previous Error

Navigate through the Output window.

To-Do List

Keep track of development tasks you need to do for the current application and use links to get you quickly to the place where you complete the tasks.

Browser

View information about system objects and objects in your application, such as their properties, events, functions, and global variables, and copy, export, or print the information.

Clip Window

Store objects or code you use frequently. You can drag or copy items to the Clip window to be saved and then drag or copy these items to the appropriate painter view when you want to use them. See The Clip window.

Library

Manage your libraries using the Library painter.

DB Profile

Define and use named sets of parameters to connect to a particular database.

Database

Maintain databases and database tables, control user access to databases, and manipulate data in databases using the Database painter.

Edit

Edit text files (such as source, resource, and initialization files) in the file editor.

Incremental Build Workspace/Solution

Update all the targets/projects and objects in the workspace/solution that have changed since the last build.

Full Build Workspace/Solution

Update all the targets/projects and objects in the workspace/solution.

Deploy Workspace/Solution

Deploy all the targets/projects in the workspace/solution.

Skip, Stop

Interrupt a build, deploy, or search operation. When a series of operations is in progress, such as a full deploy of the workspace/solution, the Skip button lets you jump to the next operation. The Stop button cancels all operations.

Debug

Debug the current target/project. You can set breakpoints and watch expressions, step through your code, examine and change variables during execution, and view the call stack and objects in memory.

Select & Debug

Select a target/project and open the Debugger.

Run

Run the current target/project just as your users would run it. For standard PowerBuilder application targets/projects, the application runs in the development environment.

Select & Run

Select a target/project and run it.

Exit

Close PowerBuilder.


Customizing the PowerBar

You can customize the PowerBar. For example, you can choose whether to move the PowerBar around, add buttons for operations you perform frequently, and display text in the buttons.

For more information, see Using toolbars.

About PowerTips

In the PowerBar, when you leave the mouse pointer over a button for a second or two, PowerBuilder displays a brief description of the button, called a PowerTip.PowerTips display in PowerBuilder wherever there are toolbar buttons.

The Clip window

You can store code fragments you use frequently in the Clip window. You copy text to the Clip window to save it and then drag or copy this text to the appropriate Script editor or editor when you want to use it.

Using the Clip window

The Clip window displays a list of named clips, a preview of the information contained in the clip, and a description. It provides buttons to move Clip window contents to the clipboard, copy clipboard contents to the Clip window, rename a clip, delete a clip, and modify the clip's description. Clips you save in one workspace/solution are available in all your workspaces/solutions; you might want to use a naming convention that reflects this.

For example, you might use standard error-checking code when you use the ConnectToServer function to connect to a server. To copy it to the clipboard, highlight the code in a Script editor and select Copy from the pop-up menu. In the Clip window, click the Paste icon, and name the clip. The Clip Description dialog box opens so that you can enter a description. To change the description later, select the clip's name and click the Modify button.

You can drag the clip from the Clip window to any script in which you want to connect to a server. You can also use the Copy icon to copy the clip to the clipboard.

You can hide or display the Clip window using the Clip Window button on the PowerBar or by selecting Window>Clip.


The Output window

The output of a variety of operations (migration, builds, deployment, project execution, object saves, and searches) displays in the Output window.

When you start a new PowerBuilder session, the Output window has a single tab, Default. New tabs are added as you perform operations.

Tab

Contents

Default

General information about the progress of full or incremental builds and project deployment

Debug

Debugger output, including the paths of assemblies loaded to support .NET debugging

Errors

Messages that indicate problems that prevent the build or deploy process from completing successfully

Warnings

Warning and informational messages

Search

Output from search operations

Unsupported (DWs) / Unsupported (PowerServer)

Names and locations of features are not supported in the target


Using the Output window

You can hide or display the Output window with the Output button on the PowerBar or by selecting Window>Output.

You control operations in the window using the Skip, Stop, Next Error, and Previous Error buttons or menu options.

Tabs display in the order in which they are created and remain in the Output window for the rest of the PowerBuilder session. To clear the output from the tabs automatically when you start a new build, make sure that the Automatically Clear Output Window check box on the General page of the System Options dialog box is selected. You can also clear and close tabs manually from the pop-up menu.

When appropriate, lines in the Output window provide links that invoke the correct painter when you double-click on that line. The pop-up menu also provides the options Edit and Edit Source to open an object in a painter or the Source editor. You can copy the contents of the current tab to the Windows clipboard, save its contents to a text file, or print its contents to your default printer.