Day 15

Customizing the IntraBuilder IDE

by Ken Henderson


CONTENTS

You'll begin your third week using IntraBuilder by learning to customize the IntraBuilder Integrated Development Environment (IDE). Some of the changes you'll make involve cosmetic alterations to the environment itself-the types and layout of palettes, the general behavior of the IntraBuilder Explorer, and so on. Some involve the specific control of the form designer, and some involve other settings. IntraBuilder allows you to change your development environment to suit your needs in a number of useful ways. I'll cover each of them separately. Some of the things you'll learn to do today include the following:

Let's begin by selecting the Desktop Properties item on the Properties menu.

NOTE
Note that the configuration changes you'll make today affect only the IntraBuilder Designer, not the IntraBuilder Server. This chapter shows you how to customize your development environment; this chapter doesn't delve into customizing server software.

Desktop Properties

Desktop properties are broken into two categories: those relating to file manipulation and those relating to the IntraBuilder Designer application as a whole. By default, the Files tab is selected; this section discusses the options it allows you to configure. Figure 15.1 shows the Files tab of the Desktop Properties dialog.

Figure 15.1 : You specify file-related options on the Files tab of the Desktop Properties dialog.

Current Directory

Setting the Current Directory option specifies the default folder for the IntraBuilder Explorer. When the IntraBuilder Explorer is started, it initially lists files from this folder. You can change the Explorer's current folder by selecting a different one in its Look In drop-down box.

Search Path

The Search Path option allows you to configure a search path for the IntraBuilder Explorer. The Explorer looks here as well as in its current folder when it needs to locate a file.

NOTE
You can specify multiple directories in the Search Path entry box by separating them with semicolons. If you enable the Use Supplemental Search Path option (in the IntraBuilder Explorer Properties dialog), the search path you specify will be displayed in the Explorer's Also Look In drop-down list.

External Editor File Name

Use the External Editor File Name option to set up an external script editor. Because JavaScript files are plain text, you can use virtually any ASCII text editor to edit them. You can use this entry box to specify your own, or simply leave it blank to use the built-in script editor.

Backup Files

You can check the Backup Files option to cause backup files to be displayed by the IntraBuilder Explorer. When you save changes you've made to a file, IntraBuilder saves a backup copy of it in its original folder. Enabling this option causes backup files that are created in this fashion to show up in the IntraBuilder Explorer. You can then open these files from the Explorer.

Output Log

When an output log is set, IntraBuilder writes anything that appears in the results pane to the output log file. You can use the output log and the _sys.scriptOut.writeln() method to help debug applications. The output log is a text file that you can edit after disabling the logging option. (See Figure 15.2.)

You can click the Application tab of the Desktop Properties dialog to configure the IntraBuilder application itself. These options aren't very different from those on the Files page, but Borland obviously felt they were different enough to belong on a separate page. Figure 15.3 shows the Application page.

Figure 15.2 : You can create an output log to capture output from sys. scriptOut.writeln().

Figure 15.3 : You specify IntraBuilder application options on the Application page of the Desktop Properties dialog.

Prompt for Experts

You can use the checkboxes in the Prompt for Experts group to control when IntraBuilder asks whether you'd like to use an expert to create an object. Your choices are Form, Report, and Table. If you check one of these options and later attempt to create the corresponding file type, IntraBuilder presents a dialog asking whether you'd like to create the file using its associated designer or by stepping through a wizard. Experts are wizards that allow you to create objects by simply answering a set of questions. As you learned in Week 1, they do most of the work for you.

Remember Logins

Checking the Remember Logins checkbox tells IntraBuilder to keep use and password information when you attach to a remote DBMS (for example, an SQL database). This alleviates the need to constantly re-supply the login information that's required to access a particular remote database. The Remember Logins checkbox helps you avoid typing mis-takes by retaining passwords to frequently used DBMSs.

Display System Tables

Because many SQL DBMSs include special tables that contain system-level information, IntraBuilder allows you to specify whether these tables should show up in the Explorer's table list. Normally, you won't reference these tables in the database applications you build, so there's usually no reason to include them. If you're building a special type of application that requires direct access to system tables, you can click this option to cause system tables to be displayed in the IntraBuilder Explorer.

SQL Trace

You can display calls made by SQL-Link drivers by checking the SQL Trace option. Use this option to troubleshoot and optimize routines that work with SQL data. SQL Trace has no effect when working with dBASE or Paradox tables. The output from SQL Trace appears in the results pane of the Script Pad. Because the output can be voluminous, you should use an output log when working with SQL Trace. See Day 21, "Building Client/Server Applications," for more information about SQL Trace.

Inspector Outline

By default, properties in the Inspector are displayed in an outline. They're organized into categories that you can double-click to display individual properties. You can uncheck this option to cause the Inspector to display properties alphabetically. You might find that this makes the properties displayed in the Inspector easier to navigate.

Splash Screen

As you might guess, the Splash Screen option configures whether the default splash screen is displayed when you start IntraBuilder. Obviously, IntraBuilder starts slightly more quickly when this option is disabled.

MRU List Size

IntraBuilder retains a list of files that you've recently opened so that you can easily reopen them. You can access this list via the File menu. The MRU (Most Recently Used) List Size option configures how many of these files are retained in the list. The default is five, but you can change it to suit your needs.

Lock

The Lock option enables you to specify whether IntraBuilder should lock database objects you're working on so that others cannot change them while you have them open. This option is checked by default, and you probably shouldn't change it. Allowing others to change objects you're currently working on could have catastrophic results.

Form Designer Properties

IntraBuilder also allows you to customize the behavior of the Form Designer. You can configure the Form Designer by selecting the Form Designer Properties option on the Properties menu. Figure 15.4 shows the Form Designer Properties dialog.

Figure 15.4 : You can configure the Form Designer via the Form Designer Properties dialog.


NOTE
The Form Designer Properties menu option is only present on the Properties menu while you are actually in the Form Designer itself.

Show Grid

The Show Grid option configures whether the Form Designer displays a grid across the background of forms you design. This grid helps you align and size controls on your forms. The grid is a design tool only; it won't be present when you run your form or when a user views it via a Web browser.

Snap to Grid

You use the Snap to Grid option to specify whether options you drop onto a form while designing it "snap" to its underlying grid. When this option is turned on, dropping an object near a grid line causes the object to move or snap to the line. This assists you with aligning controls because it alleviates the need to align them precisely by hand.

Show Ruler

The Show Ruler option toggles whether a ruler is displayed around the perimeter of forms in the Form Designer. Turning the ruler on can assist you with aligning controls and with positioning them on a form.

Grid Settings

In addition to displaying a grid while you design forms, you can also define the type of grid that you want to be displayed. Your options range from Fine to Custom; you can set them to suit your needs. You can specify the custom setting in order to fully configure the grid's granularity.

The View Menu

You can also configure IntraBuilder's development environment via the View menu. Several of the options on the menu affect the appearance and behavior of the development environment.

Toolbars and Palettes

You can click the Toolbars and Palettes option on the View menu to configure the appearance of toolbar buttons and palette tabs. Figure 15.5 shows the Toolbars and Palettes dialog.

Figure 15.5 : You can configure IntraBuilder's toolbars and component palettes via the Toolbars and Palettes dialog.

From this dialog you can specify which toolbars and palettes are to be displayed. You can also configure the types of buttons that are displayed and whether tooltips (fly-over hints) are displayed on your toolbars and palettes.

Customizing Custom Components

IntraBuilder includes a special facility for customizing the appearance of custom components. This facility works similarly to the Visual dBASE facility for configuring custom components and relies on a Component Registry table named IREG0009.DBF (the last four digits of which can vary, based on your Windows country setting).

You can use IREG0009.DBF to configure the placement and appearance of custom components you add to the Component Palette. Figure 15.6 illustrates the layout of the IREG0009.DBF table.

Figure 15.6 : You can supply bitmaps and other information for custom components using the IREG0009.DBF table.

Each row in IREG0009 corresponds to a custom control. (You create custom controls via the Save as Custom option on the File menu.) CLASSNAME corresponds to the name of the custom control. IntraBuilder uses this name to look up the visual properties you've specified for a particular control, so be sure it's exactly right. FILENAME refers to the Dynamic Link Library (DLL) containing the bitmaps you want to utilize. This DLL should contain two bitmaps for each custom control-one for when the button is up, and one for when it's down.

The CATEGORY field specifies which tab the new control is to appear on. If you leave this field blank, your custom control appears on the Custom tab. The GROUP field specifies the group number for the control. Specifying the same number for a set of controls allows you to group them together. If you leave this field blank, controls within a given CATEGORY appear as a single group.

Always exit and restart IntraBuilder after making changes to the Component Registry table. The product may become unstable if you attempt to open the Form Designer while editing the Component Registry table.

Summary

You've learned a number of useful ways for modifying and configuring the IntraBuilder development environment. Specifically, you've learned to configure the types of files displayed in the IntraBuilder Explorer, to establish an external script editor, and to specify the IntraBuilder startup folder and search path. You learned to list properties alphabetically in the Inspector and to turn off the opening splash screen. You learned to suppress Expert prompting and to configure IntraBuilder to retain remote database access passwords. You also learned to enable and disable the inclusion of system tables in the IntraBuilder table list and to control the appearance of custom controls using a custom control registration table.

Q&A

Q:I'm accustomed to the Delphi development environment, particularly its Inspector. I find the hierarchical nature of the IntraBuilder Inspector to be confusing. How can I configure it to work like Delphi's Inspector?
A:Follow these steps:
Select the Desktop Properties item on the Properties menu.
Click the Application tab in the Desktop Properties dialog.
Uncheck the Inspector Outline option. This causes the properties listed by the inspector to be listed alphabetically rather than categorically.
Q:I'm not seeing the Custom tab when I add a custom component to the Component Palette. In fact, I don't see any tabs at all. What could be causing this?
A:The Custom tab only appears when you set up custom components that do not specify their own tab in the Component Registry table. If you have set up a custom component, you need to check the Show Tabs option in the Toolbars and Palettes dialog on the View menu.

Workshop

The Workshop section provides questions and exercises to help you get a better feel for the material you learned today. Try to answer the questions and at least think about the exercises before moving on to tomorrow's lesson. You'll find the answers to the questions in Appendix A, "Answers to Quiz Questions."

Quiz

  1. What's the name of the dBASE table in which you set up bitmaps for custom components?
  2. In what IntraBuilder dialog do you specify an alternate script editor?
  3. In IntraBuilder, where do you configure which toolbars and palettes are displayed?
  4. How do you turn off IntraBuilder's Expert prompt for forms?
  5. How can you prevent other users from changing the tables with which you're currently working?
  6. How do you toggle the display of the status bar?

Exercises

  1. Create a custom component, add it to the Component Palette, and then configure it to use a custom bitmap.
  2. Toggle the Snap to Grid option and check out the effect this has on components you drop into place while designing a form.
  3. Configure a search path, and then configure the IntraBuilder Explorer so that it displays your search path below the Look In drop-down list box.
  4. Specify an external script editor, and then open a script for editing to test the execution of your editor.