Richard (Rik) Brooks

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

Top Stories by Richard (Rik) Brooks

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 show you how to automate a microhelp. When PowerBuilder put the columns on the DataWindow painter, the tab was automatically set. I just left it at the default. Then I created a window and threw the DataWindow into it. I threw a custom object on the window and associated it with the DataWi... (more)

Using the Tag Property – Part 3

This is the third and final part of a series presenting a proposal for the use of the tag property of DataWindow columns. My original thought was to provide a means to automatically set a microhelp for each column. Of course, if you are using an MDI application you have a function to set the microhelp, but that function is only available in MDI. If you are using any other application type, then this is not available to you. Even if you do have an MDI, I have found that the microhelp is not as useful as I would like. The microhelp is always on the frame, nowhere near the column. ... (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)

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)

The PostOpen Event – Why It Is So Important

Normally I try to write applications on the DataWindow or Appeon but every now and then I get a question that makes me sit back and say, "Huh?" In this case the question concerns the PostOpen event. I've seen that event named different things: ue_post_open, postOpen, post_open, ue_postOpen, etc. It has, as far as I can see, always had post and open in the name of the event. Further, just about every framework that I've ever seen has had that event in the base window. The question that I was asked was, "Why is that event there?" The programmer wanted to know why there was code in t... (more)