Added October 2008
xcall SCRSTS, SCROP_INIT, srow, scol, erow, ecol{, parentid, sflags, title, closecmd$, coldef$, xt'kbdstr, xt'flags, ctlid}
This routine outputs a status message to a window, scrolling previous messages up. Three variations are supported, depending on flags and environment: .
• Text mode using INMEMO
• GUI mode using multi-line INFLD control
• GUI mode using XTREE
Parameters
sflags
takes MBF_xxxxx flags (from ashell.bsi); the only ones of interest so far are MBF_DIALOG and MBF_MODELESS, which, together cause the scrolling status control to be placed inside its own modeless dialog window (ignored in text mode). Also, MBF_LISTBOX causes GUI version to use XTREE instead of INFLD, eliminating the scrolling limit
title
is the title string to display in the dialog.
closecmd
if MBF_KBD and MBF_SYSMENU flags included in SFLAGS, then closecmd determines what happens when X clicked (if "", then dialog is closed internally; else string is sent in place of the normal ESC) (Virtual click codes supported)
coldef
can be a legal XTREE advanced column definition, if MBF_LISTBOX (The default is "1~512~ ~S~~") WARNING: if you define any columns, it is up to you to pass subsequent MSG$ strings formatted to be compatible with the definition). Also note that if the header fields are all blank, the header row will be removed entirely.
xt'kbdstr
if MBF_KBD and MBF_LISTBOX defined, clicking on the control will send this string (which applications would typically responsd to by calling SCROP_SCROLL)
xt'flags
optional XTREE flags (if MBF_LISTBOX)
xt'ctlno
B,2 optionally returns XTREE control ID (xtr'ctlno) or INFLD AUI ID
When the XTREE option is requested (see Using XTREE with SCRSTS), three additional optional parameters can be passed to the SCROP_INIT call
xt'kbdstr (String,10)
sets the xtr'kbdstr member of the XTRCTL structure, so that clicking on the status control sends the specified string. This can be useful if you want to allow the user to manipulate the status window, such as to sort, select, etc. (This probably only makes sense in conjunction with a COLDEF that defines relevant features such as columns, popup menus, etc.) The application would normally call the SCROP_SCROLL opcode to in response to receiving the XT'KBDSTR.
xt'flags
may be used to specify additional XTREE flags, such as perhaps XTF_MSEL, XTF_SORT, etc.
ctlid
will return the XTREE control number (xtr'ctlno), or in the case of INFLD, the AUI control id. This would only be of interest in sophisticated situations where you wanted to bypass SCRSTS.SBX and operate on the control directly using XTREE.SBR or INFLD.SBR.
Examples
Display/add a message to the window:
xcall SCRSTS, SCROP_ADD, msg$ {,arg1,...argN}
(If MSG$ contains %d of %s markers, these are replaced by the corresponding ARG1 thru ARGN parameter values)
Clear the message window:
xcall SCRSTS, SCROP_CLR
Delete the message window (restore area in text mode)
xcall SCRSTS, SCROP_DEL
(If message window created inside its own dialog, dialog will be automatically deleted)
Allow user to scroll/activate the window.
xcall SCRSTS, SCROP_SCROLL {,msg${,exitcode}
Comments
The name is (SCROLL) slightly misleading because in GUI mode, you could scroll without this, but it is necessary in text mode, and in XTREE mode it activates the control allowing other features (such as sorting, selecting, etc. to take place). If EXITCODE specified, returns EXITCODE, if any.
Stores data between calls using memory module SCRSTS.MEM (meaning that currently there can be only one of them active per A-Shell instance.)
Note that in text mode, if the height is >= 3, we use a border (which occupies 2 of the allowed rows). Otherwise no border. Also, on OP 0, we save the area, and restore it on OP 3.
The SCROP_SCROLL operation now supports the return of an exitcode:
xcall SCRSTS, SCROP_SCROLL, msg$, exitcode
Since the SCROP_SCROLL opcode actually puts the focus on the status control, the exitcode will be that which you would have gotten from XTREE, INFLD, or INMEMO, depending on the environment. This would probably be most useful if you defined a PopupMenu, which returned interesting exitcodes.
The SOSLIB sample program REGPTR[908,29] has been updated to illustrate some of the new capabilities of SCRSTS.
SCRSTS.SBX 1.3(108), A-Shell’s scrolling status window handler, now supports an option to use XTREE rather than INFLD to display the scrolling status window. To specify XTREE, you must set the MBF_LISTBOX bit in the SFLAGS parameter when creating the scrolling status window. An optional new parameter allows you to specify an XTREE column definition string:
xcall SCRSTS, scrop_init, srow, scol, erow, ecol{,parentid, sflags, title, closecmd$, coldef$}
The rest of the SCRSTS opcode formats are unchanged.
Although the XTREE version actually has more overhead (XTREE is a vastly more complex control than the multi-line edit control used by INFLD), here are some of the reasons why you might prefer it:
• It eliminates the 1600 char limit on the amount of text that can be left in the window. With XTREE, there is essentially no limit.
• You can access many of the advanced XTREE features, such as colors, popup menus, columns, even multiple levels. Note, however, that it is up to you to supply a text string (in the SCROP_ADD or SCROP_TMADD calls) that is formatted to match the COLDEF specified with the SCROP_INIT.
Also note that if any of the column header fields in COLDEF$ are not blank, then the normal column header bar will be displayed. Otherwise it will not (making it more like a typical scrolling status window).
The TSTSCR.BP[907,20] sample program has been updated to allow easy experimentation with the new version.