Example #1
0
/*------------------------------*/
static
void
close_window(WORD handle)
{
	int	cx, cy, cw, ch;		/* Holds current XYWH position	*/
	
	graf_mouse(HOUR, 0L);		/* Show hourglass		*/

	wind_get(handle, WF_CXYWH, &cx, &cy, &cw, &ch);

	wind_close(handle);		/* Close window off screen	*/

	graf_shrinkbox(xstart, ystart, HBOX, WBOX, cx, cy, cw, ch);

	wind_delete(handle);		/* Clear window from system	*/
	
	graf_mouse(ARROW, 0L);		/* Change cursor to ARROW	*/
}
Example #2
0
cz1pars()
{
   FDB savefdb;
   int mousex,mousey,mstate,i,kstate;
   int done=0;
   int mbefore=0;
   int key,event;

/* grab mouse control off of AES */
   wind_update(3);
/* turn clipping off during all of module 7 */
   vs_clip(gl_hand,0,&dummy);   

/* save screen which will lie under cz1pars window */
   savefdb.fd_addr= saveptr;
   savefdb.fd_w= 640;
   savefdb.fd_h= 200*rez;
   savefdb.fd_wdwidth= 40;
   savefdb.fd_stand= 0;
   if (rez==1)
      savefdb.fd_nplanes= 2;
   else
      savefdb.fd_nplanes= 1;
   xyarray[0]= cz1_xy[0]; xyarray[1]= rez*cz1_xy[1]; 
   xyarray[2]= cz1_xy[2]; xyarray[3]= rez*cz1_xy[7];
   xyarray[4]= 0;   xyarray[5]= 0;
   xyarray[6]= cz1_xy[2]-cz1_xy[0];   xyarray[7]= rez*(cz1_xy[7]-cz1_xy[1]);
   v_hide_c(gl_hand);   
   if (saveptr) vro_cpyfm(gl_hand,3,xyarray,&scrfdb,&savefdb);
   v_show_c(gl_hand,0); 
   graf_growbox((cz1_xy[0]+cz1_xy[2])/2,rez*(cz1_xy[1]+cz1_xy[5])/2,1,1,
                cz1_xy[0],cz1_xy[1],
                cz1_xy[2]-cz1_xy[0]+1,rez*(cz1_xy[7]-cz1_xy[1])+1);
   cz1_wind();     /* put up cz1pars window */

/* executive loop */
   while (!done)
   {
      vq_mouse(gl_hand,&mstate,&mousex,&mousey);
      kstate=Kbshift(0xffff);
      if ((mstate&3)&&!mbefore)
         done= do_cz1(mousex,mousey,mstate,kstate);
      event= evnt_multi(MU_TIMER|MU_KEYBD,0,0,0,0,0,0,0,0,0,0,0,0,0,
             &dummy,1,0,&mousex,&mousey,&dummy,&dummy,&key,&dummy);    
      if ((event & MU_KEYBD)&&(key==0x6100)) cz1_undo(mousex,mousey);
      mbefore=mstate;
   }

   vs_clip(gl_hand,0,&dummy);   /* turn clipping off (clobbered by redraw */
/* restore the screen */
   xyarray[0]= 0;    xyarray[1]= 0;   
   xyarray[2]= cz1_xy[2]-cz1_xy[0];   xyarray[3]= rez*(cz1_xy[7]-cz1_xy[1]);
   xyarray[4]= cz1_xy[0];  xyarray[5]= rez*cz1_xy[1];  
   xyarray[6]= cz1_xy[2];  xyarray[7]= rez*cz1_xy[7];
   if (saveptr)
   {
      v_hide_c(gl_hand);
      vro_cpyfm(gl_hand,3,xyarray,&savefdb,&scrfdb);
      v_show_c(gl_hand,0);
   }
   else
      redraw(ws_hand,cz1_xy[0],rez*cz1_xy[1],
             cz1_xy[2]-cz1_xy[0]+1,rez*(cz1_xy[7]-cz1_xy[1])+1);
   graf_shrinkbox((cz1_xy[0]+cz1_xy[2])/2,rez*(cz1_xy[1]+cz1_xy[5])/2,1,1,
                cz1_xy[0],cz1_xy[1],
                cz1_xy[2]-cz1_xy[0]+1,rez*(cz1_xy[7]-cz1_xy[1])+1);   
/* return mouse control to AES */
   wind_update(2);

} /* end cz1pars() */