Ejemplo n.º 1
0
/* wind_init()
 * =====================================================================
 * Initialize window structure.
 */
void
wind_init( void )
{
   if(( AES_Version >= 0x0330 )
        && ( gl_ncolors > LWHITE ) )
   {
     Do3D();
   }

   init_window();
   
   if( _app )
   {
      if( xres >= MIN_RESOLUTION )
      {
        if( Create_Window() )
        {
          ActiveTree( ad_front );
          initialize();
          open_window();
          graf_mouse( ARROW, 0L );
          Activity();
        }
        else
          form_alert( 1, alert13 );
      }
      else
      {
	  form_alert( 1, wider );
	  gem_exit( 0 );
      }
   }
}
Ejemplo n.º 2
0
/* acc_open()
 * =====================================================================
 * Accessory Open Messages
 * 
 * IN: int *msg: message buffer;
 * OUT: void
 *
 * GLOBAL: WINFO w:   window structure
 *         int   ctrl_id: application id
 */
void
acc_open( const int *msg )
{
    if( msg[4] == ctrl_id )
    {
      if( w.id == NO_WINDOW )
      {
        if( xres >= MIN_RESOLUTION )
	{
          if( Create_Window() )
          {
            ActiveTree( ad_front );
            initialize();
            open_window();
            Activity();
          }
          else
            form_alert( 1, alert13 );
	}
	else
            form_alert( 1, wider );
      }
      else
        wind_set( w.id, WF_TOP );
    }
}
Ejemplo n.º 3
0
/*------------------------------*/
static
void
do_alert(void)
{

	WORD	wbutton;		/* Exit button from ALERT	*/
	
/*	No default default, STOP ICON					*/
	wbutton=form_alert(0, sys_alert);
	
/*	Display a NOTE alert depending on button selection		*/
	switch(wbutton)
	{
		case	1:		/* Button 1 - RESET		*/
		{
			form_alert(1, reset_alert);
			break;
		}
		
		case	2:		/* Button 2 - IGNORE		*/
		{
			form_alert(1, ignore_alert);
			break;
		}			
	
		case	3:		/* Button 3 - RETRY		*/
		{
			form_alert(1, retry_alert);
			break;
		}	
	}
}
Ejemplo n.º 4
0
/****************************************
* check that ttf-gdos is loaded,
* save pointer to config info
* */
static bool is_ttf_gdos( void )
{
   /** look for ttf-gdos ... **/

   pInfo = (TTF_GDOS_INF_RECORD *)vq_vgdos();
   if( (int32)pInfo == GDOS_NONE	/* no gdos at all */
	|| ((int)pInfo&1) != 0		/* pointer to add address*/
	|| pInfo > (void *)get_sysvar(phystop)	/* points outside valid memory*/
	|| pInfo < (void *)0x800 /* bot of mem */
	|| pInfo->magic_nr != MAGIC_NR ) {	/* ttf-gdos not there */
	 return FALSE;
   } /* if */

   if( pInfo->version > MY_VERSION ) {
      form_alert( 1, "[3][please use latest version][good idea]");
      return FALSE;
   } /* if */

   if( pInfo->version < MY_VERSION ) {
      form_alert( 1, "[3][please upgrade to|latest version of ttf-gdos][OK]" );
      return FALSE;
   } /* if */

   return TRUE;

} /* is_ttf_gdos() */
Ejemplo n.º 5
0
int ReadScreen( void )
{
  char name[FNSIZE], directory[FMSIZE];
  short button;
  int f, status;
  	  
  status = 0;
  getcd( 0, directory);
  strcat( directory, "\\*.NEO");
  *name = 0;
  fsel_exinput( directory, name, &button, "L„s NEO-sk„rm");
  if (button == 1)
  {
  	*(strrchr( directory, '\\')+1) = 0;
    strcat( directory, name);
    f = open( directory, O_RDONLY | O_RAW, 0);
    if (f >= 0)
    {
      if (filelength( f) == 32128)
      {
        read( f, Physbase(), 128);
        read( f, Physbase(), 32000);
        status = 1;
      }
      else
        form_alert( 1, "[3][Ej NeoChrome fil][Ok]");
      close( f);
    }
    else
      form_alert( 1, "[3][Filen finns inte][Ok]");
  }
  return status;
}
Ejemplo n.º 6
0
void  gem_prgm()

{
   OBJECT  *tree;
   int     box_x, box_y, box_w, box_h, button, end = FALSE;
   int     work_in[11], work_out[57], count, dummy;

   for (count = 0; count < 10; count++)   work_in[count] = 1;
   work_in[10] = 2;
   vdi_handle = graf_handle (& dummy, & dummy, & dummy, & dummy);
   v_opnvwk (work_in, & vdi_handle, work_out);
   vq_extnd (vdi_handle, 1, work_out);
   planes = work_out[4];

   rsrc_gaddr (R_TREE, LOGCTRL, & tree);
   form_center (tree, & box_x, & box_y, & box_w, & box_h);
   form_dial (FMD_START, 0,0,0,0, box_x, box_y, box_w, box_h);
   objc_draw (tree, ROOT, MAX_DEPTH, box_x, box_y, box_w, box_h);

   do {
        button = form_do (tree, 0) & 0x7fffu;
        evnt_timer (60, 0);
        tree[button].ob_state &= ~SELECTED;
        objc_draw (tree, button, 1, box_x, box_y, box_w, box_h);

        switch (button) {
           case FILENAM :
             modify_fname();
             objc_draw (tree, ROOT, MAX_DEPTH, box_x, box_y, box_w, box_h);
             break;
           case CLIENT :
           case MODULE :
             form_dial (FMD_FINISH, 0,0,0,0, box_x, box_y, box_w, box_h);
             do_dialog ((button == CLIENT) ? CLI_API : MOD_API);
             form_dial (FMD_START, 0,0,0,0, box_x, box_y, box_w, box_h);
             objc_draw (tree, ROOT, MAX_DEPTH, box_x, box_y, box_w, box_h);
             break;
           case TERM :
             if (form_alert (1, "[2][ |  Remove LogSTinG and   |   leave LogCTRL ?][ Yes | No ]") == 1) {
                  if ((long) (*sting_drivers->get_dftab) ("LOGSTING : REMOVE") == 'OkOk')
                       end = TRUE;
                    else
                       form_alert (1, "[1][ |  Could not remove LogSTinG !  ][ Hmmm ]");
                }
             break;
           case FIX :
             if (form_alert (1, "[2][ |  Activate new settings ?   ][ Yes | No ]") == 1)
                  do_settings();
             break;
           case CANCEL :
             if (form_alert (1, "[2][ |  Leave LogCTRL ?   ][ Yes | No ]") == 1)
                  end = TRUE;
             break;
           }
     } while (! end);

   form_dial (FMD_FINISH, 0,0,0,0, box_x, box_y, box_w, box_h);
   v_clsvwk (vdi_handle);
 }
Ejemplo n.º 7
0
/* ------------------------------------------------------------------ */
static void choose_font(void)
{
OBJECT *loading;
int cx, cy, cw, ch;
bool is_prn;

   is_prn = (form_alert( 1, "[0][select device][screen|printer]" )==2);
   dprintf(( "\033Hselected %s workstation\n", is_prn? "printer": "screen" ));

   if( init_wkstn( is_prn ) ) {

      graf_mouse(BUSY_BEE, 0);
      dprintf(( "ready to load fonts ... " )); dgetchar();
      rsrc_gaddr( R_TREE, LDGFONTS, &loading );
      form_center( loading, &cx, &cy, &cw, &ch);
      form_dial(FMD_START, 0, 0, 0, 0, cx, cy, cw, ch);
      objc_draw( loading, ROOT, MAX_DEPTH, cx, cy, cw, ch);
      (void)vst_load_fonts(handle, 0);
      form_dial( FMD_FINISH, 0, 0, 0, 0, cx, cy, cw, ch );
      dprintf(( "\033Hdone\nnow getting font names ..." )); dgetchar();
      if( get_fontnames( *(tGemFont **)(&_contrl[10]) ) ) {
	 dprintf(( "done\n" )); dgetchar();
	 graf_mouse(ARROW, 0);
	 while( select_font( is_prn ) ) {
	    if( iSelected == NO_INDEX ) {
	       form_alert( 1, "[1][You must choose|a font to dump][Try Again]" );
	    }
	    else if( gem_file_name[0] == '\0' ) {
	       form_alert( 1, "[1][You must choose a|"
			 "gem font file name][Try Again]" );
	    }
	    else {
	       dump_font();
	       gem_file_name[0] = '\0'; /* reset entries for next round */
	       iSelected = NO_INDEX;
	    } /* if */
	 } /* while */
      } /* if */

      vst_unload_fonts(handle, 0);

      free(name_table);

      dprintf(( "\033Hclosing %s workstation ...", is_prn? "printer": "screen" ));
      if( is_prn ) v_clswk(handle);
      else v_clsvwk(handle);
   }
   else form_alert(1, "[3][Can't open workstation][OK]");

} /* choose_font() */
Ejemplo n.º 8
0
void closchan(short cnum)
{
BOOLEAN aflag=FALSE;
short mcto=0;
char temps[2048];
if(chan<0){
form_alert(1,"[1][You're not in|a channel!][ooops!]");
return;
}
while(mcto<30 && !aflag){
if(cnum!=mcto && chan[mcto].win==chan[cnum].win){wn[chan[cnum].win].chan=mcto;aflag=TRUE;}
mcto++;
}
if(!aflag){
wn[chan[cnum].win].chan=-1;
dowindinfo(chan[cnum].win);
cycchan(FORWARDS);
}
if(chan[cnum].stat==2){
sprintf(temps,":%s PART %s\r",cn[wn[chan[cnum].win].cnn].nick,chan[cnum].name);
srt(temps,cn[wn[chan[cnum].win].cnn].cn);
}
if(chan[cnum].stat>2)closedccchat(cnum);
chan[cnum].stat=0;
if(aflag)dowindinfo(chan[cnum].win);
chan[cnum].win=-1;
return;
}
Ejemplo n.º 9
0
 void event_closed() {
     int16_t response = form_alert(1, 
         "[2][Are you sure you want to quit?]"
         "[ NO | YES ]");
     if (response == 2)
         app->quit();
 }
Ejemplo n.º 10
0
/* SymHebFontChange()
 * ====================================================================
 * Called whenever the Symbol or Hebrew Font is changed, turned on
 * or turned off.
 */
void
SymHebFontChange( void )
{
#if 0
     Current.Width = FALSE;
     ObString( WIDTHFLG ) = width_text[ Current.Width ];
/*   Objc_draw( tree, WIDTHFLG, MAX_DEPTH, NULL );*/

     CacheCheck( 0 ); /* Do I need to check if the cache is large enuf? NO!*/
#endif
     
     /* This is to prevent the warning from popping up all the time.
      * It will show ONCE and that is that. It is initialized when
      * the CPX or desk accessory is first opened.
      */
     if( !Symbol_Change )
     {
         Objc_draw( tree, ROOT, MAX_DEPTH, NULL );
         form_alert( 1, sym_alert );
     }    
     Symbol_Change   = TRUE;	
     Make_Width_Flag = TRUE;    /* Make sure we prompt for a make
     				 * width tables after an extend.sys
     				 */
}
Ejemplo n.º 11
0
/* Find and store all of the directories, and index them in the dpointers array */
long get_directories(void)
{
	char temp[80];
	long count,c,rcnt=0;

	count = getfnl("*", dirs, sizeof(dirs), FA_SUBDIR );
	if (count > 0) {
		if (strbpl(dpointers,300,dirs)!=count) {
			fprintf(stderr, "Too many mailbox directories\n");
			deinitialize();
			exit(1);
		}
		strsrt( dpointers, count );
		for (c=0;c<count;c++) {
			if (dpointers[c][0]=='.') { continue; }
			rcnt++;
		/*	sprintf( temp, "[0][Checking Directory |%s][OK]", dpointers[c] ); */
		/*	form_alert( 1, temp ); */
		}
		sprintf( temp, "[0][You have %ld Mail Directories][OK]", rcnt );
		form_alert( 1, temp );
	} else {
		if (_OSERR) poserr( "DIRS");
		else fprintf(stderr, "Too many mailbox directories\n");
		deinitialize();
		exit(1);
	}
	return(count);
}
Ejemplo n.º 12
0
Archivo: gui.c Proyecto: mmuman/NetSurf
static nserror
gui_cert_verify(nsurl *url, const struct ssl_cert_info *certs,
		unsigned long num, nserror (*cb)(bool proceed, void *pw),
		void *cbpw)
{
        struct sslcert_session_data *data;
        LOG("url %s", nsurl_access(url));

        // TODO: localize string
        int b = form_alert(1, "[2][SSL Verify failed, continue?][Continue|Abort|Details...]");
        if(b == 1){
                // Accept
                urldb_set_cert_permissions(url, true);
                cb(true, cbpw);
        } else if(b == 2) {
                // Reject
                urldb_set_cert_permissions(url, false);
                cb(false, cbpw);
        } else if(b == 3) {
                // Inspect
                sslcert_viewer_create_session_data(num, url, cb, cbpw, certs,
                                                   &data);
                atari_sslcert_viewer_open(data);
        }
	return NSERROR_OK;
}
Ejemplo n.º 13
0
/* SetIntroWindow()
 * ================================================================
 * RETURN: if < 0, error
 */
int
SetIntroWindow( void )
{
   /* Open the Intro window */
   ad_tree = ad_intro;

   ActiveTree( ad_tree );
   FormCenter( ad_tree, &gl_work );
   ObX( ROOT ) = gl_work.g_x;
   ObY( ROOT ) = gl_work.g_y;

   wid = wind_create( MOVER | NAME | CLOSE, gl_full.g_x, gl_full.g_y,
		            		    gl_full.g_w, gl_full.g_h );

   if( wid > 0 )
   {
     wind_set( wid, WF_NAME, wtitle );
     wind_calc( WC_BORDER, MOVER | NAME | CLOSE,
	        gl_work.g_x, gl_work.g_y, gl_work.g_w, gl_work.g_h,
	        &gl_curr.g_x, &gl_curr.g_y, &gl_curr.g_w, &gl_curr.g_h );

     wind_open( wid, gl_curr.g_x, gl_curr.g_y, gl_curr.g_w, gl_curr.g_h );
   } else form_alert( 1, nowin );

   return( wid );
}
Ejemplo n.º 14
0
/* Count and remember the number of email messages in each directory and a total */
long get_directory_mail(void)
{
	int c,d,index;
	long count=0,mail_cnt=0;
	char temp[FMSIZE];
	char **dmptr;

	for (c=0;c<dcount;c++) {	/* for each directory */
		dmpointers[c] = NULL;
		if (dpointers[c][0]=='.') { continue; }
		chdir( dpointers[c] );
		count = getfnl("mail*.txt", dmail, sizeof(dmail), 0 );
	/*	sprintf( temp, "[0][Directory %s has|%ld messages][OK]", dpointers[c], count ); */
	/*	form_alert( 1, temp ); */
		if (count > 0) {
			dmpointers[c] = calloc( count+1, sizeof(int) );
			dmpointers[c][0] = (int)count;
			dmptr = calloc( count+1, sizeof(size_t) );
			if (strbpl(dmptr,count+1,dmail)==count) {
				for (d=0;d<count;d++) {
					index = get_mail_index( dmptr[d] );
					dmpointers[c][d+1] = index;
				}
			}
			free( dmptr );
			mail_cnt += count;
		}
		chdir( mail_path );
	}
	sprintf( temp, "[0][You have %ld Directory messages][OK]", mail_cnt );
	form_alert( 1, temp );
	return(mail_cnt);
}
Ejemplo n.º 15
0
init_draw()
{

	/* Get the address of the array of pointers to the 3 system
	 * font headers
	 */
	linea0();

	font_table = la_init.li_a1;

	/* Now set up the pointer to the font we want to use: */
	font_hdr = font_table[ AL_Font[ Getrez() ] ];

	/* Set up the character height */
	charHeight = font_hdr->font_height;
	charWidth = font_hdr->font_fat_cell;

	if( charWidth != 8 ) {
		form_alert( 1, "[2][System Font must be 8 bits wide][OK]" );
		exit(1);
	}

	font_base = font_hdr->font_data;
	f_nxt_lin = font_hdr->font_width;
	s_nxt_lin = VWRAP;

	next_char = (VPLANES * 2) - 1;
	num_planes = VPLANES;

	init_colmap();
}
Ejemplo n.º 16
0
/* ***Fenster �ffnen*** */
int open_window(void)
{
 wind_calc(WC_WORK, SWIGADGETS, deskx, desky, deskw, deskh, &wi.g_x, &wi.g_y, &wi.g_w, &wi.g_h);
 wi.g_w=wi.g_w&0xFFF0; wi.g_h=wi.g_h&0xFFF0;
 wind_calc(WC_BORDER, SWIGADGETS, wi.g_x, wi.g_y, wi.g_w, wi.g_h, &wi.g_x, &wi.g_y, &wi.g_w, &wi.g_h);
 wihndl=wind_create(SWIGADGETS, deskx, desky, wi.g_w, wi.g_h);
 if(wihndl<0)
  {
   form_alert(1, "[3][Could not create|the windows!][Cancel]");
   return(-1);
  }

 wind_set(wihndl, WF_NAME, "STED", 0L);
 wind_set(wihndl, WF_INFO, " Spielfeld editieren", 0L);

 wind_calc(WC_BORDER, SWIGADGETS, 32, 32, rww<<4, rwh<<4,
			&wi.g_x, &wi.g_y, &wi.g_w, &wi.g_h);
 wi.g_x=deskx+(deskw-wi.g_w)/2;
 wi.g_y=desky+(deskh-wi.g_h)/2;

 if(aesversion>=0x0300)
  {
   wind_set(wihndl, WF_BEVENT, 1, 0, 0L);
  }

 /* Fenster �ffnen: */
 wind_open(wihndl, wi.g_x, wi.g_y, wi.g_w, wi.g_h);
 wind_get(wihndl, WF_WORKXYWH, &wi.g_x, &wi.g_y, &wi.g_w, &wi.g_h);

 return(0);
}
Ejemplo n.º 17
0
void Keyboard(void)
/*
	Change the NVRam.Language part of structure to set the active keyboard.
*/
{
  switch(F_PopupEntry)
  {
    case KBUSA:		NVRam.Keyboard = KEYB_USA;
    			break;
    case KBD:		NVRam.Keyboard = KEYB_D;
    			break;
    case KBFR:		NVRam.Keyboard = KEYB_F;
    			break;
    case KBGB:		NVRam.Keyboard = KEYB_GB;
    			break;
    case KBSP:		NVRam.Keyboard = KEYB_SP;
    			break;
    case KBI:		NVRam.Keyboard = KEYB_I;
    			break;
    case KBCHD:		NVRam.Keyboard = KEYB_CHD;
    			break;
    case KBCHF:		NVRam.Keyboard = KEYB_CHF;
    			break;
    default:		form_alert(1,Messages[MSG5].ob_spec.free_string);
    			ListPopAttach[1].StartEntry = KEYB_GB;
    			break;
  }
}
Ejemplo n.º 18
0
/* --------------------------------------------------------------------
** get the list of font names.
** put names into name_table[]
** set nr_names = number of font names found 
*/
static bool get_fontnames( const tGemFont *const pf )
{
register const tGemFont *p;
register int i;
register tFontName *pn = NULL;

   /** count nr fonts **/
   for( i=0, p=pf; p!=NULL; i++, p=p->next_font );
   nr_names = i;
   dprintf(( "\033Hthere are %d names\n", nr_names )); dgetchar();
   name_table = malloc( nr_names * sizeof(tFontName) );
   if( name_table == NULL ) {
      form_alert(1, "[3][Not enough memory|to list font names][OK]");
      return FALSE;
   } /* if */
   
   /** get all font names **/
   for( i=0, p=pf, pn=name_table ; i<nr_names ; i++, p=p->next_font, pn++ ) {
      assert( p!=NULL );
      pn->pFont = p;
      sprintf( pn->name, "%-0.32s, %d pts", p->name, p->size );
      assert( strlen(pn->name) < sizeof(pn->name) );
      dprintf(( "%\033Hs\n", pn->name ));
   } /* for */
   dgetchar();
   
   return TRUE;

} /* get_fontnames() */
Ejemplo n.º 19
0
void Language(void)
/*
	Change the NVRam.Language part of structure to set the active language.
*/
{
  switch(F_PopupEntry)
  {
    case LGUSA:		NVRam.Language = LG_USA;
    			break;
    case LGD:		NVRam.Language = LG_D;
    			break;
    case LGF:		NVRam.Language = LG_F;
    			break;
    case LGGB:		NVRam.Language = LG_GB;
    			break;
    case LGSP:		NVRam.Language = LG_SP;
    			break;
    case LGI:		NVRam.Language = LG_I;
    			break;
    case LGCHD:		NVRam.Language = LG_CHD;
    			break;
    case LGCHF:		NVRam.Language = LG_CHF;
    			break;
    default:		form_alert(1,Messages[MSG6].ob_spec.free_string);
    			ListPopAttach[1].StartEntry = LGGB;
    			break;
  }
}
Ejemplo n.º 20
0
void cpx_button( MRETS *mrets, WORD nclicks, WORD *event )
{
	static char *menu[] = { "  Info    ","  Refresh ",NULL };
	static char *timemenu[] = { "  100 ms ","  250 ms ","  500 ms ","  1 s    ",NULL };
	static WORD sel = 1;
	WORD ret;
	GRECT button;
	
	button.g_x = mrets->x;
	button.g_y = mrets->y;
	button.g_w = 1;
	button.g_h = 1;
	
	switch ( cpxPopup(xcpb,menu,2,-1,IBM,&button,(GRECT*)&dog[OBACK].ob_x) )
	{
	 case 0:	form_alert(1,INFOSTRING); break;
		
	 case 1:	ret = cpxPopup(xcpb,timemenu,4,sel,IBM,&button,(GRECT*)&dog[OBACK].ob_x);
				if ( ret >= 0 )
				{	switch ( ret )
					{
					 case 0:	sel = 0; time = 100L; break;
					 case 1:	sel = 1; time = 250L; break;
					 case 2:	sel = 2; time = 500L; break;
					 case 3:	sel = 3; time = 1000L; break;
					}
			
					cpxSet_Evnt_Mask(xcpb,MU_TIMER|MU_BUTTON|MU_KEYBD,
										&dummymoblk,&dummymoblk,time);
				}
				break;
	}
	*event = 0;
}
Ejemplo n.º 21
0
/* ------------------------------------------------------------------- */
int main(void)
{
   appl_init();
   graf_mouse(ARROW, 0);
   if(is_ttf_gdos()) {      /* is GDOS loaded? */
      if(rsrc_load("ttf-dump.rsc")) {
	 rsrc_gaddr( R_TREE, CHOOSER, &chooser );
	 choose_font();
	 rsrc_free();
	 }
	 else form_alert(1, "[3][Cannot open resource file][OK]");
   }
   else form_alert(1, "[3][this program needs TTF-GDOS][OK]");
   appl_exit();
   exit(0);
} /* main() */
Ejemplo n.º 22
0
/* Calc_Cache()
 * ======================================================================
 * Calculates and inquires the current size available of the
 * Speedo Data cache and the Speedo bitmap cache.
 */
void
Calc_Cache( BOOLEAN draw )
{
    if( SpeedoFlag )
    {

        if( open_vwork() )
        {
            vqt_cachesize( vhandle, 1, &dcache_size );
            vqt_cachesize( vhandle, 0, &bcache_size );
            dcache_size /= 1024L;
            bcache_size /= 1024L;
            close_vwork();
        }
        else
        {
            form_alert( 1, alert18 );
            dcache_size = bcache_size = 0L;
        }
        /* Miscellaneous Cache */
        sprintf( data_cache_text, "%5ldK", dcache_size );
        TedText( MUNUSED ) = data_cache_text;

        /* Character Cache */
        sprintf( bitmap_cache_text, "%5ldK", bcache_size );
        TedText( CUNUSED ) = bitmap_cache_text;

        if( draw )
        {
            Objc_draw( tree, CUNUSED, MAX_DEPTH, NULL );
            Objc_draw( tree, MUNUSED, MAX_DEPTH, NULL );
        }
    }
}
Ejemplo n.º 23
0
void  select_progeny( short prog_num, GRECT box )
{
	int prog ;					/* progeny reference					*/
	char names[IDX_NAM_MAX*2 + DATE_LENGTH + 2] ;
	char alert_str[200], *alert_ptr ;

	prog = -1 ;

	if( prog_array[prog_num + prog_oset] )	/* If child there already,	*/
											/* does it want deleting.	*/
	{
		rsrc_gaddr( R_STRING, PROG_DEL, &alert_ptr ) ;
		names_only( prog_array[prog_num + prog_oset] , names, 30, FALSE ) ;
		sprintf( alert_str, alert_ptr, names  ) ;
		if( form_alert( 1, alert_str ) == 2 )  prog = 0 ;
	}
	else  prog = get_person_reference( people[male].family_name, FALSE ) ;

	if( prog != -1 )
	{
		prog_array[prog_num + prog_oset] = prog ;
		names_date( prog, names, 40, FALSE ) ;
		strcpy( c_form_addrs.child[prog_num], names ) ;
		objc_draw( coup_form.fm_ptr, PROGENY, MAX_DEPTH,
										(int) box.g_x,(int) box.g_y,
										(int) box.g_w, (int) box.g_h ) ;
	}
}
Ejemplo n.º 24
0
ex_loadtem()
{
#if TEMFLAG
	char filename[13],pathname[80];
	long load_file();

	/* overwrite changed template? */
	if (change_flag[temCHANGE])
		if (form_alert(1,CHNGETEM)==2) return;

	filename[0]=0;
	Dsetdrv(tem_drive); dsetpath(tem_path);
	tempmem= -1;
	if (getfile(pathname,filename,TE_EXT,TLDETITL)>0)
	{
		tem_drive=Dgetdrv(); Dgetpath(tem_path,tem_drive+1);
		if (load_file(pathname,filename))
		{
			if (load_tem(filename))
			{
				strcpy(temfile,filename);
			}
		}	/* end if file loaded successfully */
	}	/* end if ok from file selector */

	dealloc_mem(tempmem);

#endif
}	/* end ex_loadtem() */
Ejemplo n.º 25
0
/* No form window is open */
void bg_event_loop()
{
	int x,y,kstate,key,clicks,event,state;
	int pipe[8];


#ifdef DEBUG
	form_alert(1,"[1][ACC bg][Ok]");
#endif
	do {
		event = evnt_multi( MU_MESAG | MU_TIMER,
							2, 0x1, 1,
							0, 0, 0, 0, 0,
							0, 0, 0, 0, 0,
							pipe,
							time_slice, 0,
							&x, &y, &state, &kstate, &key, &clicks );

		if (event & MU_TIMER)
			if (replay)
			{
				if(first_init)
					checkhang();
				load(1);
				update_time();
			}

		if (event & MU_MESAG)
		{
			handle_message(pipe); /* no window to handle */
		}

			
	} while ((fgbg==BG) && !closed_acc);
}
Ejemplo n.º 26
0
void  print_people( int ref )
{
	int reference ;					/* person selected for printing		*/
	char *alert_ptr, alert_str[200] ;
	short i, count = 0 ;
	Str_prt_params params ;
	
	while( !count )
	{
		if( !ref )
		{
			reference =  get_person_reference( NULL, TRUE ) ;
			if( !reference )  return ;		/* exit if nobody selected	*/

			count = entries ;	/* entries is number of people selected	*/
			if( count > 1 )
			{
				rsrc_gaddr( R_STRING, PRINT_MANY, &alert_ptr ) ;
				sprintf( alert_str, alert_ptr, count ) ;
				if( form_alert( 0, alert_str ) == 2 )  count = 0 ;
			}
		}
		else
		{
			matches[0] = ref ;	/* force selector list					*/
			count = 1 ;
		}	

		if( count )
		{
			if( open_printer( &params ) )
			{
				params.ref2 = 0 ;		/* Do not print second reference.	*/
				
				if( params.use_gdos )
					setup_font( &params, fontinfo ) ;

				if( params.chs_across < 40 )
				{
					rsrc_gaddr( R_STRING, GROSS_FONT, &alert_ptr ) ;
					rsrc_form_alert( 1, GROSS_FONT ) ;
				}
				else
				{
					busy( BUSY_MORE ) ;
			
					start_print_checking( &params ) ;

					i = 0 ;
					while(  printing_ok( &params ) && ( reference = matches[i++] ) )
						print_person( reference, &params ) ;

					close_printer( &params ) ;
					busy( BUSY_LESS ) ;
				}
			}
		}
	}
}
Ejemplo n.º 27
0
/*--------------------------------------------------------------*/
    WORD
_ovlerr()
{
LONG	al_addr ;

    rsrc_gaddr( 5, NOOVLERR, &al_addr ) ;
    form_alert( 1,al_addr ) ;
} /* _ovlerr */
Ejemplo n.º 28
0
/* XGen_Alert()
 *==========================================================================
 * General Form Alert for XCONTROL.ACC
 * The alert requested can be chosen from group shown up above.
 * RETURN - TRUE- CLICKED OK
 *	    FALSE - Clicked FALSE;
 */
BOOLEAN
cdecl XGen_Alert( int id )
{
    int button;

    button = form_alert( 1, ALERT[ id ] );
    return( button == 1 );
}
Ejemplo n.º 29
0
void Reset(void)
/*
	RESET the NVRAM content with the new values selected and quit program.
*/
{
  if(NVMaccess(NVM_RESET,0,(int)sizeof(NVRam),&NVRam)<FALSE)	/* Copy NVRam contents */  
    form_alert(1,Messages[MSG3].ob_spec.free_string);		/* < 0 => Access Error */
  Sortir = TRUE;
}
Ejemplo n.º 30
0
/*
 *  Issue an alert after merging in an optional character variable
 */
WORD fun_alert_merge(WORD defbut, WORD stnum, BYTE merge)
{
    rsrc_gaddr(R_STRING, stnum, (void **)&G.a_alert);
    strcpy(G.g_2text, G.a_alert);
    sprintf(G.g_1text, G.g_2text, merge);
    G.a_alert = G.g_1text;

    return form_alert(defbut, G.a_alert);
}