Projects/text-table

From Programming in RED

= Text Table Requested Features Doc Writer <chillemi@nomail.it> v0.5, 09/07/2018

toc:

It is just a bunch of notes.... if you read here, no assumption on the project !


== Introducion

Displaying data organized as list of rows and columns is a common way of managing data for the human being. Computer are very powerful instrument for working on these lists which coulde be displayed, edited, stored an retrieved and used as starting point for further operations.

A Text Table is needed components and various programmer took up the task of list managing components, creating some gui widgets which have good features but still not fully usable.

RED is the successor of REBOL and any developer needs to manage data grouped as rows and columns, so the request for development of a LIST VIEW component, powerful enough for modern needings.

== Basic Features:

  • Easy to setup
  • Data and geometry autosensing
  • Column sorting
  • Column moving
  • Filtering
  • Scrolling
  • Resizing
  • Column hiding
  • Input data validation
  • Colors management
  • Storing position
  • Rows inserting/deletion/moving
  • Database data storing and retrieving
  • Large data handling (over >100.000 entries but business application needs even >1M rows)
  • Editing
  • Sublist
  • Different datatypes
  • Cells with buttons, images and subrows
  • Auto Update
  • Save and apply views


== Complete features list:

  • RTF Text

Rich text format must be accepted

  • Easy to setup

Data should be provided in flat (1 dimension) or block of block (2 dimensions). A specification block should be provided. Without any other information the system will make his assuption about displaying data.

  • Data geometry autosensing

Base datatype is TEXT but if the widget finds another RED datatype it will operate according. The number of ROW and columns is calculated and the a corresponding number of columns will be created with basic features.

  • Auto size

Depending on columns size and data content the gui will auto setup. If columns are positionend beyod the rightmost edge a scroll bar will be added.

  • Auto Redraw on gui resize.

If requested from the user the initial size will adapt to the new gui size.

  • flat gui/touch support

Modern touch display are one dimension

  • Column sorting

Columns could be sorted and unsorted. sort column(s) and direction depends on SETUP configuration or in code changes. Sorting depends on column datatype


  • Column moving/hiding/unhide

User should be able to move columns, hidden or restored. Next/Prev/Current/Selected on relative columns Current position/selection Cell Coordinate system, absolute or relativa to column.

  • Filtering

Data cuould be displayed as it is or filtered using a function It sould be easy to have a rows between column heading and column data where you can insert the filter

TEXT-TABLE style provides table that can be used for displaying database data etc. Each column of the table provides support for sorting and filtering data, can be assigned to different column of the source data, the source data can be referenced so all changes will be reflected in the table with simple update call. All table functions can be executed from GUI all called programatically.

  • Scrolling

List should have scrollers. Scrolling steppes are defined during setup.

  • Resizing


Size of each column could be fixed or user editable

  • Input data validation

During data editing a function for validation could be provided.

  • Cell apparence

Depending on data content the color of the CELL its appearence/color/font could be changed

  • Storing position

It should be possible to store/retrieve The internal data like cursor position/columns displayed/size. It is needed for gui transitions.


  • Rows inserting/deletion/moving

Basic row deletion/adding/moving up and down should be provided. A block with rows numbers to delete should be poissible

  • defaults

During editing cell defaults could be provided

  • Database data storing and retrieving

Data coming from databases is needed Large data handling (over >100.000 entries but business application needs even >1M rows) Data could paged PAGED LISTS WITH SUBSEQUENT LOADING (DATA AND PICTURE ONE).. MAGARI SI FANNO DEGLI STUB E POI INS EGUITO

  • Editing

Cell must be editable either in place or using a remote field (like excel formula insertion)

  • Actors for data and gui events
  • Sublist

Each list could open a sublist Sub-Face Display +

  • opening another gui element could be modal or independet
  • Cell with buttons and rows

Each cell could have buttons, buttons and data, active corners. Live Corners

Button Cell/Radio CellOnOff cell support in column

  • Multi datatype +

It will support: Text Unicode Text Numbers (integers, float) Dates Pictures Input - Output Data could be different (only selected columns) +

  • Keyboard navigation +

Keyboard navigation and editing should be possible and configurable

  • Key and event handling +
  • Large range of actor, database editing actors +
  • Multi SKIN/ASPECT +
  • Column names +
  • Different selection modes +
  • Row Jump selectable +
  • Position maintaning when editing +
  • Basic Add/Remove/Delete (Even multi) with position maintaning +
  • (SETUP) Start Configuration (SETUP), when you call it the list restart (data too?) +
  • Column should reatain their original ID once moved

URL datatype

Text Table should support displaying of native RED datatypes and converting from a datatyper to another when displaying ??? (Displayed AS)

  • Tab Jomp

Hitting TAB you could jump a number of columns depending on cell.

  • Auto Update

Vedere source R3 Text Table


http://www.hmkdesign.dk/rebol/list-view/docs/list-view-history.txt (0.54) + http://www.hmkdesign.dk/rebol/list-view/docs/list-view-history.html (0.52) + http://www.hmkdesign.dk/rebol/list-view/docs/list-view.html


LEGGI LIST VIEW !

Set Face and update face should maintain previous position

List inside list


  • Other Notes

ADD/REMOVE, etc. non all kind of lists Header should have object name and header head name Ho do I inizialize empty lists ? Column name should automatically create the rebol object Object should have a default view ? (Per me) Better see everything together


data provider
get-value
set-value
delete-value
errori di ritorno
get row
return-row
delete row
get-table
get-table-info ?

On-data-load On-refresce On-reset On-revisualize

After row deleting position should not change. Nearby row should be selected

Sublist managing

Some cell should be editable, some other not

Editing and moving key combinatio

Hidden columns and hiddable column

Sot column should be highlighted Button to resert sorting

Column ID - ORIGINAL ID

Cell rendering funciohn Dinamic cell content, even graphic one.

Automation della cella

Da shloud be with no header, header should be apart Cell should be editable We miss actiors Filtering Popup Data function Cell coloring based on rule Style setup

La visualizzazione attuale della cella dovrebbe essere


///// LISTA FEATURES MIE ////// Colonne nascoste Flat list

Colonna di sort illuminata Pulsante reset ordinamento Rendering e Reenering2 per celle colorate Celle con contenuto dinamico e creato da esterno, anche grafico ed aggiornabie Multiselect, demo


Da shloud be with no header, header should be apart Cell should be editable We miss actiors Filtering Popup Data function Cell coloring based on rule Style setup




Colun resizing Main window of the list resizing Position saving and restoring


Object use? Ord nested blocks ?° Words for specification:



Dimensioni celle Cell font


Data managing, Data Editing


Right mous button management and middle and other

Scroll weel support Scoll jump support (editable)

Popuop


Resect function

Data save fubnction


Nome Colonne (Occjio fra titolo ed oggetto che tiene i dati

Doppia visione Sia come oggetto che come oggeetto su oggetto ? To-FLAT

Posizionamento selezione LA posizione e scegli tu quale evidenziare

Definire Tipo Colonne

Collegamento con Database Reactive ?

Scrollers

Keyboard manipulation


Data list as multiple lists

Sort reset

PARAMETER-LIST

List in listi

Link come oggetto ed RTF

TABS

Bottoni


Slect ed unselect

Scrollers si o no

Flat View

Gestione immagini E gif con toppios stato Immagine select ed unselect e possibilità di cambaire al volo o linkarla ad un dato o una routine la cambia


Scegliere quali celle dati visualizzare (INPUT OUTPUT)

MUTEX MULTI PERSISTENT

PRENDI INDICI o DATI

Accedi per nome

Tablet READY

Evidenziazione Cella

Prendi cio' che è stato selezionato

TAB E COLONNE CON COLORY, HEADER CON COLORI DIVERSI. Pulsanti accanto a calonnee con immagini RENDER COLORS

Speed up

Divisori verticali

Filter su specifiche colonne

Usare un procider dati esterno reattivo

Usere una sergente dati tipo munge ? Concetto di DATA SOURCE

Accented data

Lavorare su grandi liste

Supporto accentati

Sort su colonne multiple


FOLLOW e centratura

Unselect

Font più grandi

on-drag:

Lista Attori

Input Validation

Testa colonna inmodalità "filter" - Popup quando clicchi ed attori




Object use? Ord nested blocks ?° Words for specification:

/////FINE LISTA FEATURES /////


////////// R3 TEXT TABLE MIX VEK ///////////////////////



  • Dialect specification

TEXT-TABLE init-size [pair!] list-options [block!] list-data [block!]

INPUT

  This is a block of words, describing the columns as structured for the raw data. If this value is not stated, but output is, then INPUT will be the same as OUTPUT.


OUTPUT

  This is a block of words, describing the columns as structured in the output display. If this value is not stated, but input is, then INPUT will be used as OUTPUT. If used with 


• SUB-FACE , the output is mapped to each face in the order they appear in the SUB-FACE. Other keywords, like | (pipe char) can also be used to describe a 1 pixel gray spacer between columns. • NAMES This is a block of strings, which describe the shown names in the header of the list. It must have the same order and length as OUTPUT. If this value is not stated, the words will be FORMed from OUTPUT, uppercasing the first character in the word. It is overridden, when using HEADER-FACE or SUB-FACE directly. • RESIZE-COLUMN This is a single word which describes which column will be resizable. It is overridden, when using HEADER-FACE or SUB-FACE directly. • WIDTHS This is a block of integers describing the width of each column in pixels. The resizable column ignores this value. Note also that if you specify a table width that is much narrower than the combined width of the header, some columns will be perfectly hidden. It is overridden, when using HEADER-FACE or SUB-FACE directly. • MODES This is a block of words describing the mode of the button that sits in the header face above the column. SORT will use plain ascending/descending sorting. NO-SORT will create an inert sort button, that will do nothing when clicked. Default for all columns is SORT. • TYPES This is a block of words or datatypes describing the datatype for the column. This is only used to determine which style will be used to render the column. For now string! is supported. Later image! will be used to directly render images that exist in the raw data. • ADJUST Whether the header and content are LEFT, CENTER or RIGHT adjusted. • SELECT-MODE. This is either MUTEX, which allows only selecting one row PERSISTENT, which allows selecting multiple rows without using a qualifier key or MULTI (default), which allows selecting multiple rows using CTRL or SHIFT as qualifier keys. • HEADER-FACE This is a layout block. When used, it will replace the standard header generated by DATA-LIST. You can use any standard layout. • SUB-FACE This is a layout block for each row used in the layout. When using this, you can create an entirely custom layout, even with multiple lines per data row. Words in OUTPUT are distributed in the same order that the faces are described in the layout. • RENDER This is a function body that uses FACE and CELL as argument. The FACE is the list face inside the data list. The CELL is the cell that is currently being rendered. • FOLLOW-SIZE Whether to follow scrolling of a selected row line-by-line or page-by-page. The options are LINE (default)r PAGE. • DEFAULT-SORT-DIRECTION This is a single word (DESC, DESCENDING or ASC, ASCENDING) or NONE. When initializing a DATA-LIST or when using the sort reset button, a particular sort direction can be applied. Use this in combination with DEFAULT-SORT-COLUMN to achieve a particular default sorting. Using NONE will default to the standard setting for DATA-LIST. *you should be able to read an save • DEFAULT-SORT-COLUMN This is the word of the column where default sorting is applied in a DATA-LIST during initialization and when using the sort reset button. Use this in combination with DEFAULT-SORT-DIRECTION. Using NONE will default to the standard setting for DATA-LIST. • Data LIST SETUP data-list setup [input [name age weight] output [weight age]]

data-list setup [input [name age weight] output [weight | age]] You can add specific titles. In cases like these, if you don't need column rearrangement or need to hide columns, you don't have to add the OUTPUT keyword, as INPUT is automatically used as OUTPUT, if nothing else is stated:


You can add specific titles. In cases like these, if you don't need column rearrangement or need to hide columns, you don't have to add the OUTPUT keyword, as INPUT is automatically used as OUTPUT, if nothing else is stated:

You can specify which column is resizable, when the list is resized when resizing the window in which it sits. The condition is that only one column is resizable, as the list resizing model follows that of the VID Extension Kit.


///// VEK DATA LIST SETUP AND TYPES ////



data-list setup [input [name age weight] widths [100 150 50] resize-column 'age] (NO, TUTTE !)

Set a selection mode, where only one row can be selected at a time:

data-list setup [input [name age weight] select-mode 'mutex] Set follow size to a full page, to jump one whole page in the list, when navigating with cursor keys:

data-list setup [follow-size 'page] Perform adjustment of the text in a column:

data-list setup [input [name age weight] adjust [left center right]]

Set a column mode for a column, so that sorting is disabled for this column:

data-list setup [input [name age weight] modes [sort no-sort]]


You can also use words, as long as they are set and for objects, their words are used. This allows the use of object prototypes:

my-obj: make object! [a: b: c: none] And in the layout:

data-list setup [input my-obj]



[1 2 3 4] The list will automatically detect that there is only one column, if the first element is not a block.

You cannot use EDIT-FACE to edit this kind of block. For this, you will need to provide your own custom functions.

2-dimensional blocks 2-dimensional blocks are allowed and may contain various types, including objects:

[[1 2] [3 4] [5 6] [7 8]]


Object blocks This is the recommended method for maximum flexibility as the same object can be used both for specifying the list structure and for specifying rows in the list. You can also use EDIT-FACE to edit the list contents this way. Each word in the object is designated as a column and will be used as the column name. So if you have a prototype object:

my-list-row: make object! [

   name:
   age:
   weight:
       none

] The columns shown in the list will be:

Name Age Weight

//// END VEK DATA LIST SETUP AND STYLES ////


---init-size

Init size specifies table's size.

---list-options

List-options specify columns settings. List-options contain one or more labels, each label can have width and column index specified. You can also specify datatype for each column.

column-name [string!] column-index [issue!] column-width [integer!] datatype [word!]

Example: ["First name" #1 250 "Surname" #2 300 "Age" #4 50 number]

If index is not specified, columns are automatically enumerated from 1 up.

If width is not specified, default value of 150px is used.

Datatype specifies datatype used in column. These datatypes are not same as REBOL datatypes, they are adjust for use with TEXT-TABLE (see below).

---list-data

List-data are actual data used for displaying. They can be referenced. If referenced data are changed, UPDATE-FACE TEXT-TABLE must be called to reflect changes.

Format of list-data is block of blocks, where each block is one row. Rows can have different length.

Example: [

["John" "Doe" NY 45]

["Erica" "Stone" CA 19 none "note 1"]

["James" "Cole" FL 5 "note 2"]

]

===Datatypes

TEXT-TABLE supports different datatypes as values. They are not same as REBOL datatypes, although most of them share same name. There are some special datatypes like TAGS not found in REBOL. If no datatype is specified, TEXT is used. Datatypes speciefies which editor to open, or which validator to use.

Currently supported datatypes are: Currently supported datatypes are:

---TEXT

Basic datatype used for all values that haven't speciefied different datatype. TEXT opens standard field as an editor.

---TAGS

TAGS are stored as string! values in a block!. TAGS type opens tag editor.

===Style actors

Actors are the API of R3GUI. TEXT-TABLE uses some standard actors and also adds some custom actors to support all TEXT-TABLE functions. Currently implemented actors are:

---ON-INIT

Basic internal actor used when initializing GUI. Style user doesn't need to access this actor.

---ON-SET / SET-FACE

Basic actor used for setting table's values. There are several ways to set data, preffered way is to use SET-FACE function which calls the ON-SET actor. It's also possible to use ON-SET actor directly, but this will omit some data checks etc.

+++basic usage

SET-FACE text-table active-row

Basic usage that will set active row (NOTE: this may change).

+++fields

Because TEXT-TABLE is complex style with lots of different data, additional ways to input these data are implemented using the /fields refinement. Follows the list of all supported fields.

  • VALUE*

Basic field, works same as if no field is specified.

  • DATA*

Set table's data. Usage:

SET-FACE/FIELD text-table table-data 'data

  • LABELS*

(NOTE: name of this field will change to better describe fuctionality.)

Set table's attributes. Usage:

SET-FACE/FIELD text-table attributes 'labels

SET-FACE/FIELD text-table attributes 'atts ; proposed change of field name

For the dialect description, see above the LIST-OPTIONS.

  • STATE*

Set table's state. State is object holding current table state (active filters, sorting, active row...). This state can be stored on disk for later use.

---ON-GET / GET-FACE

Basic actor and function for getting table's values. Preffered method is to use GET-FACE function, it's also possible to get values using ON-GET actor.

GET-FACE text-table

Will return active row number.

Basic actor


Support Popups

Support Tablet entry and tablet flat view


/// ACTORS DA LIST VIEW ??? FORSE R3 TEXT TABLE ///

  • ACTOR LIST:

ACTORS

===Style actors

Actors are the API of R3GUI. TEXT-TABLE uses some standard actors and also adds some custom actors to support all TEXT-TABLE functions. Currently implemented actors are:

---ON-INIT Basic internal actor used when initializing GUI. Style user doesn't need to access this actor.

---ON-SET / SET-FACE Basic actor used for setting table's values. There are several ways to set data, preffered way is to use SET-FACE function which calls the ON-SET actor. It's also possible to use ON-SET actor directly, but this will omit some data checks etc.

+++basic usage SET-FACE text-table active-row Basic usage that will set active row (NOTE: this may change).

+++fields Because TEXT-TABLE is complex style with lots of different data, additional ways to input these data are implemented using the /fields refinement. Follows the list of all supported fields.

  • VALUE*

Basic field, works same as if no field is specified.

  • DATA*

Set table's data. Usage: SET-FACE/FIELD text-table table-data 'data

  • LABELS*

(NOTE: name of this field will change to better describe fuctionality.) Set table's attributes. Usage: SET-FACE/FIELD text-table attributes 'labels SET-FACE/FIELD text-table attributes 'atts ; proposed change of field name For the dialect description, see above the LIST-OPTIONS.

  • STATE*

Set table's state. State is object holding current table state (active filters, sorting, active row...). This state can be stored on disk for later use.

---ON-GET / GET-FACE Basic actor and function for getting table's values. Preffered method is to use GET-FACE function, it's also possible to get values using ON-GET actor. GET-FACE text-table Will return active row number. Basic actor

---ON-DRAW Basic internal actor that handles drawing of table data. ON-DRAW calls ON-DRAW-GRID which draws table's header and grid. After that, ON-DRAW-ROW is called for each visible row that calls ON-DRAW-CELL to draw each cell. All actors add draw code to the LAYOUT-BLOCK facet.

---ON-RESIZE Basic actor handling resizing code.

---ON-FOCUS Basic actor handling focusing code.

---ON-KEY Basic actor handling keyboard bindings. See below for list of supported keys.

---ON-REMOVE-ROW ARG: row index to remove. Remove row from table data.

---ON-OPEN-EDITOR INTERNAL actor. Will open data editor of selected type. Uses ON-PLACE-EDITOR internal actor to determine editor placement.

---ON-FIND-CELL ARG: Y position in pixels. Return index of row under mouse cursor.

---ON-FIND-COL ARG: X position in pixels Return index of column under mouse cursor.

---ON-SORT ARG: column index [integer!], direction [UP DOWN anything-else] Will sort table data. ON-SORT creates sorted index, original data are not changed.User can select by which column to sort and the direction of sort. Sort support |UP and DOWN directions, anything else (NONE is prefered but not required) will change the sorting index back to unsorted data.

---ON-GET-COL ARG: visible index Return index in data (Columns can be rearanged and ie. third visible column can be second in source data. This function will change visible index to real one).

---ON-FILTER-DATA ARG: NONE (turn off filtering) or [column-index [integer!] filter [block!]] TODO: support multi-filters (filter with more than one column). Will filter data according to a filter. Binds VALUE for filter which is cell's value that can be tested against filter. Example: all values starting with "A": all [ not none? value value/1 = #"a" ]

---ON-GET-VIEW and ON-GET-FLAT-VIEW ARG: block of indexes Return filtered view of table. NOTE: ON-GET-FLAT-VIEW actor will be removed soon.

---ON-SCROLL-LINE ARG: number of lines to scroll [integer!] - positive: scroll down, negative: scroll up Scroll table view by required number of lines.

---ON-GET-RECORD ARG: record id [integer!] Return value from table.

---ON-SET-VALUE ARG: value Will set value. NOTE: Value differs in TEXT-TABLE and TEXT-LIST, this actor hadles the differencies.

---ON-INIT-TABLE Used by DB handler to clear table all indexes. ---ON-ENTER and ON-EDIT-ACTION Actor is called when value is set in editor. *

//// FINE ACTORS DA LIST VIEW ////


/// VEK FILTERING ///


• Filtering Filter Function The QUERY-FACE accessor can filter rows, based on an input function. The input function takes a row as an input argument and when returning TRUE, the row will be included in the list. If FALSE, it will be left out.

This is useful for filtering out data that you don't want to see, such as with a real-time string filtering function.

See the file tests/lists/filtering.r for an example.

Example Example filtering function, which leaves out a line, if the string in F-FILTER cannot be found in any cell:

filter-row: func [row /local value] [ if empty? value: get-face f-filter [return true] foreach cell row [if find cell value [return true]] false ] And in the list specification the QUERY-FACE accessor uses the filter function to filter in the list per key-press:

f-filter: field on-key [query-face l-data :filter-row] l-data: data-list data list-data


Filtro dell'input Filtro su colonne multiple, dopo il data source, prima della visualizzazione


/// VEK FILTERING ///


---ON-FILTER-DATA

ARG: NONE (turn off filtering) or [column-index [integer!] filter [block!]]

TODO: support multi-filters (filter with more than one column).

Will filter data according to a filter. Binds VALUE for filter which is cell's value that can be tested against filter.

Example: all values starting with "A":

all [ not none? value value/1 = #"a" ]


//// VEK ////

• sorting Internally, the sorting mechanism uses SORT/COMPARE and is susceptible to limitations, such as trying to compare two different datatypes. Therefore it's not wise to use more than one datatype per column, if you want to sort rows.

You cannot sort multiple columns at the same time. If you select a new column to sort, the original data is resorted by that column.

You cannot yet programmatically sort.

//// END VEK ///


/// VEK DATA HANDLING ///


• Editing Using the EDIT-FACE accessor, you can do some editing of the data block in the list. If the data block is not copied, it can be used to modify an external block.

For simplicity, editing is only available, when the data is formed as a block of objects.

The EDIT-FACE accessor takes three arguments:

FACE The face to edit OP The operation to carry out, in this case ADD, EDIT or DELETE as a word VALUE The value to pass to the face accessor for the operation. Edits are carried out on the selected rows in the list.

Example Given a data-list L-DATA, we can add a row like this:

edit-face l-data 'add Adding always happen at the end of the list.

Edit a row:

edit-face l-data 'edit Delete a row:

edit-face l-data 'delete

//// END VEK DATA HANDLING ////


\\\ R3 TEXT TABLE STYLE ACCESS \\\


==Style access

--Get values

+++VALUE

  • integer!*

Returns index of current value in list-data.

+++DATA

  • block!*

Returns list-data.

+++FILTERED

  • block!*

Returns filtered list-data.

+++FILTER

  • block!*

Returns current filter settings.

+++LABELS

  • block!*

Returns current settings of labels in list-labels format (see above).

+++ROW

  • block!*

Returns list-data at current row position. ---Set values

+++VALUE

  • integer*

Set index (highlight row) of list-data.

+++DATA Set data for table.

+++LABELS Set column labels.

+++FILTER Set filter to use.

\\\ END R3 TEXT TABLE STYLE ACCESS \\\

//// LV KEYBOARD SHORTCUT ///

The LIST style offers a KEY-FACE accessor function with the following functionality:

UP Selects the previous row. If no items are selected, the first row is selected. If the previous row is out of view, the list scrolls it into view. The use of the FOLLOW-SIZE keyword during setup sets whether to jump by one line or a whole page, when the list scrolls the selected row into view. DOWN Selects the next row. If no items are selected, the first row is selected. If the next row is out of view, the list scrolls it into view. CTRL-UP Selects a row one page up and deselects the previously selected row. One page is the number of visible rows in the list. CTRL-DOWN Selects a row one page down and deselects the previously selected row. SHIFT-UP Selects the previous row and does not deselect any previous rows. SHIFT-DOWN Selects the next row and does not deselect any previous rows. CTRL-SHIFT-UP Selects the entire previous page and does not deselect any previous rows. CTRL-SHIFT-DOWN Selects the entire next page and does not deselect any previous rows. CTRL-A Selects all rows. CTRL-SHIFT-A Deselects all rows. See the file tests/lists/selection.r for an example use of ON-KEY on a DATA-LIST.

• Keyboard sort

Keyboard shortcuts

===Keyboard usage It's possible to use keyboard for TEXT-TABLE navigation and access. Here's list of supported keys:

  • UP&DOWN - navigation around table

*SHIFT+UP&DOWN - move rows up and dows *E - edit cell *CTRL+CURSOR KEYS - (only when cell editor is open) - move around table *SHIFT+E - open quick form editor. TODO: screenshot of quick form editor. ===Text-Table Data ---Specifying visible columns This will show columns 2-4 but not column 1 from text-table-data text-table ["State" #2 "Item" #3 "Touched" #4] text-table-data

/// FINE VEK KB SHORTCUT ////


===Keyboard usage

It's possible to use keyboard for TEXT-TABLE navigation and access. Here's list of supported keys:

  • UP&DOWN - navigation around table
  • SHIFT+UP&DOWN - move rows up and dows
  • E - edit cell
  • CTRL+CURSOR KEYS - (only when cell editor is open) - move around table
  • SHIFT+E - open quick form editor.

TODO: screenshot of quick form editor.

===Text-Table Data

---Specifying visible columns

This will show columns 2-4 but not column 1 from text-table-data

text-table ["State" #2 "Item" #3 "Touched" #4] text-table-data

===Filters

---Access row data for filtered list TEXT-TABLE/FACETS/FILTERED contains just the filtered rows.


//////////////////////////////////////////////////////////

////// VEK RENDERING: ////// Render Function When the list uses a RENDER-FUNC function, each cell can be evaluated for content and adjusted in appearance accordingly. Any facet of the face can be adjusted. This is used for alternate line coloring in the standard DATA-LIST.

But by setting any facet, including DRAW blocks, you can include images or complex indicators in a cell. The RENDER-FUNC function is run, every time a single cell is rendered, so speed is of importance.

See the file tests/lists/rendering.r for an example.

Cell Information Each cell contains several bits of information to help you determine rendering:

POS This is the physical position of the data in the output. If you are rendering the fourth cell in the third row, the value will be 3x4. Using POS/X, you can determine which column you are in. Using POS/Y, you can determine which row you are in, in the data, if you use it to pick the raw value from FACE/DATA-SORTED. DATA This is the raw data input to the cell. Even if there are no more rows with data to render, such as in a table with fewer rows of data than visible rows in the list, the function will still be called, and in that case, the value is NONE. ROW This is the raw data input to the entire row. This is useful to act on a cell with data from a different column. The raw data will correspond to the input format used, whether it's 1D blocks, 2D blocks or objects.

Example A basic example here uses this method to use bold text for a column with numbers between 0 and 100 that go over the value 90:

data-list with [

   render-func: func [face cell] [
       cell/font/style: if all [cell/data cell/data > 90] ['bold]
   ]

] Notice here that a check of CELL/DATA is done to ensure that the check can only be done on rows that contain output.


///// END VEK RENDERING /////

/////VEK DATA PROCESSING /////

• Data Processing


Internally, the LIST does not destroy or modify the original data, when sorting or filtering. It only does so, when using the editing functions with EDIT-FACE.

What occurs on every update, is:

The original data is fed to the list The data is passed through the filter function. If no filter is specified, all rows pass through and an index is generated for the rows that are allowed to pass through. The indexes of the filtered data passes through the sorting function and the indexes are sorted appropriately to the currently set column for sorting and the direction of sorting. The sorted indexes are used to generate the order of output of the data in the original input. The output block starting index is moved to the current scroll position. The render function is called to make any modifications necessary to the cell, before it's displayed. The face is shown and all cells are displayed from the ordered output. The scrollers are adjusted in accordance with the index of the ordered output. Selection The selected rows can be accessed through FACE/SELECTED and will be the indexes of the items in the original unsorted and unfiltered data block.

To get the content itself, use the GET-FACE function.

/// END VEK DATA PROCESSING ///

/// VEK ROW SELECTION ////

• Selecting Rows To select rows, use the SELECT-FACE function, which can take a number of different inputs.

Selection can take place, both on filtered and sorted data as well as the unfiltered and unsorted data. The division works like this:

Unfiltered and unsorted data happen with:

Numeric selection, blocks of numbers. Filtered and sorted selection happens with:

Word based selection (FIRST, PREVIOUS, NEXT, LAST) * TRUE/FALSE/NONE to select all or no rows.


Selection Mode When setting the selection mode in the list, you can determine the behavior of selection:

MUTEX This selects only one row at a time, regardless of whether holding down qualifier keys or not. When using MUTEX, using GET-FACE will return the selected item directly, not wrapped in a block. MULTI When clicking a row, it will be highlighted. When clicking other rows using SHIFT or CONTROL keys, those rows will be highlighted, either in sequence (SHIFT) or appended to the current selection (CTRL). PERSISTENT When clicking a row it will be highlighted. When clicking another row without holding down any qualifier keys, that row will also be highlighted. Clicking a row again will remove the highlight. When using MULTI or PERSISTENT, selecting multiple rows will be returned in a block in the order they are selected, when using GET-FACE on the list.

/// END VEK ROW SELECTION ///


//// VEK SCROLLING ////

• Scrolling When scrolling, you can use the scroll-wheel on any area inside the list, including the header. When the data-list is resized, the scroller is redragged.

Following The internal function FOLLOW, which exists inside the list face, allows the list to scroll to a specific physical row. This is used, when needing to scroll a particular row into view, and thus is used during keyboard navigation, to automatically scroll the list, whenever the selected row moves beyond the visible part of the list.

FOLLOW can use two modes; LINE, which is default and PAGE. This can be set during setup, using the FOLLOW-SIZE keyword.

LINE will simply scroll the chosen row into view near the top or bottom edge of the list, whichever is nearest. PAGE will scroll an entire page size, every time the face is moved out of view. This results in page-by-page style scrolling, when moving by keyboard.


//// END VEK SCROLLING ////


MUNGE

Dove sono memorizzate le teste dei campi di to-column-alpha Add column come agisce sulle teste ?


Todo trello Red Vedere programma Robert Elenco Features Setup/Rest Word: Input Output Sub

Tutto il concetto, in programmazione, deve rientrare nella videata per autosostenersi

Vedere "Data Handling 2"

Vedi anke LIST VIEW di HENRIK