home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Black Box 4
/
BlackBox.cdr
/
genapps
/
hp22dc.arj
/
USRGUIDE
/
BTNSFLDS.TXT
< prev
next >
Wrap
Text File
|
1991-05-16
|
59KB
|
1,587 lines
________________________________________________________________________
Chapter 14: Buttons and Fields 241
________________________________________________________________________
CHAPTER 14: BUTTONS AND FIELDS
INTRODUCTION
Suppose you have designed your own pad and have mastered using
HyperPAD's painting tools. You probably created some pages and
backgrounds with attractive screen layouts. However, now you want your
pad to be more functional than just a collection of interesting screens.
Your first step is to add buttons and fields to your pad. Buttons and
fields are the focal point of all activity in a pad. Placed on pages and
backgrounds, buttons can be selected to perform actions that you define,
such as changing pages or running other DOS programs. Placing fields on
your pages and backgrounds lets you define where the user will be able
to type information. In short, buttons and fields make your pad come to
life.
________________________________________________________________________
Chapter 14: Buttons and Fields 242
________________________________________________________________________
BUTTONS
A button is an object located on the page or background that the user
can select to carry out an action. You can create buttons that allow the
user to:
0 Go to another page
0 Go to another pad
0 Perform calculations
0 Run other DOS programs
FIELDS
Fields are rectangular editing areas located on the page or background
into which textual information can be typed. Fields can contain:
0 Numbers
0 Names and addresses
0 Traveling expenses
0 A list of files on your hard disk
0 Information retrieved for further processing
A field can contain up to 30,000 characters. Every field can hold more
text than will fit within its borders.
BUTTON AND FIELD PROPERTIES
Buttons and fields can be placed anywhere on a page or background. Each
has defining characteristics, or properties, used to control its
appearance and behavior. Some examples of button and field properties
are:
0 Location
0 Color
0 Name
0 Accelerator key
By adjusting an object's properties, you can design attractive objects
that behave appropriately for your pad.
________________________________________________________________________
Chapter 14: Buttons and Fields 243
________________________________________________________________________
WHY USE BUTTONS AND FIELDS?
Buttons and fields can be added to a pad to increase its functionality.
Most of the interaction between the user and the pad occurs through the
use of buttons and fields. As a pad author, you will use buttons and
fields to:
0 Create links between pages and pads
0 Hold information that the user can manipulate
0 Automate repetitive tasks
0 Display information for instructional purposes
For example, you can create a database by adding fields to the
background of a new pad. By adding pages and information to this pad,
you are essentially adding records to the database.
Once your database includes many pages, you may want to automate
navigation, making it easier to move between pages. Simply add buttons
on the background and link them to other pages in the database.
Suppose that you then wanted to take some notes and attach them to a
specific page in the pad. Simply add a field to that page.
The procedures described in this chapter give you all the information
necessary to perform tasks like those mentioned above.
DESIGNING WITH BUTTONS AND FIELDS
Using the Selector tool, objects can be positioned, cut, copied, pasted,
edited, and duplicated. Combined with the painting tools, objects on the
page and background make your pad functional, something that users can
browse by clicking on buttons and typing into fields. This chapter will
also explain how to use the Selector tool to create and modify objects.
________________________________________________________________________
Chapter 14: Buttons and Fields 244
________________________________________________________________________
HOW BUTTONS AND FIELDS ARE ORGANIZED
OBJECT LAYERING
Buttons and fields are created on either the page or the background.
Regardless of whether they are located on the page or background,
objects are layered according to the order in which they were created.
For example, the first object you create will be on layer 1, the next on
layer 2, and so on.
Objects on higher-numbered layers overlap those on lower-numbered
layers. Objects on the lower-numbered layers are closest to the page,
while objects on the higher-numbered layers are farther away.
┌───────────────────────────────────────────────────────────────────────┐
│ │
│ **** The Printed Documentation has a picture or screen shot here **** │
│ │
└───────────────────────────────────────────────────────────────────────┘
BACKGROUND OBJECTS
Background buttons appear on every page that use that background. They
provide access to those functions you want available on every page that
uses that background. One example is a navigation button, such as a Home
button, that, when selected, takes a user to the Home pad, or paging
buttons which let the user move to the next or previous page.
Background fields are templates for holding text information. They
define the area and position in which text can be placed on the page.
Each page maintains its own private contents for the background fields.
________________________________________________________________________
Chapter 14: Buttons and Fields 245
________________________________________________________________________
The following diagram shows how the background fields act as templates
for text stored on the page:
┌───────────────────────────────────────────────────────────────────────┐
│ │
│ **** The Printed Documentation has a picture or screen shot here **** │
│ │
└───────────────────────────────────────────────────────────────────────┘
Background fields are particularly useful for creating databases. The
background containing the fields acts as the database structure or
definition, and each page stores one record in the database.
EDITING OBJECTS USING THE SELECTOR TOOL
The Selector tool allows you to work with buttons and fields. Using the
Selector tool, you can resize, move, cut, copy, paste, delete, and edit
objects.
To use the Selector tool, the user level must be set to either authoring
or scripting. At the authoring level, you can create, move, resize, and
edit the properties of objects. The scripting level gives you all the
capabilities of the authoring level, plus the ability to edit an
object's script.
________________________________________________________________________
Chapter 14: Buttons and Fields 246
________________________________________________________________________
To change the user level to scripting:
1. Select the Protect command from the File menu (ALT+F, T).
2. Select the scripting option (ALT+I), then press ENTER.
Now that the user level is set to scripting, you can use the Selector
tool.
SELECTING A BUTTON OR FIELD
To select a button or field with the keyboard:
1. Choose the Selector command from the Tools menu (ALT+T, S). The
shortcut for this command is CTRL+S.
Selected buttons and fields are indicated with anchors on each corner:
┌───────────────────────────────────────────────────────────────────────┐
│ │
│ **** The Printed Documentation has a picture or screen shot here **** │
│ │
└───────────────────────────────────────────────────────────────────────┘
If there are no objects to edit, the cursor will not move until you
create an object or move to a page with objects.
2. If the object you want to select is located on the background,
select Background from the Edit menu (ALT+E, B).
You can tell that you are editing the background if:
"BKGND" appears on the status bar.
The Background command is checked on the Edit menu.
3. Press TAB or SHIFT+TAB to place the anchors on the next or previous
object until the one you want is selected.
If you defined an accelerator key for the object, you can press ALT and
the accelerator key to quickly select the object.
To select a button or field with the mouse:
1. Choose the Selector tool from the Tools menu.
2. Point to the object and click the left mouse button.
________________________________________________________________________
Chapter 14: Buttons and Fields 247
________________________________________________________________________
CREATING OBJECTS
You can create buttons or fields by selecting the New Button or New
Field command from the Objects menu. The shortcuts for these commands
are:
To: Press:
----------------------------------
Create a new field CTRL+F3
Create a new button ALT+F3
After an object is created, it's placed in the center of the screen
ready to be positioned and resized.
ADDING FIELDS TO THE BACKGROUND
Fields, like buttons, can be added to either the page or the background.
Each field acts as a storage area for information. When added to the
page, both the field and its text are unique to that page--they have no
effect on any other page in the pad.
Background fields, however, can be shared by many pages. Each page that
uses a specific background maintains its own contents for the fields on
that background.
Creating fields on the background is no different from creating fields
on the page. However, if you create or delete any fields on a
background, when you finish editing the background, HyperPAD will
display the following message:
┌───────────────────────────────────────────────────────────────────────┐
│ │
│ **** The Printed Documentation has a picture or screen shot here **** │
│ │
└───────────────────────────────────────────────────────────────────────┘
________________________________________________________________________
Chapter 14: Buttons and Fields 248
________________________________________________________________________
Rebuilding the pad involves updating every page that uses a particular
background with new field information. This operation happens
automatically when you access a page. However, to speed access to these
pages, you may want to rebuild the pad all at once.
If you respond <<Ok>> to this dialog box, the pad will be rebuilt.
If you select <Cancel>, the pages that use the background will not be
updated until the next time those pages are accessed.
MOVING OBJECTS
When you create a button or field, it is placed in the center of the
screen. Your next step is to reposition the object in the appropriate
location on the page or background.
To move a selected object with the keyboard:
To: Press:
--------------------------------------------------------
Move the object by one line Arrow keys
Move the object by larger amounts CTRL+Arrow keys
Move the object to the left edge HOME
Move the object to the right edge END
To move an object with the mouse:
1. Point to the object.
2. Press the left mouse button and drag the object to the desired
location.
RESIZING OBJECTS
After positioning an object, you can alter its size. An object can be as
small as one row by one column, or as large as the screen.
To resize an object with the keyboard:
1. Press ALT+TAB repeatedly until the cursor reaches the corner you
want to stretch.
2. Press SHIFT+arrow keys to stretch the corner in the direction of the
arrow key.
________________________________________________________________________
Chapter 14: Buttons and Fields 249
________________________________________________________________________
The following keys can also be used to resize objects:
To: Press:
--------------------------------------------------------------------
Stretch a corner faster with the arrow keys CTRL+SHIFT+Arrow keys
Stretch a corner to the left edge SHIFT+HOME
Stretch a corner to the right edge SHIFT+END
To resize an object with the mouse:
1. Point to the corner that you want to stretch (place the mouse
pointer on top of one of the four anchors).
2. Press the left mouse button and drag the corner to its new location.
Note: Dragging the mouse away from the center makes the object larger,
while dragging the mouse toward the center makes it smaller.
COPYING AND PASTING OBJECTS
HyperPAD allows you to copy buttons and fields from one pad to another
using the Cut, Copy, and Paste commands. Once an object has been copied,
it can be placed anywhere--on another page or background in the same
pad, or even on a page or background in another pad.
When you copy an object, it is placed into the clipboard for later use.
Since only one item at a time can occupy the clipboard, the previous
contents of the clipboard are lost. When you paste the object from the
clipboard, an exact copy will be placed onto the page or background in
the same location as the original.
Note: The clipboard is a temporary storage area. When you leave
HyperPAD or run another program from HyperPAD, the clipboard will be
emptied.
________________________________________________________________________
Chapter 14: Buttons and Fields 250
________________________________________________________________________
CUSTOMIZING WITH COPY AND PASTE
The Copy and Paste commands provide powerful shortcuts for customizing
your pads. You can save time by making use of buttons and fields that
already exist in another pad. You don't have to understand how a button
or field works; simply copy an object that already does what you want,
then paste it into the pad you're working with.
For example, the Phone pad doesn't have a button that takes you directly
to your Daily Planner. You can create a button to do this by copying the
Daily Planner button from the Pads screen to the background of your
Phone pad. Then, when you want to go directly to the Daily Planner, you
can just select this button.
To use a different example, suppose you want to add a mechanism to the
Home pad that will enable you to take a quick note. You can easily
accomplish this task by copying a field from the Ideas pad and pasting
it onto your Home pad.
To copy an object with the keyboard:
1. Select the object to be copied.
2. Select Copy from the Edit menu (ALT+E, C). (The shortcuts for this
command are CTRL+C or CTRL+INSERT.)
To copy an object with the mouse:
Hold down CTRL, point to the object, then press the left mouse button
and drag the object to its new location.
Note: The exact name of the Copy command on the Edit menu depends on
the selected object. If a button is selected, the displayed command is
"Copy Button"; otherwise, the displayed command is "Copy Field."
COPYING ONLY PROPERTIES
A special copying feature available to mouse users allows you to copy an
object's properties and apply them to another object of the same type
without copying the location property or the script.
For example, suppose that you just created a field in the Phone pad and
want it to look exactly like all the other fields on the same page.
Instead of duplicating the field (by copying and pasting it), you can
just copy the properties.
Note: You can only copy properties to another object of the same type
(i.e., between two buttons or between two fields).
________________________________________________________________________
Chapter 14: Buttons and Fields 251
________________________________________________________________________
To copy an object's properties:
1. Select the object whose properties you want to copy.
2. Point to the object to which the properties to be copied (don't
click on it yet).
3. While holding down the CTRL and SHIFT keys, click the left mouse
button (CTRL+SHIFT+click).
CUTTING OBJECTS
The Cut command allows you to remove a button or field from the current
page or background and store it in the clipboard for reuse.
To cut an object:
1. Select the object to be cut.
2. Select Cut from the Edit menu (ALT+E, X). The shortcuts for this
command are CTRL+X and SHIFT+DEL.
The selected object will be copied into the clipboard and removed from
the screen. The object can then be recalled with the Paste command.
PASTING OBJECTS
Once you have stored a copy of an object in the clipboard using either
the Copy or Cut command, you can retrieve it with the Paste command.
HyperPAD allows you to paste an object from the clipboard to the same
page or background from which it was copied, to another page or
background in the same pad, or to a different pad. You can paste as many
copies of a stored object as you want.
Note: Pasted objects have all the same properties, including screen
location and script, as the original object.
To paste an object:
1. Navigate to the page on which you want to paste the object (this
could be on the same page, a different page, a background, or a
different pad).
2. Select the Paste command from the Edit menu (ALT+E, P). The
shortcuts for this command are CTRL+V or SHIFT+INSERT.
Note: The name of the Paste command changes according to what is being
pasted. If you're pasting a field, the displayed command is "Paste
Field;" otherwise, the displayed command is "Paste Button."
________________________________________________________________________
Chapter 14: Buttons and Fields 252
________________________________________________________________________
DELETING OBJECTS
Use the Delete command to remove an object from the page or background
without saving a copy in the clipboard.
To delete an object:
1. Select the object to be deleted.
2. Select the Delete command from the Edit menu (ALT+E, D). The
shortcut for this command is DEL.
The selected object is removed from the page or background, without a
copy being placed in the clipboard.
Note: A deleted object can never be recovered. Therefore, you may want
to make a backup copy of your pad before deleting many objects, in case
you need to recall them (use the Save a Copy command (ALT+F,S) on the
File menu).
CLONING OBJECTS
The Clone command allows you to quickly place a copy of an object on the
same page as the original, without copying it to the clipboard. Cloned
objects overlap the object from which they were cloned, offset slightly
down and to the right.
This command avoids the two-step process of copying the object into the
clipboard and then pasting it. In addition, the clipboard's contents are
preserved.
To clone an object:
1. Select the object to be cloned.
2. Select Clone from the Objects menu (ALT+O, C). The shortcut for this
command is CTRL+D.
A clone of the original object appears on-screen. Note: The new object
is selected, so that you can modify it immediately.
LAYERING OBJECTS
Each object created on a page or background is contained on an invisible
layer. All of these layers are stacked on top of one another. If one
object is on a higher layer than another, it will cover that object
wherever they overlap.
________________________________________________________________________
Chapter 14: Buttons and Fields 253
________________________________________________________________________
All buttons and fields are layered on top of one another. In addition,
each object is numbered by its position relative to the other layered
objects of the same type.
┌───────────────────────────────────────────────────────────────────────┐
│ │
│ **** The Printed Documentation has a picture or screen shot here **** │
│ │
└───────────────────────────────────────────────────────────────────────┘
When you create a new button or field, a new layer to hold that object
is placed on top of all existing object layers. You can determine the
layer of a given button or field by examining the Object Info dialog box
for that object. This is discussed later in this chapter.
The layer of a button or field can be changed using the Bring Closer and
Send Farther commands on the Objects menu. These commands move the
selected button or field up or down one layer.
To move an object up one layer:
1. Select the object that you want moved to a higher layer.
2. Select the Bring Closer command from the Objects menu (ALT+O, R).
The shortcut for this command is PLUS on the numeric keypad.
The selected object is moved one layer farther from the page or
background.
________________________________________________________________________
Chapter 14: Buttons and Fields 254
________________________________________________________________________
To move an object down one layer:
1. Select the object you want moved to a lower layer.
2. Select the Send Farther command from the Objects menu (ALT+O, S).
The shortcut for this command is MINUS on the numeric keypad.
The selected object is moved one layer closer to the page or background.
COVERING OBJECTS
A common use for layering is to cover other objects. Objects completely
covered by other objects are not selectable by the pad user.
To cover an object:
1. Select the New Button (ALT+O,B) or New Field (ALT+O, F) command from
the Objects menu to create a new button or field.
The new object will be placed in the center of the screen.
2. Move the new object over the object to be covered.
3. Resize the object, if necessary, to completely cover the desired
object.
________________________________________________________________________
Chapter 14: Buttons and Fields 255
________________________________________________________________________
The following picture illustrates a pad with two background buttons that
take you to the previous and next pages. On the first page of your pad,
however, having the Prev button doesn't make sense because there is no
previous page. Thus, you may want to cover this button up with an opaque
button on page 1.
┌───────────────────────────────────────────────────────────────────────┐
│ │
│ **** The Printed Documentation has a picture or screen shot here **** │
│ │
└───────────────────────────────────────────────────────────────────────┘
________________________________________________________________________
Chapter 14: Buttons and Fields 256
________________________________________________________________________
PROPERTIES OF OBJECTS
Until now we have focused on altering objects in relation to each other
on the screen. This manipulation of objects is important when designing
screen layouts. You can further customize your buttons and fields by
altering their properties.
Properties determine not only how an object looks--i.e., its color or
edge type--but also how it responds to actions the user performs.
HyperPAD allows you to modify an object's properties using the Button
and Field Info dialog boxes.
The following sections describe how to customize your buttons and fields
by modifying the properties listed in these dialog boxes.
THE FIELD INFO DIALOG BOX
All of a field's properties are accessible through the Field Info dialog
box. From this dialog box, you can adjust the properties that control a
field's color, edge type, and default behavior.
GETTING THE FIELD INFO DIALOG BOX
With the keyboard:
1. Select the desired field.
2. Select the Field Info command from the Objects menu (ALT+O, I). A
shortcut for this command is to press ENTER or SPACE.
The Field Info dialog box appears on the screen.
With the mouse:
To access the Field Info dialog box with the mouse, select the field,
then double-click the left mouse button.
________________________________________________________________________
Chapter 14: Buttons and Fields 257
________________________________________________________________________
The Field Info dialog box is shown below.
┌───────────────────────────────────────────────────────────────────────┐
│ │
│ **** The Printed Documentation has a picture or screen shot here **** │
│ │
└───────────────────────────────────────────────────────────────────────┘
The following diagram shows a field with some of its field properties.
┌───────────────────────────────────────────────────────────────────────┐
│ │
│ **** The Printed Documentation has a picture or screen shot here **** │
│ │
└───────────────────────────────────────────────────────────────────────┘
The descriptions that follow explain how each of the available field
properties modifies the appearance and behavior of the field.
________________________________________________________________________
Chapter 14: Buttons and Fields 258
________________________________________________________________________
FIELD NAME
This text box displays the name of the field. If the Show name property
is on, then the field name will appear either on top or to the left of
the field (depending on the value of the Name position property). The
field name text box is empty for a new field.
Note: The field name can be used to refer to a field from within a
script, so choose a meaningful name that you can remember.
FIELD NUMBER
This number indicates the field's layer in relation to the other fields
on the page or background.
Note: The field number can be used to refer to a field from within a
script.
FIELD ID
The ID is a unique number assigned to a field when it is created. This
number will never change.
Note: The ID is the only way to uniquely identify a field from within a
script. Unique IDs are assigned to each field on a page, but fields on
different pages may have the same ID.
________________________________________________________________________
Chapter 14: Buttons and Fields 259
________________________________________________________________________
ALIGN
The Align option controls the justification of text within a field.
┌───────────────────────────────────────────────────────────────────────┐
│ │
│ **** The Printed Documentation has a picture or screen shot here **** │
│ │
└───────────────────────────────────────────────────────────────────────┘
LEFT: Aligns each line of text flush with the left edge of the field.
This is the default.
RIGHT: Aligns each line of text flush with the right edge of the field.
CENTER: Centers each line between the left and right edges of the
field.
NAME POS
The Name pos (name position) property determines the positioning of the
field name that appears if the Show name property is on. The name can be
placed either on top or to the left of the field. By default, the name
is placed to the left.
┌───────────────────────────────────────────────────────────────────────┐
│ │
│ **** The Printed Documentation has a picture or screen shot here **** │
│ │
└───────────────────────────────────────────────────────────────────────┘
________________________________________________________________________
Chapter 14: Buttons and Fields 260
________________________________________________________________________
SHOW NAME
When this option is on, the field's name is displayed in the position
designated by the Name pos property.
WITH EDGE
This property determines whether the field is drawn with a border. The
edge displayed around the field is determined by the value of the Edge
type property. The color of the border matches the Border Color setting
(if the field is not transparent).
┌───────────────────────────────────────────────────────────────────────┐
│ │
│ **** The Printed Documentation has a picture or screen shot here **** │
│ │
└───────────────────────────────────────────────────────────────────────┘
If the With edge property is on, scrolling and list box fields are
displayed with a scroll bar on their right edge. If you turn off the
With edge property, the scroll bar will not be visible.
HILITE IF FOCUS
This property determines whether the field is highlighted when it has
the focus. When Hilite if focus is on, the field will be highlighted
using the color specified by Hilite Color.
If this property is not on, editing can begin as soon as the field
receives the focus. Otherwise, the user must press F2 to remove the
highlight and begin editing.
SCROLLABLE
This setting determines whether the field can hold more information than
can be contained within the physical confines of the field's rectangle.
When Scrollable is on, the text within the field can be scrolled to
display text located below the visible area of the field.
________________________________________________________________________
Chapter 14: Buttons and Fields 261
________________________________________________________________________
LOCK TEXT
When this property is on, a read-only field is created. If you don't
want your field to be edited or scrolled through, activate this
property. Locked text fields do not receive the focus.
STYLE
The Style options control the type of field. The style can be set to
Transparent, Scrolling, Opaque, and List box. The default style is
Opaque.
OPAQUE: This option creates a nontransparent field. The color of Opaque
fields is determined by the Fill and Border Color settings.
┌───────────────────────────────────────────────────────────────────────┐
│ │
│ **** The Printed Documentation has a picture or screen shot here **** │
│ │
└───────────────────────────────────────────────────────────────────────┘
TRANSPARENT: This option creates a transparent field. All characters,
paint, and objects behind the field will be visible.
SCROLLING: Scrolling fields are opaque, with a scroll bar on the right
edge. A mouse is required to use the scroll bar.
┌───────────────────────────────────────────────────────────────────────┐
│ │
│ **** The Printed Documentation has a picture or screen shot here **** │
│ │
└───────────────────────────────────────────────────────────────────────┘
________________________________________________________________________
Chapter 14: Buttons and Fields 262
________________________________________________________________________
LIST BOX: List box fields contain a list of items that can be marked
and unmarked using SPACE. Text within a list box field is not word
wrapped.
┌───────────────────────────────────────────────────────────────────────┐
│ │
│ **** The Printed Documentation has a picture or screen shot here **** │
│ │
└───────────────────────────────────────────────────────────────────────┘
In order to get information into a list box:
1. Set the style of the field to Opaque.
2. Type text into the field, pressing ENTER at the end of each line.
3. Set the style of the field back to List box.
BORDER COLOR
This property controls the attribute used to display the field's border
(if the field is not transparent and the With edge property is on). The
default is light grey on black.
FILL COLOR
This property controls the color used to display the field's interior
(if the field is not transparent). The default is light grey on black.
HILITE COLOR
This property controls the color used to display the field when the
field receives the focus (if the Hilite if focus property is on). The
default is black on light grey.
________________________________________________________________________
Chapter 14: Buttons and Fields 263
________________________________________________________________________
EDGE TYPE
This property controls which edge type is displayed as a field's border
(if the field's With edge property is on). Choose among 15 edge types.
The default edge type is 1 (single line).
┌───────────────────────────────────────────────────────────────────────┐
│ │
│ **** The Printed Documentation has a picture or screen shot here **** │
│ │
└───────────────────────────────────────────────────────────────────────┘
NAME COLOR
The Name Color option controls the color used to display the field's
name (if the Show name property is on). The default is black on light
grey.
SCRIPT
This option opens the field's script in the Script Editor window.
THE BUTTON INFO DIALOG BOX
All button properties are accessible through the Button Info dialog box.
From this dialog box, you can adjust properties that control the
button's color, edge type, and default behavior.
USING THE BUTTON INFO DIALOG BOX
To access the Button Info dialog box with the keyboard:
1. Select the desired button.
2. Select the Button Info command from the Objects menu (ALT+O,U). A
shortcut for this command is to press ENTER or SPACE.
The Button Info dialog box appears on the screen.
________________________________________________________________________
Chapter 14: Buttons and Fields 264
________________________________________________________________________
To access the Button's Info dialog box with the mouse:
Point to the button and double-click the left mouse button.
BUTTON INFO...
The Button Info dialog box is shown below.
┌───────────────────────────────────────────────────────────────────────┐
│ │
│ **** The Printed Documentation has a picture or screen shot here **** │
│ │
└───────────────────────────────────────────────────────────────────────┘
The following subsections describe the button properties available in
the dialog box and how they modify the appearance and behavior of a
button.
BUTTON NAME
The button name is displayed in the button rectangle. It is centered by
default.
Note: The button name can be used within a script to refer to a button.
ACCELERATOR KEY
The Accelerator property determines the ALT key combination used to
quickly select this button. Any letter or number can be used as a button
accelerator.
ACCELERATOR COLOR
This property controls the color of the button accelerators displayed
when the user holds down the ALT key.
________________________________________________________________________
Chapter 14: Buttons and Fields 265
________________________________________________________________________
BUTTON NUMBER
This number indicates the button's layer in relation to the other
buttons on the page or background.
Note: The button number can be used in a script to refer to a button.
BUTTON ID
Every object on a page or background is assigned an ID number when it is
created. This number is unique to each button on the page. (However,
there may be two buttons with the same ID number on different pages.)
Note: The ID is the only way to uniquely identify a button from within
a script.
SHOW NAME
Set this option on to display the button name. It is on by default.
┌───────────────────────────────────────────────────────────────────────┐
│ │
│ **** The Printed Documentation has a picture or screen shot here **** │
│ │
└───────────────────────────────────────────────────────────────────────┘
WITH EDGE
When With edge is on, the button is displayed with a border.
┌───────────────────────────────────────────────────────────────────────┐
│ │
│ **** The Printed Documentation has a picture or screen shot here **** │
│ │
└───────────────────────────────────────────────────────────────────────┘
________________________________________________________________________
Chapter 14: Buttons and Fields 266
________________________________________________________________________
HILITE IF FOCUS
This property determines whether a button is highlighted when it has the
focus (the default is off). If so, the button is displayed using the
hilite color. (The Hilite if focus property will have no effect if Auto
hilite is not on.)
AUTO HILITE
This property determines whether a button is capable of being
highlighted (the default is on). If Auto hilite is on, the button will
be highlighted when the user places the mouse pointer within its
rectangle and presses the left mouse button. If the Hilite if focus
property is also on, the button will be highlighted whenever it receives
the focus.
If Auto hilite is not on, the button will never be highlighted.
SHADOW
This property causes a button to be displayed with a shadow below and
to the right of it. The default is off (no shadow).
┌───────────────────────────────────────────────────────────────────────┐
│ │
│ **** The Printed Documentation has a picture or screen shot here **** │
│ │
└───────────────────────────────────────────────────────────────────────┘
STYLE
Opaque: This option, when on, makes a button nontransparent. The button
completely hides any characters or objects under it. This option is on
by default.
Transparent: When this option is on, any empty spaces in the button
become transparent. Any characters or objects under the button are
visible through the empty spaces.
________________________________________________________________________
Chapter 14: Buttons and Fields 267
________________________________________________________________________
CHECK BOX: This option creates check box buttons. Check box buttons are
displayed with brackets to the left of the name. Selecting a check box
button toggles the check mark [X] between the brackets.
Check box buttons are transparent and cannot be shadowed.
┌───────────────────────────────────────────────────────────────────────┐
│ │
│ **** The Printed Documentation has a picture or screen shot here **** │
│ │
└───────────────────────────────────────────────────────────────────────┘
BORDER COLOR
This property controls the color used to display a button's edge. The
default is light grey on black. The Border Color has no effect if the
button is transparent.
FILL COLOR
This property determines the color used to display the interior of a
nontransparent button.
HILITE COLOR
This property controls the color of a button when it is highlighted.
Only buttons with the Auto Hilite property on will be highlighted. The
default is black on light grey.
EDGE TYPE
This property determines the displayed border pattern of a button. If
the button is not transparent, the edge will be displayed with the
Border Color.
SCRIPT
This option opens the button's script in the Script Editor window.
________________________________________________________________________
Chapter 14: Buttons and Fields 268
________________________________________________________________________
BUTTON AND FIELD IDEAS
The following section describes some special uses of buttons and fields.
INVISIBLE BUTTONS
You can create completely invisible buttons by:
0 Setting the Style property to Transparent
0 Setting the With edge property to off
0 Setting the Show name property to off
Buttons with these characteristics are, for all practical purposes,
invisible to the user. There is no border, name, or edge to give away
the button's position. Some practical uses for these buttons are
discussed below.
SELECTING OBJECTS OF A LOWER LAYER
By placing an invisible button on top of another button, you can create
the illusion of clicking on the visible button, when, in fact, the
invisible button is being selected.
In a help system, the background may contain paging buttons that go to
the previous and next pages. On the index page, however, you want these
buttons to be disabled (because there isn't a logical next or previous
page). You can accomplish this by placing an invisible page button which
executes the special case actions on top of the paging buttons.
SELECTING PAINT
Invisible buttons can be used on top of the paint layer to create the
illusion that the user is clicking on an icon, such as the phone or
house icon found in the Ideas pad.
Suppose you've been asked to develop an Executive Information System
(EIS) for top management. Further, your boss wants to be able to click
on icons to quickly see various reports about the company's status.
Here's how to develop this type of linked icon:
To create a linked icon:
1. Paint the icon on the picture layer.
Copy an image from the Ideas pad if you want to save time.
________________________________________________________________________
Chapter 14: Buttons and Fields 269
________________________________________________________________________
2. Create an invisible button, as described above, and place it on top
of the icon.
3. Link the button to where you want the boss to go when the icon is
selected. (See invisible button section below about linking.)
INVISIBLE FIELDS
Invisible fields have the following properties:
0 The Style property is set to transparent.
0 The With Edge property is set to off.
0 The Show Name property is set to off.
Invisible fields are useful for creating graphic typing areas. You
should specify a transparent field when the underlying graphics contain
a visual clue that a field is there. The following example overlays a
transparent field onto some painted lines to create the illusion of
ruled paper:
┌───────────────────────────────────────────────────────────────────────┐
│ │
│ **** The Printed Documentation has a picture or screen shot here **** │
│ │
└───────────────────────────────────────────────────────────────────────┘
________________________________________________________________________
Chapter 14: Buttons and Fields 270
________________________________________________________________________
DATABASE FIELDS
By modifying a field's properties, you can create traditional database
entry fields. Database fields have the following properties:
0 The With edge property is set to off.
0 The Show name property is set to on.
0 The Name position property is set to left.
0 The Style property is set to Opaque.
These fields are familiar to many users who work with database programs,
which often display information on forms with these kinds of fields.
┌───────────────────────────────────────────────────────────────────────┐
│ │
│ **** The Printed Documentation has a picture or screen shot here **** │
│ │
└───────────────────────────────────────────────────────────────────────┘
LINKING BUTTONS
A link is a connection established between a page and another page or
pad. Links are established using buttons, so that when you select a
button on a page, you access the linked page or pad.
When you create information applications, like help systems, links are
especially useful. With HyperPAD, you can link a series of information
pages together. When browsing, a user can then move easily between
pieces of related information simply by selecting buttons.
All buttons contain link information hidden in their scripts, which is
accessible through the Button Info dialog box. HyperPAD automates the
process of creating a link, freeing you from the task of having to type
the actions into the button's script.
________________________________________________________________________
Chapter 14: Buttons and Fields 271
________________________________________________________________________
To link a button:
1. Select the button to be linked.
2. Press ENTER to open the Button Info dialog box.
3. Select the Link To button from the bottom of the dialog box.
The following popup dialog box appears:
┌───────────────────────────────────────────────────────────────────────┐
│ │
│ **** The Printed Documentation has a picture or screen shot here **** │
│ │
└───────────────────────────────────────────────────────────────────────┘
If you have a mouse, you can move this dialog box to the side, getting
it out of the way so that you can view the page underneath.
4. Navigate to the destination page. This may involve using PGDN or
PGUP to change pages, or using Open from the File menu (ALT+F,O) to go
to another pad, or using one of the Go menu commands.
5. Select one of the following options from the dialog box:
This Page: This choice links the button to a specified page, even if it
is on a different pad than the button being linked. The shortcut for
this command is ALT+P.
This Pad: This choice links the button to this pad.
When you select the button, it will take you to the page that was
accessed when the pad was last opened. The shortcut for this command is
ALT+D.
Cancel: This choice cancels the linking process. The shortcut for this
command is ALT+C.
After selecting one of these buttons, you'll be returned to the page
that was open when you began the procedure.
________________________________________________________________________
Chapter 14: Buttons and Fields 272
________________________________________________________________________
WHAT REALLY HAPPENS
When you link buttons using the Link To command in the Button Info
dialog box, HyperPAD actually creates statements within the button's
script that perform the link. These statements essentially say, "When
this button is selected, change to this other page".
You can examine these statements by selecting the Script button from the
Button Info dialog box. Scripts are introduced in the next section.
SCRIPTING
Each button in HyperPAD has an attached script that can define what
happens when the button is selected (although each button has a script,
some scripts are blank). When you select a button, HyperPAD tells that
button that it has been selected. The button, in response, can execute a
group of commands that you have created.
The commands in a script are written in an Englishlike language called
PADtalk. Using PADtalk, you can instruct your buttons to perform diverse
tasks, such as changing to another page, running another program, or
preparing a report and sending it to the printer.
The following section introduces PADtalk and gives some practical
examples to use in your own scripts. PADtalk is examined in depth in the
PADtalk Reference Guide.
ACCESSING A BUTTON'S SCRIPT
To access a button's script:
1. Use the Selector tool to select a button.
2. Press ENTER to open the Button Info dialog box.
3. Select the Script button.
A shortcut to get to the script is to press SHIFT+ENTER when the button
is selected.
FRAMEWORK FOR SCRIPTS
PADtalk is different from most computer languages. Many languages suffer
from a strict set of rules that must be followed. PADtalk, on the other
hand, allows you to write commands in a more intuitive, Englishlike
style that is easy to read.
________________________________________________________________________
Chapter 14: Buttons and Fields 273
________________________________________________________________________
Even so, HyperPAD's commands and language syntax still follow loose
rules that you must keep in mind. Don't worry, though. HyperPAD provides
you with instant error information when you make a mistake.
HANDLERS
Scripts are composed of groups of commands; each group is called a
handler. The word handler marks the beginning of a group of statements
that is executed when something happens to the button. Generally,
commands are executed when buttons are selected (when you highlight the
button and press ENTER or click on the button with the mouse).
The following shows a sample handler that instructs HyperPAD to change
to the next page when the button is selected.
handler select;
begin
go to the next page;
end;
Simply, the above handler says: "When the button is selected, change to
the next page".
The group of commands that is executed is contained between the words
begin and end. You can specify as many commands as necessary between
these words, separating each command with a semicolon.
Don't worry about upper- or lowercase words. PADtalk pays no attention
to capitalization.
________________________________________________________________________
Chapter 14: Buttons and Fields 274
________________________________________________________________________
SOME USEFUL PADTALK COMMANDS
There are many types of statements and commands that you can type into
PADtalk. This section introduces some useful statements that you can
include in your scripts immediately, without knowing any more about
PADtalk.
THE GO COMMAND
The go command lets you change to another page or even another pad. The
following are examples of the go command:
go to page 10;
go to page "Preferences";
go to the next page;
go to the previous page;
THE RUN COMMAND
The run command lets you run other DOS programs from within HyperPAD.
When doing so, HyperPAD shrinks down to 3K of memory, providing your
programs with plenty of memory in which to run. Some examples of the run
command are:
run "C:\LOTUS\123.EXE";
run "COMMAND.COM";
THE FIND COMMAND
The find command allows you to locate a particular piece of text
anywhere in your pad. Some examples of the find command are:
find "hello";
find "lawyer" in field 1;
find "james" in field 2;
________________________________________________________________________
Chapter 14: Buttons and Fields 275
________________________________________________________________________
CONCLUSION
In this chapter you learned about buttons and fields, including how they
are created, moved, resized, and deleted. You learned how to customize
your pads by copying and pasting objects between pages and even between
different pads. We also told you about properties, which give you the
ability to create attractive buttons and fields that behave in a manner
appropriate for your pad. In the last section, you learned how to make a
button respond in different ways when it is selected by placing commands
into the button's script.