Example #1
0
ex_delete()
{
#if DISKFLAG
	char filename[13],pathname[80];
	int saveMP;

	if (midiplexer) saveMP=MPoff();

	filename[0]=0;
	/* uses drive and path from most recent disk function */
	if (getfile(pathname,filename,ALL_EXT,DEL_TITL)>0)
	{
		if (big_alert(1,CHEKDEL1,filename,CHEKDEL2)==1)
		{
			/* delete all files with this pathname (pathname might contain
				wild card characters) -- error message only for first one */
			graf_mouse(BEE_MOUSE);
			if (Fdelete(pathname))
				big_alert(1,BADDEL1,filename,BADDEL2);
			else
				while (!Fdelete(pathname)) ;
			graf_mouse(ARROWMOUSE);
		}
	}

	if (midiplexer&&saveMP) MPon();

#endif
}  /* end ex_delete() */
Example #2
0
ex_rename()
{
#if DISKFLAG
	char fromfile[13],frompath[80];
	char tofile[13],topath[80];
	int hand,saveMP;

	if (midiplexer) saveMP=MPoff();

	fromfile[0]=0;
	/* uses drive and path from most recent disk function */
	if (getfile(frompath,fromfile,ALL_EXT,RENFRMTITL)>0)
	{
		graf_mouse(BEE_MOUSE);
		hand= Fopen(frompath,0);
		if (hand<0)
			big_alert(1,BADOPEN1,fromfile,BADOPEN2);
		else
		{
			Fclose(hand);
			graf_mouse(ARROWMOUSE);
			strcpy(tofile,fromfile);
			if (getfile(topath,tofile,ALL_EXT,RENTOTITL)>0)
			{
				graf_mouse(BEE_MOUSE);
				if (Frename(0,frompath,topath))
					big_alert(1,BADRENAME1,tofile,BADRENAME2);
			}
		}
	}	/* end if got a file from file selector */
	graf_mouse(ARROWMOUSE);
	if (midiplexer&&saveMP) MPon();

#endif
}	/* end ex_rename() */
Example #3
0
/*! event in main menu */
void event_pmenu(int *quit) {
	int i;

	switch(buf[4]) 	{
	case M_ALERTE :
		big_alert(2, ALERT, "", TRUE);
		menu_tnormal(adr_menu, T_FICHIER, 1);
		break;
	
	case M_WMENU :
		win[WINDMENU].w_pal =(Palette *)malloc(work_display.n_color *sizeof(Palette));
		for(i = 0 ; i < work_display.n_color ; i++) {
			win[WINDMENU].w_pal[i][0] = work_display.palette[i][0];
			win[WINDMENU].w_pal[i][1] = work_display.palette[i][1];
			win[WINDMENU].w_pal[i][2] = work_display.palette[i][2];
		}
		open_window(WINDMENU, WTYP_PICT, WATR_CURRB,
			bureau.xd +(bureau.wd / 5), bureau.yd +(bureau.hd / 5), 320, 150,
			100, 100, 200, 200, 16, 16,
			WFARROW, THIN_CROSS,
			winicn, ZERO, close_wmenu, get_string(TIT_MENU), "",
			(long) bureau.wd,(long) bureau.hd, TRUE, FALSE, W_MENU,
			10, BLACK);
		menu_tnormal(adr_menu, T_FENETRES, 1);
		break;
	
	case M_QUITTER :
		*quit = TRUE;
		menu_tnormal(adr_menu, T_FICHIER, 1);
		break;
	}	/* switch case */
}	/* endof event_pmenu */
Example #4
0
/*! free popup event */
void event_freepu(void) {
	int i;

	switch(buf[4]) {
	case PUL_ALERT :
		if(_app) 
			menu_tnormal(adr_menu, T_FICHIER, 0);
		else {
			win[WINDACC].w_bar[T_FICHIER + 3].ob_state |= SELECTED;
			draw_object(T_FICHIER + 3, WINDACC);
		}
		big_alert(2, ALERT, "", TRUE);

		if(_app)
			menu_tnormal(adr_menu, T_FICHIER, 1);
		else {
			win[WINDACC].w_bar[T_FICHIER + 3].ob_state &= ~SELECTED;
			draw_object(T_FICHIER + 3, WINDACC);
		}
		break;
	
	case PUL_WMENU :
		if(_app)
			menu_tnormal(adr_menu, T_FENETRES, 0);
		else {
			win[WINDACC].w_bar[T_FENETRES + 3].ob_state |= SELECTED;
			draw_object(T_FENETRES + 3, WINDACC);
		}
		if(win[WINDMENU].w_hg <= ZERO) {
			win[WINDMENU].w_pal =(Palette *)malloc(work_display.n_color * sizeof(Palette));
			for(i = 0 ; i < work_display.n_color ; i++) {
				win[WINDMENU].w_pal[i][0] = work_display.palette[i][0];
				win[WINDMENU].w_pal[i][1] = work_display.palette[i][1];
				win[WINDMENU].w_pal[i][2] = work_display.palette[i][2];
			}
			open_window(WINDMENU, WTYP_PICT, WATR_CURRB,
				bureau.xd +(bureau.wd / 5), bureau.yd +(bureau.hd / 5), 320, 150,
				100, 100, 200, 200, 16, 16,
				WFARROW, THIN_CROSS,
				winicn, ZERO, close_wmenu, get_string(TIT_MENU), "",
				(long) bureau.wd,(long) bureau.hd,
				TRUE, FALSE, W_MENU,
				10, BLACK);
		}
		else {
			buf[3] = win[WINDMENU].w_hg;
			(*win[WINDMENU].w_top)();
		}
		if(_app)
			menu_tnormal(adr_menu, T_FENETRES, 1);
		else {
			win[WINDACC].w_bar[T_FENETRES + 3].ob_state &= ~SELECTED;
			draw_object(T_FENETRES + 3, WINDACC);
		}
		break;
	}	/* end switch case */
}	/* event_freepu */
Example #5
0
/*! Display BIG alert */
void test_alerte(void) {
	big_alert(1, AL_POINTEUR, "", TRUE);
}	/* endof test_alerte() */ 
Example #6
0
/*! menu in window events */
void event_wmenu(int *flacc) {
	int i;

	if(buf[5] == WINDMENU) {
		switch(buf[4] - 3) {	/* 3 objets have been added to the menu */
		
		case MW_IMAGE :
			charge_image();
			break;
		
		case MW_ALERTE :
			big_alert(2, ALERT, "", TRUE);
			if(win[buf[5]].w_bar[buf[4]].ob_state & CHECKED)
				menu_icheck(win[buf[5]].w_bar, buf[4], FALSE);
			else
				menu_icheck(win[buf[5]].w_bar, buf[4], TRUE);
			win[buf[5]].w_bar[buf[3]].ob_state &= ~SELECTED;
			draw_object(buf[3], buf[5]);
			break;
		}	/* end switch */
	}	/* event for main menu not running as an accessory */
	else if(buf[5] == WINDACC) {		
		switch(buf[4] - 3)	{	/* 3 objets added to main menu */
		
		case M_ALERTE :
			big_alert(2, ALERT, "", TRUE);
			win[buf[5]].w_bar[buf[3]].ob_state &= ~SELECTED;
			draw_object(buf[3], buf[5]);
			break;
		
		case M_WMENU :
			win[buf[5]].w_bar[buf[3]].ob_state &= ~SELECTED;
			draw_object(buf[3], buf[5]);
			if(win[WINDMENU].w_hg <= ZERO) {
				win[WINDMENU].w_pal =(Palette *)malloc(work_display.n_color *sizeof(Palette));
				for(i = 0 ; i < work_display.n_color ; i++) {
					win[WINDMENU].w_pal[i][0] = work_display.palette[i][0];
					win[WINDMENU].w_pal[i][1] = work_display.palette[i][1];
					win[WINDMENU].w_pal[i][2] = work_display.palette[i][2];
				}
				open_window(WINDMENU, WTYP_PICT, WATR_CURRB,
					bureau.xd +(bureau.wd / 5), bureau.yd +(bureau.hd / 5), 320, 150,
					100, 100, 200, 200, 16, 16,
					WFARROW, THIN_CROSS,
					winicn, ZERO, close_wmenu, get_string(TIT_MENU), "",
					(long) bureau.wd,(long) bureau.hd,
					TRUE, FALSE, W_MENU, 10, BLACK);
			}
			else {
				buf[3] = win[WINDMENU].w_hg;
				(*win[WINDMENU].w_top)();
			}
			break;
		
		case M_QUITTER :
			clos_acc();
			win[buf[5]].w_bar[buf[3]].ob_state &= ~SELECTED;
			*flacc = FALSE;
			break;
		} /* end of switch */
	}	/* event for main menu running as accessory */
}	/* end of event_wmenu */