DataMuseum.dk

Presents historical artifacts from the history of:

RegneCentralen RC759 "Piccoline"

This is an automatic "excavation" of a thematic subset of
artifacts from Datamuseum.dk's BitArchive.

See our Wiki for more about RegneCentralen RC759 "Piccoline"

Excavated with: AutoArchaeologist - Free & Open Source Software.


top - metrics - download

⟦927db8e15⟧ TextFile

    Length: 3468 (0xd8c)
    Types: TextFile
    Names: »FORMDO.DOC«

Derivation

└─⟦53ffa2da0⟧ Bits:30003931/GEM_Develop_disk_1_KOPI_CDOS.imd Disketter indleveret af Steffen Jensen (Piccolo/Piccoline)
    └─⟦this⟧ »FORMDO.DOC« 

TextFile

 editable */
	REG LONG	tree;          /* text field, or a field that is as */
	WORD		start_obj;     /* marked as a default return field. */
	WORD		which;
æ
	REG WORD	obj, flag, theflag, inc;

	obj = 0;
	flag = EDITABLE;
	inc = 1;
	switch(which)
	æ
	  case FMD_BACKWARD:
		inc = -1;
						/* fall thru		*/
	  case FMD_FORWARD:
		obj = start_obj + inc;
		break;
	  case FMD_DEFLT:
		flag = DEFAULT;
		break;
	å

	while ( obj >= 0 )
	æ
	  theflag = LWGET(OB_FLAGS(obj));
	  if (theflag & flag)
	    return(obj);
	  if (theflag & LASTOB)
	    obj = -1;
	  else
	    obj += inc;
	å
	return(start_obj);
å


	WORD
fm_inifld(tree, start_fld)
	LONG		tree;
	WORD		start_fld;
æ
						/* position cursor on	*/
						/*   the starting field	*/
	if (start_fld == 0)
	  start_fld = find_obj(tree, 0, FMD_FORWARD);
	return( start_fld );
å


	WORD
form_do(tree, start_fld)
	REG LONG	tree;
	WORD		start_fld;
æ
	REG WORD	edit_obj;
	WORD		next_obj;
	WORD		which, cont;
	WORD		idx;
	WORD		mx, my, mb, ks, kr, br;

	wind_update(1);
	wind_update(3);
						/* set starting field	*/
						/*   to edit, if want	*/
						/*   first editing field*/
						/*   then walk tree	*/
	next_obj = fm_inifld(tree, start_fld);
	edit_obj = 0;
						/* interact with user	*/
	cont = TRUE;
	while(cont)
	æ
						/* position cursor on	*/
						/*   the selected 	*/
						/*   editting field	*/
	  if ( (next_obj != 0) &&
	       (edit_obj != next_obj) )
	  æ
	    edit_obj = next_obj;
	    next_obj = 0;
	    objc_edit(tree, edit_obj, 0, &idx, EDINIT);
	  å
						/* wait for mouse or key */
	  which = evnt_multi(MU_KEYBD ø MU_BUTTON, 
			0x02, 0x01, 0x01, 
			0, 0, 0, 0, 0,
			0, 0, 0, 0, 0,
			0x0L,
			0, 0,
			&mx, &my, &mb, &ks, &kr, &br);
						/* handle keyboard event*/
	  if (which & MU_KEYBD)
	  æ
	    cont = form_keybd(tree, edit_obj, next_obj, kr, &next_obj, &kr);
	    if (kr)
	      objc_edit(tree, edit_obj, kr, &idx, EDCHAR);
	  å
						/* handle button event	*/
	  if (which & MU_BUTTON)
	  æ
	    next_obj = objc_find(tree, ROOT, MAX_DEPTH, mx, my);
 	    if (next_obj == NIL)
	    æ
	      /* sound(TRUE, 440, 2); */
	      next_obj = 0;
	    å
	    else
	      cont = form_button(tree, next_obj, br, &next_obj);
	  å
						/* handle end of field	*/
						/*   clean up		*/
	  if ( (!cont) øø
	       ((next_obj != 0) && 
		(next_obj != edit_obj)) )

	  æ
	    objc_edit(tree, edit_obj, 0, &idx, EDEND);
	  å
	å

	wind_update(2);
	wind_update(0);
						/* return exit object	*/
						/*   hi bit may be set	*/
						/*   if exit obj. was	*/
						/*   double-clicked	*/
	return(next_obj);
å



NOTE:   This is the end of the source code for form_do.  Remember this 
        code was provided for you to use or modify in the writing of 
        your own code to perform similar functions.  BEWARE, check your 
        code carefully.

«eof»