<Chapter Label="chap:browse-user">
<Heading>Browsing Tables in &GAP; using <C>ncurses</C>
–The 100
As stated in Section <Ref Sect="sec:intro"/>,
one aim of the &Browse; package is to provide tools for the quite usual task
to show a two-dimensional array or certain rows and columns of it
on a character screen in a formatted way,
to navigate in this array via key strokes (and mouse events), and
to search for strings, to sort the array by row or column values etc.
<P/>
The idea is that one starts with an array of data,
the <E>main table</E><Index>main table of a browse table</Index>.
Optionally, labels for each row of the main table are given,
which are also arranged in an array (with perhaps several columns),
the <E>row labels table</E><Index>row labels of a browse table</Index>;
analogously,
a <E>column labels java.lang.StringIndexOutOfBoundsException: Index 24 out of bounds for length 2
of labels for the columns of the main table may be given.
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
shown
The space above the row labels and to the left of the column subsection{\textcolor{Chapter }{Sign (of an rcwa permutation of
can be used for a fourth table,
the <E>corner table</E><Index>corner table of a browse tablelogpage{[ 2,45 ]\
with information about the hyperdef{L}{X8365EEEB82C946FD
Optionally, a <E>header</E><Index>header of a browse table</Index>
anda<E>footer</E<Index>footer of a browse table</Index>
may be shown above and below these four tables, respectively.
Header and footer are not separated into columns.
the hasjava.lang.StringIndexOutOfBoundsException: Index 48 out of bounds for length 48
<P/>
<Alt Only="Text">
<textb{java.lang.StringIndexOutOfBoundsException: Range [16, 15) out of bounds for length 27
───────────────
│ header │
├────────┬──────────
│ │
│ corner │
│ │ │
────┼───────────
│ │ │
│ │ │
main │
│ labels │ table │
│ │ │
│ │ │
│ │ │
+\um_rm) {()} < 0 \frac{ -2r{}}}.
│ footer │
└────────────────────────────────┘
</Verb>
</Alt>
<Alt Only="LaTeX">
<![CDATA[
\begin{center}
\begin{tabular}{|c|c|}
\hline
\multicolumn{2}{|c|}{header} \\
\hline
corner & column labels \\
\hline
& \\
row & main \\
labels & table \\
& \\
\hline
\multicolumn{2}{|c|}{footer} \\
\hline
\end{tabular}
\end{center}
]]>
</Alt>
<Alt Only="HTML">
<![CDATA[
</p>
<table rules="all" border="3">
<thead>
<tr>
<td colspan="2" align="center">header</td>
</tr>
</thead>
<tfoot>
<tr>
<td colspan="2" align="center">footer</td>
</tr>
</tfoot>
<tbody>
<tr>
<td align="center">corner</td>
<td align="center">column labels</td>
</tr>
<tr>
<td align="center">row labels</td>
<td align="center">main table</td>
</tr>
</tbody>
</table><p>
]]>
</Alt>
<P/>
If not the whole tables fit into the java.lang.StringIndexOutOfBoundsException: Index 41 out of bounds for length 8
and columns of The signmapping isan epimorphism RCWA({ensuremath{\mathbb Z})to the
together with the corresponding row and column labels.
lso inthis the row row heightsand column widths are computed w...
the whole table not w.r.t. the normal subgroup of RCWA({\ensuremath{\mathbb Z}}) of index{\nobreakspace}2.
This means that the shown row labels are unchanged if the range of shown
columns is changed,
the shown column labels are unchanged if the range of shown rows is changed,
and the whole corner table is simple group CT({\ensuremath{\mathbb a this .
<P/>
The begin[java.lang.StringIndexOutOfBoundsException: Range [30, 29) out of bounds for length 77
<E>java.lang.StringIndexOutOfBoundsException: Index 8 out of bounds for length 2
those just tothe be java.lang.StringIndexOutOfBoundsException: Range [73, 74) out of bounds for length 73
in a record
‐which we call a <E>browse table</E>–
without need for additional &GAP; programming.
<P/>
Section <Ref Sect="sec:features"/> gives an overview of the features
available in standard browse table applications,
and Section  [1, 11]
the data structures used in browse tables.
Finally, Section <Ref Sect="sec:browsegeneric"/> introduces
the function <Ref Func="NCurses\nd{
which is the generic functionjava.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2
<P/>
For technical java.lang.StringIndexOutOfBoundsException: Range [0, 21) out of bounds for length 2
and java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 0
java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2
<P/>
Examples of browse table applications are shown
Chapter&;RefChap="ch:appl"/>.
<!-- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -->
<Section Labeljava.lang.StringIndexOutOfBoundsException: Range [13, 12) out of bounds for length 47
<Heading>Features logpage[2,5 ]
</Heading>
Standard applications ofh{{{
have the following functionality.
ther only a , add java.lang.StringIndexOutOfBoundsException: Range [61, 60) out of bounds for length 75
see Chapters <Ref Factoring group elements into the members of some ``nice'' set of generators is often helpful. In this section we describe an operation
and <Ref Chap="ch:appl"/>.
<P/>
<List>
<Mark>Scrolling:<Index>scrolling in a browse table</Index></Mark>
<Item>
The subranges of shown rows and columns of the main table can be modified,
such that the focus area is moved to the left, to the Z}).Elements of generatedrcwagroups be into
generators ` usual'', {nobreakspace}textttPreImagesRepresentative(\ef{:foran .from a free group to group}).
cell or a part of it, by thejava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
minus onetable cell)
If mouse events <Index>mouse events</Index>
arelogpage{ 2 , 1]\
</Item>
<Mark{{{java.lang.StringIndexOutOfBoundsException: Index 33 out of bounds for length 33
<Item>
A cell, row, or column of the main table can be selected;
then it is shown label{CTCSCRSplit:for an rcwajava.lang.StringIndexOutOfBoundsException: Range [19, 18) out of bounds for length 48
<STANDOUT<C>java.lang.StringIndexOutOfBoundsException: Index 32 out of bounds for length 32
see&;Ref"ssec">
The selection can be moved inside the main table to of3rcwajava.lang.StringIndexOutOfBoundsException: Range [31, 30) out of bounds for length 205
java.lang.StringIndexOutOfBoundsException: Range [10, 9) out of bounds for length 62
when the window borders are reached.
</Item>
<Mark>Searching:<Index>searching in a browse table</Index></Mark>
<Item>
A search string is entered by the user, and the \texttt{\symbol{45}}preserving and $c$ is integral
becomes selected; one can java.lang.StringIndexOutOfBoundsException: Index 32 out of bounds for length 0
Global search
not, search for substrings or complete words) and what the first java.lang.StringIndexOutOfBoundsException: Range [0, 70) out of bounds for length 0
the next matching cells are (search in the whole table or just in the
selected row or column, search for whole words or prefixes or suffixes,
search forwards or backwards).
</Item>
<Mark>Sorting:<Index>sorting a browse table</Index></Mark>
<Item>
If a row or column is selected then the main table can be sorted w. Assuming the hypothesis that CT({\ensuremath{\mathbb Z}}) is the group of all
the entries in this row or column.
Global sort parameters describe for example whether one wants to sort
ascending or descending, or case sensitive or not.
<P/>
If a categorized table is sorted by a column then the category rows
are removed andthecurrent sorting filtering by is reset
before the table is sorted by the given column.
If a tableintegers ,$a$ always an element of CT({\ensuremath{\mathbb Z}}).
then this ordering is reset first.
<P/>
Sorting can be undone globally, i. e., one canbegin{Verbatim}commandchars=@,fontsize=\,frame=singlelabel=Example
unsorted table.
</Item>
<Mark>Sortingjava.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2
<>
If a column is selected then the main table can be sorted w.r.t.
theentries inthis columnjava.lang.StringIndexOutOfBoundsException: Index 29 out of bounds for length 29
and additionally these entries areg@gap> !java.lang.StringIndexOutOfBoundsException: Range [29, 28) out of bounds for length 54
i. e.,
additional rows are added to the java.lang.StringIndexOutOfBoundsException: Range [3, 1) out of bounds for length 66
java.lang.StringIndexOutOfBoundsException: Range [24, 5) out of bounds for length 71
java.lang.StringIndexOutOfBoundsException: Range [30, 31) out of bounds for length 20
(There should be no danger to mix up this notion of categories with the one
ClassReflection 2() )]
The category rows can be <E>collapsed</E>
<Index>collapsed category row</Index>
(that is, the !gapprompt@gap>| !ggapprompt@> !apinput@Product(facts)=g|
or <E>expanded</E><Index>expanded category row</Index>
(that is, the corresponding table rows are shown).
Some of the global search parameters affect the category rows,
for example, whether the category rows shall involve a counter showing the
java.lang.StringIndexOutOfBoundsException: Range [11, 8) out of bounds for length 36
or whether a row of the browse table appears under different category rows.
<P/> <!-- Whenatablegetssortedandcategorizedthatisalreadycategorized, thenewcategoryrowsarecreatedontruetruefalsejava.lang.StringIndexOutOfBoundsException: Index 23 out of bounds for length 23 sosuccessivelycategorizingbyseveral <P/>
-->
Sorting and categorizing can be undone globally, i. e.,
one can return to the unsorted table without category rows.
</Item>
<Mark>Filtering:<Index>filtering a browse table</Index></Mark>
<Item>
The browse table can be restricted to those rows or columns java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 0
a given search string occurs.
(Also entries in collapsed rows can match; they remain collapsed then.)
As a consequence, the category rows are restricted to those
under which a matching row occurs.
(It is irrelevant whether the search string occurs in category rows.)
<P/>
If the search string does not occur at all then a message is printed,
and the table remains as it was before.
If a browse table is restricted then this fact is indicated by the message
<Q>restricted table</Q> in the lower right corner of the window.
<P/>
When a column or row is selected then the search is restricted to the
entries in this column or row, respectively.
Besides using a search,
one can also explicitly hide the selected row or column.
Filtering in an already restricted table restricts the shown rows or
columns further.
<P/>
Filtering can be undone globally, i. e., one can return to the
unrestricted table.
</Item>
<Mark>Help:<Index>help window for a browse table</Index></Mark>
<Item>
Depending on the application and on the situation,
different sets of user inputs may be available
and different meanings of these inputs are possible.
An overview of the currently available inputs and their meanings
can be opened in each situation, by hitting the <B>?</B> key.
</Item>
<Mark>Re-entering:</Mark>
<Item>
When one has called <Ref Func="NCurses.BrowseGeneric"/> with a browse table,
and returns from visual mode to the &GAP; prompt after some navigation steps,
calling <C>NCurses.BrowseGeneric</C> again with this table
will enter visual mode in the same situation where it was left.
For example, the cell in the top-left position will be the same as before,
and if a cell was selected before then this cell will be \logpage{[ 2, 5,2 ]}\obreak
(One can avoid this behavior using the optional second argument of
<C>NCurses.BrowseGeneric</C>.)
</Item>
<Mark>Logging:<Index>log of a browse table session</Index></Mark>
<Item
The integers corresponding to the user inputs in visual mode
are collected in a list that is stored in the component
<C>dynamic.log</C> of\abel{FactorizationIntoCSCRCT:oranrcwa permutation of Z}
It can be used for repeating the inputs with the replay feature.
(For browse table applications that give the user no access to the
browse table itself, one can force the log to be assigned to the component
<C>log</C> of the global variable <C>BrowseData</C>,
<Index>BrowseData.log</Index>
see Section <Ref Subsect="BrowseData"/>.)
</Item>
<Mark>Replay:<Index>replay of a browse table session</Index></Mark>
<Item>
Instead of interactively hitting keys in visual mode, one can prescribe
the user inputs to a browse table via a <Q>replay record</Q>;
the inputs are then processed with given time intervals.
The easiest way to create a meaningful replay record is via the function
<Ref Func="BrowseData.SetReplay"/>, with argument the <C>dynamic.log</C>
component ofthe browsetable in question that was stored in an
interactive session.
</Item>
</List>
<P/>
The following features are not available in standard applications.
They require additional programming.
<P/>
<List>
<Mark>noindent\textcolor{uncColor{\$\{actorization{\mdseries\ }\ndex{Factorization@\texttt{Factorization}!for an rcwa permutation of Z}
<Item>
One possible action is to <Q>click</Q> a selected cell, row, or column,
by hitting the <B>Enter</B> key.
It depends on the application what the effect is.
A typical situation is that a corresponding &GAP; object is added to the
list of return values of <Ref Func="NCurses.BrowseGeneric"/>.
Again it depends on the application what this &GAP; object is.
In order to use this feature, one has to provide a record whose components
are &GAP; functions, see Section <Ref Subsect="BrowseData"/>
for details.
If mouse events <Index>ouse events</Index> are enabled
(see <Ref Func="NCurses.UseMouse"/>)
then also mouse clicks can be used as an alternative
to hitting the <B>Enter</B> key.
</Item>
<Mark>Return Value:<Index>return value\label{Factorization:for an rcwa permutation of Z}
<Item>
The function <Ref Func="NCurses.BrowseGeneric"/> may have
an application }hfill\scriptsize (method)}}\\
A typical situation is that a list of objects corresponding to those
cells is returned that were <Q>clicked</Q> in visual mode.
In order textbf\indent Returns:\ }
the component <C>dynamic.Return</C> of the browse table.
</Item>
</List>
</Section>
<!-- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -->
<Section Label="sec:browsebasicdata">
<Heading>Data Structures used by <C>NCurses.and class transpositions, provided that such a factorization transpositions,provided that such a factorization exists and the
<#Include Label="IsBrowseTableCellData_man">
<#Include Label="BlockEntry_man">
<#Include Label="IsBrowseTable_man">
</Section>
<!-- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -->
<Section Label="sec:browsegeneric">
<Heading>The Function <C>NCurses.BrowseGeneric</C></Heading>
<#Include Label="NCurses.BrowseGeneric_man">
</Section>
</Chapter>
<!-- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -->
<Chapter Label="chap:browse-prg">
<Heading>Browsing Tables in &GAP; using <C>ncurses</C>
–The method finds it
This chapter describes some aspects of the internals of the browse table
handling.
The relevant objects are
<E>action functions</E> that implement the individual java.lang.StringIndexOutOfBoundsException: Index 62 out of bounds for length 0
(see Section <Ref Sect="sec:actions"/>),
<E>modes</E> that describeThe mayreturn \texttt{,stopwithanerrormessage or run into an infinite loop. If it returns a
situations (see Section <Ref Sect="sec:modes"/>),
and <E>browse applications</E> that are given by the combination of several
modes (see Section <Ref Sect="sec:applications"/>).
Most of the related data is stored in the global variable
<Ref Var="BrowseData"/>.
For more details, one should look directly at the code in the file
<F>lib/browse.gi</F> of the &Browse; package.
<!-- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -->
<Section Label="sec:actions">
<Heading>Navigation Steps in Browse Tables</Heading>
Navigating in a browse table means that after entering visual mode
by calling <Ref Func="NCurses.BrowseGeneric"/>,
the user hits one or several keys, or uses a mouse button,
and if this input is in a given set of admissible inputs
then a corresponding function is executed with argument the browse table
(plus additional information in the case of mouse events).
The function call then may change components in this table
(recommended: components in its <C>dynamic</C> component),
such that the appearance in the window may be different afterwards,
and also the admissible inputs and their effects may have changed.
<P/>
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 <B>?</B> key and the <B>F1</B> key should belong to a function
that shows a help window
(see Section <Ref Subsect="BrowseData.actions.ShowHelp"/>),
the <B>q</B> key and the <B>Esc</B> key should belong to a function
that exits the current mode
thatthe BEsc/B> keymaybe as input
only after a delay of about a java.lang.StringIndexOutOfBoundsException: Range [0, 36) out of bounds for length 0
the <>Q/B> key belong to function that exits the browse
application (see Section <Ref Subsect="BrowseData.actions.QuitMode"/>),
the <B>F2</B> key should belong to a function that saves the current
window contents in a global variable
(see Section <Ref Subsect="BrowseData.actions.SaveWindow"/>),
and
the <B>E</B> key should belong to a function that enters a break loop
(see Section <Ref Subsect="BrowseData.actions.Error"/>).
The <B>Enter</B> and <B>Return</B> keys should belong to a <Q>click</Q>
on a selected table entry, and if a category row is selected then they
should expand/collapse this category.
The <B>M</B> key should toggle enabling and disabling mouse events.
Mouse events on a cell or on a category row of a browse table
should move the selected entry to this position;
it is recommended that no functionality is lost if no mouse events are used,
java.lang.StringIndexOutOfBoundsException: Range [19, 8) out of bounds for length 69
<P/>
Each such function is wrapped into a record with the components <C>action</C>
(the function itself) and <C>helplines</C> (a list of attribute lines that
describes what the function does).
<Index>action record of a browse table</Index>
are by thehelpfeature CNCurses.BrowseGeneric</C>,
see Section <Ref Subsect="BrowseData.actions.ShowHelp"/>.
<P/>
The action functions need not return anything.
Whenever the shown screen shall be recomputed after the function call,
the component <C>dynamic.changed</C> of the browse table must be set to
<K>true</K> by the action functions.
<P/>
After entering the first characters of an admissible input
that consists of more characters,
the last line of the window with the browse table shows these characters
behind the prefix <Q>partial input:</Q>.
<Index>partial input in a browse table</Index>
One can delete the last entered character of a partial input via the
<B>Delete</B> and <B>Backspace</B> keys.
It is not possible to make these keys part le input.
When a partial input is given, only those user inputs have an effect
that extend the partial input to (a prefix of) an admissible input.
Forexample,forhelp hitting the <B></B> key will in
not work if a partial input had been entered before.
</Section>
<!-- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -->
<Section Label="sec:modes">
<Heading>Modes in Browse Tables</Heading>
<Index>mode of a browse table</Index>
In different situations, different inputs may be admissible for the same
browse table,definition.
For example, the meaning of <Q>moving down</Q> can be different depending on
whether a cell
<P/>
The By factoringprocess begins with splittingoff from the
particular situation is collected in a <E>mode</E> of the browse table.
(There should be no danger to mix up this right. This can be changed by setting the option \mbox{\texttt{\mdseries\slshape Direction}} to \texttt{"from the left"}.
<</Q> in <ef Sect=":ntro/>)
A mode is represented by a record with the components
<Coccurring in the final stage of the algorithm is computed. This can be
(a string used to suppressed by setting the option \mbox{\texttt{\mdseries\slshape ShortenPartition}} equal to \texttt{false}.
<C>headerLength</C>, <C>footer</C>, <C>footerLength</C> default, at theend checked whether the product of the
and factors indeed equals \box{\texttt{mdseries\slshape g}. Thishis check be suppressedby the option \mbox{\texttt{\mdseries\slshape NC}}.
<C>flag</C>
(a string that begin{Verbatim}[commandchars=!@|,fontsize=\small,frame=single,label=Example]
different modes),
<C><C>actions
(a list of records describing the navigation steps that are !apprompt@gap>| !gapinput@Factorization(Comm(ClassShift(0,3)*ClassReflection(1,2),|
in the mode, see !gapprompt@>| !gapinput (02));
[ (2(3) ) ClassShift 2() )-,( 06),26) )
(the function used to eventually print the current window contents,
thehe default is <C>BrowseData.ShowTables</C>).
<Index>BrowseData.ShowTables</Index>
Due to the requirement that each admissible user input uniquely determines
a corresponding function, no admissible user input can be a prefix
another admissible input, for java.lang.StringIndexOutOfBoundsException: Index 32 out of bounds for length 14
<P/>
Navigation steps (see Section <Ref For purposes of demonstrating the capabilities of the factorization routine,
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 in Section{nobreakspace}\ref{sec:FactoringTheCollatzPermutation} Collatz' permutation is factored. Lothar Collatz has investigated this
<P/>
In a browse table, all available modes are stored in the component
<C>work.availableModes<
The value of the component <C>dynamic.activeModes</C> is a list of
mode records that is used as a stack:
The <E>current mode<The permutations of the followingkind play an important role in factoring
changing the current mode is achieved
by unbinding the last entry (so one returns to the mode
java.lang.StringIndexOutOfBoundsException: Range [31, 4) out of bounds for length 71
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>dynamic.activeModes/C> list becomes empty,
the browse table application is left.
(In this situation,
if the browse table had been entered from the &GAP; prompt then
visual mode is left, and one returns to the &GAP; prompt.)
<P/>
The following modes are predefined by the &Browse; package.
Each of these modes admits the user inputs
<B>?</B>, <B>F1</B>, <B>q</B>, <B>Esc</B>,
<B>Q</B>, <B>F2</B>, <B>E</B>, and <B>M</B>
that have been mentioned in Section <Ref Sect="sec:actions"/>.
<List>
<Mark>browse</Mark>
<Item>
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.
</Item>
<Mark>help</Mark>
<Item>
This mode is entered by calling <C>BrowseData.ShowHelpTable</C>;
it shows a help window concerning the actions available in the mode
from which the <C>help</C> mode was entered.
The <C>help</C> mode admits scrolling in the help table
by a cell or by a screen.
See Section <Ref Subsect="BrowseData.actions.ShowHelp"/>
for details.
</Item>
<Mark>select_entry</Mark>
<Item>
In this mode, one table cell is
this cell is highlighted using the attribute in the component
<C>work\oindenttextcolor{uncColor}{$\triangleright$\nspace\texttt{PrimeSwitch({({\mdseries\slshape p}\{rimeSwitch\texttt{PrimeSwitch}pjava.lang.StringIndexOutOfBoundsException: Index 140 out of bounds for length 140
see the remark in Section\{scriptsizem)}\
The mode admits\\textcolor{uncColor{\$\enspacetextttPrimeSwitch\\lshapep,k}\{rimeSwitch\texttt{rimeSwitch}p,k}
searchinglabelPrimeSwitchp kjava.lang.StringIndexOutOfBoundsException: Index 24 out of bounds for length 24
expandingor collapsing the current category rowor all category rows,
and executing the <Q>click</Q> function of this mode,
provided that the component <C>work.Click.( "\\extcolor{uncColor}$t$\nspace\exttt{PrimeSwitch{mdseriesslshape p, , }\index{@t{}!,r,mjava.lang.StringIndexOutOfBoundsException: Index 151 out of bounds for length 151
of the browse table is bound.
</>
<Mark>select_row</Mark>
<Item>
This is like the <C>select_entry</C> mode,
except that a whole row of the browse table is highlighted.
Searching is restricted to the selected row, and <Q>click</Q> refers to the
function <C>work.Click.( "select_row" )</C>.
</Item>
<Mark>select_row_and_entry</Mark>
<Item>
This is a combination of the <C>select_entry</C> mode and the
<C>select_row</C> mode.
</Item>
<Mark>select_column</Mark>
<Item>
This is like the <C>select_row</C> mode,
just a column is selected not a row.
</Item>
<Mark>select_column_and_entry</Mark>
<Item>
This is like the <C>select_row_and_entry</C> mode,
just a column is selected not a row.
</Item>
</List>
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 &Browse; package can be available
(<Q>standard application</Q>),
or additional functionality can be provided by extending available modes or
adding new modes.
<P/>
When <Ref Func="NCurses.BrowseGeneric"/> has been called
with the browse table <A>t</A>, say, the following loop is executed.
<Enum>
<Item>
If the list <A>t</A><C>.dynamic.activeModes</C> is empty then exit
the browse table, and if the component <A>t</A><C>.dynamic.Return</C>
is bound then return its value.
Otherwise proceed with step 2.
</Item>
<Item>
If <A>t</A><C>.dynamic.changed</C> is <K>true</K> then
call the <C>ShowTables</C> function of the current mode;
this causes a redraw of the window that shows the browse table.
Then go to step 3.
</Item>
<Item>
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.
</Item>
</Enum>
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.
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.