@...BROWSE
DEFINE BROWSE
Creates a browse control
  

A Browse control is a general purpose database browser.

SYNTAX

Standard Window:

[ @ <nRow> ,<nCol> ] BROWSE <ControlName>
[ ID <
nId> ]
[ OF | PARENT | DIALOG <
ParentWindowName> ]
WIDTH <
nWidth>
HEIGHT <
nHeight>
HEADERS <
acHeaders>
WIDTHS <
anWidths>
WORKAREA <
WorkAreaName>
FIELDS <
acFields>
[ VALUE <
nValue> ]
[ FONT <
cFontname> SIZE <nFontsize> ]
[ BOLD ] [ ITALIC ] [ UNDERLINE ] [ STRIKEOUT ]
[ TOOLTIP <
cToolTipText> ]
[ BACKCOLOR <
aBackColor> ]
[ DYNAMICBACKCOLOR <
dynamicbackcolor> ]
[ DYNAMICFORECOLOR <
dynamicforecolor> ]
[ FONTCOLOR <
aFontColor> ]
[ ON GOTFOCUS <
OnGotFocusProcedur> | <bBlock> ]
[ ON CHANGE <
OnChangeProcedure> | <bBlock> ]
[ ON LOSTFOCUS <
OnGotFocusProcedur> | <bBlock> ]
[ [ ON DBLCLICK <
OnDblClickProcedure> | <bBlock> ] | [ EDIT [ INPLACE ] ] [ APPEND  ]
[ INPUTITEMS <
inputitems> ]
[ DISPLAYITEMS <displayitems> ]
[ ON HEADCLICK <
aOnHeadClickProcedure> | <abBlock> ]
[ WHEN <
aWhenFields> ]
[ VALID <
abBlock> ]
[ VALIDMESSAGES <a
cValidationMessages> ]
[ READONLY <
alReadOnlyFields> ]
[ LOCK ]
[ DELETE ]
[ NOLINES ]
[ IMAGE <
acImageNames> ]
[ JUSTIFY <
anJustifyValue> ]
[ NOVSCROLL ]
[ HELPID <
nHelpId> ]
[ BREAK ]
[ HEADERIMAGE <
aImageHeader> ]
[ NOTABSTOP ]

Dialog Window:

REDEFINE BROWSE <ControlName>
ID <
nId>
[ OF | PARENT | DIALOG <
ParentWindowName> ]
HEADERS <
acHeaders>
WIDTHS <
anWidths>
WORKAREA <
WorkAreaName>
FIELDS <
acFields>
[ VALUE <
nValue> ]
[ FONT <
cFontname> SIZE <nFontsize> ]
[ BOLD ] [ ITALIC ] [ UNDERLINE ] [ STRIKEOUT ]
[ TOOLTIP <
cToolTipText> ]
[ BACKCOLOR <
aBackColor> ]
[ DYNAMICBACKCOLOR <
dynamicbackcolor> ]
[ DYNAMICFORECOLOR <
dynamicforecolor> ]
[ FONTCOLOR <
aFontColor> ]
[ ON GOTFOCUS <
OnGotFocusProcedur> | <bBlock> ]
[ ON CHANGE <
OnChangeProcedure> | <bBlock> ]
[ ON LOSTFOCUS <
OnGotFocusProcedur> | <bBlock> ]
[ [ ON DBLCLICK <
OnDblClickProcedure> | <bBlock> ] | [ EDIT  [ INPLACE ] ] [ APPEND ]
[ INPUTITEMS <
inputitems> ]
[ DISPLAYITEMS <displayitems> ]
[ ON HEADCLICK <
aOnHeadClickProcedure> | <abBlock> ]
[ WHEN <
aWhenFields> ]
[ VALID <
abBlock> ]
[ VALIDMESSAGES <a
cValidationMessages> ]
[ READONLY <
alReadOnlyFields> ]
[ LOCK ]
[ DELETE ]
[ NOLINES ]
[ IMAGE <
acImageNames> ]
[ JUSTIFY <
anJustifyValue> ]
[ NOVSCROLL ]
[ HELPID <
nHelpId> ]
[ BREAK ]
[ HEADERIMAGE <
aImageHeader> ]
[ NOTABSTOP ]

Splitbox Version

BROWSE <ControlName>
[ OF <
ParentWindowName> ]
[ WIDTH <
nWidth> ]
[ HEIGHT <
nHeight> ]
[ HEADERS <
acHeaders> ]
[ WIDTHS <
anWidths> ]
[ WORKAREA <
WorkAreaName> ]
[ FIELDS <
acFields> ]
[ VALUE <
nValue> ]
[ FONT <
cFontname> SIZE <nFontsize> ]
[ BOLD ] [ ITALIC ] [ UNDERLINE ] [ STRIKEOUT ]
[ TOOLTIP <
cToolTipText> ]
[ BACKCOLOR <
aBackColor> ]
[ DYNAMICBACKCOLOR <
dynamicbackcolor> ]
[ DYNAMICFORECOLOR <
dynamicforecolor> ]
[ FONTCOLOR <
aFontColor> ]
[ ON GOTFOCUS <
OnGotFocusProcedur> | <bBlock> ]
[ ON CHANGE <
OnChangeProcedure> | <bBlock> ]
[ ON LOSTFOCUS <
OnGotFocusProcedur> | <bBlock> ]
[ [ ON DBLCLICK <
OnDblClickProcedure> | <bBlock> ] | [ EDIT [ INPLACE ] ] [ APPEND  ]
[ INPUTITEMS <
inputitems> ]
[ DISPLAYITEMS <displayitems> ]
[ ON HEADCLICK <
aOnHeadClickProcedure> | <abBlock> ]
[ WHEN <
aWhenFields> ]
[ VALID <
abBlock> ]
[ VALIDMESSAGES <a
cValidationMessages> ]
[ READONLY <
alReadOnlyFields> ]
[ LOCK ]
[ DELETE ]
[ NOLINES ]
[ IMAGE <
acImageNames> ]
[ JUSTIFY <
anJustifyValue> ]
[ NOVSCROLL ]
[ HELPID <
nHelpId> ]
[ BREAK ]
[ HEADERIMAGE <
aImageHeader> ]
[ NOTABSTOP ]

Alternate Syntax:

DEFINE BROWSE <ControlName>
[ ID <
nId> ]
[ PARENT <
ParentWindowName> ]
COL <
nCol>
ROW <
nRow>
WIDTH <
nWidth>
HEIGHT <
nHeight>
HEADERS <
acHeaders>
WIDTHS <
anWidths>
FIELDS <
acFields>
[ VALUE <
nValue> ]
WORKAREA <
WorkAreaName>
[ FONTNAME <
cFontname>
[ FONTSIZE <
nFontsize> ]
[ FONTBOLD < .T. | .F.> ]
[ FONTITALIC < .T. | .F.> ]
[ FONTUNDERLINE < .T. | .F.> ]
[ FONTSTRIKEOUT < .T. | .F.> ]
[ TOOLTIP <
cToolTipText> ]
[ BACKCOLOR <
aBackColor> ]
[ DYNAMICBACKCOLOR <
dynamicbackcolor> ]
[ DYNAMICFORECOLOR <
dynamicforecolor> ]
[ FONTCOLOR <
aFontColor> ]
[ ONGOTFOCUS <
OnGotFocusProcedure> | <bBlock> ]
[ ONCHANGE <
OnChangeProcedure> | <bBlock> ]
[ ONLOSTFOCUS <
OnGotFocusProcedur> | <bBlock> ]
[ ONDBLCLICK <
OnDblClickProcedure> | <bBlock> ]
[ ALLOWEDIT < .T. | .F.> ]
[ INPLACEEDIT < .T. | .F.> ]
[ ALLOWAPPEND < .T. | .F.> ]
[ INPUTITEMS <
inputitems> ]
[ DISPLAYITEMS <displayitems> ]
[ ONHEADCLICK <
aOnHeadClickProcedure> | <abBlock> ]
[ WHEN <
aWhenFields> ]
[ VALID <
abBlock> ]
[ VALIDMESSAGES <a
cValidationMessages> ]
[ READONLYFIELDS <
alReadOnlyFields> ]
[ LOCK < .T. | .F.>  ]
[ ALLOWDELETE < .T. | .F.> ]
[ NOLINES < .T. | .F.> ]
[ IMAGE <
acImageNames> ]
[ JUSTIFY <
anJustifyValue> ]
[ VSCROLLBAR < .T. | .F.> ]
[ HELPID <
nHelpId> ]
[ BREAK < .T. | .F.> ]
[ HEADERIMAGE <
aImageHeader> ]
[ NOTABSTOP < .T. | .F.> ]

END BROWSE

DESCRIPTION: 

nRow, nCol
Position in the area of ??the window in pixels.
nWidth, nHeigth
The desired size of the Browse Control in pixels.
nId
The ID identifier this Control in Dialog Window
ControlName
A reference to the Browse Control
ParentWindowName
A reference to the Parent Window.
acHeaders
A list of text expressions for headers.
anWidths
A list of sizes for each column in pixels.
WorkAreaName
A reference to the Workarea.
acFields
A list of text expressions to display as columns.
cFontname, nFontsize
A reference to the Font and size the Font.
OnChangeProcedure
An action to be performed when selecting a new row.
OnGotFocusProcedure
An action to be performed when Browse is focused.
OnLostFocusProcedure
An action to be performed when Browse is lost focused.
OnDblClickProcedure
An action to be performed when Double Left clicking.
abBlock
An expression to be validated when the Browse loses its focus.
alReadOnlyFields
A list of logical expressions for the fields…
acImageNames
Background color as a RGB number
aOnHeadClickProcedure
A list of actions to be executed when a certain column header is clicked with the mouse.
aWhenFields
A Function or CodeBlock to evaluate indicating if the Browse is or not enable..
acValidationMessages
A list of associated messages of fields displayed when editable Field loses its focus and is not valid.


REMARKS:

·     Value property selects a record by its number (RecNo())

·     Value property returns selected record number (recNo())

·     Browse control does not change the active work area

·     Browse control does not change the record pointer in any area (nor change selection when it changes) when SET BROWSESYNC is OFF (the default)

·     You can programmatically refresh it using refresh method.

·     Variables called <MemVar>.<WorkAreaName>.<FieldName> are created for validation in browse editing window. You can use it in VALID array.

·     Using APPEND clause you can add records to table associated with WORKAREA clause. The hotkey to add records is Alt+A. Append Clause Can't Be Used With Fields Not Belonging To Browse WorkArea

·     Using DELETE clause allows to mark selected record for deletion pressing <Del> key

·     The leftmost column in a browse control must be left aligned.

·     The leftmost column in a browse control must be left aligned.

·     When used in control definition, Header property must be loaded with a character array containing as elements as control columns.

·     SET BROWSESYNC: When is set to ON, BROWSE control will move the record pointer in its workarea according to user selection or value property programmatic setting.

·     Setting 'Value' to reccount()+1 (EOF) will cause that browse windows get empty (no records will be showed).

PROPERTIES:

 

·   Value
Set / Gets browse value - selected record number
·   Enabled
Set / Gets enabled state of a browse control
·   Visible          
Set / Gets visible a browse control.
·   Row
Set / Gets row position of a browse control.
·   Col   
Set / Gets column position of a browse control.
·   Width
Set / Gets width of a browse control.
·   Height
Set / Gets height of a browse control.
·   Header (nColumnIndex)
Set / Gets header text in a browse control.
·   HeaderImage (nColumnNumber)
Set / Gets header image in a browse control.
·   FontName
Set / Gets browse control's font name.
·   FontSize
Set / Gets browse control's font size.
·   FontBold
Set / Gets browse control's font bold property
·   FontItalic
Set / Gets browse control's font italic property
Set / Gets browse control's font underline property
Set / Gets browse control's font strikeout property
·   ToolTip
Set / Gets browse control's tooltip text.
·   BackColor
Set / Gets the background color for text within the control
·   FontColor
Set / Gets the foreground color for text within the control
·   Cargo
Set / Gets user property 'Cargo' for browse control
·   Name (R)
Retrieves the name of a browse control.
·   Parent (D)
Set the name as character identifier of the parent window.
·   HelpId (D)
Set the numeric help topic identifier of the control.
·   Break (D)
Control passes to the statement that follows the terminated statement.
·   Widths (D)
 
·   Fields (D)
 
·   WorkArea (D)
 
·   Valid (D)
 
·   ValidMessages (D)
 
·   ReadOnlyFields (D)
 
·   Lock (D)
 
·   AllowAppend
 
·   AllowDelete
 
·   AllowEdit
 
·   InPlaceEdit (D)
 
·   NoLines (D)
 
·   Image (D)
 
·   Justify (D)
 
·   VScrollBar (D)
 
·   When (D)
 
·   DynamicBackColor (D)
 
·   DynamicForeColor (D)
 
·   NoTabStop (D)
Sets whether an element behavior can't receive focus and participate in the tabbing sequence

D: Available at control definition only
R: Read-Only

EVENTS:

·   OnGotFocus
An action to be performed when getting the focus
·   OnChange
An action to be performed when generic changing of the control
An action to be performed when losing the focus.
·   OnDblClick
An action to be performed when Double Left clicking.
A list of actions to be executed when a certain column header is clicked with the mouse

METHODS:

·   Show
Shows a gui object
·   Hide
Hides a gui object
·   SetFocus
Gives the focus to a control.
·   Refresh
Repaint a Control
·   Release
Releases a control from memory
·   ColumnAutoFit (nColumn)
Set widths of a column to fit column contents text & column contents.
·   ColumnAutoFitH (nColumn)
Set widths of a column to fit column header text & column contents
Set widths of all columns to fit each column contents  text & column contents.
Set widths of all columns to fit each column header text & column contents.
Update enables for Browse control
Update disables for Browse control
·   SaveAs
Save Control as BitMap file.

EXAMPLE:

See demos in :
\Samples\Basic\Browse_1
\Samples\Basic\Browse_3
\Samples\Basic\Browse_4
\Samples\Basic\Browse_5
\Samples\Basic\Browse_6
\Samples\Basic\Browse_7
\Samples\Basic\Browse_8
\Samples\Basic\ImageBrowse1
\Samples\Basic\ImageBrowse2
\Samples\Basic\DualBrowse