TWBrowse

Source: source/classes/wbrowse.prg

Inherits from: TControl

TWBrowse is FiveWin's original browse control for navigating database records and array data in a tabular format. It provides column headers, adjustable column sizing, keyboard navigation, inline editing, and integration with database objects, arrays, and ADO recordsets. TXBrowse is the modern successor, but TWBrowse remains in active use for simpler scenarios.

Key DATA Members

DATATypeDescription
cAliasCharacterAlias of the work area being browsed
bLineBlockCode block for drawing each row
bSkipBlockCustom skip block for navigation
nRowPosNumericCurrent row position
nColPosNumericCurrent column position
aHeadersArrayArray of column header strings
aColSizesArrayArray of column widths in pixels
lAutoEditLogicalEnable automatic inline editing
lCellStyleLogicalUse cell-level styling instead of row-level

Methods

MethodDescription
New( nRow, nCol, nW, nH, bLine, aHeaders, aColSizes, oWnd )Create a new browse control
SetArray( aArr )Bind the browse to an array data source
SetOBJ( oDbf )Bind the browse to a TDatabase object
SetADO( oRs )Bind the browse to an ADO recordset
SetFilter( cField, u1, u2 )Apply a filter condition to the current data source
Report( cTitle, lPreview )Generate a printed report of the browse content
Html()Export the browse content as an HTML table string

Example: 3-Column Browse Bound to DBF

#include "FiveWin.ch"

function Main()

   local oWnd, oBrw

   USE CUSTOMER NEW

   DEFINE WINDOW oWnd TITLE "Customers" SIZE 600, 400

   @ 10, 10 BROWSE oBrw ;
      HEADERS "Code", "Name", "City" ;
      SIZES 60, 200, 150 ;
      OF oWnd

   oBrw:SetOBJ( TDatabase():Open( nil, "CUSTOMER" ) )

   ACTIVATE WINDOW oWnd CENTERED

return nil

Notes

See Also