Esempio n. 1
0
static void OnMoveClicked(WndButton* pWnd){
  if(pWnd) {
    WndForm * pForm = pWnd->GetParentWndForm();
    if(pForm) {
      pForm->SetModalResult(mrOK);
    }
  }
  MapWindow::SetPanTaskEdit(twItemIndex);
}
Esempio n. 2
0
static void OnCloseClicked(WndButton* pWnd) {
  ItemIndex = -1;
  if(pWnd) {
    WndForm * pForm = pWnd->GetParentWndForm();
    if(pForm) {
      pForm->SetModalResult(mrCancel);
    }
  }
}
Esempio n. 3
0
static void OnSIMClicked(WndButton* pWnd) {
  RUN_MODE = RUN_SIM;
  if(pWnd) {
    WndForm * pForm = pWnd->GetParentWndForm();
    if(pForm) {
      pForm->SetModalResult(mrOK);
    }
  }
}
Esempio n. 4
0
static void OnBallastDump(WndButton* pWnd) {
  BallastTimerActive = !BallastTimerActive;
  if(pWnd) {
    WndForm * pForm = pWnd->GetParentWndForm();
    if(pForm) {
      pForm->SetModalResult(mrOK);
    }
  }
}
Esempio n. 5
0
static void OnOk(WndButton* pWnd)
{
  PlayResource(TEXT("IDR_WAV_CLICK"));
  if(pWnd) {
    WndForm * pForm = pWnd->GetParentWndForm();
    if(pForm) {
      pForm->SetModalResult(mrOK);
    }
  }
}
Esempio n. 6
0
static void OnPILOTClicked(WndButton* pWnd) {
  RUN_MODE = RUN_PILOT;
  LKSound(_T("LK_SLIDE.WAV"));
  if(pWnd) {
    WndForm * pForm = pWnd->GetParentWndForm();
    if(pForm) {
      pForm->SetModalResult(mrOK);
    }
  }
}
Esempio n. 7
0
static void OnNickelClick(WndButton* pWnd) {
  RUN_MODE = RUN_EXIT;
  RestartToNickel = true;
  LKSound(_T("LK_SLIDE.WAV"));
  if(pWnd) {
    WndForm * pForm = pWnd->GetParentWndForm();
    if(pForm) {
      pForm->SetModalResult(mrOK);
    }
  }
}
Esempio n. 8
0
static void OnWPSCloseClicked(WndButton* pWnd){
  ItemIndex = -1;
  if(pWnd) {
    WndForm * pForm = pWnd->GetParentWndForm();
    if(pForm) {
      pForm->SetModalResult(mrCancel);
    }
  }
  wf->SetTimerNotify(0,NULL);

}
Esempio n. 9
0
static void OnMoveBeforeClicked(WndButton* pWnd){
  LockTaskData();
  SwapWaypoint(twItemIndex-1);
  SetWaypointValues();
  UnlockTaskData();
  if(pWnd) {
    WndForm * pForm = pWnd->GetParentWndForm();
    if(pForm) {
      pForm->SetModalResult(mrOK);
    }
  }
}
Esempio n. 10
0
static void OnEXITClicked(WndButton* pWnd) {
  RUN_MODE = RUN_EXIT;
#ifdef KOBO
  RestartToNickel = false;
#endif
  if(pWnd) {
    WndForm * pForm = pWnd->GetParentWndForm();
    if(pForm) {
      pForm->SetModalResult(mrOK);
    }
  }
}
Esempio n. 11
0
static void OnFLYClicked(WndButton* pWnd) {
  RUN_MODE = RUN_FLY;
  //  Removed 110605: we now run devInit on startup for all devices, and we dont want an immediate and useless reset.
  //  LKForceComPortReset=true;
  PortMonitorMessages = 0;
  if(pWnd) {
    WndForm * pForm = pWnd->GetParentWndForm();
    if(pForm) {
      pForm->SetModalResult(mrOK);
    }
  }
}
Esempio n. 12
0
static bool
OnKeyDown(WndForm &sender, unsigned key_code)
{
  DataFieldEnum *dfe;

  /* map the Altair hardware buttons */
  switch (key_code){
  case VK_UP:
    dfe = (DataFieldEnum *)edit_select->GetDataField();
    dfe->Dec();
    edit_select->RefreshDisplay();
    return true;

  case VK_DOWN:
    dfe = (DataFieldEnum *)edit_select->GetDataField();
    dfe->Inc();
    edit_select->RefreshDisplay();
    return true;

  case VK_LEFT:
    dfe = (DataFieldEnum *)edit_content->GetDataField();
    dfe->Dec();
    edit_content->RefreshDisplay();
    return true;

  case VK_RIGHT:
    dfe = (DataFieldEnum *)edit_content->GetDataField();
    dfe->Inc();
    edit_content->RefreshDisplay();
    return true;

  case VK_APP1:
    OnNameAccess(*buttonPaste);
    return true;

  case '6':
    sender.SetModalResult(mrOK);
    return true;

  case '7':
    OnCopy(*buttonPaste);
    return true;

  case '8':
    OnPaste(*buttonPaste);
    return true;

  default:
    return false;
  }
}
Esempio n. 13
0
static void OnEnterClicked(WndButton* pWnd) {
  (void)pWnd;

  if (TaskIndex >= iNO_Tasks) {
      TaskIndex = iNO_Tasks - 1;
  }
  if (TaskIndex >= 0) {
      if(pWnd) {
          WndForm * pForm = pWnd->GetParentWndForm();
          if(pForm) {
              pForm->SetModalResult(mrOK);
          }
      }
  }
}
Esempio n. 14
0
static void OnCloseClicked(WndButton* pWnd) {

  LKSound(_T("LK_SLIDE.WAV"));
  switch (RUN_MODE) {
    case RUN_DUALPROF:
      RUN_MODE = RUN_WELCOME;
      break;
  }

  if(pWnd) {
    WndForm * pForm = pWnd->GetParentWndForm();
    if(pForm) {
      pForm->SetModalResult(mrOK);
    }
  }
}
Esempio n. 15
0
static void OnRemoveClicked(WndButton* pWnd) {
  LockTaskData();
  RemoveTaskPoint(twItemIndex);
  SetWaypointValues();
  if (ActiveTaskPoint>=twItemIndex) {
    ActiveTaskPoint--;
  }
  if (ActiveTaskPoint<0) {
    ActiveTaskPoint= -1;
  }
  UnlockTaskData();
  if(pWnd) {
    WndForm * pForm = pWnd->GetParentWndForm();
    if(pForm) {
      pForm->SetModalResult(mrOK);
    }
  }
}
Esempio n. 16
0
static void OnTaskSelectListListEnter(WindowControl * Sender,
    WndListFrame::ListInfo_t *ListInfo) {
  (void) Sender;

  TaskIndex = ListInfo->ItemIndex + ListInfo->ScrollIndex;
  if (TaskIndex >= iNO_Tasks) {
      TaskIndex = iNO_Tasks - 1;
  }

  if (TaskIndex >= 0) {
      if(Sender) {
          WndForm * pForm = Sender->GetParentWndForm();
          if(pForm) {
              pForm->SetModalResult(mrOK);
          }
      }
  }
}
Esempio n. 17
0
static void OnEnterClicked(WndButton* pWnd) {
    (void)pWnd;

    if (ItemIndex >= iNO_ELEMENTS) {
        ItemIndex = iNO_ELEMENTS - 1;
    }
    if (ItemIndex >= 0) {
      if(pWnd) {
        WndForm * pForm = pWnd->GetParentWndForm();
        if(pForm) {
          pForm->SetModalResult(mrOK);
        }
      }
    }

    if ((ItemIndex >= 0) && (ItemIndex < iNO_ELEMENTS)) {
        dlgAddMultiSelectListDetailsDialog(ItemIndex);
    }

}
Esempio n. 18
0
static void OnDeleteClicked(WndButton* pWnd){

  TCHAR file_name[MAX_PATH];

  WndProperty* wp;
  DataFieldFileReader *dfe;

  wp = (WndProperty*)wf->FindByName(TEXT("prpFile"));
  if (!wp) return;

  wp->OnLButtonDown((POINT){0,0});

  dfe = (DataFieldFileReader*) wp->GetDataField();

  int file_index = dfe->GetAsInteger();
  if (file_index>0) {
	_stprintf(file_name, TEXT("%s '%s' ?"), MsgToken(1789), dfe->GetAsString()); // Delete task file?
	if(MessageBoxX(file_name, _T(" "), mbYesNo) == IdNo) {
		return;
	}
  } else {
	MessageBoxX(MsgToken(1790),_T(" "), mbOk); // No task file to delete
	return;
  }

  if (file_index>0) {
    lk::filesystem::deleteFile(dfe->GetPathFile());
    // Cannot update dfe list, so we force exit.
    ItemIndex = -1;
    if(pWnd) {
      WndForm * pForm = pWnd->GetParentWndForm();
      if(pForm) {
        pForm->SetModalResult(mrOK);
      }
    }
    return;
  }
}
Esempio n. 19
0
static void OnMultiSelectListListEnter(WindowControl * Sender,
                                       WndListFrame::ListInfo_t *ListInfo) {
    (void) Sender;

    ItemIndex = ListInfo->ItemIndex + ListInfo->ScrollIndex;
    if (ItemIndex >= iNO_ELEMENTS) {
        ItemIndex = iNO_ELEMENTS - 1;
    }
    if (ItemIndex >= 0) {
      if(Sender) {
        WndForm * pForm = Sender->GetParentWndForm();
        if(pForm) {
          pForm->SetModalResult(mrOK);
        }
      }
    }


    if ((ItemIndex >= 0) && (ItemIndex < iNO_ELEMENTS)) {
        dlgAddMultiSelectListDetailsDialog(ItemIndex);
    }

}
Esempio n. 20
0
inline void
PlaneListWidget::LoadClicked()
{
  if (LoadWithDialog(GetList().GetCursorIndex()))
    form->SetModalResult(mrOK);
}
Esempio n. 21
0
 virtual void OnActivateItem(unsigned index) override {
   form->SetModalResult(mrOK);
 }