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

 twABBrowse(wT, wL, wB, wR, aInRa, cTitle, aColHead,;
             aFooters, lEditFlag, aActionKeys, wColor,;
             wSType, wFType, wFColor, lScBar, lAlite,;
             nFreeze, lStabilize, bPreRun, bPostRun, ;
             nExitKey, lBarOn, lWindow )
 ----------------------------------------------------------------------------

     Display and handle keystrokes for a TBrowse defined on a passed
     array. All parameters have defaults. By allowing the function to
     set them, twABBrowse() operates similarly to DBEDIT(), but with
     superior keystroke defaults and mouse support. twABBrowse() is a
     relatively small function with column defaults handled within. If
     you want total control over column definitions in an array
     browser, see twRABrowse().

     As with all TSDWIN MAXI functions, users are urged to enclose the
     function call in their own  'black-box' function to ensure that
     the defaults which stay the same throughout an application will be
     consistent. That way, you also avoid defining the entire parameter
     list every time.

     A TSDWIN command will be available for twABBrowse().

       Key Handling:

                Up Arrow ---------+
                Down Arrow        |
                Left Arrow        |
                Right Arrow       |
                Page Down         |- Scroll the Highlight Bar in
                Page Up           |  the normal way.
                Ctrl Page Down    |
                Ctrl Page Up      |
                Ctrl Left Arrow   |
                Ctrl Right Arrow  |
                Ctrl Home         |
                Ctrl End ---------+

                Escape         - Exit with no choice.
                Enter          - If EditFlag is .T., allow editing of
                                 the current array element.
                Delete         - Delete the current element and resize
                                 the array.
                Alpha Keys     - Speed Search.
                F1             - Display default keystroke handling.
                F8             - Swap current column with the one on
                                 the left.
                F7             - Delete the current column from the
                                 display.
                F9             - Subtract one to the count of columns
                                 on the left which are frozen. The
                                 freeze value defaults to 0.
                F10            - Add one to the count of columns
                                 on the left which are frozen. The
                                 freeze value defaults to 0.

       Arguments:

     wT, wL      - 'N' Screen coordinates for the display
     wB, wR            window.

     aInRa       - 'A' Passed Array .

     cTitle      - 'C' Header for the display window. The default is
                       NIL.

     aColHead    - 'A' Optional array of headers for the columns.
                       Defaults to NIL.

     aFooters    - 'A' Footer for the columns. The default is NIL.

     lEditFlag   - 'L' Allow/disallow editing in the DBedit() manner.

     aActionKeys - 'A' This optional parameter allows you to require
                      twABBrowse() to execute external code WITHOUT
                      exiting the browse. The operation is similar to
                      that used in the Alert Class.

                      Each element in the array must have two elements,
                      the first to indicate which key you wish to use
                      to invoke the external code, the second, a code
                      block to execute when that key is pressed.

                      ActionKeys can be used to override the default
                      keystroke handling in twABBrowse(), ie., if you
                      don't like what K_F8 does, pass in code to
                      replace it in the ActionKeys Array or pass NIL to
                      suspend it.

     wColor      - 'C' Clipper colour string. Defaults to
                       SETCOLOR(). It is suggested that you pass
                       a colour string with the Clipper
                       background colour set. If you do, that
                       colour is used for frozen columns.

     wSType      - 'N' TSDWIN shadow type. Defaults to no shadow.

     wFType      - 'N' TSDWIN frame type. Defaults to single line box.

     wFColor     - 'C' Optional border colour. Can be used to make the
                       active window, in this case the browse, have a
                       different border colour from other windows.

     lSCBar      - 'L' Logical to indicate whether or not scrollbars
                       are to be used.

     lALite      - 'L' Logical to indicate whether or not to use field
                       pointing for the highlight or to disable it and
                       highlight an entire row of the display.

     nFreeze     - 'N' The number fo columns to freeze.

     lStabilize  - 'L' The TBrowse Stabilize() method allows users to
                       break out of the stabilization process if a key
                       is pressed, thereby allowing the user faster
                       response on key presses. However, not all users
                       like the results when this is allowed. The
                       display will go blank in the browse window as
                       long as the user holds down a navigation key for
                       up or down movement. The lStabilize parameter
                       indicates whether or not carry out stabilization
                       to completion before processing the next key
                       press. The default is .F., indicating NOT TO
                       FINISH STABILIZING the browse as keys are
                       pressed. For large databases, the difference in
                       speed is very noticeable.

     bPreRun     - 'B' You may pass in a code block to execute before
                       the browse begins. For instance, the default
                       title colour in the browse is the standard text
                       colour. bPreRun allows you to change this by
                       leaving cTitle as NIL and creating:

                         bPreRun := {|| twTitle( "Title", YourColor" )}

     bPostRun    - 'B' This parameter acts like the PreRun block but is
                       executed after leaving the browse before the
                       browse window is popped if there is one.

     nExitKey    - 'N' The default exit keys are ESC and ENTER ( if
                       editing is disallowed ). You may wish to change
                       the behaviour of a browse with an ActionKey,
                       Therefore provision is made here to allow a
                       different key to provide an escape sequence.
                       Many users choose K_ALT_X to exit as it is used
                       in most CUA systems.

     lBarOn      - 'L' lBarOn defaults to .T. and indicates whether or
                       not the highlight bar is to be displayed when
                       AutoLite is set to off. If you set it to .F.,
                       you can use this browse to scan text files which
                       you have stored in an array.

     lWindow     - 'L' lWindow indicates whether you want the function
                       to open a window in which to display the browse.
                       You may wish to create a browse in part of a
                       window. lWindow allows you to do this. If
                       lWindow is set to .F., no window is displayed
                       and the browse fills the entire coordinate area.

       Return:

     Current Element Number or zero for no choice.

       Example:

    aArray := twDIRECTORY("*.*", "D")
    ASORT( aArray,,, {|x,y| x[1] < y[1]} )

    nChoice := twABBrowse( wT, wL, wB, wR, aArray,
                           "Directory of Files in " + CURDIR() ;
                           ,{"The;File;Name",;
                             "File;Size",;
                             "File;Date",;
                             "File;Time",;
                             "File;Attribute"};
                            ,, .T.,, ;
                            "bg+/rg,gr+/n,,bg+/rg,n/w", ;
                            3, 1, "gr+/g", .T., .T., 1, .T. )

See Also: twRABrowse() twACChoice() twABHotSpot() twABMouseLine()

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