UI Catalog

As you learn more about NewBASIC, you'll learn about the components when you end up using each component in the Builder. The rest of this chapter will consist of descriptions of the various pieces the Builder's features such as the

The Component Palette

The Component Palette allows you to add new components to your program. To add a new component to your program, press the appropriate button in the Component Palette, then click somewhere on the Form to place the new component. (If you have added a Dialog or a Floater component to your program, then you may click on that Dialog or Floater to place the new component there.)

The Component Palette will only show you one group of component types at a time. The first component in the Palette is a popout list which you may use to choose which group of component types should be available.

The + button in the Basic UI section is a special button: it does not add a new component. If you have pressed one of the other buttons and the Builder is waiting for you to click to place a new component on the form, press the + button to specify that you don't want to add a new component after all.

The Form

To select a component, click it with the mouse.
To change... Method of changing component
position Select and click-drag it. If you drag it within the bounds of a Group, Dialog, Clipper, Form, or Floater, it will become a child of that Group, Dialog, Clipper, Form, or Floater.
size Select it, then position the mouse pointer close to its edge. The mouse pointer picture changes to an arrow. Click-drag to change the size.
properties Bring up the Properties Box by choosing Component Properties from the Window menu. For more information, see Properties Box.
handler Bring up the Editor window (double-click the component or choose Editor from the Window menu). For more information about using the Editor window, see The Editor Window.

The Form is itself a component. For information about the Form component type, see The Form.

The Main Window

The Main Window contains buttons used when debugging and some menus.

Press the Run button to test your program. While you are testing, you will not be able to change your program: you will not be able to select components on the form or change your BASIC code in the Editor. When you are done testing, press the Stop button.

The File Menu

This menu contains the following items.

New Module
Discards the current program and brings up a new program.
Open
Discards the current program and allows you to bring up an existing program--a .BAS file you've previously saved.
Save
Saves your work to the file you chose earlier with Save As....
Save As...
Allows you to choose a new file location and name in which to save your work. You may choose a directory in which to save your work and a filename. Normally, you will choose a file name with the .BAS suffix and press the dialog box's Save button.
Build
This item brings up a submenu which has items allowing you to build compiled versions of your program. This is used when you are writing a program that will be loaded by other programs.
Exit
Exits the Builder. To Exit to DOS, choose Exit to DOS from the Express menu.
Compile All
You should never need to use this. In the past, it has come in handy for working around certain bugs.

The Edit Menu

The Edit menu can be used for cutting, copying, and pasting text in the Editor's text window. However, this will only work if you have pinned the edit menu. That is, you must open the Edit menu and choose the first item (which looks a little like a thumbtack). This turns the menu into a separate window. Now you can use the Edit menu functions to cut, copy, and paste text in the Editor window.

The Debug Menu

These functions are only useful when debugging (see Debugging). In general, these items are used to peek at the values of your program's variables while it is paused.

The Window Menu

This menu allows you to bring up other important windows.

Toolbox
Brings up the Component Palette (see The Component Palette).
Component Properties
Brings up the Properties Box (see Properties Box).
Editor
Brings up the Editor, by which you may edit BASIC routines. For more information about what you can do with NewBASIC, see The NewBASIC Language.

The Component Properties Box

To change the properties of the selected component, use the Properties box.

For any component, there may be up to three kinds of properties to change: General, Children, and Specific. To edit properties of one kind, press the appropriate button, work with the gadgetry that appears in the Properties box, and press the Apply button.

General Properties

The General properties box area contains properties used by most components that draw themselves on screen. These properties are described in detail in this section. For more information about these properties, see the chapter called Component Types.

The Visible checkbox allows you to change the component's visible property. Turning this off will make the component disappear. For more information about this property, see visible integer (0-1). Normally, this flag will be 1; if it is zero, then the component will be invisible. Also, all of its children will be invisible.

The Enabled checkbox allows you to change the component's enabled property. Turning this off will make the component appear grayed out and prevent the user from changing the component's data. For more information about this property, see enabled integer (0-1). Normally, this flag will be 1; if it is zero, then the user will not be able to interact with the component, and the component will appear grayed-out.

Caption Text allows you to change the component's caption property. The caption is the name by which the component displays to identify itself to the user. For more information about this property, see caption string, the text caption for the component. For example, an OK button's caption is "OK."

The Width and Height choices allow you to change the component's sizeHControl and sizeVControl properties. These properties determine how the component will try to size itself. Sometimes these properties may be overridden by those of the component's parent or children components. For more information about these properties, see sizeHControl integer (0-3). Using this property, you can base a component's width on that of its child or parent components.

The Apply button applies the property changes to the component.

Children Properties

Children properties are strange: NewBASIC has various tile properties which allow components with children to control how they arrange those children. This makes it convenient to lay out your interface with components neatly aligned with one another.

Only some kinds of component types may have children: Forms, Groups, Dialogs, Floaters, and Clippers. If the selected component is not of one of these types, the Children area of the Properties box will be greyed out so you don't accidentally begin assigning Children properties to these types.

The Tile option allows you to change the component's tile property. If this is turned on, then the component will arrange its children geometrically. Otherwise, the component will let its children find their own positions. For more information about this property see tile integer (0-1).

The Layout option allows you to change the component's tileLayout property. This property specifies whether the component should arrange its children horizontally or vertically. For more information about this property, see tileLayout integer (0-1).

The Align Horizontal and Align Vertical choices allow you to change the component's tileAlign and tileVAlign properties. Your choice determines where the component will position its children relative to its edges. For more information about these properties, see tileHAlign integer (0-3).

The Tile Spacing number allows you to change the component's tileSpacing property. This property determines the amount of space the component will keep between its children. For more information about these properties, see tileSpacing integer (0-63).

The Horiz. Inset and Vertical Inset numbers allow you to change the component's tileHInset and tileVInset properties. These properties specify the margin the component should maintain between its edges and the area in which it places its children components. for more information about these properties, see tileHInset integer (0-63).

Specific Properties

The Specific properties box area is only enabled for components of a very few types. It contains gadgetry which allow you to change properties specific to components of the type you have selected. For information about the properties for any given component type, see that component's information in the Component Types reference section (starting at Component Types).

Editor Window

You will use the Editor window to edit your BASIC code. The features of this window are described in The Editor Window.