Ejemplo n.º 1
0
static DataField *
CreateDistanceDataField(DataFieldListener *listener)
{
  DataFieldEnum *df = new DataFieldEnum(listener);
  FillDistanceEnum(*df);
  return df;
}
Ejemplo n.º 2
0
static void
PrepareAirspaceSelectDialog()
{
    gcc_unused ScopeBusyIndicator busy;

    wf = LoadDialog(CallBackTable, UIGlobals::GetMainWindow(),
                    Layout::landscape ? _T("IDR_XML_AIRSPACESELECT_L") :
                    _T("IDR_XML_AIRSPACESELECT"));
    assert(wf != NULL);

#ifdef GNAV
    wf->SetKeyDownNotify(FormKeyDown);
#endif

    wAirspaceList = (WndListFrame*)wf->FindByName(_T("frmAirspaceList"));
    assert(wAirspaceList != NULL);
    wAirspaceList->SetActivateCallback(OnAirspaceListEnter);
    wAirspaceList->SetPaintItemCallback(OnPaintListItem);

    wpName = (WndProperty*)wf->FindByName(_T("prpFltName"));
    wpDistance = (WndProperty*)wf->FindByName(_T("prpFltDistance"));
    FillDistanceEnum(*(DataFieldEnum *)wpDistance->GetDataField());
    wpDistance->RefreshDisplay();

    wpDirection = (WndProperty*)wf->FindByName(_T("prpFltDirection"));
    FillDirectionEnum(*(DataFieldEnum *)wpDirection->GetDataField());
    wpDirection->RefreshDisplay();

    LoadFormProperty(*wf, _T("prpFltType"), type_filter_list, WILDCARD);

    wf->SetTimerNotify(OnTimerNotify);
}
Ejemplo n.º 3
0
static void
PrepareAirspaceSelectDialog()
{
  gcc_unused ScopeBusyIndicator busy;

  dialog = LoadDialog(nullptr, UIGlobals::GetMainWindow(),
                  Layout::landscape ? _T("IDR_XML_AIRSPACESELECT_L") :
                                      _T("IDR_XML_AIRSPACESELECT"));
  assert(dialog != NULL);

#ifdef GNAV
  dialog->SetKeyDownFunction(FormKeyDown);
#endif

  const DialogLook &dialog_look = UIGlobals::GetDialogLook();

  airspace_list_control = (ListControl*)dialog->FindByName(_T("frmAirspaceList"));
  assert(airspace_list_control != NULL);
  airspace_list_control->SetItemHeight(AirspaceListRenderer::GetHeight(dialog_look));

  name_control = (WndProperty*)dialog->FindByName(_T("prpFltName"));
  assert(name_control != NULL);
  name_control->SetDataField(new PrefixDataField());

  distance_control = (WndProperty*)dialog->FindByName(_T("prpFltDistance"));
  assert(distance_control != NULL);
  FillDistanceEnum(*(DataFieldEnum *)distance_control->GetDataField());
  distance_control->RefreshDisplay();

  direction_control = (WndProperty*)dialog->FindByName(_T("prpFltDirection"));
  assert(direction_control != NULL);
  FillDirectionEnum(*(DataFieldEnum *)direction_control->GetDataField());
  direction_control->RefreshDisplay();

  type_control = (WndProperty*)dialog->FindByName(_T("prpFltType"));
  assert(type_control != NULL);
  LoadFormProperty(*dialog, _T("prpFltType"), type_filter_list, WILDCARD);
}