Esempio n. 1
0
void System::setExit(bool quit) {
  if (!isClosing()) {
    bool running = isRunning();
    _state = quit ? kClosingState : kBackState;
    if (running) {
      brun_break();
    }
  }
}
// handle the system menu
void Controller::handleMenu(int menuId) {
  int fontSize = _output->getFontSize();
  _systemMenu = false;

  switch (menuId) {
  case MENU_SOURCE:
    showSystemScreen(true);
    break;
  case MENU_CONSOLE:
    showSystemScreen(false);
    break;
  case MENU_KEYPAD:
    maShowVirtualKeyboard();
    break;
  case MENU_ZOOM_UP:
    if (_fontScale > FONT_MIN) {
      _fontScale -= FONT_SCALE_INTERVAL;
      fontSize = (_initialFontSize * _fontScale / 100);
    }
    break;
  case MENU_ZOOM_DN:
    if (_fontScale < FONT_MAX) {
      _fontScale += FONT_SCALE_INTERVAL;
      fontSize = (_initialFontSize * _fontScale / 100);
    }
    break;
  }

  if (fontSize != _output->getFontSize()) {
    _output->setFontSize(fontSize);
    // restart the shell
    buttonClicked("main.bas");
    brun_break();
    _runMode = break_state;
  }
  
  if (!isRunning()) {
    _output->flush(true);
  }
}
Esempio n. 3
0
void System::setLoadBreak(const char *path) {
  _loadPath = path;
  _history.push(new strlib::String(path));
  _state = kBreakState;
  brun_break();
}
Esempio n. 4
0
void System::setRestart() {
  if (isRunning()) {
    brun_break();
  }
  _state = kRestartState;
}
// stop and running program
void Controller::setExit(bool quit) {
  if (isRunning()) {
    brun_break();
  }
  _runMode = quit ? exit_state : back_state;
}