Exemplo n.º 1
0
void movement()
{
char ch1,ch2;
entercell(sys.cell);

do {
	ch1 = getch();
	if (ch1 == 0)
	{
       	ch2 = getch();
        docommand(ch2);
	}
	else
	if (isalnum(ch1) || ch1 == 27 || ch1 == 8 || ch1 == '+' || ch1 == '-' || ch1 == '.')
	{
         ungetch(ch1);
	if ((sys.screen== SCREEN1) && ( status.data[sys.cell.row-8].month == -1) &&
	(sys.cell.col != MONTH) && (sys.cell.col <= HELDP))
	{
	leavecell(sys.cell);
	 clearrow();
	sys.cell.col = MONTH;
	entercell(sys.cell);
	}
	 ch2 = editcell(sys.cell);
	 docommand(ch2);
	}
   } while (1);
}
Exemplo n.º 2
0
void mainmenu(void)
/* Executes the commands in the main menu */
{
 switch(getcommand(MENU, COMMAND))
 {
  case 0 :
   smenu();
   break;
  case 1 :
   formatcells();
   break;
  case 2 :
   deletecell(curcol, currow, UPDATE);
   printfreemem();
   if (autocalc)
    recalc();
   break;
  case 3 :
   gotocell();
   break;
  case 4 :
   cmenu();
   break;
  case 5 :
   rmenu();
   break;
  case 6 :
   editcell(curcell);
   break;
  case 7 :
   umenu();
   break;
  case 8 :
   changeautocalc(!autocalc);
   break;
  case 9 :
   checkforsave();
   stop = TRUE;
   break;
 } /* switch */
} /* mainmenu */