@...GRID DEFINE GRID Creates a grid control.
|
SYNTAX
Standard Window:
@ <nRow> ,<nCol> GRID <ControlName>
[ ID <nId> ]
[ OF | PARENT | DIALOG <ParentWindowName> ]
[ WIDTH <nWidth> ]
[ HEIGHT <nHeight> ]
[ HEADERS <acHeaders>]
[ WIDTHS <anWidths> ]
[ ITEMS <acItems> ]
[ VALUE <nValue> ]
[ FONT <cFontname> SIZE <nFontsize> ]
[ BOLD ] [ ITALIC ] [ UNDERLINE ] [ STRIKEOUT ]
[ TOOLTIP <cToolTipText> ]
[ BACKCOLOR <aBackColor> ]
[ FONTCOLOR <aFontColor> ]
[ DYNAMICBACKCOLOR <aDynamicBackColor> ]
[ DYNAMICFORECOLOR <aDynamicForeColor> ]
[ ON GOTFOCUS <OnGotFocusProcedur> | <bBlock> ]
[ ON CHANGE <OnChangeProcedure> | <bBlock> ]
[ ON LOSTFOCUS <OnGotFocusProcedur> | <bBlock> ]
[ [ ON DBLCLICK <OnDblClickProcedure> | <bBlock> ] | [ EDIT ] ]
[ ON HEADCLICK <aOnHeadClickProcedure> | <abBlock> ]
[ INPLACE <EditControls> ]
[ CELLED | CELLNAVIGATION ]
[ COLUMNCONTROLS { aControlDef1,aControlDef2,...aControlDefN } ]
[ COLUMNVALID <ColumnValid> ]
[ COLUMNWHEN <ColumnWhen> ]
[ VALIDMESSAGES <acValidationMessages> ]
[ VIRTUAL ]
[ ITEMCOUNT <nItemCount> ]
[ ON QUERYDATA <OnQueryDataProcedure> | <bBlock> ]
[ MULTISELECT ]
[ NOLINES ]
[ NOHEADERS ]
[ IMAGE <acImageNames> ]
[ JUSTIFY <anJustifyValue> ]
[ HELPID <nHelpId> ]
[ BREAK ]
[ HEADERIMAGE <aImageHeader> ]
[ NOTABSTOP ]
[ CHECKBOXES ]
Dialog Window:
REDEFINE GRID <ControlName>
ID <nId>
[ OF | PARENT | DIALOG <ParentWindowName> ]
[ HEADERS <acHeaders>]
[ WIDTHS <anWidths> ]
[ ITEMS <acItems> ]
[ VALUE <nValue> ]
[ FONT <cFontname> SIZE <nFontsize> ]
[ BOLD ] [ ITALIC ] [ UNDERLINE ] [ STRIKEOUT ]
[ TOOLTIP <cToolTipText> ]
[ BACKCOLOR <aBackColor> ]
[ FONTCOLOR <aFontColor> ]
[ DYNAMICBACKCOLOR <aDynamicBackColor> ]
[ DYNAMICFORECOLOR <aDynamicForeColor> ]
[ ON GOTFOCUS <OnGotFocusProcedur> | <bBlock> ]
[ ON CHANGE <OnChangeProcedure> | <bBlock> ]
[ ON LOSTFOCUS <OnGotFocusProcedur> | <bBlock> ]
[ [ ON DBLCLICK <OnDblClickProcedure> | <bBlock> ] | [ EDIT ] ]
[ ON HEADCLICK <aOnHeadClickProcedure> | <abBlock> ]
[ INPLACE <EditControls> ]
[ CELLED | CELLNAVIGATION ]
[ COLUMNVALID <ColumnValid> ]
[ COLUMNCONTROLS { aControlDef1,aControlDef2,...aControlDefN } ]
[ COLUMNWHEN <ColumnWhen> ]
[ VALIDMESSAGES <acValidationMessages> ]
[ VIRTUAL ]
[ ITEMCOUNT <nItemCount> ]
[ ON QUERYDATA <OnQueryDataProcedure> | <bBlock> ]
[ MULTISELECT ]
[ NOLINES ]
[ NOHEADERS ]
[ IMAGE <acImageNames> ]
[ JUSTIFY <anJustifyValue> ]
[ HELPID <nHelpId> ]
[ BREAK ]
[ HEADERIMAGE <aImageHeader> ]
[ NOTABSTOP ]
[ CHECKBOXES ]
SPLITBOX VERSION
GRID <ControlName>
[ OF | PARENT <ParentWindowName> ]
[ WIDTH <nWidth> ]
[ HEIGHT <nHeight> ]
[ HEADERS <acHeaders>]
[ WIDTHS <anWidths> ]
[ ITEMS <acItems> ]
[ VALUE <nValue> ]
[ FONT <cFontname> SIZE <nFontsize> ]
[ BOLD ] [ ITALIC ] [ UNDERLINE ] [ STRIKEOUT ]
[ TOOLTIP <cToolTipText> ]
[ BACKCOLOR <aBackColor> ]
[ FONTCOLOR <aFontColor> ]
[ DYNAMICBACKCOLOR <aDynamicBackColor> ]
[ DYNAMICFORECOLOR <aDynamicForeColor> ]
[ ON GOTFOCUS <OnGotFocusProcedur> | <bBlock> ]
[ ON CHANGE <OnChangeProcedure> | <bBlock> ]
[ ON LOSTFOCUS <OnGotFocusProcedur> | <bBlock> ]
[ [ ON DBLCLICK <OnDblClickProcedure> | <bBlock> ] | [ EDIT ] ]
[ ON HEADCLICK <aOnHeadClickProcedure> | <abBlock> ]
[ INPLACE <EditControls> ]
[ CELLED | CELLNAVIGATION ]
[ COLUMNVALID <ColumnValid> ]
[ COLUMNCONTROLS { aControlDef1,aControlDef2,...aControlDefN } ]
[ COLUMNWHEN <ColumnWhen> ]
[ VALIDMESSAGES <acValidationMessages> ]
[ VIRTUAL ]
[ ITEMCOUNT <nItemCount> ]
[ ON QUERYDATA <OnQueryDataProcedure> | <bBlock> ]
[ MULTISELECT ]
[ NOLINES ]
[ NOHEADERS ]
[ IMAGE <acImageNames> ]
[ JUSTIFY <anJustifyValue> ]
[ HELPID <nHelpId> ]
[ BREAK ]
[ HEADERIMAGE <aImageHeader> ]
[ NOTABSTOP ]
[ CHECKBOXES ]
Alternate Syntax:
DEFINE GRID <ControlName>
[ ID <nId> ]
[ PARENT <ParentWindowName> ]
COL <nCol>
ROW <nRow>
[ WIDTH <nWidth> ]
[ HEIGHT <nHeight> ]
[ HEADERS <acHeaders>]
[ WIDTHS <anWidths> ]
[ ITEMS <acItems> ]
[ VALUE <nValue> ]
[ FONTNAME <cFontname>
[ FONTSIZE <nFontsize> ]
[ FONTBOLD < .T. | .F.> ]
[ FONTITALIC < .T. | .F.> ]
[ FONTUNDERLINE < .T. | .F.> ]
[ FONTSTRIKEOUT < .T. | .F.> ]
[ TOOLTIP <cToolTipText> ]
[ BACKCOLOR <aBackColor> ]
[ FONTCOLOR <aFontColor> ]
[ DYNAMICBACKCOLOR <aDynamicBackColor> ]
[ DYNAMICFORECOLOR <aDynamicForeColor> ]
[ ONGOTFOCUS <OnGotFocusProcedur> | <bBlock> ]
[ ONCHANGE <OnChangeProcedure>
| <bBlock> ]
[ ONLOSTFOCUS <OnGotFocusProcedur> | <bBlock> ]
[ [ ONDBLCLICK <OnDblClickProcedure> | <bBlock> ] | [ ALLOWEDIT < .T. | .F.> ] ]
[ ONHEADCLICK <aOnHeadClickProcedure> | <abBlock> ]
[ INPLACEEDIT <EditControls> ]
[ CELLED | CELLNAVIGATION < .T. | .F.> ]
[ COLUMNCONTROLS { aControlDef1,aControlDef2,...aControlDefN } ]
[ COLUMNVALID <ColumnValid> ]
[ COLUMNWHEN <ColumnWhen> ]
[ VALIDMESSAGES <acValidationMessages> ]
[ VIRTUAL < .T. | .F.> ]
[ ITEMCOUNT <nItemCount> ]
[ ON QUERYDATA <OnQueryDataProcedure> | <bBlock> ]
[ MULTISELECT < .T. | .F.> ]
[ NOLINES < .T. | .F.> ]
[ SHOWHEADERS < .T. | .F.> ]
[ IMAGE <acImageNames> ]
[ JUSTIFY <anJustifyValue> ]
[ HELPID <nHelpId> ]
[ BREAK < .T. | .F.> ]
[ HEADERIMAGE <aImageHeader> ]
[ NOTABSTOP < .T. | .F.> ]
[ CHECKBOXES < .T. | .F.> ]
END GRID
EDIT INPLACE { aControlDef1 , aControlDef2
, ... , aControlDefN }
Control Definition Array:
TEXTBOX { cControlType , cDataType , cInputMask , cFormat
}
cControlType = 'TEXTBOX' (Required)
cDataType = 'CHARACTER' , 'NUMERIC' , 'DATE' (Required)
cInputMask = cInputMask (Optional)
cFormat = cFormat (Optional)
DATEPICKER { cControlType , cControlStyle }
cControlType = 'DATEPICKER' (Required)
cControlStyle = 'DROPDOWN' , 'UPDOWN' (Required)
COMBOBOX { cControlType , acItems }
cControlType 'COMBOBOX' (Required)
acItems (Required)
SPINNER { cControlType , nRangeMin , nRangeMax }
cControlType 'SPINNER' (Required)
nRangeMin (Required)
nRangeMax (Required)
CHECKBOX { cControlType , cCheckedLabel , cUnCheckedLabel }
cControlType 'CHECKBOX' (Required)
cCheckedLabel (Required)
cUnCheckedLabel (Required)
DYNAMIC { cControlType , bCodeBlock }
cControlType = 'DYNAMIC' (Required)
bCodeBlock = CodeBlock that return array with normal type control (Required)
to CodeBlock is passed two params - row and column indexes.
Data type for each column will depend control specified.
NUMERIC TEXTBOX : NUMERIC
DATE TEXTBOX : DATE
CHARACTER TEXTBOX : CHARACTER
SPINNER : NUMERIC
COMBOBOX : NUMERIC
CHECKBOX : LOGICAL
Remarks
If MULTISELECT clause is used VALUE must be a numeric array, containing the index position of selected items.
If EDIT clause is used, by doubleclicking an item, will open an editing window allowing to change the item content.
EDIT and MULTISELECT clauses can't be used simultaneously.
The leftmost column in a grid 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.
When AddColumn / DeleteColumn methods are used, all items in grid (if any) will be lost.
PROPERTIES:
Set / Gets Grid value - selected record number
| |
Set / Gets enabled state of a Grid control
| |
Set / Gets visible a Grid control.
| |
Set / Gets row position of a Grid control.
| |
Set / Gets column position of a Grid control.
| |
Set / Gets width of a Grid control.
| |
Set / Gets height of a Grid control.
| |
Set / Get header text in a Grid control.
| |
Set / Gets header image in a Grid control.
| |
Set / Gets Grid control's font name.
| |
Set / Gets Grid control's font size.
| |
Set / Gets Grid control's font bold property
| |
Set / Gets Grid control's font italic property
| |
Set / Gets Grid control's font underline property
| |
Set / Gets Grid control's font strikeout property
| |
Set / Gets Grid control's tooltip text.
| |
Set / Gets the background color for text within the control
| |
Set / Gets the foreground color for text within the control
| |
Set / Gets user property 'Cargo' for Grid control
| |
Set / Get item text in a Grid control.
| |
Set / Get cell value in Grid control.
| |
Get item count in a Grid control.
| |
Retrieves the name of a Grid control.
| |
·
Parent (D)
|
Set the name as character identifier of the parent window.
|
Set the numeric help topic identifier of the control.
| |
·
Widths (D)
|
|
·
Virtual (D)
|
|
·
ValidMessages (D)
|
|
·
MultiSelect (D)
|
|
·
NoLines (D)
|
|
·
Image (D)
|
|
·
Justify (D)
|
|
·
AllowEdit (D)
|
|
·
ColumnControls (D)
|
|
·
ColumnValid (D)
|
|
·
ColumnWhen (D)
|
|
·
ShowHeaders (D)
|
Sets a value that indicates whether the header is displayed in the
Grid control.
|
·
DynamicBackColor (D)
|
|
·
DynamicForeColor (D)
|
|
·
Break (D)
|
Control passes to the statement that follows the terminated
statement.
|
·
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
Properties Available For OnQueryData Procedure
Properties Available For OnDblClick Procedure
EVENTS:
An action to be performed when getting the focus
| |
An action to be performed when generic changing of the control
| |
An action to be performed when losing the focus.
| |
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
| |
· OnQueryData
|
|
METHODS:
Shows a gui object
| |
Hides a gui object
| |
Gives the focus to a control.
| |
Releases a control from memory
| |
Add a new item to a Grid control.
| |
Deletes an item from a Grid.control
| |
Deletes all items from a Grid.control
| |
Add a new column to a Grid control.
| |
Deletes a column from a Grid control.
| |
Set widths of a column to fit column contents text & column contents.
| |
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 Grid control
| |
Update disables for Grid control
| |
Save Control as BitMap file.
|
EXAMPLE: