NB. provides jtable form

coclass'jtable'
require 'jtgrid'

TABLE=: 0 : 0
pc table;pn "Table";
xywh 4 5 72 11;cc checkbox checkbox;cn "extended precision";
xywh 79 5 30 11;cc font button;cn "Font...";
xywh 0 19 175 150;cc grid isigraph ws_border ws_clipchildren rightmove bottommove;
xywh 0 169 175 9;cc scrollbar scrollbar topmove rightmove bottommove;
xywh 175 19 9 150;cc scrollbarv scrollbarv leftmove rightmove bottommove;
pas 0 0;pcenter;
rem form end;
)

create=: 3 : 0
dataname=: y.
xprecision=: 0
wd TABLE
wdfit''
formhwnd=:wd'qhwndp'
grid=: ''conew'jtgrid'
init__grid y.;'grid';'scrollbar';'scrollbarv'
wd'set scrollbar 0 0 1000 1'
wd'set scrollbarv 0 0 1000 1'
gridfocus__grid''
wd 'pshow;'
)

destroy=: 3 : 0
wd'pclose'
destroy__grid''
codestroy''
)

table_close=: destroy

formselect=: 3 : 'wd''psel '',formhwnd'

table_grid_size=:    3 : 'size__grid 0'
table_grid_mbldown=: 3 : 'mbldown__grid sysdata'
table_grid_mmove=:   3 : 'mmove__grid sysdata'
table_grid_mblup=:   3 : 'mblup__grid sysdata'
table_grid_mbldbl=:  3 : 'mbldbl__grid sysdata'
table_grid_char=:    3 : 'char__grid sysdata;sysmodifiers'
table_grid_copy=:    3 : 'copy__grid 0'

NB. =========================================================
table_font_button=: 3 : 0
f=. wd'mbfont ',font0__grid
if.''-:f do. return. end.
gridfocus__grid''
setfont0__grid f
setheights__grid ''
glpaintx__grid''
gridfocus__grid''
)

NB. =========================================================
table_checkbox_button=: 3 : 0
xprecision__grid=: ".checkbox
get__grid''
setdata__grid''
glpaintx__grid''
gridfocus__grid''
)

NB. =========================================================
table_scrollbar_button=: 3 : 0
scrollbar__grid scrollbar
gridfocus__grid''
)

NB. =========================================================
table_scrollbarv_button=: 3 : 0
scrollbarv__grid scrollbarv
gridfocus__grid''
)
