NB. split.ijs - splitter control NB. see TEST section at the bottom for an example NB. http://www.jsoftware.com/pipermail/general/2003-October/014971.html NB. 07/14/2003 Oleg Kobchenko NB. 07/15/2006 Oleg Kobchenko - j601, componentized require'gl2' coclass 'psplit' coinsert'jgl2' wfopen=: ;:^:(0=L.) crot=: [: , _2 |.\ ] irot=: [: ,./ _2 ]\"1 ] create=: 3 : 0 HZ=:'h'={: ID=: 0{::y LC=: wfopen 1{::y RC=: wfopen 2{::y nm=. >coname'' pn=. >{:<;._2 wd'qp' (pn,'_',ID,'_paint__COCREATOR') =: ('paint_', nm,'_')~ (pn,'_',ID,'_mbldown__COCREATOR') =: ('mbldown_',nm,'_')~ (pn,'_',ID,'_mblup__COCREATOR') =: ('mblup_', nm,'_')~ CAPT=: '' ) destroy=: codestroy FG=: 3#127 BG=: 210 200 190 paint=: 3 : 0 glclear'' glcursor HZ { IDC_SIZEWE,IDC_SIZENS glpen 0,0 [ glbrush glrgb BG glrect 0 0 , glqwh'' glpen 1,0 [ glrgb FG wh=. <. , (|.^:HZ 0.25 0.75,:0.4 0.6) * glqwh'' gllines (irot^:HZ 0 2 0 3 ,:1 2 1 3) { wh ) mbldown=: 3 : 0 glsel ID NB. is it really necessary? glcapture 5+HZ CAPT=: HZ{".sysdata__COCREATOR ) mblup=: 3 : 0 if. 0=#CAPT do. return. end. glcapture 0 move (HZ{".sysdata__COCREATOR) - CAPT CAPT=: '' ) move=: 3 : 0 LC setp crot^:HZ 0 0, y, 0 (x wd'setxywhx ',(>x),' ',":pos+y ) NB. ========================================================= NB. TEST=: 0 : 0 NB. pc test; NB. xywh 6 6 44 61;cc ok button bottommove;cn "OK"; NB. xywh 6 69 44 14;cc b1 button topmove bottommove; NB. xywh 6 86 44 14;cc b2 button topmove bottommove; NB. xywh 51 6 3 94;cc splitv isigraph bottommove; NB. xywh 55 6 111 28;cc b3 button rightmove; NB. xywh 169 6 31 28;cc b4 button leftmove rightmove; NB. xywh 54 35 146 3;cc splith isigraph rightmove; NB. xywh 55 39 145 62;cc cancel button rightmove bottommove;cn "Cancel"; NB. pas 6 6;pcenter; NB. rem form end; NB. ) NB. NB. test_run=: 3 : 0 NB. wd TEST NB. LC=: ;:'ok b1 b2' NB. RC=: ;:'cancel b3' NB. spv=: 'psplit' conew~ 'splitv';'ok b1 b2';'b3 splith cancel' NB. sph=: 'psplit' conew~ 'splith';'b3 b4' ;'cancel' NB. wd 'pshow;' NB. ) NB. NB. test_close=: 3 : 0 NB. destroy__spv'' NB. destroy__sph'' NB. wd'pclose' NB. ) NB. NB. test_run''