Esempio n. 1
0
/**
 * This function handles all "pan" input events
 * @param misc A string describing the desired pan action.
 *  on             Turn pan on
 *  off            Turn pan off
 *  toogle         Toogles pan mode
 *  up             Pan up
 *  down           Pan down
 *  left           Pan left
 *  right          Pan right
 *  @todo feature: n,n Go that direction - +/-
 *  @todo feature: ??? Go to particular point
 *  @todo feature: ??? Go to waypoint (eg: next, named)
 */
void
InputEvents::eventPan(const TCHAR *misc)
{
  if (StringIsEqual(misc, _T("toggle")))
    TogglePan();

  else if (StringIsEqual(misc, _T("on")))
    EnterPan();

  else if (StringIsEqual(misc, _T("off")))
    LeavePan();

  else if (StringIsEqual(misc, _T("up")))
    if (IsHP31X())
      // Scroll wheel on the HP31x series should zoom in pan mode
      sub_ScaleZoom(1);
    else
      sub_PanCursor(0, 1);

  else if (StringIsEqual(misc, _T("down")))
    if (IsHP31X())
      // Scroll wheel on the HP31x series should zoom in pan mode
      sub_ScaleZoom(-1);
    else
      sub_PanCursor(0, -1);

  else if (StringIsEqual(misc, _T("left")))
    sub_PanCursor(1, 0);

  else if (StringIsEqual(misc, _T("right")))
    sub_PanCursor(-1, 0);

  XCSoarInterface::SendMapSettings(true);
}
Esempio n. 2
0
/**
 * This function handles all "pan" input events
 * @param misc A string describing the desired pan action.
 *  on             Turn pan on
 *  off            Turn pan off
 *  toogle         Toogles pan mode
 *  up             Pan up
 *  down           Pan down
 *  left           Pan left
 *  right          Pan right
 *  @todo feature: n,n Go that direction - +/-
 *  @todo feature: ??? Go to particular point
 *  @todo feature: ??? Go to waypoint (eg: next, named)
 */
void
InputEvents::eventPan(const TCHAR *misc)
{
  if (StringIsEqual(misc, _T("toggle")))
    TogglePan();

  else if (StringIsEqual(misc, _T("on")))
    EnterPan();

  else if (StringIsEqual(misc, _T("off")))
    LeavePan();

  else if (StringIsEqual(misc, _T("up")))
    sub_PanCursor(0, 1);

  else if (StringIsEqual(misc, _T("down")))
    sub_PanCursor(0, -1);

  else if (StringIsEqual(misc, _T("left")))
    sub_PanCursor(1, 0);

  else if (StringIsEqual(misc, _T("right")))
    sub_PanCursor(-1, 0);

  XCSoarInterface::SendMapSettings(true);
}
Esempio n. 3
0
File: Pan.cpp Progetto: DRIZO/xcsoar
void
TogglePan()
{
  if (IsPanning())
    LeavePan();
  else
    EnterPan();
}
Esempio n. 4
0
void
TogglePan()
{
  assert(CommonInterface::main_window != NULL);

  const GlueMapWindow *map = CommonInterface::main_window->GetMap();
  if (map == NULL)
    EnterPan();
  else if (map->IsPanning())
    LeavePan();
}
Esempio n. 5
0
void
InputEvents::setMode(Mode mode)
{
  assert((unsigned)mode < input_config.modes.size());

  if (mode == current_mode)
    return;

  if (current_mode == MODE_PAN)
    /* disable pan mode before displaying the normal menu; leaving pan
       mode enabled would be confusing for the user, and doesn't look
       consistent */
    LeavePan();

  current_mode = mode;
  UpdateOverlayMode();

  drawButtons(current_mode, true);
}