Example #1
0
void InsetMathXYArrow::draw(PainterInfo & pi, int x, int y) const
{
	metrics(mi_);
	FontSetChanger dummy(pi.base, "textrm");

	if (editing()) {

#if 0

		int lasc;
		int ldes;
		int lwid;
		mathed_string_dim(pi.base.font, "target: ", lasc, ldes, lwid);

		cell(0).draw(pi, x + lwid, y);
		pi.base.text(x + 3, y, "target");
		y += max(dim0.des, ldes) + 5;

		y += max(dim1.asc, lasc) + 5;
		cell(1).draw(pi, x + lwid, y);
		pi.base.text(x + 3, y, "label");

#endif

	} else {

		pi.pain.text(x, y, "X");
		MathData const & s = sourceCell();
		MathData const & t = targetCell();
		pi.pain.line(s.xm(), s.ym(), t.xm(), t.ym(), Color_math);
		cell(1).draw(pi, (s.xm() + t.xm())/2, (s.ym() + t.ym())/2);

	}
}
Example #2
0
void Menu::options()
{
  const char* names[] = {
    "CLR",
    "SDIR",
    "SPDS",
    "TRGT",
    "BACK"
  };

  switch (gUserInterface.getString(names, 5, 4)) {
    case 0:
      clear();
      break;
    case 1:
      startDirection();
      break;
    case 2:
      speeds();
      break;
    case 3:
      targetCell();
      break;
    case 4:
      // back
      break;
    default:
      break;
  }
}