Example #1
0
static void OnCloseClicked(WndButton* pWnd){
  if(pWnd) {
    WndForm * pForm = pWnd->GetParentWndForm();
    bool bIdenti = false;
    getVariables();
    for (unsigned int i=0 ; i < NO_WP_FILES-1; i++)
    {
      if((szWaypointFile[i] != NULL) &&  (_tcslen (szWaypointFile[i])> 0))
      for (unsigned int j=(i+1) ; j < NO_WP_FILES; j++)
      {
        TCHAR tmp[MAX_PATH];
        if((szWaypointFile[j] != NULL) && (_tcslen (szWaypointFile[j])> 0))
        {
		  if(_tcscmp(szWaypointFile[i],szWaypointFile[j])==0)
		  {
		   _sntprintf(tmp, MAX_PATH, _T("%s %u %s %u %s!"), MsgToken(2340), // _@M2340_ "Waypoint Files"
														    i+1,
															MsgToken(2345) , //_@M2345_ "and"
															j+1,
															MsgToken(2346) //_@M2346_ "are identical"
														 );
		    MessageBoxX(  tmp, MsgToken(356),  mbOk) ;  // _@M356_ "Information"
		    bIdenti = true;
		  }
        }
      }
    }
    if( bIdenti) return ;


    if(pForm) {
      pForm->SetModalResult(mrOK);
    }
  }
}
Example #2
0
static void OnEnableClicked(WndButton* pWnd)
{

  if (ItemIndex != -1) {
     const size_t i = (FullFlag) ? StrIndex[LowLimit + ItemIndex] : (LowLimit + ItemIndex);
    if ((UpLimit-LowLimit>0)
        && (ItemIndex >= 0)  // JMW fixed bug, was >0
        && (ItemIndex < (UpLimit - LowLimit))) {

      CAirspace *airspace = AirspaceSelectInfo[i].airspace;
      if (airspace) {
          wf->SetTimerNotify(0,NULL);
          LKSound(TEXT("LK_TICK.WAV"));
          CAirspaceManager::Instance().PopupAirspaceDetail(airspace);
      }
    }
  } else {
    if(pWnd) {
      WndForm * pForm = pWnd->GetParentWndForm();
      if(pForm) {
        pForm->SetModalResult(mrCancel);
      }
    }    
  }
}
Example #3
0
bool dlgAirspaceShowModal(bool coloredit){

  colormode = coloredit;

  WndForm *wf = dlgLoadFromXML(CallBackTable, ScreenLandscape ? IDR_XML_AIRSPACE_L : IDR_XML_AIRSPACE_P);
  if (!wf) return false;

  WndListFrame* wAirspaceList = (WndListFrame*)wf->FindByName(TEXT("frmAirspaceList"));
  LKASSERT(wAirspaceList!=NULL);
  wAirspaceList->SetBorderKind(BORDERLEFT);
  wAirspaceList->SetEnterCallback(OnAirspaceListEnter);

  WndOwnerDrawFrame* wAirspaceListEntry = (WndOwnerDrawFrame*)wf->FindByName(TEXT("frmAirspaceListEntry"));
  if(wAirspaceListEntry) {
    wAirspaceListEntry->SetCanFocus(true);
  }

  UpdateList(wAirspaceList);

  changed = false;

  wf->ShowModal();

  delete wf;

  return changed;
}
Example #4
0
static void OnSetFrequency(WndButton* pWnd){
(void)pWnd;
#ifdef RADIO_ACTIVE
TCHAR Tmp[255];
 if(RadioPara.Enabled)
 {
   double ASFrequency = ExtractFrequency((TCHAR*)airspace_copy.Name());
   if(!ValidFrequency(ASFrequency))
   {
	 ASFrequency = ExtractFrequency((TCHAR*)airspace_copy.Comment());
   }
   if(ValidFrequency(ASFrequency))
   {
     _stprintf(Tmp,_T("%7.3fMHz"),ASFrequency);
     devPutFreqActive(ASFrequency, (TCHAR*)airspace_copy.Name());
     DoStatusMessage(_T(""), Tmp );
   }
 }
#endif  // RADIO_ACTIVE        
  if(pWnd) {
    WndForm * pForm = pWnd->GetParentWndForm();
    if(pForm) {
      pForm->SetModalResult(mrOK);
    }
  }
} 
Example #5
0
static void OnCloseClicked(WndButton* pWnd) {
  if(pWnd) {
    WndForm * pForm = pWnd->GetParentWndForm();
    if(pForm) {
      pForm->SetModalResult(mrOK);
    }
  }
}
Example #6
0
static void OnBallastDump(WndButton* pWnd) {
  BallastTimerActive = !BallastTimerActive;
  if(pWnd) {
    WndForm * pForm = pWnd->GetParentWndForm();
    if(pForm) {
      pForm->SetModalResult(mrOK);
    }
  }
}
Example #7
0
static void OnCloseClicked(WndButton* pWnd) {
  TaskIndex = -1;
  if(pWnd) {
      WndForm * pForm = pWnd->GetParentWndForm();
      if(pForm) {
          pForm->SetModalResult(mrCancel);
      }
  }
}
Example #8
0
static void OnSIMClicked(WndButton* pWnd) {
  RUN_MODE = RUN_SIM;
  if(pWnd) {
    WndForm * pForm = pWnd->GetParentWndForm();
    if(pForm) {
      pForm->SetModalResult(mrOK);
    }
  }
}
Example #9
0
static void OnMoveClicked(WndButton* pWnd){
  if(pWnd) {
    WndForm * pForm = pWnd->GetParentWndForm();
    if(pForm) {
      pForm->SetModalResult(mrOK);
    }
  }
  MapWindow::SetPanTaskEdit(twItemIndex);
}
Example #10
0
static void OnCloseClicked(WndButton* pWnd) {
  ItemIndex = -1; // to stop FormDown bringing up task details
  if(pWnd) {
    WndForm * pForm = pWnd->GetParentWndForm();
    if(pForm) {
      pForm->SetModalResult(mrOK);
    }
  }
}
Example #11
0
static void OnOk(WndButton* pWnd)
{
  PlayResource(TEXT("IDR_WAV_CLICK"));
  if(pWnd) {
    WndForm * pForm = pWnd->GetParentWndForm();
    if(pForm) {
      pForm->SetModalResult(mrOK);
    }
  }
}
Example #12
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);
    }
  }
}
Example #13
0
static void OnWPSCloseClicked(WndButton* pWnd){
  ItemIndex = -1;
  if(pWnd) {
    WndForm * pForm = pWnd->GetParentWndForm();
    if(pForm) {
      pForm->SetModalResult(mrCancel);
    }
  }
  wf->SetTimerNotify(0,NULL);

}
Example #14
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);
    }
  }
}
Example #15
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);
    }
  }
}
Example #16
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);
    }
  }
}
Example #17
0
static void OnMoveBeforeClicked(WndButton* pWnd){
  LockTaskData();
  SwapWaypoint(twItemIndex-1);
  SetWaypointValues();
  UnlockTaskData();
  if(pWnd) {
    WndForm * pForm = pWnd->GetParentWndForm();
    if(pForm) {
      pForm->SetModalResult(mrOK);
    }
  }
}
Example #18
0
static void
Main()
{
  WndForm *form = LoadDialog(NULL, main_window, xmlfile.c_str());
  if (form == NULL) {
    _ftprintf(stderr, _T("Failed to load resource '%s'\n"), xmlfile.c_str());
    return;
  }

  form->ShowModal();
  delete form;
}
Example #19
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);
          }
      }
  }
}
Example #20
0
void
SetFormControlEnabled(WndForm &form, const TCHAR *control_name, bool enabled)
{
  Window *window = form.FindByName(control_name);
  assert(window != NULL);
  window->set_enabled(enabled);
}
Example #21
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);
    }
  }
}
Example #22
0
/*
 * only called by #CAirspaceManager::ProcessAirspaceDetailQueue()
 * for display AirspaceDetails, use #PopupAirspaceDetail
 */
void dlgAirspaceDetails() {

  WndForm* wf = dlgLoadFromXML(CallBackTable, IDR_XML_AIRSPACEDETAILS);

  if (!wf) return;
  wf->SetTimerNotify(1000, OnTimer);
  
  SetValues(wf);

  wf->ShowModal();

  delete wf;
  wf = NULL;

  return;
}
Example #23
0
bool
ConfigPanel::FinishFileField(WndForm &wf, const TCHAR *control_name,
                             const TCHAR *profile_key)
{
    const WndProperty *wp = (const WndProperty *)wf.FindByName(control_name);
    return wp != NULL && FinishFileField(*wp, profile_key);
}
Example #24
0
void
ShowFormControl(WndForm &form, const TCHAR *control_name, bool visible)
{
  Window *window = form.FindByName(control_name);
  assert(window != NULL);
  window->set_visible(visible);
}
Example #25
0
void
ShowOptionalFormControl(WndForm &form, const TCHAR *control_name,
                        bool visible)
{
  Window *window = form.FindByName(control_name);
  if (window != NULL)
    window->set_visible(visible);
}
Example #26
0
void
ConfigPanel::InitFileField(WndForm &wf, const TCHAR *control_name,
                           const TCHAR *profile_key, const TCHAR *filters)
{
    WndProperty *wp = (WndProperty *)wf.FindByName(control_name);
    assert(wp != NULL);

    InitFileField(*wp, profile_key, filters);
}
Example #27
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);
          }
      }
  }
}
Example #28
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);
    }
  }
}
Example #29
0
void dlgProgress::SetProgressText(const TCHAR* szText) {
    WindowControl* wText = _WndForm->FindByName(TEXT("frmText")); 
    if(wText) {
        wText->SetCaption(szText);
        wText->Redraw();
#ifndef USE_GDI
        MainWindow.Refresh();
#endif
    }
}
Example #30
0
void
PlaneEditWidget::UpdateCaption()
{
  if (dialog == nullptr)
    return;

  StaticString<128> tmp;
  tmp.Format(_T("%s: %s"), _("Plane Details"), GetValueString(REGISTRATION));
  dialog->SetCaption(tmp);
}