home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The World of Computer Software
/
World_Of_Computer_Software-02-386-Vol-2of3.iso
/
t
/
tw21l.exe
/
GENHLP.DOC
< prev
next >
Wrap
Text File
|
1993-02-06
|
5KB
|
135 lines
twBRBrowse()
twBRBrowse() is a general purpose database
browser. It is capable of carrying out all
the functions found in the browse in DBU with
many enhancements.
There is built in mouse support, scoping and
the ability to pass executable code to the
function through the use of actionkeys. You
may also obtain a reference to the browse and
its full cargo structure, and modify its
behaviour on the fly.
The default keystroke handling in twBRBrowse()
can be overidden by assigning ActionKey blocks
to replace the defaults. ActionKeys are
processed BEFORE the default keystroke
handler. This method was deemed easier for
programmers than the method of passing an
entire ApplyKey function. Both methods will
be made available in a future release. The
defaults vary according to the Autolite
setting:
If lAlite is False, the right and left
arrow keys pan the browse. If it is true,
the cursor is moved one column.
The built in Get System allows the user to
perform gets on the entire browse or only on
selected columns. The ability to define a
reader makes the browse totally configureable
to your needs.
An append mode is included, but editing and
appending to databases is best performed by
executing the task through ActionKeys.
Both vertical and horizontal scrollbars are
available. If you allow scrollbars, the
horizontal one is displayed only if the
entire browse will not fit within the window.
twBRBrowse() has a complicated parameter
list. The simplest way to set up the browse
is to follow the following format:
1. Define your parameters:
LOCAL wT, wL, wB, wR, aColumns, cTitle, ;
cTopKey, bScopeBlock, ;
lEditFlag, aActionKeys, wColor, ;
wSType, wFType, wFColor, lScBar, ;
lMsgs, lAlite, nFreeze, lStabilize, ;
bPreRun, bPostRun, nExitKey, ;
aSeparators, lOKAppend, lSound
2. Use a template to define them:
wT := // Top of window.
wL := // Left of window.
wB := // Bottom of window.
wR := // Right of window.
aColumns := // Column definitions.
cTitle := // Window title.
cTopKey := // Initial scope key.
bScopeBlock := // Block for filter.
lEditFlag := // Allow edits?
aActionKeys := // Action key blocks.
wColor := // Window/browse colour.
wSType := // Window shadow type.
wFType := // Window frame type.
wFColor := // Window frame colour.
lScBar := // Use scrollbars?
lMsgs := // Display setup messages.
lAlite := // Use autolite?
nFreeze := // Columns to freeze.
lStabilize := // Stabilize before keys?
bPreRun := // Setup block.
bPostRun := // Exit block.
nExitKey := // Alternate EXIT key.
aSeparators := // Column separators.
lOKAppend := // Allow appends?
lSound := // Allow sound?
3. Define the columns:
AADD( aColumns, { cHead, bBlk, nWid, cFoot, ;
lEdit, cPic, bWhn, bVld, ;
bRdr, aClr, bClr, cCsep, ;
cHsep, cFsep })
etc.
4. Define the ActionKeys:
AADD( aActionKeys, { nKey, bBock } )
etc.
NOTE: You may want to save any setkeys you
have active which conflict with keys set here
before entering the browse. Remember to reset
them later.
5. Define Mouse Hot Spots:
nHandle := twBRHotSpot( nT, nL, nB, nR, ;
bAction, nButton,
nSleep, lRelease )
6. Call the browse:
twBRBrowse( wT, wL, wB, wR, aColumns, ;
cTitle, aFooters, cTopKey, ;
bScopeBlock, lEditFlag, ;
aActionKeys, wColor, wSType, ;
wFType, wFColor, lScBar, lMsgs, ;
lAlite, nFreeze, lStabilize, ;
bPreRun, bPostRun, nExitKey,
aSeparators, lOKAppend, lSound )
7. Release Mouse Hot Spots:
twBRRemHotSpot( nHandle )
You MUST remove any mouse spots you set up
to release the memory they use when you are
finished with them.