Class are destined to control listing of history.
HistoryObj(nLrow, nLcol, nRrow, nRcol, sColor) --> QUEUE object
<ClassName> | HISTORY |
<Lrow> | Numeric, a HISTORY viewport coordinates |
<Lcol> | Numeric, a HISTORY viewport coordinates |
<Rrow> | Numeric, a HISTORY viewport coordinates |
<Rcol> | Numeric, a HISTORY viewport coordinates |
<History> | Array, array of history items |
<Header> | String, the history box header |
<Size> | Numeric, the max size history array |
<ColorSpec> | String, color specification. |
"clr1, clr2, clr3, clr4" | |
clr1 - border and items color | |
clr2 - current item colors if object in focus | |
clr3 - current item colors if object outof focus | |
clr4 - title colors |
ADD | Add item into history. |
DELETE | Delete item from history. |
FIRST | Get first item. |
HISTORYOBJ | HISTORY object constructor. |
INSERTTOFIRST | Insert item to first position. |
RUN | Run history. |
SET | Init history. |
SETSIZE | Set new size history array. |
History := HistoryObj(5, 5, 10, 30) do while .t. fname := fileDialog() if !empty(fname) History:InsertToFirst(fname) else exit endif enddo do while .t. fname := History:Run() str := memoread(fname) memoedit(str, 0, 0, maxrow(), maxcol()) enddo
No dependies of platform.
Add item into history.
Add(<sData>) --> NIL
Returns NIL.
Add() is addes data <sData> to the end of history array <::History>.
If <sData> already exist within <::History>, it removes from old place and addes to the end of <::History>.
Delete item from history.
Delete(<sData>) --> TRUE || FALSE
Returns TRUE if element <sData> exists and removes.
Delete() is deletes data <sData> from the history array <::History>. The size of <::History> not changes.
If <sData> exist into <::History>, it removes, all lower items shift up one position and Delete() returns TRUE.
Get first item.
First() --> <sData>
No arguments
Returns first item of <::History>.
First() returns first item of history array <::History> as string <sData> without removes element from array.
HISTORY object constructor.
HistoryObj(nLrow, nLcol, nRrow, nRcol, sColor) --> QUEUE object
Method returns new HISTORY object.
HistoryObj() is constructs and returns new HISTORY object. That class can be use to manipulating listing of history( for example, history listing of loaded files)
Insert item to first position.
InsertToFirst(<sData>) --> NIL
Returns NIL.
InsertToFirst() is inserts data <sData> to history array <::History> begin with first position. All items with one will be shifted down one position.
If <sData> already exist within <::History>, it removes from old place and insert to first position.
Run history.
Run([<nPos>][, <lItem>]) --> <vData>
Returns value or index of selected item.
Run() is drows history and it is simple key handler and returns by press <ENTER> value or index of selected item.
Init history.
Set(<aArr>[, <nSize>]) --> NIL
Returns NIL.
Set() truncates <::History> to zero and addes to <::History> items from <aArr>.
New size of history buffer is <nSize>. If <nSize> not specified, then new size is size of <aArr>
Set new size history array.
SetSize(<nSize>) -->
Returns NIL.
SetSize() set new size <nSize> for history array <::History>.