Scripts/Editable wdview

From J Wiki
Jump to navigation Jump to search

This script is an editable version of wdview. This will be added to the J602 scripts.

For now, you can download the script File:Jview.ijs and save it in ~addons/misc, or replace the script system/classes/view/jview.ijs.

Please send any comments to Chris Burke.

The arguments to wdview are:

x is optional window name

y is text  or  header;text [;options...]

options are in one of two forms:

1. a boxed list of up to 4 flags:

   wrap;print;top;edit (default 0;1;0;0)

2. a character list of keywords delimited by commas and/or blanks, all default 0 if not given:

   wrap, noprint, top, edit

Here edit means the form is editable.

When the form is closed, then if there is a verb view_result__COCREATOR, it is called. The argument is a return code, optionally followed by text. If the OK button is pressed, the result is:

   0;updated text

Otherwise, result is:

   1;original text

For example:

   load 'jview'       NB. or load '~addons/misc/jview.ijs'
   view_result=: smoutput
   wdview 'header text';'bodytext';'edit'