  
  [1m[4m[31m5. Browsing Tables in [1mGAP[1m[4m[31m using [22m[32mncurses[1m[4m[31m -- The Programming Interface[0m
  
  This  chapter  describes  some  aspects of the internals of the browse table
  handling.  The  relevant  objects  are  [22m[36maction  functions[0m that implement the
  individual  navigation steps (see Section [1m5.1[0m), [22m[36mmodes[0m that describe the sets
  of  available  navigation  steps  in given situations (see Section [1m5.2[0m), and
  [22m[36mbrowse  applications[0m that are given by the combination of several modes (see
  Section [1m5.3[0m).  Most  of  the  related  data is stored in the global variable
  [1m[34mBrowseData[0m  ([1m5.4-1[0m).  For more details, one should look directly at the code
  in the file [1mlib/browse.gi[0m of the [1mBrowse[0m package.
  
  
  [1m[4m[31m5.1 Navigation Steps in Browse Tables[0m
  
  Navigating  in  a  browse  table  means  that  after entering visual mode by
  calling  [1m[34mNCurses.BrowseGeneric[0m  ([1m4.3-1[0m),  the user hits one or several keys,
  and  if  this  input  is  in  a  given  set  of  admissible  inputs  then  a
  corresponding  function  is  executed  with  argument  the browse table. The
  function  call  then  may  change  components  in  this  table (recommended:
  components in its [22m[32mdynamic[0m component), such that the appearance in the window
  may  be  different  afterwards,  and  also  the  admissible inputs and their
  effects may have changed.
  
  The  relation  between the admissible inputs and the corresponding functions
  is  application  dependent. However, it is recommended to associate the same
  input  to  the same function in different situations; for example, the [1m[46m?[0m key
  and  the  [1m[46mF1[0m  key  should belong to a function that shows a help window (see
  Section  [1m5.4-4[0m),  the [1m[46mq[0m key and the [1m[46mEsc[0m key should belong to a function that
  exits  the  current  mode  (Note that the [1m[46mEsc[0m key may be recognized as input
  only  after  a  delay  of  about  a  second.),  the [1m[46mQ[0m key should belong to a
  function  that  exits the browse application (see Section [1m5.4-6[0m), the [1m[46mF2[0m key
  should  belong  to  a  function  that saves the current window contents in a
  global  variable  (see  Section  [1m5.4-5[0m),  and  the  [1m[46mE[0m key should belong to a
  function  that enters a break loop (see Section [1m5.4-7[0m). The [1m[46mEnter[0m and [1m[46mReturn[0m
  keys should belong to a "click" on a selected table entry, and if a category
  row is selected then they should expand/collapse this category.
  
  When  the first characters of an admissible input have been entered, one can
  delete  the  last entered character via the [1m[46mDelete[0m and [1m[46mBackspace[0m keys. It is
  not possible to make these keys part of an admissible input.
  
  Each  such function is wrapped into a record with the components [22m[32maction[0m (the
  function  itself)  and  [22m[32mhelplines[0m  (a list of attribute lines that describes
  what  the  function  does).  The  help lines are used by the help feature of
  [22m[32mNCurses.BrowseGeneric[0m, see Section [1m5.4-4[0m.
  
  The  action  functions  need  not return anything. Whenever the shown screen
  shall  be  recomputed after the function call, the component [22m[32mdynamic.changed[0m
  of the browse table must be set to [22m[32mtrue[0m by the action functions.
  
  
  [1m[4m[31m5.2 Modes in Browse Tables[0m
  
  In  different  situations,  different  inputs may be admissible for the same
  browse  table,  and  different  functions  may belong to the same input. For
  example,  the meaning of "moving down" can be different depending on whether
  a cell is selected or not.
  
  The  set  of  admissible  user  inputs  and  corresponding  functions  for a
  particular  situation  is  collected  in  a [22m[36mmode[0m of the browse table. (There
  should  be  no  danger  to mix up this notion of mode with the "visual mode"
  introduced  in  Section [1m1.1[0m.)  A  mode  is  represented by a record with the
  components  [22m[32mname[0m (a string used to associate the mode with the components of
  [22m[32mheader[0m, [22m[32mheaderLength[0m, [22m[32mfooter[0m, [22m[32mfooterLength[0m, [22m[32mClick[0m, and for the help screen),
  [22m[32mflag[0m  (a  string that describes properties of the mode but that can be equal
  for  different  modes), [22m[32mactions[0m (a list of records describing the navigation
  steps that are admissible in the mode, see Section [1m5.1[0m), and [22m[32mShowTables[0m (the
  function  used  to eventually print the current window contents, the default
  is  [22m[32mBrowseData.ShowTables[0m). Due to the requirement that each admissible user
  input uniquely determines a corresponding function, no admissible user input
  can be a prefix of another admissible input, for the same mode.
  
  Navigation  steps  (see Section [1m5.1[0m) can change the current mode or keep the
  mode.  It  is  recommended  that each mode has an action to leave this mode;
  also an action to leave the browse table application is advisable.
  
  In  a  browse  table,  all  available  modes  are  stored  in  the component
  [22m[32mwork.availableModes[0m, whose value is a list of mode records. The value of the
  component  [22m[32mdynamic.activeModes[0m  is  a list of mode records that is used as a
  stack: The [22m[36mcurrent mode[0m is the last entry in this list, changing the current
  mode  is  achieved  by  unbinding the last entry (so one returns to the mode
  from  which  the current mode had been entered by adding it to the list), by
  adding  a  new mode record (so one can later return to the current mode), or
  by  replacing  the  last  entry  by  another  mode  record.  As  soon as the
  [22m[32mdynamic.activeModes[0m  list  becomes  empty,  the  browse table application is
  left.  (In this situation, if the browse table had been entered from the [1mGAP[0m
  prompt then visual mode is left, and one returns to the [1mGAP[0m prompt.)
  
  The  following  modes  are  predefined  by the [1mBrowse[0m package. Each of these
  modes  admits  the  user  inputs  [1m[46m?[0m, [1m[46mF1[0m, [1m[46mq[0m, [1m[46mEsc[0m, [1m[46mQ[0m, [1m[46mF2[0m, and [1m[46mE[0m that have been
  mentioned in Section [1m5.1[0m.
  
  [1m[33mbrowse[0m
        This  mode  admits  scrolling  of  the  browse table by a cell or by a
        screen,  searching  for  a  string,  selecting  a row, a column, or an
        entry, and expanding or collapsing all category rows.
  
  [1m[33mhelp[0m
        This  mode  is entered by calling [22m[32mBrowseData.ShowHelpTable[0m; it shows a
        help  window  concerning  the actions available in the mode from which
        the  [22m[32mhelp[0m mode was entered. The [22m[32mhelp[0m mode admits scrolling in the help
        table by a cell or by a screen. See Section [1m5.4-4[0m for details.
  
  [1m[33mselect_entry[0m
        In  this  mode,  one  table cell is regarded as selected; this cell is
        highlighted using the attribute in the component [22m[32mwork.startSelect[0m as a
        prefix  of  each  attribute line, see the remark in Section [1m2.2-3[0m. The
        mode  admits  moving the selection by one cell in the four directions,
        searching  for  a  string  and for further occurrences of this string,
        expanding or collapsing the current category row or all category rows,
        and  executing  the  "click"  function of this mode, provided that the
        component [22m[32mwork.Click.( "select_entry" )[0m of the browse table is bound.
  
  [1m[33mselect_row[0m
        This  is  like  the  [22m[32mselect_entry[0m mode, except that a whole row of the
        browse  table  is highlighted. Searching is restricted to the selected
        row, and "click" refers to the function [22m[32mwork.Click.( "select_row" )[0m.
  
  [1m[33mselect_row_and_entry[0m
        This  is  a  combination  of  the [22m[32mselect_entry[0m mode and the [22m[32mselect_row[0m
        mode.
  
  [1m[33mselect_column[0m
        This is like the [22m[32mselect_row[0m mode, just a column is selected not a row.
  
  [1m[33mselect_column_and_entry[0m
        This  is like the [22m[32mselect_row_and_entry[0m mode, just a column is selected
        not a row.
  
  
  [1m[4m[31m5.3 Browse Applications[0m
  
  The  data in a browse table together with the set of its available modes and
  the  stack of active modes forms a browse application. So the part of or all
  functionality   of   the   [1mBrowse[0m   package   can  be  available  ("standard
  application"),  or  additional  functionality  can  be provided by extending
  available modes or adding new modes.
  
  When  [1m[34mNCurses.BrowseGeneric[0m ([1m4.3-1[0m) has been called with the browse table [22m[34mt[0m,
  say, the following loop is executed.
  
  [1m[33m1.[0m
        If the list [22m[34mt[0m[22m[32m.dynamic.activeModes[0m is empty then exit the browse table,
        and  if the component [22m[34mt[0m[22m[32m.dynamic.Return[0m is bound then return its value.
        Otherwise proceed with step 2.
  
  [1m[33m2.[0m
        If  [22m[34mt[0m[22m[32m.dynamic.changed[0m is [22m[32mtrue[0m then call the [22m[32mShowTables[0m function of the
        current mode; this causes a redraw of the window that shows the browse
        table. Then go to step 3.
  
  [1m[33m3.[0m
        Get one character of user input. If then the current user input string
        is  the  name  of  an  action  of  the  current  mode  then  call  the
        corresponding  action  function  and go to step 1; if the current user
        input  string  is  just  a  prefix  of the name of some actions of the
        current  mode  then  go to step 3; if the current user input string is
        not a prefix of any name of an action of the current mode then discard
        the last read character and go to step 3.
  
  When  one  designs  a  new  application,  it may be not obvious whether some
  functionality  shall  be implemented via one mode or via several modes. As a
  rule  of  thumb,  introducing a new mode is recommended when one needs a new
  set  of  admissible  actions  in a given situation, and also if one wants to
  allow  the  user  to perform some actions and then to return to the previous
  status.
  
  
  [1m[4m[31m5.4 Predefined Browse Functionalities[0m
  
  [1m[4m[31m5.4-1 BrowseData[0m
  
  [1m[34m> BrowseData_________________________________________________[0mglobal variable
  
  This  is  the  record  that  contains  the  global data used by the function
  [1m[34mNCurses.BrowseGeneric[0m  ([1m4.3-1[0m).  The  components  are [22m[32mactions[0m, [22m[32mdefaults[0m, and
  several capitalized names for which the values are functions.
  
  [22m[32mBrowseData.actions[0m  is  a  record  containing  the  action  records that are
  provided by the package, see Section [1m5.1[0m. These actions are used in standard
  applications of [1m[34mNCurses.BrowseGeneric[0m ([1m4.3-1[0m). Of course there is no problem
  with using actions that are not stored in [22m[32mBrowseData.actions[0m.
  
  [22m[32mBrowseData.defaults[0m  is  a  record that contains the defaults for the browse
  table used as the first argument of [1m[34mNCurses.BrowseGeneric[0m ([1m4.3-1[0m). Important
  components  have been described above, see [1m[34mBrowseData.IsBrowseTable[0m ([1m4.2-3[0m),
  in the sense that these components provide default values of [22m[32mwork[0m components
  in browse tables. Here is a list of further interesting components.
  
  The following components are provided in [22m[32mBrowseData.defaults.work[0m.
  
  [1m[33m[22m[32mwindowParameters[0m[0m
        is  a  list  of  four  nonnegative integers, denoting the arguments of
        [22m[32mNCurses.newwin[0m  for  the  window  in  which  the browse table shall be
        shown. The default is [22m[32m[ 0, 0, 0, 0 ][0m, i. e., the window for the browse
        table is the full screen.
  
  [1m[33m[22m[32mminyx[0m[0m
        is  a  list  of  length  two,  the  entries must be either nonnegative
        integers,  denoting  the  minimal  number of rows and columns that are
        required  by  the  browse  table, or unary functions that return these
        values  when they are applied to the browse table; this is interesting
        for  applications  that  do not support scrolling, or for applications
        that may have large row or column labels tables. The default is a list
        with  two functions, the return value of the first function is the sum
        of the heights of the table header, the column labels table, the first
        table  row,  and  the table footer, and the return value of the second
        function is the sum of widths of the row labels table and the width of
        the  first  column.  (If the header/footer is given by a function then
        this part of the table is ignored in the [22m[32mminyx[0m default.)
  
  [1m[33m[22m[32malign[0m[0m
        is  a substring of [22m[32m"bclt"[0m, which describes the alignment of the browse
        table  in  the window. The meaning and the default are the same as for
        [1m[34mBrowseData.IsBrowseTableCellData[0m  ([1m4.2-1[0m). (Of course this is relevant
        only if the table is smaller than the window.)
  
  [1m[33m[22m[32mheaderLength[0m[0m
        describes  the  lengths  of  the headers in the modes for which [22m[32mheader[0m
        functions  are  provided.  The value is a record whose component names
        are  names  of  modes and the corresponding components are nonnegative
        integers. This component is ignored if the [22m[32mheader[0m component is unbound
        or  bound  to  a  list,  missing  values  are computed by calls to the
        corresponding [22m[32mheader[0m function as soon as they are needed.
  
  [1m[33m[22m[32mfooterLength[0m[0m
        corresponds to [22m[32mfooter[0m in the same way as [22m[32mheaderLength[0m to [22m[32mheader[0m.
  
  [1m[33m[22m[32mMain[0m[0m
        if  bound  to  a  function  then  this function can be used to compute
        missing  values  for  the  component  [22m[32mmain[0m;  this  way  one  can avoid
        computing/storing  all [22m[32mmain[0m values at the same time. The access to the
        entries   of   the   main   matrix   is   defined   as   follows:   If
        [22m[32mmainFormatted[i][j][0m is bound then take it, if [22m[32mmain[i][j][0m is bound then
        take  it and compute the formatted version, if [22m[32mMain[0m is a function then
        call  it  with  arguments  the browse table, [22m[32mi[0m, and [22m[32mj[0m, and compute the
        formatted   version,   otherwise  compute  the  formatted  version  of
        [22m[32mwork.emptyCell[0m.  (For  the  condition whether entries in [22m[32mmainFormatted[0m
        can   be  bound,  see  below  in  the  description  of  the  component
        [22m[32mcacheEntries[0m.)
  
  [1m[33m[22m[32mcacheEntries[0m[0m
        describes  whether  formatted  values  of  the entries in the matrices
        given by the components [22m[32mcorner[0m, [22m[32mlabelsCol[0m, [22m[32mlabelsRow[0m, [22m[32mmain[0m, and of the
        corresponding  row  and  column  separators  shall  be  stored  in the
        components  [22m[32mcornerFormatted[0m,  [22m[32mlabelsColFormatted[0m,  [22m[32mlabelsRowFormatted[0m,
        and  [22m[32mmainFormatted[0m. The value must be a Boolean, the default is [22m[32mfalse[0m;
        it should be set to [22m[32mtrue[0m only if the tables are reasonably small.
  
  [1m[33m[22m[32mcornerFormatted[0m[0m
        is  a  list  of lists of formatted entries corresponding to the [22m[32mcorner[0m
        component.  Each  entry  is  either  an  attribute  line  or a list of
        attribute  lines  (with  the same number of displayed characters), the
        values    can    be    computed    from    the   input   format   with
        [22m[32mBrowseData.FormattedEntry[0m.  The  entries  are stored in this component
        only  if the component [22m[32mcacheEntries[0m has the value [22m[32mtrue[0m. The default is
        an empty list.
  
  [1m[33m[22m[32mlabelsColFormatted[0m[0m
        corresponds to [22m[32mlabelsCol[0m in the same way as [22m[32mcornerFormatted[0m to [22m[32mcorner[0m.
  
  [1m[33m[22m[32mlabelsRowFormatted[0m[0m
        corresponds to [22m[32mlabelsRow[0m in the same way as [22m[32mcornerFormatted[0m to [22m[32mcorner[0m.
  
  [1m[33m[22m[32mmainFormatted[0m[0m
        corresponds to [22m[32mmain[0m in the same way as [22m[32mcornerFormatted[0m to [22m[32mcorner[0m.
  
  [1m[33m[22m[32mm0[0m[0m
        is  the  maximal  number  of  rows in the column labels table. If this
        value  is not bound then it is computed from the components [22m[32mcorner[0m and
        [22m[32mlabelsCol[0m.
  
  [1m[33m[22m[32mn0[0m[0m
        is the maximal number of columns in [22m[32mcorner[0m and [22m[32mlabelsRow[0m.
  
  [1m[33m[22m[32mm[0m[0m
        is  the  maximal number of rows in [22m[32mlabelsRow[0m and [22m[32mmain[0m. This value [22m[36mmust[0m
        be  set  in  advance  if  the values of [22m[32mmain[0m are computed using a [22m[32mMain[0m
        function,  and  if  the  number of rows in [22m[32mmain[0m is larger than that in
        [22m[32mlabelsRow[0m.
  
  [1m[33m[22m[32mn[0m[0m
        is  the  maximal  number  of columns in [22m[32mlabelsCol[0m and [22m[32mmain[0m. This value
        [22m[36mmust[0m be set in advance if the values of [22m[32mmain[0m are computed using a [22m[32mMain[0m
        function,  and if the number of columns in [22m[32mmain[0m is larger than that in
        [22m[32mlabelsCol[0m.
  
  [1m[33m[22m[32mheightLabelsCol[0m[0m
        is  a list of 2 [22m[32mm0[0m+ 1 nonnegative integers, the entry at position i is
        the  maximal  height of the entries in the i-th row of [22m[32mcornerFormatted[0m
        and  [22m[32mlabelsColFormatted[0m.  Values  that  are  not bound are computed on
        demand     from    the    table    entries,    with    the    function
        [22m[32mBrowseData.HeightLabelsCol[0m.  (So  if  one  knows the needed heights in
        advance,  it  is  advisable  to set the values, in order to avoid that
        formatted  table  entries are computed just for computing their size.)
        The default is an empty list.
  
  [1m[33m[22m[32mwidthLabelsRow[0m[0m
        is  the  corresponding  list  of  2 [22m[32mn0[0m+ 1 maximal widths of entries in
        [22m[32mcornerFormatted[0m and [22m[32mlabelsRowFormatted[0m.
  
  [1m[33m[22m[32mheightRow[0m[0m
        is  the  corresponding  list  of  2 [22m[32mm[0m+ 1 maximal heights of entries in
        [22m[32mlabelsRowFormatted[0m and [22m[32mmainFormatted[0m.
  
  [1m[33m[22m[32mwidthCol[0m[0m
        is  the  corresponding  list  of  2  [22m[32mn[0m+ 1 maximal widths of entries in
        [22m[32mlabelsColFormatted[0m and [22m[32mmainFormatted[0m.
  
  [1m[33m[22m[32memptyCell[0m[0m
        is  a  table  cell  data  object to be used as the default for unbound
        positions in the four matrices. The default is the empty list.
  
  [1m[33m[22m[32msepCategories[0m[0m
        is  an  attribute  line  to  be  used  repeatedly as a separator below
        expanded category rows. The default is the string [22m[32m"-"[0m.
  
  [1m[33m[22m[32mstartCollapsedCategory[0m[0m
        is  a  list  of attribute lines to be used as prefixes of unhidden but
        collapsed  category  rows.  For  categories of level i, the last bound
        entry  before  the (i+1)-th position is used. The default is a list of
        length  one,  the entry is the boldface variant of the string [22m[32m"> "[0m, so
        collapsed categories on different levels are treated equally.
  
  [1m[33m[22m[32mstartExpandedCategory[0m[0m
        is  a  list  of  attribute  lines  to  be used as prefixes of expanded
        category rows, analogously to [22m[32mstartCollapsedCategory[0m. The default is a
        list of length one, the entry is the boldface variant of the string [22m[32m"*
        "[0m, so expanded categories on different levels are treated equally.
  
  [1m[33m[22m[32mstartSelect[0m[0m
        is  an  attribute  line  to be used as a prefix of each attribute line
        that  belongs  to  a  selected  cell.  The  default  is  to switch the
        attribute [22m[32mNCurses.attrs.STANDOUT[0m on, see Section [1m2.1-7[0m.
  
  [1m[33m[22m[32mClick[0m[0m
        is  a record whose component names are names of available modes of the
        browse  table.  The  values  are  unary functions that take the browse
        table  as  their  argument.  If  the  action [22m[32mClick[0m is available in the
        current  mode and the corresponding input is entered then the function
        in the relevant component of the [22m[32mClick[0m record is called.
  
  [1m[33m[22m[32mavailableModes[0m[0m
        is a list whose entries are the mode records that can be used when one
        navigates through the browse table, see Section [1m5.2[0m.
  
  [1m[33m[22m[32mSpecialGrid[0m[0m
        is a function that takes a browse table and a record as its arguments.
        It  is  called  by [22m[32mBrowseData.ShowTables[0m after the current contents of
        the window has been computed, and it is intended to draw an individual
        grid  into  the  table  that  fits  better  than  anything that can be
        specified  in  terms of row and column separators. (If other functions
        than [22m[32mBrowseData.ShowTables[0m are used in some modes of the browse table,
        these functions must deal with this aspect themselves.) The default is
        to do nothing.
  
  The following components are provided in [22m[32mBrowseData.defaults.dynamic[0m.
  
  [1m[33m[22m[32mchanged[0m[0m
        is  a  Boolean that must be set to [22m[32mtrue[0m by action functions whenever a
        refresh of the window is necessary; it is automatically reset to [22m[32mfalse[0m
        after the refresh.
  
  [1m[33m[22m[32mindexRow[0m[0m
        is  a  list of positive integers. The entry k at position i means that
        the k-th row in the [22m[32mmainFormatted[0m table is shown as the i-th row. Note
        that  depending on the current status of the browse table, the rows of
        [22m[32mmainFormatted[0m  (and  of  [22m[32mmain[0m)  may be permuted, or it may even happen
        that  a row in [22m[32mmainFormatted[0m is shown several times, for example under
        different  category  rows. It is assumed (as a "sort convention") that
        the  [22m[36meven[0m  positions  in  [22m[32mindexRow[0m point to [22m[36meven[0m numbers, and that the
        subsequent  [22m[36modd[0m  positions (corresponding to the following separators)
        point  to  the subsequent [22m[36modd[0m numbers. The default value is the list [
        1,  2,  ...,  m  ],  where  m  is  the number of rows in [22m[32mmainFormatted[0m
        (including the separator rows, so m is always odd).
  
  [1m[33m[22m[32mindexCol[0m[0m
        is the analogous list of positive integers that refers to columns.
  
  [1m[33m[22m[32mtopleft[0m[0m
        is  a  list  of  four  positive  integers denoting the current topleft
        position  of  the  main table. The value [ i, j, k, l ] means that the
        topleft entry is indexed by the i-th entry in [22m[32mindexRow[0m, the j-th entry
        in [22m[32mindexCol[0m, and the k-th row and l-th column inside the corresponding
        cell. The default is [ 1, 1, 1, 1 ].
  
  [1m[33m[22m[32misHiddenRow[0m[0m
        is  a  list  of Booleans, of the same length as the [22m[32mindexRow[0m value. If
        the  entry  at  position  i is [22m[32mtrue[0m then the i-th row is currently not
        shown;  a  typical  situation  is  that the row belongs to a collapsed
        category row. It is assumed (as a "hide convention") that the value at
        any even position equals the value at the subsequent odd position. The
        default is that all entries are [22m[32mfalse[0m.
  
  [1m[33m[22m[32misHiddenCol[0m[0m
        is the corresponding list for [22m[32mindexCol[0m.
  
  [1m[33m[22m[32mactiveModes[0m[0m
        is  a  list  of  mode records that are contained in the [22m[32mavailableModes[0m
        list  of  the  [22m[32mwork[0m component of the browse table. The current mode is
        the  last  entry in this list. The default depends on the application,
        [22m[32mBrowseData.defaults[0m  prescribes the list containing only the mode with
        [22m[32mname[0m component [22m[32m"browse"[0m.
  
  [1m[33m[22m[32mselectedEntry[0m[0m
        is  a  list  [  i,  j  ]. If i = j = 0 then no table cell is selected,
        otherwise  i  and j are the row and column index of the selected cell.
        (Note that i and j are always even.) The default is [ 0, 0 ].
  
  [1m[33m[22m[32mselectedCategory[0m[0m
        is  a  list  [  i, l ]. If i = l = 0 then no category row is selected,
        otherwise  i  and  l  are  the row index and the level of the selected
        category row. (Note that i is always even.) The default is [ 0, 0 ].
  
  [1m[33m[22m[32msearchString[0m[0m
        is  the  last string for which the user has searched in the table. The
        default is the empty string.
  
  [1m[33m[22m[32msearchParameters[0m[0m
        is   a   list   of  parameters  that  are  modified  by  the  function
        [22m[32mBrowseData.SearchStringWithStartParameters[0m.    If   one   sets   these
        parameters  in  a  search  then  these values hold also for subsequent
        searches.  So  it  may  make sense to set the parameters to personally
        preferred ones.
  
  [1m[33m[22m[32msortFunctionForColumnsDefault[0m[0m
        is  a  function  with two arguments used to compare two entries in the
        same  column  of  the  main  table  (or  two category row values). The
        default  is  the  function  [22m[32m\<[0m.  (Note  that  this  default may be not
        meaningful if some of the rows or columns contain strings representing
        numbers.)
  
  [1m[33m[22m[32msortFunctionForRowsDefault[0m[0m
        is the analogous function for comparing two entries in the same row of
        the main table.
  
  [1m[33m[22m[32msortFunctionsForRows[0m[0m
        is  a list of comparison functions, if the i-th entry is bound then it
        replaces the [22m[32msortFunctionForRowsDefault[0m value when the table is sorted
        w.r.t. the i-th row.
  
  [1m[33m[22m[32msortFunctionsForColumns[0m[0m
        is  the  analogous  list  of  functions for the case that the table is
        sorted w.r.t. columns.
  
  [1m[33m[22m[32msortParametersForRowsDefault[0m[0m
        is  a  list of parameters for sorting the main table w.r.t. entries in
        given rows, e. g., whether one wants to sort ascending or descending.
  
  [1m[33m[22m[32msortParametersForColumnsDefault[0m[0m
        is  the analogous list of parameters for sorting w.r.t. given columns.
        In  addition  to  the  parameters for rows, also parameters concerning
        category  rows are available, e. g., whether the data columns that are
        transformed into category rows shall be hidden afterwards or not.
  
  [1m[33m[22m[32msortParametersForRows[0m[0m
        is  a list that contains ar position i, if bound, a list of parameters
        that  shall  replace  those  in  [22m[32msortParametersForRowsDefault[0m when the
        table is sorted w.r.t. the i-th row
  
  [1m[33m[22m[32msortParametersForColumns[0m[0m
        is the analogous list of parameters lists for sorting w.r.t. columns.
  
  [1m[33m[22m[32mcategories[0m[0m
        describes  the current category rows. The value is a list [ l_1, l_2 ]
        where l_1 is a [22m[36msorted[0m list [ i_1, i_2, ..., i_k ] of positive integers
        and l_2 is a list of length k where the j-th entry has the form [ i_j,
        l_j,  v_j,  s_j,  h_j  ].  This  means that above the i_j-th table row
        (w.r.t. the component [22m[32mindexRow[0m), there is a category row at level l_j,
        which  is  hidden if h_j is [22m[32mtrue[0m, and otherwise the shown value is the
        attribute  line  v_j  and  the  separator  below the category row is a
        repetition  of  s_j.  The default value is [22m[32m[ [], [] ][0m. (Note that this
        "hide  convention"  makes  sense  mainly  if  together  with  a hidden
        category  row,  also  the  category  rows  on  higher  levels  and the
        corresponding  data  rows  are  hidden  --  but  this  property is [22m[36mnot[0m
        checked.)  Categories  are computed with the [22m[32mCategoryValue[0m function in
        the [22m[32mwork[0m component of the browse table.
  
  [1m[33m[22m[32mlog[0m[0m
        describes  the  session log which is currently written. The value is a
        list of positive integers, representing the user inputs in the current
        session.  When  [1mGAP[0m  returns  from  a  call  to  [1m[34mNCurses.BrowseGeneric[0m
        ([1m4.3-1[0m),  one  can access the log list of the user interactions in the
        browse table as the value of its component [22m[32mdynamic.log[0m.
  
        If    [22m[32mBrowseData.logStore[0m    had    been    set    to    [22m[32mtrue[0m   before
        [1m[34mNCurses.BrowseGeneric[0m  ([1m4.3-1[0m)  had been called then the list can also
        be  accessed as the value of [22m[32mBrowseData.log[0m. If [22m[32mBrowseData.logStore[0m is
        unbound  or has a value different from [22m[32mtrue[0m then [22m[32mBrowseData.log[0m is not
        written.  (This  can  be  interesting  in  the  case  of  browse table
        applications  where  the  user does not get access to the browse table
        itself.)
  
  [1m[33m[22m[32mreplay[0m[0m
        describes  the non-interactive input for the current browse table. The
        value  is  a record with the components [22m[32mlogs[0m (a dense list of records,
        the  default  is  an  empty list) and [22m[32mpointer[0m (a positive integer, the
        default  is  1).  If  [22m[32mpointer[0m is a position in [22m[32mlogs[0m then currently the
        [22m[32mpointer[0m-th  record  is  processed,  otherwise  the  browse  table  has
        exhausted  its  non-interactive  part, and requires interactive input.
        The  records  in [22m[32mlog[0m have the components [22m[32msteps[0m (a list of user inputs,
        the  default  is an empty list), [22m[32mposition[0m (a positive integer denoting
        the  current  position  in  the  [22m[32msteps[0m  list  if  the log is currently
        processed,  the default is 1), [22m[32mreplayInterval[0m (the timeout between two
        steps  in milliseconds if the log is processed, the default is 0), and
        [22m[32mquiet[0m  (a  Boolean, [22m[32mtrue[0m if the steps shall not be shown on the screen
        until the end of the log is reached, the default is [22m[32mfalse[0m).
  
  [1m[4m[31m5.4-2 BrowseData.SetReplay[0m
  
  [1m[34m> BrowseData.SetReplay( [0m[22m[34mdata[0m[1m[34m ) _____________________________________[0mfunction
  
  This      function      sets      and      resets      the      value     of
  [22m[32mBrowseData.defaults.dynamic.replay[0m.
  
  When  [22m[32mBrowseData.SetReplay[0m  is  called with a list [22m[34mdata[0m as its argument then
  the entries are assumed to describe user inputs for a browse table for which
  [1m[34mNCurses.BrowseGeneric[0m ([1m4.3-1[0m) will be called afterwards, such that replay of
  the  inputs  runs.  (Valid  input  lists  can be obtained from the component
  [22m[32mdynamic.log[0m of the browse table in question.)
  
  When  [22m[32mBrowseData.SetReplay[0m  is  called  with  the  only  argument [22m[32mfalse[0m, the
  component   is   unbound   (so   replay  is  disabled,  and  thus  calls  to
  [22m[32mNCurses.BrowseGeneric[0m will require interactive user input).
  
  The  replay feature should be used by initially setting the input list, then
  running  the  replay  (perhaps  several  times),  and  finally unbinding the
  inputs,  such that subsequent uses of other browse tables do not erroneously
  expect their input in [22m[32mBrowseData.defaults.dynamic.replay[0m.
  
  Note  that the value of [22m[32mBrowseData.defaults.dynamic.replay[0m is used in a call
  to  [22m[32mNCurses.BrowseGeneric[0m only if the browse table in question does not have
  a component [22m[32mdynamic.replay[0m before the call.
  
  [1m[4m[31m5.4-3 BrowseData.AlertWithReplay[0m
  
  [1m[34m> BrowseData.AlertWithReplay( [0m[22m[34mt, messages[, attrs][0m[1m[34m ) _______________[0mfunction
  [1mReturns:[0m  an integer representing a (simulated) user input.
  
  The  function  [22m[32mBrowseData.AlertWithReplay[0m  is  a  variant  of  [1m[34mNCurses.Alert[0m
  ([1m3.1-1[0m)  that  is  adapted for the replay feature of the browse table [22m[34mt[0m, see
  Section  [1m4.1[0m.  The  arguments  [22m[34mmessages[0m  and  [22m[34mattrs[0m  are  the  same  as  the
  corresponding   arguments   of   [22m[32mNCurses.Alert[0m,   the  argument  [22m[32mtimeout[0m  of
  [22m[32mNCurses.Alert[0m   is   taken   from   the  browse  table  [22m[34mt[0m,  as  follows.  If
  [22m[32mBrowseData.IsDoneReplay[0m  returns  [22m[32mtrue[0m for [22m[32mt[0m then [22m[32mtimeout[0m is zero, so a user
  input  is requested for closing the alert box; otherwise the requested input
  character is fetched from [22m[32mt.dynamic.replay[0m.
  
  No  alert box is shown if [22m[32mBrowseData.IsQuietSession[0m returns [22m[32mtrue[0m when called
  with  [22m[34mt[0m[22m[32m.dynamic.replay[0m, otherwise the alert box is closed after the time (in
  milliseconds) that is given by the [22m[32mreplayInterval[0m value of the current entry
  in [22m[34mt[0m[22m[32m.dynamic.replay.logs[0m.
  
  The  function  returns  either the return value of the call to [22m[32mNCurses.Alert[0m
  (in  the  interactive  case)  or the value that was fetched from the current
  replay record (in the replay case).
  
  [1m[4m[31m5.4-4 BrowseData.actions.ShowHelp[0m
  
  [1m[34m> BrowseData.actions.ShowHelp________________________________[0mglobal variable
  
  There  are  two  predefined  ways  for showing an overview of the admissible
  inputs and their meaning in the current mode of a browse table. The function
  [22m[32mBrowseData.ShowHelpTable[0m displays this overview in a browse table (using the
  [22m[32mhelp[0m mode), and [22m[32mBrowseData.ShowHelpPager[0m uses [22m[32mNCurses.Pager[0m.
  
  Technically,  the  only  difference  between  these  two  functions  is that
  [22m[32mBrowseData.ShowHelpTable[0m      supports     the     replay     feature     of
  [22m[32mNCurses.BrowseGeneric[0m, whereas [22m[32mBrowseData.ShowHelpPager[0m simply does not call
  the pager in replay situations.
  
  The  action  record  [22m[32mBrowseData.actions.ShowHelp[0m is associated with the user
  inputs  [1m[46m?[0m  or  [1m[46mF1[0m  in standard [22m[32mNCurses.BrowseGeneric[0m applications, and it is
  recommended to do the same in other [22m[32mNCurses.BrowseGeneric[0m applications. This
  action  calls  the  function  stored  in  the component [22m[32mwork.ShowHelp[0m of the
  browse      table,      the     default     (i. e.,     the     value     of
  [22m[32mBrowseData.defaults.work.ShowHelp[0m) is [22m[32mBrowseData.ShowHelpTable[0m.
  
  [22m[35m---------------------------  Example  ----------------------------[0m
    [22m[35mgap> xpl1.work.ShowHelp:= BrowseData.ShowHelpPager;;[0m
    [22m[35mgap> BrowseData.SetReplay( "?Q" );[0m
    [22m[35mgap> Unbind( xpl1.dynamic );[0m
    [22m[35mgap> NCurses.BrowseGeneric( xpl1 );[0m
    [22m[35mgap> xpl1.work.ShowHelp:= BrowseData.ShowHelpTable;;[0m
    [22m[35mgap> BrowseData.SetReplay( "?dQQ" );[0m
    [22m[35mgap> Unbind( xpl1.dynamic );[0m
    [22m[35mgap> NCurses.BrowseGeneric( xpl1 );[0m
    [22m[35mgap> BrowseData.SetReplay( false );[0m
    [22m[35mgap> Unbind( xpl1.dynamic );[0m
  [22m[35m------------------------------------------------------------------[0m
  
  [1m[4m[31m5.4-5 BrowseData.actions.SaveWindow[0m
  
  [1m[34m> BrowseData.actions.SaveWindow______________________________[0mglobal variable
  
  The function [22m[32mBrowseData.actions.SaveWindow.action[0m asks the user to enter the
  name  of  a  global  [1mGAP[0m variable, using [1m[34mNCurses.GetLineFromUser[0m ([1m3.1-3[0m). If
  this  variable  name  is valid and if no value is bound to this variable yet
  then the current contents of the window of the browse table that is given as
  the argument is saved in this variable, using [1m[34mNCurses.SaveWin[0m ([1m2.2-10[0m).
  
  [1m[4m[31m5.4-6 BrowseData.actions.QuitMode[0m
  
  [1m[34m> BrowseData.actions.QuitMode________________________________[0mglobal variable
  [1m[34m> BrowseData.actions.QuitTable_______________________________[0mglobal variable
  
  The  function [22m[32mBrowseData.actions.QuitMode.action[0m unbinds the current mode in
  the  browse  table  that  is given as its argument (see Section [1m5.2[0m), so the
  browse  table  returns  to the mode from which this mode had been called. If
  the  current  mode is the only one, first the user is asked for confirmation
  whether  she  really  wants to quit the table; only if the [1m[46my[0m key is hit, the
  last mode is unbound.
  
  The  function  [22m[32mBrowseData.actions.QuitTable.action[0m  unbinds all modes in the
  browse table that is given as its argument, without asking for confirmation;
  the effect is to exit the browse application (see Section [1m5.3[0m).
  
  [1m[4m[31m5.4-7 BrowseData.actions.Error[0m
  
  [1m[34m> BrowseData.actions.Error___________________________________[0mglobal variable
  
  After [1m[34mNCurses.BrowseGeneric[0m ([1m4.3-1[0m) has been called, interrupting by hitting
  the  [1m[46mCtrl-C[0m  keys  is  not possible. It is recommended to provide the action
  [22m[32mBrowseData.actions.Error[0m   for   each   mode   of   a  [22m[32mNCurses.BrowseGeneric[0m
  application,  which  enters  a  break  loop  and  admits  returning  to  the
  application. The recommended user input for this action is the [1m[46mE[0m key.
  
