home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Monster Media 1993 #2
/
Image.iso
/
database
/
p4w_all.zip
/
TI1314.ASC
< prev
next >
Wrap
Text File
|
1993-04-27
|
14KB
|
463 lines
PRODUCT : Paradox for Windows NUMBER : 1314
VERSION : 1.0
OS : WIN
DATE : April 27, 1993 PAGE : 1/7
TITLE : Using Tab Order With UI Objects in a Form
Intended Audience:
Anyone interested in understanding and manipulating the tab
sequence in a Paradox for Windows form.
Prerequisites:
This document assumes that Microsoft Windows was installed
correctly. This means that you have followed the steps in the
Windows Getting Started guide (Chapter 1), and in the Windows
User's Guide (Chapters 14, 15, and Appendix A). If your Windows
installation does not conform to those standards, Paradox for
Windows may not be able to run successfully. This document also
assumes you have read the Paradox for Windows Getting Started
guide, Chapters 1, 2, and 8.
Purpose of the TI:
To enable you to control the order in which UI (User Interface)
objects contain focus by pressing [Tab] or [Shift+Tab] in a form.
Four different UI object types (Button, Field, Graphs, and
EditRegion) have a Tab Stop property. For consistency, "OBJECT"
refers to any one of these three field types, whereas "object"
refers to any UI object. [Shift+Tab] is assumed to perform the
same action as [Tab] in the reverse direction.
This document is subdivided into three Sections:
SECTION I How to set/release a tab stop for an OBJECT
SECTION II How to determine the tab sequence when
pressing [Tab].
SECTION III An example that demonstrates how to alter the
natural tab sequence without using ObjectPAL
code.
SECTION I How to set/release a tab stop for an OBJECT
To set the Tab Stop property, inspect the OBJECT by clicking the
right mouse button on the OBJECT. Then choose the Run Time | Tab
Stop property. To release the OBJECT from the tab sequence,
repeat the above process.
PRODUCT : Paradox for Windows NUMBER : 1314
VERSION : 1.0
OS : WIN
DATE : April 27, 1993 PAGE : 2/7
TITLE : Using Tab Order With UI Objects in a Form
NOTE: The Tab Stop property acts as a toggle. When there is a
checkmark next to the Tab Stop property, Paradox will
include the OBJECT in the tab sequence of movement among
objects. If there is no checkmark next to the Tab Stop
property, Paradox bypasses the OBJECT in the tab sequence.
In the case of Button objects, you can still use the mouse
to push the button.
SECTION II How to determine the tab sequence when pressing [Tab]
As a simplified explanation, the tab sequence in a form is in the
same order which you would read a book, from left to right, top
to bottom. But due to the graphical nature of Paradox for
Windows, the tab sequence is slightly more complicated because
objects can overlap one another, either vertically or
horizontally.
For the sake of simplicity, this section assumes that only
objects with the Tab Stop property are on the form (Buttons,
Fields, and Graphs). SECTION III will embellish on SECTION II,
bringing in the concept of the containership hierarchy and how it
plays a vital role in determining the tab sequence.
When tabbing between OBJECTS, Paradox uses the following
algorithm to determine which OBJECT to move to next:
Paradox scans from top-left to bottom right looking for an
object. If no object is found on the current page, it will
continue looking for an object on subsequent pages.
When an OBJECT is found (objectOne), Paradox scans that portion
of the form defined below for another object (objectTwo).
Defined width: the area directly to the left of objectOne
Defined Height: from the top of objectOne to the midpoint of
objectOne
PRODUCT : Paradox for Windows NUMBER : 1314
VERSION : 1.0
OS : WIN
DATE : April 27, 1993 PAGE : 3/7
TITLE : Using Tab Order With UI Objects in a Form
If another object is found, one of the two cases below is
implemented.
CASE 1: If the midpoint of objectOne is ABOVE the top of
objectTwo, then pressing [Tab] will select
objectOne.
or
CASE 2: If the midpoint of objectOne IS EQUAL TO or BELOW
the top of objectTwo, then pressing [Tab] will
select objectTwo.
If there are no other objects in the above defined area, then
pressing [Tab] will select objectOne. This algorithm works for
all situations except the one described in Example 6. The
following examples should help clarify the above algorithm. In
these examples, each box is a Button Object, with the midpoint so
noted.
EXAMPLE 1:
┌─────────────────┐
│ │
│ │
midpoint ───»├─ Button1 │
╔═════════════════╗│ │
║ ║│ │
║ ║└─────────────────┘
║ Button2 ║
║ ║
║ ║
╚═════════════════╝
Since the midpoint of Button1 is ABOVE Button2, pressing [Tab]
will select Button1.
PRODUCT : Paradox for Windows NUMBER : 1314
VERSION : 1.0
OS : WIN
DATE : April 27, 1993 PAGE : 4/7
TITLE : Using Tab Order With UI Objects in a Form
EXAMPLE 2:
┌─────────────────┐
midpoint ───┐ │ │
╔═════════════════╗│ │ │
║ ║└»├─ Button3 │
║ ║ │ │
║ Button4 ║ │ │
║ ║ └─────────────────┘
║ ║
╚═════════════════╝
Since the midpoint of Button3 is BELOW Button4, pressing [Tab]
will select Button4.
EXAMPLE 3:
┌──────────────────────────────────────┐
│ │
│ ╔═════════════════╗ │
│ ║ ║ Button5 │
│ ║ ║ │
│ ║ Button6 ║ │
└──╫─────────────────╫─────────────────┘
║ ║
╚═════════════════╝
Since there are no objects to the left of Button5, pressing [Tab]
will select Button5.
EXAMPLE 4:
┌─────────────────────────────────┐
╔═╪═══════════════╗ │
║ │ ║ │
║ │ ║ Button7 │
║ │ Button8 ║ │
║ │ ║ │
║ └───────────────╫─────────────────┘
╚═════════════════╝
This is the same as EXAMPLE 2 but the Button Objects are
overlapping. Pressing [Tab] will select Button7.
PRODUCT : Paradox for Windows NUMBER : 1314
VERSION : 1.0
OS : WIN
DATE : April 27, 1993 PAGE : 5/7
TITLE : Using Tab Order With UI Objects in a Form
EXAMPLE 5:
┌───────────────────────────────┐
│ Button9 │
│ ╔═══════════════════╗ │
│ ║ ║ │
└─────╫───────────────────╫─────┘
║ Button10 ║
╚═══════════════════╝
This is the same as EXAMPLE 3. Pressing [Tab] will select
Button9.
EXAMPLE 6:
┌────────────────┐
│ Button11 │
╔═╪════════════════╪═╗
║ │ │ ║
║ └────────────────┘ ║
║ Button12 ║
╚════════════════════╝
This case is the exception to the rule because Button11 is
horizontally contained within Button12. When Paradox finds
OBJECTS in this pyramid type structure, the top OBJECT will
always receive focus first. Had the right side of Button11
extended beyond the right side of Button12, you would need to
compare the midpoint of Button11 to the top of Button12 to
determine which object would receive focus first.
SECTION III An example that demonstrates how to alter the
natural tab sequence without using ObjectPAL code.
As stated in SECTION II, other objects play an important role in
determining the tab sequence among OBJECTS. Here is what's
really happening when [Tab] is pressed:
Paradox looks for ANY object in the form, not just the four UI
objects that have a Tab Stop property. When it finds an object,
it looks within that object's container (those objects contained
by the object) to see if any of the inner objects have a Tab Stop
PRODUCT : Paradox for Windows NUMBER : 1314
VERSION : 1.0
OS : WIN
DATE : April 27, 1993 PAGE : 6/7
TITLE : Using Tab Order With UI Objects in a Form
property. If it finds one (or more) Paradox follows the
algorithm defined above to determine which OBJECT is next in the
tab sequence.
Below is an example to help clarify how Paradox uses the
containership hierarchy when you press [Tab] among OBJECTS:
Pressing [Tab] repeatedly in this form will move the pointer
through the Button Objects as if you were reading a newspaper (in
columns), rather than reading left to right across the page.
┌────────────────────────┐ ┌────────────────────────┐
│ Box1 │ │ Box2 │
│ ┌─────────────────┐ │ │ ┌─────────────────┐ │
│ │ Button1 │ │ │ │ Button5 │ │
│ └─────────────────┘ │ │ └─────────────────┘ │
│ ┌─────────────────┐ │ │ ┌─────────────────┐ │
│ │ Button2 │ │ │ │ Button6 │ │
│ └─────────────────┘ │ │ └─────────────────┘ │
│ ┌─────────────────┐ │ │ ┌─────────────────┐ │
│ │ Button3 │ │ │ │ Button7 │ │
│ └─────────────────┘ │ │ └─────────────────┘ │
│ ┌─────────────────┐ │ │ ┌─────────────────┐ │
│ │ Button4 │ │ │ │ Button8 │ │
│ └─────────────────┘ │ │ └─────────────────┘ │
│ │ │ │
└────────────────────────┘ └────────────────────────┘
Box1 contains four objects, Button1 through Button4. Likewise
Box2 also contains four objects, Button5 through Button8. When
you first enter the form, Paradox finds the first object on the
form (reading like a book) which, in this example, is Box1.
Paradox then looks within Box1 for any objects that have a Tab
Stop property, when and if it finds one, it move to that OBJECT
(Button1) following the algorithm defined in SECTION II.
When you press [Tab], Button2 will get focus NOT Button5 because
you are still working within the containership of Box1. The tab
order will move VERTICALLY down the form until it reaches
Button4. At this point, when you press [Tab], you will move to
Box2. Paradox will again follow the same containership logic.
PRODUCT : Paradox for Windows NUMBER : 1314
VERSION : 1.0
OS : WIN
DATE : April 27, 1993 PAGE : 7/7
TITLE : Using Tab Order With UI Objects in a Form
It will look within Box2 for any objects with the Tab Stop
property and move to that object following the algorithm in
SECTION II.
In this example, Box1 and Box2 are visible boxes. To apply this
in a more practical sense, the Box Objects should be made
invisible. This can be accomplished by two possible techniques.
One technique is to inspect the Box Objects (right-click on the
Box Object), select Frame | Style, and choose the no frame
option.
An alternative technique is to select all the objects (that the
box would contain) and group them together by selecting Design |
Group. The grouping technique has the same effect as an
invisible box.
You can build on the containership concept by placing other
(invisible) Box Objects within Box Objects to produce more
elaborate tab sequences.
NOTE: This algorithm only applies for the [Tab] and [Shift+Tab]
keys. It DOES NOT apply for the arrow keys.
DISCLAIMER: You have the right to use this technical information
subject to the terms of the No-Nonsense License Statement that
you received with the Borland product to which this information
pertains.