Welcome!

Richard (Rik) Brooks

Subscribe to Richard (Rik) Brooks: eMailAlertsEmail Alerts
Get Richard (Rik) Brooks via: homepageHomepage mobileMobile rssRSS facebookFacebook twitterTwitter linkedinLinkedIn


Top Stories by Richard (Rik) Brooks

Security is a must for most corporate applications. This article will give you a starting point to designing and implementing your own. We will do it with a table that is added to the example database and implement it in ancestor code. The idea is that you should only have to add rows to a table to implement your security. The Table The security table will provide a means to turn on and off controls and menu items as our inherited objects are constructed. Security Login_name varchar(20) PK Application varchar(20) PK Item_type varchar(10) PK Item_name varchar(20) PK Priviledge varchar(2)   Security Column Name Data Type Description Login_name Varchar(20) PK The login name of the user Application Varchar(20) PK The name of the application Item_type Varchar(10) PK Might be window or menu or a type of control in a window like a command button. We will only co... (more)

DataWindow Magic: Master_Detail Object

One of the most useful custom objects that I've ever written is my master_detail object. It holds a prominent place in my toolkit. This article will take you through the steps of how to write one and in the process de-mystify the object. First we want something that looks like Figure 1. Selecting a row in the top DataWindow will display the details in the bottom. I'm sure that you've seen this kind of DataWindow and you've probably written many of them. The key here is not to tell you how to write this but how to simplify every one that you will write in the future. For our exam... (more)

Using the Tag Property – Part 1

Have you ever seen a form that has its own microhelp that changes when a field gets focus? I'm sure you have. You might see a window and at the bottom of the window is a line that says, "OPTIONAL - Enter the employee birth date," when a field is entered. We are going to create a simple automated solution that will allow you to carry the microhelp along in the DataWindow. Take a look at Figure 1. It's a freeform DataWindow with a SQL data source. I chose the Employee table from the sample database that comes with PowerBuilder. I didn't do anything special to it. My goal here is to ... (more)

DataWindow Sorting with Column Headers

This article describes how to create a grid presentation window that allows sorting by clicking on the column header. To begin we need to create a grid DataWindow. I'm selecting just a few columns from the employee table. Here is my sql for the DataWindow in Figure 1. Once we have created it I get the DataWindow painter shown in Figure 2. There are several changes that we need to make. Let's change the status column so it's no longer a set of radio buttons. This is a read-only screen so let's remove the status and add a computed field. To do this let's remove the Status column ... (more)

Advanced DataWindow Sorting

This article provides a means of automating the sorting of DataWindows... not just grid DataWindows as discussed in last month's article, but all DataWindows, regardless of display format. Bear in mind that we are writing programmer tools. When writing for programmers we want to give the programmer the maximum number of options while minimizing the programmer effort. In other words, default as much as possible but allow the programmer to move beyond the defaults. We have several action items to implement: Do the housekeeping to get an application going Create a window for sorting.... (more)