Main BASIS Page
Main Advantage Page
This Issue's Table of Contents
Randolph Wrestles With ResBuilder Previous Article Table of Contents Next Article

By William Baker

Several months ago I told about how Randolph could use TAOS: The Developer's Workbench® to generate simple GUI screens (see "Bringing Visual PRO/5 to TAOS," The BASIS Advantage Magazine, Vol. 1. No. 2). Recently Randolph surprised me by saying that he had studied the generated code and learned how to create GUI screens using Visual PRO/5™ mnemonics. Not surprisingly, he was dissatisfied with the results:

I pointed out that without too much effort he could change the sizes and locations of the controls to make a nicer screen, but he said that he had spent several hours on the code and wasn't going to spend any more time on it.

"Whatever possessed you to start writing Visual PRO/5 mnemonics, anyway?" I asked.

"Nothing more than a desire to keep a customer happy, though obviously that's devilishly hard, especially when that customer is Walt. Walt didn't like the GUI screens TAOS created because they didn't have the boxes around the prompts that he was used to. So I fooled around with the 'BOX' mnemonic, then discovered there was no way to get it to print a box on a GUI screen. After reading the manual for several hours, I finally found the 'GROUPBOX' mnemonic, but as you see it doesn't work very well...and Walt wants black lines on his boxes, not the gray lines that 'GROUPBOX' draws."

"I don't know if you'll be pleased to hear this or disgusted, but BASIS has released a visual tool that will save you from having to write mnemonics to create GUI screens. You can lay out the screens interactively-a bit like you do in the TAOS forms generator, but you're laying out GUI screens instead of character-based screens."

Randolph sighed wearily. "I don't know whether to be pleased or disgusted, but the thought of learning yet another piece of software definitely makes me feel tired. If you can run it here, I guess I can look at it."

"I just got this off the ftp site, so I don't know much about it," I said as I reached for my mouse. "It's called 'ResBuilder'."

"Is that 'Res' short for 'Reservation'?" Randolph asked.

"All I can figure is it must be short for 'Resource,' which is what BASIS calls the GUI screens created with its tools."

When ResBuilder came up, we were faced with a tree control labeled NewResFile at the top and branches labeled Form, Child Window, and Menu -- which made sense to me, because each resource would naturally include one or more forms and zero or more child windows and menus. So I tried to figure out what to do next, but when I tried clicking the menu choice for New Resource File and various parts of the tree, all I could do was make the tree display expand and contract.

Finally, Randolph suggested that I try one of the tool buttons with sparks drawn on it, which turned out to be the button for creating new forms. (Sometimes, Randolph is handy to have around.) That brought up a form labeled Form 1 with a default form ID of 101. By right-clicking on the background, I was able to bring up a Properties sheet that let me set the form's attributes, such as its title, dimensions, colors, and position.

Once the empty form was on the screen, a new toolbar came up for adding controls. Each control we put on the form has its own Properties sheet, which we accessed by selecting the control and right-clicking on it. (At first, Randolph tried to get to the Properties sheet by right-clicking on the controls without selecting them first, but after a while he figured out that he was bringing up the Properties sheet for the form itself, not for the controls.)

After playing around for awhile, Randolph set to work making a real form. As you can see, it's not going to win any design prizes, but even Randolph had to concede it looked better than his attempt to use PRO/5® mnemonics, and it took less than half as much time to put together.

Randolph was disappointed that his controls weren't quite lined up properly. I discovered in the readme file that alignment wasn't implemented yet, so Randolph stubbornly tried to place his controls by hand. He kept missing by five or ten pixels, and ignored my suggestion that he edit the location and dimensions of each control in the Properties sheet.

I also pointed out that if he could lay out his controls on a grid, they would be a lot easier to line up, and I showed him the Grid Setting... dialog under the Options menu. This dialog let us set the size of the grid and offered options labeled Snap On-To grid and Snap On-To size. We turned on the To grid option, but that didn't draw a grid or make any snapping happen. After a while, we discovered that grid display and snapping can be checked on and off in the Layout menu as well as from a pair of buttons at the bottom of the ResBuilder screen. Randolph had no idea what it meant to snap something "to size." After some experimenting, we discovered that if Grid and Snap On were checked under the Layout menu and the Snap On - To size option was set under Options-Grid Setting..., our controls expanded to the nearest grid intersections when they were sized. This made it easy for Randolph to get consistent widths and heights on all his controls.

By the end of the day, Randolph had designed a fairly nice screen and saved it on his diskette. Then he came up with the next obvious question: "Now that I have a ResBuilder screen ready to go, what do I do with it?"

"Well," I answered, "that's the 64,000 carrot question isn't it? I think you'll need to go take a long nap before you start dealing with that one."

Previous Article Table of Contents Next Article
Copyright 1999, BASIS International Ltd. All rights reserved.
Terms of Use