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


C++ AddEnum函数代码示例

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


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

示例1: AddEnum

void
RASPSettingsPanel::Prepare(ContainerWindow &parent, const PixelRect &rc)
{
  WndProperty *wp;

  wp = AddEnum(_("Field"), nullptr);
  DataFieldEnum *dfe = (DataFieldEnum *)wp->GetDataField();
  dfe->EnableItemHelp(true);
  dfe->addEnumText(_("Terrain"));
  for (unsigned i = 1; i < RasterWeather::MAX_WEATHER_MAP; i++) {
    const TCHAR *label = RASP.ItemLabel(i);
    if (label != NULL)
      dfe->AddChoice(i, label, nullptr, RASP.ItemHelp(i));
  }

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

  wp = AddEnum(_("Time"), nullptr);
  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();
}
开发者ID:Adrien81,项目名称:XCSoar,代码行数:32,代码来源:RASPDialog.cpp

示例2: RequestAllSettings

void
V7ConfigWidget::Prepare(ContainerWindow &parent, const PixelRect &rc)
{
  RequestAllSettings(device);

  brgps = WaitUnsignedValue(device, "BRGPS", 5);
  brpda = WaitUnsignedValue(device, "BRPDA", 5);

  static gcc_constexpr_data StaticEnumChoice baud_list[] = {
    { 0, _T("4800"), NULL },
    { 1, _T("9600"), NULL },
    { 2, _T("19200"), NULL },
    { 3, _T("38400"), NULL },
    { 4, _T("57600"), NULL },
    { 5, _T("115200"), NULL },
    { 6, _T("230400"), NULL },
    { 7, _T("256000"), NULL },
    { 8, _T("460800"), NULL },
    { 9, _T("500k"), NULL },
    { 10, _T("1M"), NULL },
    { 0 }
  };

  AddEnum(_("GPS baud rate"), NULL, baud_list, brgps);
  AddEnum(_("PDA baud rate"), NULL, baud_list, brpda);
}
开发者ID:damianob,项目名称:xcsoar,代码行数:26,代码来源:V7ConfigWidget.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: AddEnum

void mitk::ResliceMethodProperty::AddThickSlicesTypes()
{
  AddEnum( "disabled", (IdType) 0 );
  AddEnum( "mip", (IdType) 1 );
  AddEnum( "sum", (IdType) 2 );
  AddEnum( "weighted", (IdType) 3 );
}
开发者ID:AGrafmint,项目名称:MITK,代码行数:7,代码来源:mitkResliceMethodProperty.cpp

示例5: AddEnum

void mitk::ConnectomicsRenderingNodeRadiusParameterProperty::AddRenderingNodeRadiusParameters()
{
  AddEnum( connectomicsRenderingNodeParameterConstant, NODE_RADIUS_CONSTANT );
  AddEnum( connectomicsRenderingNodeParameterDegree , NODE_RADIUS_DEGREE );
  AddEnum( connectomicsRenderingNodeParameterBetweenness , NODE_RADIUS_BETWEENNESS );
  AddEnum( connectomicsRenderingNodeParameterClustering , NODE_RADIUS_CLUSTERING );
}
开发者ID:0r,项目名称:MITK,代码行数:7,代码来源:mitkConnectomicsRenderingNodeRadiusParameterProperty.cpp

示例6: Create

 void Create() {
   AddEnum(_("Airbrake locked"), nullptr, airbrake_state_list, false);
   AddEnum(_("Flaps"), nullptr, flap_position_list, 0);
   AddBoolean(_("Gear down"), nullptr, false);
   AddBoolean(_("Acknowledge"), nullptr, false);
   AddBoolean(_("Repeat"), nullptr, false);
   AddBoolean(_("Speed command"), nullptr, false);
 }
开发者ID:StefanL74,项目名称:XCSoar,代码行数:8,代码来源:SwitchesDialog.cpp

示例7: AddEnum

void mitk::VtkScalarModeProperty::AddInterpolationTypes()
{
  AddEnum( "Default", static_cast<IdType>( VTK_SCALAR_MODE_DEFAULT ) );
  AddEnum( "PointData", static_cast<IdType>( VTK_SCALAR_MODE_USE_POINT_DATA ) );
  AddEnum( "CellData", static_cast<IdType>( VTK_SCALAR_MODE_USE_CELL_DATA ) );
  AddEnum( "PointFieldData", static_cast<IdType>( VTK_SCALAR_MODE_USE_POINT_FIELD_DATA ) );
  AddEnum( "CellFieldData", static_cast<IdType>( VTK_SCALAR_MODE_USE_CELL_FIELD_DATA ) );
}
开发者ID:0r,项目名称:MITK,代码行数:8,代码来源:mitkVtkScalarModeProperty.cpp

示例8: AddEnum

void mitk::RenderingModeProperty::AddRenderingModes()
{
  AddEnum( "LevelWindow_Color", LEVELWINDOW_COLOR );
  AddEnum( "LookupTable_LevelWindow_Color", LOOKUPTABLE_LEVELWINDOW_COLOR );
  AddEnum( "ColorTransferFunction_LevelWindow_Color", COLORTRANSFERFUNCTION_LEVELWINDOW_COLOR );
  AddEnum( "LookupTable_Color", LOOKUPTABLE_COLOR );
  AddEnum( "ColorTransferFunction_Color", COLORTRANSFERFUNCTION_COLOR );
}
开发者ID:fmorency,项目名称:MITK,代码行数:8,代码来源:mitkRenderingModeProperty.cpp

示例9: N_

void
GlideComputerConfigPanel::Prepare(ContainerWindow &parent, const PixelRect &rc)
{
  const ComputerSettings &settings_computer = XCSoarInterface::GetComputerSettings();

  RowFormWidget::Prepare(parent, rc);

  static gcc_constexpr_data StaticEnumChoice auto_mc_list[] = {
    { (unsigned)TaskBehaviour::AutoMCMode::FINALGLIDE, N_("Final glide"),
      N_("Adjusts MC for fastest arrival.  For OLC sprint tasks, the MacCready is adjusted in "
          "order to cover the greatest distance in the remaining time and reach the finish height.") },
    { (unsigned)TaskBehaviour::AutoMCMode::CLIMBAVERAGE, N_("Trending average climb"),
      N_("Sets MC to the trending average climb rate based on all climbs.") },
    { (unsigned)TaskBehaviour::AutoMCMode::BOTH, N_("Both"),
      N_("Uses trending average during task, then fastest arrival when in final glide mode.") },
    { 0 }
  };

  AddEnum(_("Auto MC mode"),
          _("This option defines which auto MacCready algorithm is used."),
          auto_mc_list, (unsigned)settings_computer.task.auto_mc_mode);

  AddBoolean(_("Block speed to fly"),
             _("If enabled, the command speed in cruise is set to the MacCready speed to fly in "
                 "no vertical air-mass movement. If disabled, the command speed in cruise is set "
                 "to the dolphin speed to fly, equivalent to the MacCready speed with vertical "
                 "air-mass movement."),
             settings_computer.features.block_stf_enabled);
  SetExpertRow(BlockSTF);

  AddBoolean(_("Nav. by baro altitude"),
             _("When enabled and if connected to a barometric altimeter, barometric altitude is "
                 "used for all navigation functions. Otherwise GPS altitude is used."),
             settings_computer.features.nav_baro_altitude_enabled);
  SetExpertRow(EnableNavBaroAltitude);

  AddBoolean(_("Flap forces cruise"),
             _("When Vega variometer is connected and this option is true, the positive flap "
                 "setting switches the flight mode between circling and cruise."),
             settings_computer.external_trigger_cruise_enabled);
  SetExpertRow(EnableExternalTriggerCruise);

  static gcc_constexpr_data StaticEnumChoice aver_eff_list[] = {
    { ae15seconds, _T("15 s"), N_("Preferred period for paragliders.") },
    { ae30seconds, _T("30 s") },
    { ae60seconds, _T("60 s") },
    { ae90seconds, _T("90 s"), N_("Preferred period for gliders.") },
    { ae2minutes, _T("2 min") },
    { ae3minutes, _T("3 min") },
    { 0 }
  };

  AddEnum(_("L/D average period"),
          _("Here you can decide on how many seconds of flight this calculation must be done. "
              "Normally for gliders a good value is 90-120 seconds, and for paragliders 15 seconds."),
          aver_eff_list, settings_computer.average_eff_time);
  SetExpertRow(AverEffTime);
}
开发者ID:davidswelt,项目名称:XCSoar,代码行数:58,代码来源:GlideComputerConfigPanel.cpp

示例10: AddEnum

void
SymbolsConfigPanel::Prepare(ContainerWindow &parent, const PixelRect &rc)
{
  const MapSettings &settings_map = CommonInterface::GetMapSettings();

  AddEnum(_("Ground track"),
          _("Display the ground track as a grey line on the map."),
          ground_track_mode_list, (unsigned)settings_map.display_ground_track);

  AddBoolean(_("FLARM traffic"), _("This enables the display of FLARM traffic on the map window."),
             settings_map.show_flarm_on_map);

  AddEnum(_("Trail length"),
          _("Determines whether and how long a snail trail is drawn behind the glider."),
          trail_length_list,
          (unsigned)settings_map.trail.length, this);
  SetExpertRow(TRAIL_LENGTH);

  AddBoolean(_("Trail drift"),
             _("Determines whether the snail trail is drifted with the wind when displayed in "
               "circling mode. Switched Off, "
               "the snail trail stays uncompensated for wind drift."),
             settings_map.trail.wind_drift_enabled);
  SetExpertRow(TRAIL_DRIFT);

  AddEnum(_("Trail type"),
          _("Sets the type of the snail trail display."), trail_type_list, (int)settings_map.trail.type);
  SetExpertRow(TRAIL_TYPE);

  AddBoolean(_("Trail scaled"),
             _("If set to ON the snail trail width is scaled according to the vario signal."),
             settings_map.trail.scaling_enabled);
  SetExpertRow(TRAIL_WIDTH);

  AddBoolean(_("Detour cost markers"),
             _("If the aircraft heading deviates from the current waypoint, markers are displayed "
                 "at points ahead of the aircraft. The value of each marker is the extra distance "
                 "required to reach that point as a percentage of straight-line distance to the waypoint."),
             settings_map.detour_cost_markers_enabled);
  SetExpertRow(ENABLE_DETOUR_COST_MARKERS);

  AddEnum(_("Aircraft symbol"), NULL, aircraft_symbol_list,
          (unsigned)settings_map.aircraft_symbol);
  SetExpertRow(AIRCRAFT_SYMBOL);

  AddEnum(_("Wind arrow"), _("Determines the way the wind arrow is drawn on the map."),
          wind_arrow_list, (unsigned)settings_map.wind_arrow_style);
  SetExpertRow(WIND_ARROW_STYLE);

  AddBoolean(_("FAI triangle areas"),
             _("Show FAI triangle areas on the map."),
             settings_map.show_fai_triangle_areas);
  SetExpertRow(SHOW_FAI_TRIANGLE_AREAS);

  ShowTrailControls(settings_map.trail.length != TrailSettings::Length::OFF);
}
开发者ID:rjsikarwar,项目名称:XCSoar,代码行数:56,代码来源:SymbolsConfigPanel.cpp

示例11: RequestAllSettings

void
FLARMConfigWidget::Prepare(ContainerWindow &parent, const PixelRect &rc)
{
  RequestAllSettings(device);

  baud = GetUnsignedValue(device, "BAUD", 2);
  priv = GetUnsignedValue(device, "PRIV", 0);
  thre = GetUnsignedValue(device, "THRE", 2);
  range = GetUnsignedValue(device, "RANGE", 3000);
  acft = GetUnsignedValue(device, "ACFT", 0);
  log_int = GetUnsignedValue(device, "LOGINT", 2);
  notrack = GetUnsignedValue(device, "NOTRACK", 0);

  static constexpr StaticEnumChoice baud_list[] = {
    { 0, _T("4800"), NULL },
    { 1, _T("9600"), NULL },
    { 2, _T("19200"), NULL },
    { 4, _T("38400"), NULL },
    { 5, _T("57600"), NULL },
    { 0 }
  };

  AddEnum(_("Baud rate"), NULL, baud_list, baud);
  AddBoolean(_("Stealth mode"), NULL, priv == 1);
  AddInteger(_("Threshold"), NULL, _T("%d m/s"), _T("%d"), 1, 10, 1, thre);
  AddInteger(_("Range"), NULL, _T("%d m"), _T("%d"), 2000, 25500, 250, range);

  static constexpr StaticEnumChoice acft_list[] = {
    { (unsigned)FlarmTraffic::AircraftType::UNKNOWN, N_("Unkown") },
    { (unsigned)FlarmTraffic::AircraftType::GLIDER, N_("Glider") },
    { (unsigned)FlarmTraffic::AircraftType::TOW_PLANE, N_("Tow plane") },
    { (unsigned)FlarmTraffic::AircraftType::HELICOPTER, N_("Helicopter") },
    { (unsigned)FlarmTraffic::AircraftType::PARACHUTE, N_("Parachute") },
    { (unsigned)FlarmTraffic::AircraftType::DROP_PLANE, N_("Drop plane") },
    { (unsigned)FlarmTraffic::AircraftType::HANG_GLIDER, N_("Hang glider") },
    { (unsigned)FlarmTraffic::AircraftType::PARA_GLIDER, N_("Paraglider") },
    { (unsigned)FlarmTraffic::AircraftType::POWERED_AIRCRAFT,
      N_("Powered aircraft") },
    { (unsigned)FlarmTraffic::AircraftType::JET_AIRCRAFT, N_("Jet aircraft") },
    { (unsigned)FlarmTraffic::AircraftType::FLYING_SAUCER,
      N_("Flying saucer") },
    { (unsigned)FlarmTraffic::AircraftType::BALLOON, N_("Balloon") },
    { (unsigned)FlarmTraffic::AircraftType::AIRSHIP, N_("Airship") },
    { (unsigned)FlarmTraffic::AircraftType::UAV,
      N_("Unmanned aerial vehicle") },
    { (unsigned)FlarmTraffic::AircraftType::STATIC_OBJECT,
      N_("Static object") },
    { 0 }
  };

  AddEnum(_("Type"), NULL, acft_list, acft);
  AddInteger(_("Logger interval"), NULL, _T("%d s"), _T("%d"),
             1, 8, 1, log_int);
  AddBoolean(_("No tracking mode"), NULL, notrack == 1);

}
开发者ID:CnZoom,项目名称:XcSoarPull,代码行数:56,代码来源:ConfigWidget.cpp

示例12: AddBoolean

void
TrackingConfigPanel::Prepare(ContainerWindow &parent, const PixelRect &rc)
{
  const TrackingSettings &settings =
    CommonInterface::GetComputerSettings().tracking;

  RowFormWidget::Prepare(parent, rc);

#ifdef HAVE_SKYLINES_TRACKING
  AddBoolean(_T("SkyLines"), NULL, settings.skylines.enabled, this);
  AddTime(_("Tracking Interval"), NULL, 5, 1200, 5,
          settings.skylines.interval);

#ifdef HAVE_SKYLINES_TRACKING_HANDLER
  AddBoolean(_("Track friends"),
             _("Download the position of your friends live from the SkyLines server."),
             settings.skylines.traffic_enabled, this);
#endif

  StaticString<64> buffer;
  if (settings.skylines.key != 0)
    buffer.UnsafeFormat(_T("%llX"), (unsigned long long)settings.skylines.key);
  else
    buffer.clear();
  AddText(_T("Key"), NULL, buffer);
#endif

#if defined(HAVE_SKYLINES_TRACKING) && defined(HAVE_LIVETRACK24)
  AddSpacer();
#endif

#ifdef HAVE_LIVETRACK24
  AddBoolean(_T("LiveTrack24"),  _T(""), settings.livetrack24.enabled, this);

  AddTime(_("Tracking Interval"), _T(""), 5, 3600, 5, settings.interval);

  AddEnum(_("Vehicle Type"), _("Type of vehicle used."), vehicle_type_list,
          (unsigned) settings.vehicleType);

  WndProperty *edit = AddEnum(_("Server"), _T(""), server_list, 0);
  ((DataFieldEnum *)edit->GetDataField())->Set(settings.livetrack24.server);
  edit->RefreshDisplay();

  AddText(_("Username"), _T(""), settings.livetrack24.username);
  AddPassword(_("Password"), _T(""), settings.livetrack24.password);
#endif

#ifdef HAVE_SKYLINES_TRACKING
  SetSkyLinesEnabled(settings.skylines.enabled);
#endif

#ifdef HAVE_LIVETRACK24
  SetEnabled(settings.livetrack24.enabled);
#endif
}
开发者ID:DRIZO,项目名称:xcsoar,代码行数:55,代码来源:TrackingConfigPanel.cpp

示例13: AddEnum

void
MapDisplayConfigPanel::Prepare(ContainerWindow &parent, const PixelRect &rc)
{
    RowFormWidget::Prepare(parent, rc);

    const MapSettings &settings_map = CommonInterface::GetMapSettings();
    const PageSettings &page_settings = CommonInterface::GetUISettings().pages;

    AddEnum(_("Cruise orientation"),
            _("Determines how the screen is rotated with the glider"),
            orientation_list,
            (unsigned)settings_map.cruise_orientation,
            this);

    AddEnum(_("Circling orientation"),
            _("Determines how the screen is rotated with the glider while circling"),
            orientation_list,
            (unsigned)settings_map.circling_orientation,
            this);

    AddBoolean(_("Circling zoom"),
               _("If enabled, then the map will zoom in automatically when entering circling mode and zoom out automatically when leaving circling mode."),
               settings_map.circle_zoom_enabled);

    AddEnum(_("Map shift reference"),
            _("Determines what is used to shift the glider from the map center"),
            shift_bias_list,
            (unsigned)settings_map.map_shift_bias,
            this);
    SetExpertRow(MAP_SHIFT_BIAS);

    AddInteger(_("Glider position offset"),
               _("Defines the location of the glider drawn on the screen in percent from the screen edge."),
               _T("%d %%"), _T("%d"), 10, 50, 5,
               settings_map.glider_screen_position);
    SetExpertRow(GliderScreenPosition);

    AddFloat(_("Max. auto zoom distance"),
             _("The upper limit for auto zoom distance."),
             _T("%.0f %s"), _T("%.0f"), fixed(20), fixed(250), fixed(10), false,
             UnitGroup::DISTANCE, settings_map.max_auto_zoom_distance);
    SetExpertRow(MaxAutoZoomDistance);

    AddBoolean(_("Distinct page zoom"),
               _("Maintain one map zoom level on each page."),
               page_settings.distinct_zoom);
    SetExpertRow(PAGES_DISTINCT_ZOOM);

    UpdateVisibilities();
}
开发者ID:kwtskran,项目名称:XCSoar,代码行数:50,代码来源:MapDisplayConfigPanel.cpp

示例14: RequestAllSettings

void
LX16xxConfigWidget::Prepare(ContainerWindow &parent, const PixelRect &rc)
{
  RequestAllSettings(device);

  AddInteger(_("Avg. time"), NULL, _T("%d s"), _T("%d"), 1, 30, 1,
             WaitUnsignedValue(device, LX1600::Setting::VARIO_AVG_TIME, 25));

  static constexpr StaticEnumChoice range_list[] = {
    { 25, _T("2.5 m/s"), NULL },
    { 50, _T("5.0 m/s"), NULL },
    { 100, _T("10 m/s"), NULL },
    { 0 }
  };

  AddEnum(_("Vario Range"), NULL, range_list,
          (unsigned)(WaitFixedValue(device, LX1600::Setting::VARIO_RANGE,
                                    fixed(5.0)) * 10));
  AddFloat(_("Vario Filter"), NULL,
           _T("%.2f s"), _T("%.2f"), fixed(0.25), fixed(5), fixed(0.25), false,
           WaitFixedValue(device, LX1600::Setting::VARIO_FILTER, fixed(1)));

  static constexpr StaticEnumChoice te_level_list[] = {
    { 0, _T("Off"), NULL },
    { 50, _T("50 %"), NULL },
    { 60, _T("60 %"), NULL },
    { 70, _T("70 %"), NULL },
    { 80, _T("80 %"), NULL },
    { 90, _T("90 %"), NULL },
    { 100, _T("100 %"), NULL },
    { 110, _T("110 %"), NULL },
    { 120, _T("120 %"), NULL },
    { 130, _T("130 %"), NULL },
    { 140, _T("140 %"), NULL },
    { 150, _T("150 %"), NULL },
    { 0 }
  };

  AddEnum(_("TE Level"), NULL, te_level_list,
          (unsigned)WaitFixedValue(device, LX1600::Setting::TE_LEVEL, fixed(50)));

  AddFloat(_("TE Filter"), NULL,
           _T("%.2f s"), _T("%.2f"), fixed(0.0), fixed(2), fixed(1), false,
           WaitFixedValue(device, LX1600::Setting::TE_FILTER, fixed(1.5)));

  AddFloat(_("SMART Filter"), NULL,
           _T("%.2f m/s²"), _T("%.2f"), fixed(0.5), fixed(5), fixed(0.1), false,
           WaitFixedValue(device, LX1600::Setting::SMART_VARIO_FILTER, fixed(1)));
}
开发者ID:arogithub,项目名称:XCSoar-TE,代码行数:49,代码来源:LX16xxConfigWidget.cpp

示例15: AddEnum

void mitk::ShaderProperty::AddShaderTypes()
{  
  AddEnum( "fixed" );
  
  std::list<mitk::ShaderRepository::Shader::Pointer> *l
    = mitk::ShaderRepository::GetGlobalShaderRepository()->GetShaders();
    
  std::list<mitk::ShaderRepository::Shader::Pointer>::const_iterator i = l->begin();
  
  while( i != l->end() )
  {
    AddEnum( (*i)->name );
    i++;
  }
}
开发者ID:david-guerrero,项目名称:MITK,代码行数:15,代码来源:mitkShaderProperty.cpp


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