当前位置: 首页>>代码示例>>C++>>正文


C++ DataFieldEnum类代码示例

本文整理汇总了C++中DataFieldEnum的典型用法代码示例。如果您正苦于以下问题:C++ DataFieldEnum类的具体用法?C++ DataFieldEnum怎么用?C++ DataFieldEnum使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了DataFieldEnum类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: FillTCPPorts

static void
FillTCPPorts(DataFieldEnum &dfe)
{
  dfe.addEnumText(_T("4353"), 4353);
  dfe.addEnumText(_T("10110"), 10110);
  dfe.addEnumText(_T("4352"), 4352);
}
开发者ID:Adrien81,项目名称:XCSoar,代码行数:7,代码来源:DeviceEditWidget.cpp

示例2: setVariables

static void setVariables(void) {
  WndProperty *wp;

  wp = (WndProperty*)wf->FindByName(TEXT("prpPGNumberOfGates"));
  if (wp) {
    wp->GetDataField()->SetAsInteger(PGNumberOfGates);
    wp->RefreshDisplay();
  }
  wp = (WndProperty*)wf->FindByName(TEXT("prpPGOpenTimeH"));
  if (wp) {
    wp->GetDataField()->SetAsInteger(PGOpenTimeH);
    wp->RefreshDisplay();
  }
  wp = (WndProperty*)wf->FindByName(TEXT("prpPGOpenTimeM"));
  if (wp) {
    wp->GetDataField()->SetAsInteger(PGOpenTimeM);
    wp->RefreshDisplay();
  }
  wp = (WndProperty*)wf->FindByName(TEXT("prpPGGateIntervalTime"));
  if (wp) {
    wp->GetDataField()->SetAsInteger(PGGateIntervalTime);
    wp->RefreshDisplay();
  }
  wp = (WndProperty*)wf->FindByName(TEXT("prpPGStartOut"));
  if (wp) {
    DataFieldEnum* dfe;
    dfe = (DataFieldEnum*)wp->GetDataField();
	// LKTOKEN  [email protected]_ = "IN (Exit)" 
    dfe->addEnumText(gettext(TEXT("[email protected]_")));
	// LKTOKEN  [email protected]_ = "OUT (Enter)" 
    dfe->addEnumText(gettext(TEXT("[email protected]_")));
    dfe->Set(PGStartOut);
    wp->RefreshDisplay();
  }
}
开发者ID:JanezKolar,项目名称:LK8000,代码行数:35,代码来源:dlgTimeGates.cpp

示例3: AddEnum

void
RASPSettingsPanel::Prepare(ContainerWindow &parent, const PixelRect &rc)
{
  const WeatherUIState &state = CommonInterface::GetUIState().weather;
  time = state.time;

  WndProperty *wp;

  wp = AddEnum(_("Field"), nullptr, this);
  DataFieldEnum *dfe = (DataFieldEnum *)wp->GetDataField();
  dfe->EnableItemHelp(true);
  for (unsigned i = 0; i < rasp.GetItemCount(); i++) {
    const auto &mi = rasp.GetItemInfo(i);
    const TCHAR *label = mi.label;
    if (label != nullptr)
      label = gettext(label);

    const TCHAR *help = mi.help;
    if (help != nullptr)
      help = gettext(help);

    dfe->AddChoice(i, mi.name, label, help);
  }

  dfe->Set(state.map);
  wp->RefreshDisplay();

  AddEnum(_("Time"), nullptr, this);
  UpdateTimeControl();
}
开发者ID:kwtskran,项目名称:XCSoar,代码行数:30,代码来源:RASPDialog.cpp

示例4: FillI2CBus

static void
FillI2CBus(DataFieldEnum &dfe)
{
  dfe.addEnumText(_T("0"), 0u);
  dfe.addEnumText(_T("1"), 1u);
  dfe.addEnumText(_T("2"), 2u);
}
开发者ID:M-Scholli,项目名称:XCSoar,代码行数:7,代码来源:DeviceEditWidget.cpp

示例5: DetectSerialPorts

static bool
DetectSerialPorts(DataFieldEnum &df)
{
  TTYEnumerator enumerator;
  if (enumerator.HasFailed())
    return false;

  unsigned sort_start = df.Count();

  bool found = false;
  const char *path;
  while ((path = enumerator.Next()) != nullptr) {
    const char *display_string = path;
    if (memcmp(path, "/dev/", 5) == 0)
      display_string = path + 5;

    AddPort(df, DeviceConfig::PortType::SERIAL, path, display_string);
    found = true;
  }

  if (found)
    df.Sort(sort_start);

  return found;
}
开发者ID:M-Scholli,项目名称:XCSoar,代码行数:25,代码来源:DeviceEditWidget.cpp

示例6: InitTargetPoints

/*
 * Reads task points from the
 * protected task manager
 * and loads the Task Point UI
 * and initializes the pan mode on the map
 */
static void
InitTargetPoints()
{
  WndProperty *wp = (WndProperty*)wf->FindByName(_T("prpTaskPoint"));
  GetTaskData();
  DataFieldEnum* dfe;
  dfe = (DataFieldEnum*)wp->GetDataField();
  TCHAR tp_label[80];
  TCHAR tp_short[21];

  if (TaskSize <= target_point)
    target_point = ActiveTaskPointOnEntry;
  else
    target_point = max(target_point, ActiveTaskPointOnEntry);

  target_point = max(0, min((int)target_point, (int)TaskSize - 1));
  for (unsigned i = ActiveTaskPointOnEntry; i < TaskSize; i++) {
    _tcsncpy(tp_short, protected_task_manager.get_ordered_taskpoint_name(i), 20);
    tp_short[20] = 0;
    _stprintf(tp_label, _T("%d %s"), i, tp_short);
    dfe->addEnumText(tp_label);
  }
  dfe->Set(max(0, (int)target_point - (int)ActiveTaskPointOnEntry));

  if (TaskSize > target_point) {
    const GeoPoint t = protected_task_manager.get_ordered_taskpoint_location(target_point,
        XCSoarInterface::Basic().Location);
    SetZoom();
    XCSoarInterface::SetSettingsMap().TargetPan = true;
    XCSoarInterface::SetSettingsMap().EnablePan = true;
    XCSoarInterface::SetSettingsMap().PanLocation = t;
    XCSoarInterface::SetSettingsMap().TargetPanIndex = target_point;
  }
  wp->RefreshDisplay();
}
开发者ID:galippi,项目名称:xcsoar,代码行数:41,代码来源:dlgTarget.cpp

示例7: InitTargetPoints

/**
 * Reads task points from the protected task manager
 * and loads the Task Point UI and initializes the pan mode on the map
 */
static bool
InitTargetPoints()
{
  WndProperty *wp = (WndProperty*)wf->FindByName(_T("prpTaskPoint"));
  DataFieldEnum* dfe;
  dfe = (DataFieldEnum*)wp->GetDataField();

  if (!GetTaskData(*dfe))
    return false;

  if (TaskSize <= target_point)
    target_point = ActiveTaskPointOnEntry;
  else
    target_point = max(target_point, ActiveTaskPointOnEntry);

  target_point = max(0, min((int)target_point, (int)TaskSize - 1));

  dfe->Set(max(0, (int)target_point - (int)ActiveTaskPointOnEntry));

  if (TaskSize > target_point) {
    SetTarget();
  }

  wp->RefreshDisplay();
  return true;
}
开发者ID:davidswelt,项目名称:XCSoar,代码行数:30,代码来源:dlgTarget.cpp

示例8: dlgWeatherShowModal

void
dlgWeatherShowModal()
{

  wf = LoadDialog(CallBackTable, UIGlobals::GetMainWindow(),
                  _T("IDR_XML_WEATHER"));
  if (wf == NULL)
    return;

  WndProperty* wp;

  wp = (WndProperty*)wf->FindByName(_T("prpTime"));
  if (wp) {
    DataFieldEnum* dfe;
    dfe = (DataFieldEnum*)wp->GetDataField();
    dfe->addEnumText(_T("Now"));
    for (unsigned i = 1; i < RasterWeather::MAX_WEATHER_TIMES; i++) {
      if (RASP.isWeatherAvailable(i)) {
        TCHAR timetext[10];
        _stprintf(timetext, _T("%04d"), RASP.IndexToTime(i));
        dfe->addEnumText(timetext, i);
      }
    }

    dfe->Set(RASP.GetTime());

    wp->RefreshDisplay();
  }

  wp = (WndProperty*)wf->FindByName(_T("prpDisplayItem"));
  DataFieldEnum* dfe;
  if (wp) {
    dfe = (DataFieldEnum*)wp->GetDataField();
    dfe->addEnumText(_("Terrain"));

    for (int i = 1; i <= 15; i++) {
      const TCHAR *label = RASP.ItemLabel(i);
      if (label != NULL)
        dfe->addEnumText(label, i);
    }
    dfe->Set(RASP.GetParameter());
    wp->RefreshDisplay();
  }

  wf->ShowModal();

  wp = (WndProperty*)wf->FindByName(_T("prpTime"));
  if (wp) {
    DataFieldEnum* dfe;
    dfe = (DataFieldEnum*)wp->GetDataField();
    RASP.SetTime(dfe->GetAsInteger());
  }

  wp = (WndProperty*)wf->FindByName(_T("prpDisplayItem"));
  if (wp)
    RASP.SetParameter(wp->GetDataField()->GetAsInteger());

  delete wf;
}
开发者ID:alon,项目名称:xcsoar,代码行数:59,代码来源:dlgWeather.cpp

示例9: SetPort

static void
SetPort(DataFieldEnum &df, DeviceConfig::PortType type, const TCHAR *value)
{
  assert(value != NULL);

  if (!df.Set(value))
    df.Set(AddPort(df, type, value));
}
开发者ID:M-Scholli,项目名称:XCSoar,代码行数:8,代码来源:DeviceEditWidget.cpp

示例10: FillI2CAddr

/* Only lists possible addresses of supported devices */
static void
FillI2CAddr(DataFieldEnum &dfe)
{
  dfe.addEnumText(_T("0x76 (MS5611)"), 0x76);
  dfe.addEnumText(_T("0x77 (BMP085 and MS5611)"), 0x77);
//  dfe.addEnumText(_T("0x52 (Nunchuck)"), 0x52); Is implied by device, no choice
//  dfe.addEnumText(_T("0x69 (MPU6050)"), 0x69); Is implied by device, no choice
//  dfe.addEnumText(_T("0x1e (HMC5883)"), 0x1e); Is implied by device, no choice
}
开发者ID:M-Scholli,项目名称:XCSoar,代码行数:10,代码来源:DeviceEditWidget.cpp

示例11: FillPress

static void
FillPress(DataFieldEnum &dfe)
{
  dfe.addEnumText(_T("Static & Vario"), (unsigned)DeviceConfig::PressureUse::STATIC_WITH_VARIO);
  dfe.addEnumText(_T("Static"), (unsigned)DeviceConfig::PressureUse::STATIC_ONLY);
  dfe.addEnumText(_T("TE probe (compensated vario)"), (unsigned)DeviceConfig::PressureUse::TEK_PRESSURE);
  dfe.addEnumText(_T("Pitot (airspeed)"), (unsigned)DeviceConfig::PressureUse::PITOT);
  dfe.addEnumText(_T("Pitot zero calibration"), (unsigned)DeviceConfig::PressureUse::PITOT_ZERO);
}
开发者ID:M-Scholli,项目名称:XCSoar,代码行数:9,代码来源:DeviceEditWidget.cpp

示例12: FillBaudRates

static void
FillBaudRates(DataFieldEnum &dfe)
{
  dfe.addEnumText(_T("1200"), 1200);
  dfe.addEnumText(_T("2400"), 2400);
  dfe.addEnumText(_T("4800"), 4800);
  dfe.addEnumText(_T("9600"), 9600);
  dfe.addEnumText(_T("19200"), 19200);
  dfe.addEnumText(_T("38400"), 38400);
  dfe.addEnumText(_T("57600"), 57600);
  dfe.addEnumText(_T("115200"), 115200);
}
开发者ID:M-Scholli,项目名称:XCSoar,代码行数:12,代码来源:DeviceEditWidget.cpp

示例13: dlgWeatherShowModal

void
dlgWeatherShowModal()
{
  WndForm *wf = LoadDialog(nullptr, UIGlobals::GetMainWindow(),
                           _T("IDR_XML_WEATHER"));
  if (wf == NULL)
    return;

  WndProperty* wp;

  wp = (WndProperty*)wf->FindByName(_T("prpTime"));
  assert(wp != nullptr);
  DataFieldEnum *dfe = (DataFieldEnum *)wp->GetDataField();
  dfe->addEnumText(_("Now"));
  for (unsigned i = 1; i < RasterWeather::MAX_WEATHER_TIMES; i++) {
    if (RASP.isWeatherAvailable(i)) {
      TCHAR timetext[10];
      _stprintf(timetext, _T("%04d"), RASP.IndexToTime(i));
      dfe->addEnumText(timetext, i);
    }
  }

  dfe->Set(RASP.GetTime());
  wp->RefreshDisplay();

  wp = (WndProperty *)wf->FindByName(_T("prpDisplayItem"));
  assert(wp != nullptr);
  dfe = (DataFieldEnum *)wp->GetDataField();
  dfe->EnableItemHelp(true);
  dfe->addEnumText(_("Terrain"));

  for (int i = 1; i <= 15; i++) {
    const TCHAR *label = RASP.ItemLabel(i);
    if (label != NULL)
      dfe->AddChoice(i, label, nullptr, RASP.ItemHelp(i));
  }
  dfe->Set(RASP.GetParameter());
  wp->RefreshDisplay();

  wf->ShowModal();

  wp = (WndProperty *)wf->FindByName(_T("prpTime"));
  assert(wp != nullptr);
  dfe = (DataFieldEnum *)wp->GetDataField();
  RASP.SetTime(dfe->GetValue());

  wp = (WndProperty *)wf->FindByName(_T("prpDisplayItem"));
  assert(wp != nullptr);
  dfe = (DataFieldEnum *)wp->GetDataField();
  RASP.SetParameter(dfe->GetValue());

  delete wf;
}
开发者ID:Tjeerdm,项目名称:XCSoarDktjm,代码行数:53,代码来源:dlgWeather.cpp

示例14: AddPort

static unsigned
AddPort(DataFieldEnum &df, DeviceConfig::PortType type,
        const TCHAR *text, const TCHAR *display_string=NULL,
        const TCHAR *help=NULL)
{
  /* the uppper 16 bit is the port type, and the lower 16 bit is a
     serial number to make the enum id unique */

  unsigned id = ((unsigned)type << 16) + df.Count();
  df.AddChoice(id, text, display_string, help);
  return id;
}
开发者ID:M-Scholli,项目名称:XCSoar,代码行数:12,代码来源:DeviceEditWidget.cpp

示例15: OnNextClicked

static void
OnNextClicked(gcc_unused WndButton &Sender)
{
  if (target_point < (TaskSize - 1))
    target_point++;
  else
    target_point = ActiveTaskPointOnEntry;
  WndProperty *wp = (WndProperty*)wf->FindByName(_T("prpTaskPoint"));
  DataFieldEnum* dfe = (DataFieldEnum*)wp->GetDataField();
  dfe->Set(target_point - ActiveTaskPointOnEntry);
  RefreshTargetPoint();
  wp->RefreshDisplay();
}
开发者ID:davidswelt,项目名称:XCSoar,代码行数:13,代码来源:dlgTarget.cpp


注:本文中的DataFieldEnum类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。