(please beware possible line wraps in the script below)

Some observations,
1. if replacing  CELLDATA=. 1 1$<'abc'  with   CELLDATA=. <'abc'
   it signals an error in jzgrid.
2. if use COLWIDTH=. +:54 (length of grid=length of cell)
   there will be a horizontal scroallbar
3. while use keyboard to enter data in g1 or g2 and tab to the next control,
   the caret on g1/g2 is still visible (not hidden)
4. run ( form_run'' )
   first time, abc in g1 cde in g2  (correct)
   now close form and run again
   second time, cde both in g1 and g2 (incorrect)
   now close form and run again
   third time, same as the last
   forth time, J session close (not sure if this is a crash)

5. restart J and run again and then close the form.
   then use form editor to edit the form and it said
   wdhandler
   error in: form_g_paint
   domain error: glclear
     glclear''


NB. =========================================================
require 'jzgrid'
require 'pack'

FORM=: 0 : 0
pc form;
xywh 4 4 54 12;cc edit1 edit;
xywh 4 21 54 12;cc g1 isigraph;
xywh 4 43 54 12;cc g2 isigraph;
xywh 71 53 48 12;cc button1 button;cn "button1";
pas 6 6;pcenter;
rem form end;
)

form_run=: 3 : 0
wd FORM
NB. initialize form here
HDRROW=. HDRROW=. ''
GRIDBORDER=. 0
CELLALIGN=. 1
COLAUTOFIT=. 0
GRIDLINES=. 0 0

g1=: '' conew 'jzgrid'
COLWIDTH=. <:@+:54
CELLDATA=. 1 1$<'abc'
GRIDID=. 'g1'
show__g1 pack 'CELLDATA' ; 'GRIDID' ; 'COLWIDTH' ; 'HDRCOL' ; 'HDRROW' ; 'CELLALIGN' ; 'COLAUTOFIT' ; 'GRIDBORDER' ; 'GRIDLINES'

g2=: '' conew 'jzgrid'
COLWIDTH=. <:@+:54
CELLDATA=. 1 1$<'cde'
GRIDID=. 'g2'
show__g2 pack 'CELLDATA' ; 'GRIDID' ; 'COLWIDTH' ; 'HDRCOL' ; 'HDRROW' ; 'CELLALIGN' ; 'COLAUTOFIT' ; 'GRIDBORDER' ; 'GRIDLINES'

wd 'pshow;'
)

form_close=: 3 : 0
1!:2&2 'form_close'
destroy__g1 ''
destroy__g2 ''
wd'pclose'
)
NB. =========================================================

----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to