HistoryGui allows easy access to History as it happens: one can read recent lines, when they were written and by whom; one can search for text strings and by author names; and one can quickly grab lines of code for rewriting. Apart from documenting just in time programming sessions, all of this can be useful in live coding performances. See e.g. the system developed by powerbooks_unplugged, in the Quark called Republic.
The gui elements in detail:
lineShorts, or the filtered
lineShorts; selecting them in ListView makes them come appear in post-doc window.
( // create a short history h = History([ [0, \me, "1+2"], [1, \me, "3+5"], [1.234, \you, "q = q ? ();"], [3, \her, "\"Herstory\".speak"] ]); // make a gui for it g = h.makeWin(0@20); // find or make a text window for code line display // (called 'doc' because that was a Document in pre-Qt times) g.findDoc; // post line at index 2 in h.lines in doc window g.postDoc(2); )
get and set the height of the text window opened by HistoryGui
get and set the title of the text window opened by HistoryGui
create a new HistoryGui
the number of lines in the TextView above
a parent window or view in which to place new HistoryGui
bounds for new HistoryGui, constrained by its minSize.
flag whether to create a skipjack for the HistoryGui.
options to set for the HistoryGui (inherited from JITGui).
top: the TextView for the selected line
the line of buttons, popup and TextView
the ListView for the history lines
reset all views
show the line at that index in History.lines in the TextView.
the external text window made by HistoryGui to show codelines on. This is still called doc because it used to be a Document in pre-Qt times.
find an open a re-usable text window, or make a new one
get or set the symbol for the doc strategy to use:
\sameDoc tries to re-use a single text window,
\newDoc always makes a new one (and keep track of old docs)
list of previous text windows (docs) opened
find the codeline at index in History, and post it on the textwindow
set the string of the current textwindow
create a new textwindow with currently selected line
flag whether filtering is on
convenience on/off methods
keys and string fragments to filter for. e.g. [ 'all', "+" ] gets lines from all sources that contain the string "+".
apply filtering to history lines
the indices of the current filtered lines
the current filtered short lines for gui display
method:.setKeyFilter set the key(s) to filter for, and perform filtering
set the string to filter for, and perform filtering
stickMode 0 means top, i.e. select top when new lines come in; stickMode 1 means keep, i.e. keep current line selected after new lines come in.
( // create a short history h = History([ [0, \me, "1+2"], [1, \me, "3+5"], [1.234, \you, "q = q ? ();"], [3, \her, "\"Herstory\".speak"] ]); // make a gui for it g = h.makeWin(0@20); // find or make a text window for code line display // (called 'doc' because that was a Document in pre-Qt times) g.findDoc; // post line at index 2 in h.lines in doc window g.postDoc(2); ) h.document; // show how filtering works: g.filtering; // is filter on? g.filterOff; // shorthand for off g.filterOn; // and on // filtering looks for lines by author key(s) // and strings in the code lines: g.filters.postcs; g.setKeyFilter(\all); g.setKeyFilter(\me); g.setStrFilter(""); g.setStrFilter("3"); g.filters.postcs; // internal state cached in the HistoryGui: g.filteredIndices; g.filteredShorts;