FREE PowerBuilder Training

Introduction to PowerBuilder

HomePrevious Lesson: Creating Shortcuts
Next Lesson: Toolbars

PowerPanel

While developing you create/test objects using painters. Each painter has an icon associated with it. You can see all the painter icons right below the menu options laid horizontally. To see the descriptive text and shortcut for each icon, display PowerPanel by selecting 'File/PowerPanel' from the menu.


PowerPanel

The dialog box shown above is called 'PowerPanel'. To invoke a painter from the PowerPanel, you need to click the icon/text and select 'OK' button ( don't do it now ). PowerPanel is available from initial versions of PowerBuilder. We don't see any real need for PowerPanel in real life. Then do you wonder how to invoke painters without the menu options and PowerPanel. If so, you will come to know of it in the next section.

Before we go any further, lets have an overview of each painter. Close PowerPanel by clicking on the 'Cancel' button.


Application Painter
Application object is the entry point to any PowerBuilder application.  For those from 'C' background it is like 'main()'. In the application object you can specify what PowerBuilder should do when:
you start the application
the application is idle for a pre-determined time
an error occurs at run-time
you close the application

Window Painter
In any application, screen is the main interface between a user and an application. It allows you to do data entry, see reports and so on. In PowerBuilder, screens are called as 'Windows'. Don't confuse the term 'Windows' with Microsoft Windows operating system; it is referred to as 'MS-Windows'. A Window Painter, as the name suggests allows you to paint and save window objects. On a window you can paint various controls such as CommandButtons, ListBoxes, etc.

Menu
Painter
A menu is a list of options or commands. An example of a menu would be your browser's menu. In character based systems, typically one menu occupies the whole screen. When the user selects a menu option, another screen will be displayed with a new menu. In some systems like AS/400 or Mainframes, you can see all the available options at the bottom of the screen, it is nothing but a menu.

Under MS-Windows, menu interface is user-friendly than character based screens. In PowerBuilder, you can create menu objects in the menu painter and assign it to the screens (windows) you have painted in the window painter. You can also paint popup menus (context sensitive menus) in the menu painter.


DataWindow Painter
DataWindow object allows you to retrieve data from a database or other source, for display. A DataWindow object definition consists of:
data source definition (about the data to bring, i.e., database, table, column names, etc.)
presentation definition (about how you would like to display the retrieved data, i.e., a table format, labels, graph and so on).

You can also do data entry through a DataWindow. After painting the DataWindow object, you can't use that object alone. You need to associate a DataWindow object with a DataWindow control and place that DataWindow control on the screen (window). Finally users interact with the DataWindow object through the screen (window).


Data Pipeline Painter
The Data Pipeline object allows you to copy tables and their data from one database to another with few lines of code, even if the tables are located on different DBMSs. For example, you may want to develop an application using Watcom (SQL AnyWhere) database on your desktop, but you need some SQL Server data which resides on the network.

In the traditional way, you need to export the data from SQL Server and fiddle with the data to make sure that the data format is compatible for importing into Watcom database and then import it. In this approach, if you want to refresh the existing data, you need to write a big program.

Things are very simple if use PowerBuilder. Here you can just paint a data pipeline object in couple of minutes and execute the pipeline. You can then reuse the data pipeline object every time you want to copy/refresh data from the source.


User Object Painter
An User Object allows you to reuse the code. It is nothing but a collection of one or more PowerBuilder/ non-PowerBuilder objects. Non-PowerBuilder objects includes objects from VB, DLLs, OCX and so on. 

Query Painter
A Query Painter allows you to build SQL SELECT statements which can be saved as query objects in the PowerBuilder library. If you intend to use the same SQL statement many times in your application as embedded SQL or as DataWindow source, you need to define reusable query objects.

Function Painter
The function painter allows you to build function objects that define a series of frequently executed commands. In PowerBuilder, a function is a collection of PowerScript commands and/or embedded/dynamic SQL statements. You can also refer to these functions in your PowerScript and DataWindow painter.

Structure Painter
The Structure Painter allows you to create structure objects. A structure is nothing but a set of related variables (which may have different data types) grouped under a single name. It makes management of related variables easy. You can refer to the structures in your PowerScript.

Library Painter
Objects you create in PowerBuilder painters (application, windows, menus, functions, queries, structures, user objects and DataWindow objects) are stored in an operating system file with ".pbl" extension (pronounced as pible); In PowerBuilder terminology, this file is called a "Library". A Library Painter allows you to create and maintain PowerBuilder libraries and objects in those libraries.

Database Painter
Database Painter allows you to create database objects--such as table, view, index, stored procedure, trigger, etc. without knowing the actual DDL syntax. All the database objects that you create in this painter are stored in the connected database and not in the PowerBuilder library. Objects that you create in other painters--such as window, menu are stored in PowerBuilder library. You can also do database administration from this painter.

Project Painter
Project Painter allows you to create PowerBuilder Dynamic Linked Libraries (PBDs), executables. You need to define what libraries need to be included in the project for the first time. Once you define this, you can create executable files with few clicks. It also allows you to do incremental rebuild if you are using a version control system.
Run You guessed it right. A Run icon allows you to execute the application you are currently working on.
Debug A Debug painter allows you to view the execution of the current application step-by-step and simplifies the discovery of bugs. It is very powerful and comes with all the debugging facilities you will ever need.
HomePrevious Lesson: Creating Shortcuts
Next Lesson: Toolbars
 
Copyright © 1996 - 2013 Prasad Bodepudi. All Rights Reserved.