コード例 #1
0
ファイル: dlgTaskWaypoint.cpp プロジェクト: bugburner/xcsoar
static void OnRemoveClicked(WindowControl * Sender) {
	(void)Sender;
  task.RemoveTaskPoint(twItemIndex, XCSoarInterface::SettingsComputer(),
                       XCSoarInterface::Basic());
  SetWaypointValues();
  wf->SetModalResult(mrOK);
}
コード例 #2
0
ファイル: dlgTaskWaypoint.cpp プロジェクト: Acrobot/LK8000
static void OnMoveBeforeClicked(WindowControl * Sender){
	(void)Sender;
  LockTaskData();
  SwapWaypoint(twItemIndex-1);
  SetWaypointValues();
  UnlockTaskData();
  wf->SetModalResult(mrOK);
}
コード例 #3
0
ファイル: dlgTaskWaypoint.cpp プロジェクト: LK8000/LK8000
static void OnMoveBeforeClicked(WndButton* pWnd){
  LockTaskData();
  SwapWaypoint(twItemIndex-1);
  SetWaypointValues();
  UnlockTaskData();
  if(pWnd) {
    WndForm * pForm = pWnd->GetParentWndForm();
    if(pForm) {
      pForm->SetModalResult(mrOK);
    }
  }
}
コード例 #4
0
ファイル: dlgTaskWaypoint.cpp プロジェクト: bugburner/xcsoar
static void OnAATEnabled(DataField *Sender, DataField::DataAccessKind_t Mode) {
  switch(Mode){
    case DataField::daGet:
    break;
    case DataField::daPut:
    case DataField::daChange:
      ReadValues();
      SetValues();
      GetWaypointValues();
      SetWaypointValues();
    break;
  }
}
コード例 #5
0
ファイル: dlgTaskWaypoint.cpp プロジェクト: Acrobot/LK8000
static void OnRemoveClicked(WindowControl * Sender) {
	(void)Sender;
  LockTaskData();
  RemoveTaskPoint(twItemIndex);
  SetWaypointValues();
  if (ActiveWayPoint>=twItemIndex) {
    ActiveWayPoint--;
  }
  if (ActiveWayPoint<0) {
    ActiveWayPoint= -1;
  }
  UnlockTaskData();
  wf->SetModalResult(mrOK);
}
コード例 #6
0
ファイル: dlgTaskWaypoint.cpp プロジェクト: LK8000/LK8000
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);
    }
  }
}
コード例 #7
0
ファイル: dlgTaskWaypoint.cpp プロジェクト: Acrobot/LK8000
void dlgTaskWaypointShowModal(int itemindex, int tasktype, bool addonly){
  wf = NULL;
 
  if (!ScreenLandscape) {
    char filename[MAX_PATH];
    LocalPathS(filename, TEXT("dlgTaskWaypoint_L.xml"));
    wf = dlgLoadFromXML(CallBackTable, 
                        
                        filename, 
                        hWndMainWindow,
                        TEXT("IDR_XML_TASKWAYPOINT_L"));
  } else {
    char filename[MAX_PATH];
    LocalPathS(filename, TEXT("dlgTaskWaypoint.xml"));
    wf = dlgLoadFromXML(CallBackTable, 
                        filename, 
                        hWndMainWindow,
                        TEXT("IDR_XML_TASKWAYPOINT"));    
  }

  if (ISPARAGLIDER) {
    if(DoOptimizeRoute()) 
		AATEnabled=TRUE;
	EnableMultipleStartPoints=false;
  }

  twItemIndex = itemindex;
  twType = tasktype;

  if (!wf) return;

  //ASSERT(wf!=NULL);
  //  wf->SetKeyDownNotify(FormKeyDown);

  wStart     = ((WndFrame *)wf->FindByName(TEXT("frmStart")));
  wTurnpoint = ((WndFrame *)wf->FindByName(TEXT("frmTurnpoint")));
  wAATTurnpoint = ((WndFrame *)wf->FindByName(TEXT("frmAATTurnpoint")));
  wFinish    = ((WndFrame *)wf->FindByName(TEXT("frmFinish")));

  //ASSERT(wStart!=NULL);
  //ASSERT(wTurnpoint!=NULL);
  //ASSERT(wAATTurnpoint!=NULL);
  //ASSERT(wFinish!=NULL);

  WndButton* wb;
  if (addonly) {
    wb = (WndButton *)wf->FindByName(TEXT("butSelect"));
    if (wb) {
      wb->SetVisible(false);
    }
    wb = (WndButton *)wf->FindByName(TEXT("butRemove"));
    if (wb) {
      wb->SetVisible(false);
    }
    wb = (WndButton *)wf->FindByName(TEXT("butDetails"));
    if (wb) {
      wb->SetVisible(false);
    }
    wb = (WndButton *)wf->FindByName(TEXT("butDown"));
    if (wb) {
      wb->SetVisible(false);
    }
    wb = (WndButton *)wf->FindByName(TEXT("butUp"));
    if (wb) {
      wb->SetVisible(false);
    }
  } else {
    if (!ValidTaskPoint(twItemIndex-1)) {
      wb = (WndButton *)wf->FindByName(TEXT("butUp"));
      if (wb) {
        wb->SetVisible(false);
      }
    }
    if (!ValidTaskPoint(twItemIndex+1)) {
      wb = (WndButton *)wf->FindByName(TEXT("butDown"));
      if (wb) {
        wb->SetVisible(false);
      }
    }
  }

  SetWaypointValues(true);

  switch (twType) {
    case 0:
      wStart->SetVisible(1);
      wTurnpoint->SetVisible(0);
      wAATTurnpoint->SetVisible(0);
      wFinish->SetVisible(0);
      break;
    case 1:
      wStart->SetVisible(0);
      if (AATEnabled) {
	wTurnpoint->SetVisible(0);
	wAATTurnpoint->SetVisible(1);
      } else {
	wTurnpoint->SetVisible(1);
	wAATTurnpoint->SetVisible(0);
      }
      wFinish->SetVisible(0);
    break;
    case 2:
      wStart->SetVisible(0);
      wTurnpoint->SetVisible(0);
      wAATTurnpoint->SetVisible(0);
      wFinish->SetVisible(1);
    break;
  }

  // set properties...

  SetValues(true);

  UpdateCaption();

  wf->ShowModal();

  // now retrieve changes

  GetWaypointValues();

  ReadValues();

  delete wf;

  wf = NULL;

}
コード例 #8
0
ファイル: dlgTaskWaypoint.cpp プロジェクト: bugburner/xcsoar
void dlgTaskWaypointShowModal(int itemindex, int tasktype, bool addonly){
  wf = NULL;

  if (!Layout::landscape) {
    wf = dlgLoadFromXML(CallBackTable,
                        _T("dlgTaskWaypoint_L.xml"),
                        XCSoarInterface::main_window,
                        _T("IDR_XML_TASKWAYPOINT_L"));
  } else {
    wf = dlgLoadFromXML(CallBackTable,
                        _T("dlgTaskWaypoint.xml"),
                        XCSoarInterface::main_window,
                        _T("IDR_XML_TASKWAYPOINT"));
  }

  twItemIndex = itemindex;
  twType = tasktype;

  if (!wf) return;

  assert(wf!=NULL);
  //  wf->SetKeyDownNotify(FormKeyDown);

  settings_task = task.getSettings();

  wStart     = ((WndFrame *)wf->FindByName(_T("frmStart")));
  wTurnpoint = ((WndFrame *)wf->FindByName(_T("frmTurnpoint")));
  wAATTurnpoint = ((WndFrame *)wf->FindByName(_T("frmAATTurnpoint")));
  wFinish    = ((WndFrame *)wf->FindByName(_T("frmFinish")));

  assert(wStart!=NULL);
  assert(wTurnpoint!=NULL);
  assert(wAATTurnpoint!=NULL);
  assert(wFinish!=NULL);

  WndButton* wb;
  if (addonly) {
    wb = (WndButton *)wf->FindByName(_T("butSelect"));
    if (wb) {
      wb->hide();
    }
    wb = (WndButton *)wf->FindByName(_T("butRemove"));
    if (wb) {
      wb->hide();
    }
    wb = (WndButton *)wf->FindByName(_T("butDetails"));
    if (wb) {
      wb->hide();
    }
    wb = (WndButton *)wf->FindByName(_T("butDown"));
    if (wb) {
      wb->hide();
    }
    wb = (WndButton *)wf->FindByName(_T("butUp"));
    if (wb) {
      wb->hide();
    }
  } else {
    if (!task.ValidTaskPoint(twItemIndex-1)) {
      wb = (WndButton *)wf->FindByName(_T("butUp"));
      if (wb) {
        wb->hide();
      }
    }
    if (!task.ValidTaskPoint(twItemIndex+1)) {
      wb = (WndButton *)wf->FindByName(_T("butDown"));
      if (wb) {
        wb->hide();
      }
    }
  }

  SetWaypointValues(true);

  switch (twType) {
    case 0:
      wStart->show();
      wTurnpoint->hide();
      wAATTurnpoint->hide();
      wFinish->hide();
      break;
    case 1:
      wStart->hide();
      wTurnpoint->set_visible(!settings_task.AATEnabled);
      wAATTurnpoint->set_visible(settings_task.AATEnabled);
      wFinish->hide();
    break;
    case 2:
      wStart->hide();
      wTurnpoint->hide();
      wAATTurnpoint->hide();
      wFinish->show();
    break;
  }

  // set properties...

  SetValues(true);

  UpdateCaption();

  wf->ShowModal();

  // now retrieve changes

  GetWaypointValues();

  ReadValues();

  delete wf;

  wf = NULL;

}