Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Artful Two for Clipper 5.0 - Norton Guide http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]

Syntax

DB_SCROLL( nTr, nTc, nBr, nBc, ;
           xcUdf_rsay[, pKeyval[, xcUdf_rget [, ;
           xcUdf_wsay[, xcUdf_xcpt[, nMode [, ;
           nGo_rec[, lIs_auto[, xcRet_val [, ;
           ncColor1 [, ncColor2 ]]]]]]]]]] )

Purpose

A flexible alternative to DBEDIT() for child windows. Easily permits adding
and editing of records in a scrolling window.

Arguments

     nTr, nTc, nBr, nBc -- window coordinates

     xcUdf_rsay -- name, without parentheses, of user's function to
                       paint one row of a DB_SCROLL window.

     pKeyval -- index key value on which to lock the window; defaults
                    to entire file

     xcUdf_rget -- name, without parentheses, of function which
                       GETs one record on a row.

     xcUdf_wsay -- if passed, name of udf, including parentheses,
                       to paint the window area.

     xcUdf_xcpt -- if passed, name of exception handler

     nMode -- Possible values are:

            0:  paint window, allow editing

            1:  paint window only

            2:  do not paint window, allow editing

            3:  batch mode: allow appends only

     nGo_rec -- if passed, record number of top record for window;
                    defaults to first record of view.

     lIs_auto -- if passed, .T., and xcUdf_rget, automatically go
                     to add mode if no child record exists, defaults to .F.

     bRet_val -- if passed, code block to be evaluated for a return
                     value; defaults to record number of last window row.

     ncColor1 -- if passed, colour for displaying a record, default 1.

     ncColor2 -- if passed, colour for highlighting a record, default 2.

Setup

The child table must be open and, if a lock expression is passed, indexed
on the key of the lock expression.

@SECTION = Keyboard handling

     Esc -- exit

     Ins -- add a record

     Enter -- edit the current record

     Del -- offer to delete the current record

     Up -- move up one row

     Dn -- move down one row

     PgUp -- move up one window-full

     PgDn -- move down one window-full

     Home -- move to top of window

     End -- move to bottom of window

     Ctrl-PgUp -- move to first record in view

     Ctrl-PgDn -- move to last record in view

     You may write xcUdf_xcpt to handle other keys.

Example

     CHK_DICT( "AAI_DICT" )
     RETURN ORD_ITEM->( DB_SCROLL( 17, 1, 22, 78, ;
                        "ITM_RSAY", ORDERS->Order_Num,;
                        .F., .F., .F., 1 ) )



     FUNCTION ITM_RSAY( _row, _bool )
     @ _row,  1 SAY PICTURE "@!"
     @ _row, 10 SAY FETCH( Id, "PRODUCT", "DESC" )
     @ _row, 41 SAY Qty_orderd PICTURE "####"
     @ _row, 47 SAY Tax_rate PICTURE "@Z .99"
     @ _row, 52 SAY PRODUCT->Currency
     @ _row, 57 SAY Price PICTURE big_money
     @ _row, 69 SAY Ext_price PICTURE big_money
     RETURN .T.

Returns

Evaluation of bRet_val if passed, otherwise record number of
the record that was highlighted when <ESC> was pressed.

Side Effects

All those of screen display, editing, record editing, etc. Upon exit,
the record pointer points at the top window record.

Artful Calls

DB_DEL, DB_GET, DB_WSAY, WIND_BOTT, SYSCOLOR, SEEK_REL, MACRO, XINCR,
STAT_LINE, DUST_1, MINIMAX, TONE

Source File

AA_DBSCL.PRG

See Also: TBROWSER()

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson