Beispiel #1
0
void
BarMenu (int xmax, int ymax, int leftmar, int stepwidth)
{

  int ii, jj;
  int lastx, lasty;
  int key1, key2;
  int i;
  int ok_flag = 0;



  ClrSelArea ();

  if (gEncode == BIG5) {
    input_print_string (0, 1, "請選擇->", LIGHTBAR_MESSAGE, INPUT_BGCOLOR);
  }

  if (gEncode == GB) {
    input_print_string (0, 1, string_BIG5toGB ("請選擇->"), LIGHTBAR_MESSAGE,
			INPUT_BGCOLOR);
  }

  for (jj = 1; jj <= xmax; jj++)
    for (ii = 1; ii <= ymax; ii++) {
      chinese_bar (jj, ii, leftmar, stepwidth,
		   Item_attr[jj] == 1 ? NORMAL : NORMALDISABLE,
		   Item_str[jj][ii]);
    }

  chinese_bar (mx, my, leftmar, stepwidth,
	       Item_attr[mx] == 1 ? REVERSE : REVERSEDISABLE,
	       Item_str[mx][my]);

  #ifdef VGALIB
  gl_copyscreen(physical_screen);
  #endif

  initscr ();
  noecho ();
  keypad (stdscr, TRUE);


  while (ok_flag == 0) {

    key2 = getch ();
    lastx = mx;
    lasty = my;
    switch (key2) {

    case KEY_HOME:
      mx = 1;
      my = 1;
      break;
    case KEY_END:
      mx = xmax;
      my = ymax;
      break;
    case KEY_UP:
      Up (xmax, ymax);
      break;
    case KEY_LEFT:
      BarLeft (xmax, ymax, leftmar, stepwidth);
      break;
    case KEY_RIGHT:
      BarRight (xmax, ymax, leftmar, stepwidth);
      break;
    case KEY_DOWN:
      Dn (xmax, ymax);
      break;
    case 10:
    case 13:
    case KEY_ENTER:
      ok_flag = 1;
      ClrSelArea ();
      if (mx == 10 && gItem_disp_off == 0) {
	set_active_input_method (0);
      } else {
	set_active_input_method (mx + gItem_disp_off);
      }
      break;
    case 200:
    case 201:
    case 202:
    case 203:
    case 204:
    case 205:
    case 206:
    case 207:
    case 208:
    case 209:
      ok_flag = 1;
      ClrSelArea ();
      if (key2 - 200 == 0) {
	mx = 10;
	my = 1;
	set_active_input_method (0);
      } else {
	mx = key2 - 200;
	my = 1;
	set_active_input_method (mx);
      }
      BarMenuInit (10, 1);
      BarMenu (10, 1, 8, 6);
      break;
    default:
      ok_flag = 1;
      ClrSelArea ();
      if (mx == 10 && gItem_disp_off == 0) {
	set_active_input_method (0);
      } else {
	set_active_input_method (mx + gItem_disp_off);
      }

      hz_filter (hztty_list->tty_fd, key2);
      break;
    }

    if (ok_flag == 1) {
      break;
    }



    chinese_bar (mx, my, leftmar, stepwidth,
		 Item_attr[mx] == 1 ? REVERSE : REVERSEDISABLE,
		 Item_str[mx][my]);

    if (!(lasty == my && lastx == mx)) {
      chinese_bar (lastx, lasty, leftmar, stepwidth,
		   Item_attr[lastx] == 1 ? NORMAL : NORMALDISABLE,
		   Item_str[lastx][lasty]);
    }
    #ifdef VGALIB
    gl_copyscreen(physical_screen);
    #endif


  }

  keypad (stdscr, FALSE);

}
Beispiel #2
0
void Splice(edge *a, edge *b, point *v) {
	edge *next;
	if (Oi(a) == v) next = On(a), On(a) = b; else next = Dn(a), Dn(a) = b;
	if (Oi(next) == v) Op(next) = b; else Dp(next) = b;
	if (Oi(b) == v) On(b) = next, Op(b) = a; else Dn(b) = next, Dp(b) = a;
}