WINLIB

standard windows library

defined in z locale

these definitions are assumed available to other windows programs

load after standard library 'stdlib.ijs'

wd            main window driver
wde           wd error - as wd but displays error and signals break
wdcenter      center form on another
wdclipread    read clipboard
wdclipwrite   write to clipboard
wdfit         ensure form fits in window
wdget         get values from matrix, e.g. wd'q'
wdhandler     wd handler
wdinfo        information box
wdisparent    if a parent window
wdmove        position window
wdpclose      close parent window
wdqshow       display result of wdq
wdquery       query box
wdreset       reset window driver
wdselect      selection box
wdstatus      put status message on screen
wdview        text viewer

Defined items
NameClassDescription
wdVerbmain window driver, name for 11!:0
wdresetVerbreset window driver
wdclipreadVerbread clipboard
wdisparentVerbreturn 1 if a parent window
wdcenterVerbcenter form on another
wdclipwriteVerbwrite to clipboard
wdeVerbas wd but displays error and signals break
wdfitVerbfit form in window
wdgetVerbget values from matrix, e.g. wd'q'
wdhandlerVerbwd handler
wdinfoVerbinformation box
wdmoveVerbposition window, relative to side of screen
wdpcloseVerbclose parent window
wdqshowVerbdisplay result of wdq
wdqueryVerbquery box
wdselectVerbselection box
wdstatusVerbput status message on screen
wdviewVerbtext viewer

wd.................. (v) main window driver, name for 11!:0

wdreset............. (v) reset window driver

wdclipread.......... (v) read clipboard

wdisparent.......... (v) return 1 if a parent window

wdcenter............ (v) center form on another

form: wdcenter xywh
use this to center a form on another

wdclipwrite......... (v) write to clipboard

wde................. (v) as wd but displays error and signals break

wdfit............... (v) fit form in window

y. is two integers for horizontal and vertical
in each case, the entire form will be shown

values are:
  0   move the side out of view back into the window
      - typically reduces the form size
  1   move the form so it is all visible
      - typically leaves the form size unchanged
  2   stretch the form to the window
  3   maximize the form to full screen, hiding caption and borders

an empty argument is treated as 1 1

wdget............... (v) get values from matrix, e.g. wd'q'

utility to index 2-column boxed array, e.g. result of wd 'q'
form:  names wdget data
returns items in second column indexed on names in first column
result is boxed if left argument is boxed
e.g. 'sysfocus' wdget wdq

wdhandler........... (v) wd handler

runs in form locale
sets global event data: wdq
runs first found of: form_handler, form_event, form_default,
with global event variables from wdq
if debug is off, wraps event handler in try. catch.

wdinfo.............. (v) information box

syntax: wdinfo [title;] message

wdmove.............. (v) position window, relative to side of screen

form: [window] wdmove offset

offset is the xy offset.
  if  >: 0  the offset is from topleft
  if  < 0   the offset is from bottomright (less 1)

e.g.
    0 0  = topleft
  _1 _1  = bottomright
   5 _11 = 5 from left, 10 from bottom

wdpclose............ (v) close parent window

wdqshow............. (v) display result of wdq

display wdq result - useful for testing forms

wdquery............. (v) query box

form: [opt] wdquery [title;] message
  opt has one or two elements:
   0{  = 0    okcancel          (ok=0 cancel=1)
         1    retrycancel       (retry=0 cancel=1)
         2    yesno             (yes=0 no=1)
         3    yesnocancel       (yes=0 no=1 cancel=2)
         4    abortretryignore  (abort=0 retry=1 ignore=2)
   1{ = default button (0, 1 or 2)

wdselect............ (v) selection box

windows selection box

y. is a either:   boxed list of choices
            or:   title ; <boxed list of choices
   if y. is empty, closes selection box if open.

x. is optional of up to 3 values (default 0). the second and
   third options are only referenced when the box is created:
  0{ initial selection
  1{ 0=single selection, 1=multiple selection
  2{ 0=close on exit, 1=leave open if selection made

returns 2 item boxed list:
  0{ 0=cancel, 1=accept
  1{ indices of selections

wdstatus............ (v) put status message on screen

write status message on screen

{title} wdstatus message    - write message
        wdstatus ''         - close message box

default text size is 1 row of 50 characters.
for a larger size, call wdstatus initially with a message
of the required size (pad with blanks if necessary).
once created, the message box is not resized.

wdview.............. (v) text viewer

y. is text  or  header;text [;wrap;print (default 0 1)]
x. is optional window name
uses standard Windows edit control,
which is limited to around 20K in size.

system\main\winlib.ijsRelease: 4.02/1998-11-13/12:26