Class are destined to control of associated in list data values. For example, it can be list of files.
<ClassName> | LISTITEM |
<Item> | Array, array of data value |
<nTop> | Numeric, a LISTITEM viewport coordinates |
<nLeft> | Numeric, a LISTITEM viewport coordinates |
<nBottom> | Numeric, a LISTITEM viewport coordinates |
<nRight> | Numeric, a LISTITEM viewport coordinates |
<ColorSpec> | String, color specification. |
"clr1, clr2, clr3, clr4, clr5, clr6, clr7" | |
clr1 - border and items color | |
clr2 - current item colors if object in focus | |
clr3 - current item colors if object outof focus | |
clr4 - title colors | |
clr5 - selected item colors | |
clr6 - current selected item colors | |
clr7 - founded symbol colors | |
<ItemCount> | Numeric, items count |
<Buffer> | Numeric, the cuurent items number |
<First> | Numeric, the number of first element into viewport |
<ItemWin> | Numeric, items into viewport |
<Line> | Numeric, a current cursor coordinates - line |
<Col> | Numeric, a current cursor coordinates - column |
<Pos> | Numeric, a current column |
<ColWin> | Numeric, a number columns into viewport |
<RowWin> | Numeric, a number rows into viewport |
<LenCol> | Array, array with columns width |
<Title> | Array, array of string that contain columns titles |
<Delim> | String, columns delimiters |
<HasFocus> | Logical, is TRUE if object in focus |
<FindBuffer> | String, the find buffer |
ADDITEM | Add new element to listing. |
CLEAR | Remove all items from listing. |
CLEARFINDBUFFER | Crears find buffer. |
DELITEM | Delete an listing element. |
DOWN | Goes next element. |
DRAWTITLE | Draw columns header. |
END | Goes to last element of array <::Item>. |
FIND | Find substring. |
GETITEM | Gets current item. |
GETSELECTED | Returns selected items numbers. |
HANDLEKEY | Simple handle key. |
HOME | Goes to first element of array <::Item>. |
INSITEM | Insert new element into listing. |
KILLFOCUS | Kill focus. |
LEFT | Goes to left. |
LISTITEMNEW | LISTITEM object constructor. |
PAGEDOWN | Goes to next page of array <::Item>. |
PAGEUP | Goes to previouse page of array <::Item>. |
REFRESH | Refreshed viewport. |
RIGHT | Goes to right. |
SELECT | Select item. |
SETCOLUMNS | Set columns count. |
SETFOCUS | Set focus to object. |
SETITEM | Sets new current item. |
SETKEY | Set a code block associated with code key value. |
SETTITLE | Set columns header. |
SETWIDTHCOL | Set columns width. |
UP | Goes previous element. |
AddItem(<vData>[, <sColor>][, <sSelColor>]) --> 0 || 1
AddItem() added new element to the end listing <::Item>.
Clear() --> NIL
Clear() removes all items from a <::Item> and sets counters to zero.
ClearFindBuffer() --> NIL
ClearFindBuffer() is clears find buffer. <::FindBuffer> sets to empty string.
DelItem(<nPos>) --> 0 || 1
DelItem() is deletes an element <nPos> from an listing <::Item>. The contents of the element is lost, and all elements from <nPos>+1 position shifted up one element. The last element in the array discarded.
End() --> NIL
End() is moves cursor to the last element of <::Item> listing. The new current element will be len(<::Item>).
Find(<sStr>) --> TRUE || FALSE
Find() is addes substring <sStr> to the end of find buffer <::FindBuffer> and searching <::FindBuffer> within <::Item>. If <::FindBuffer> is empty, searching start with first element of <::Item>, in other searching start with current position <::Buffer>.
The <::FindBuffer> value is compared to the array element beginning with the leftmost character in the <::Item> element and proceeding until there are no more characters left in <::FindBuffer>. If <::FindBuffer> is found seraching stopped, <::Buffer> sets to position founded element and Find() returns TRUE. If there is no match, <::Buffer> no changed, <sStr> removes from a <::FIndBuffer> and Find() returns FALSE.
GetItem() --> <vData>
GetItem() is gets the current element <::Buffer> into listing <::Item>. If array <::Item> is empty, method return NIL.
GetSelected() --> <aSelectedItems>
GetSelected() returns array of selected items numbers.
HandleKey(<nKey>) --> .T. || .F.
HandleKey() is evaluates code block that associated with key code <nKey>. The keypress/code block definition creates within SetKey() method.
A default key code cursor moves associates with corresponded methods Left(), Right(), Up(), Down() and more of LISTITEM class.
Home() --> NIL
Home() is moves cursor to the first element of <::Item> listing. The new current element will be 1.
InsItem(<vData>, <nPos>[, <sColor>][, <sSelColor>][, <lSelected>]) --> 0 || 1
InsItem() inserted new element <vData> into listing <::Item>. New element inserted at position <nPos>. Before insertion, size of <::Item> increased by 1 and all elements with <nPos> shifted down one elemen.
KillFocus() --> NIL
KillFocus() is kils focus for object of LISTITEM class. Attribute <::HasFocus> take value FALSE.
Left() --> NIL
Left() is moves cursor to left of current column. The new current element will be <::Buffer> - <::RowWin>.
ListItemNew(<nLrow>,<nLcol>,<nRrow>,<nRcol>[,<nColumns>[,<sDelimiter>[,<sColor>]]]) --> ListItem object
ListItemNew() is constructs and returns new LISTITEM object. That class can be used to edit, view, control associated in list data.
<nLrow> | Numeric, a object coordinates |
<nLcol> | Numeric, a object coordinates |
<nRrow> | Numeric, a object coordinates |
<nRcol> | Numeric, a object coordinates |
<nColumns> | Numeric, a number columns into viewport. By default 1. |
<sDelimiter> | String, a columns delimiter. By default <|> |
<sColor> | String, a colors specification. By default "7/0, 7/0, 7/0, 7/0, 7/0, 7/0, 7/0" |
Returns : | Method returns new LISTITEM object. |
PageDown() --> NIL
PageDown() is moves cursor to the next page of <::Item> listing. The size of page is <::ItemWin>. The current element will be <::Buffer>+<::ItemWin>.
PageUp() --> NIL
PageUp() is moves cursor to the previouse page of <::Item> listing. The size of page is <::ItemWin>. The current element will be <::Buffer>-<::ItemWin>.
Refresh() --> NIL
Refresh() is refreshes viewport. Called within methods of class LISTITEM automaticaly.
Right() --> NIL
Right() is moves cursor to right of current column. The new current element will be <::Buffer> + <::RowWin>.
Select([<vItem>]) --> TRUE
Select() is sets selected (one or more) items of listing <::Item>.
SetColumns(<nCol>) --> TRUE || FALSE
SetColumns() is sets columns count and sets new balanced width for all columns.
SetFocus() --> NIL
SetFocus() is sets focus to object of LISTITEM class. Attribute <::HasFocus> take value TRUE.
SetItem(<nPos>) --> 0 || 1
SetItem() is sets new current element with number <nPos>. If <nPos> is more than length of <::Item>, method returns 0. If array <::Item> is empty, method return NIL.
SetKey(<nKey>[, <bData>]) --> bPreviouse
SetKey() is sets a new code block associated with code <nKey>. When replacing an existing code block definition, it returns previous code block, in other returns current one. Its associated key code will be evaluated HandleKey() methods.
If <bData> is NIL, SetKey() returns old block code and remove keypress/code block definition.
A default key code is cursor moves(K_UP, K_DOWN, K_LEFT, K_RIGHT, K_PGUP, K_PGDN, K_HOME, K_END ....) associates with corresponded methods Left(), Right(), Up(), Down() and more.
Users code block take two parameters: link to LISTITEM object and key code; and can be returns one of next values:
-1 User request for the LISTITEM to lose input focus
0 Code block associated with <nKey> was evaluated
1 Unable to locate <nKey> in the dictionary, key was not processed
SetTitle(<aTitle>) --> TRUE || FALSE
SetTitle() is sets headers for listing columns. Headers sets for first len(<aTitle>) columns, the rest columns becomes empty header.