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


C++ DataFieldEnum::addEnumText方法代码示例

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


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

示例1: SetValues

static void SetValues(void) {
  WndProperty* wp;
  if(Units::CoordinateFormat==4) {
	  int utmXZone;
	  char utmYZone;
	  double easting, northing;

      LatLonToUtmWGS84(utmXZone, utmYZone, easting, northing, global_wpt->Latitude, global_wpt->Longitude );

      wp = (WndProperty*)wf->FindByName(TEXT("prpUTMzoneX"));
      if (wp) {
      	wp->GetDataField()->SetAsInteger(utmXZone);
		wp->RefreshDisplay();
      }
      wp = (WndProperty*)wf->FindByName(TEXT("prpUTMzoneY"));
      if (wp) {
    	  DataFieldEnum* dfe = (DataFieldEnum*)wp->GetDataField();
    	  if(dfe){
    		  std::for_each(std::begin(cYZone), std::end(cYZone), std::bind(&DataFieldEnum::addEnumText, dfe, _1));
    		  dfe->Set(YZoneToenum(utmYZone));
    	  }
    	  wp->RefreshDisplay();
      }
      wp = (WndProperty*)wf->FindByName(TEXT("prpUTMeast"));
      if (wp) {
    	  wp->GetDataField()->SetAsFloat(easting);
    	  wp->RefreshDisplay();
      }
      wp = (WndProperty*)wf->FindByName(TEXT("prpUTMnorth"));
      if (wp) {
    	  wp->GetDataField()->SetAsFloat(northing);
    	  wp->RefreshDisplay();
      }
  } else {
	  bool sign;
	  int dd,mm,ss;


	  Units::LongitudeToDMS(global_wpt->Longitude,
				&dd, &mm, &ss, &sign);

	   wp = (WndProperty*)wf->FindByName(TEXT("prpLongitudeSign"));
	  if (wp) {
		DataFieldEnum* dfe;
		dfe = (DataFieldEnum*)wp->GetDataField();
		dfe->addEnumText((TEXT("W")));
		dfe->addEnumText((TEXT("E")));
		dfe->Set(sign);
		wp->RefreshDisplay();
	  }
	  wp = (WndProperty*)wf->FindByName(TEXT("prpLongitudeD"));
	  if (wp) {
		wp->GetDataField()->SetAsFloat(dd);
		wp->RefreshDisplay();
	  }

	  switch (Units::CoordinateFormat) {
	  case 0: // ("DDMMSS");
	  case 1: // ("DDMMSS.ss");
		wp = (WndProperty*)wf->FindByName(TEXT("prpLongitudeM"));
		if (wp) {
		  wp->GetDataField()->SetAsFloat(mm);
		  wp->RefreshDisplay();
		}
		wp = (WndProperty*)wf->FindByName(TEXT("prpLongitudeS"));
		if (wp) {
		  wp->GetDataField()->SetAsFloat(ss);
		  wp->RefreshDisplay();
		}
		break;
	  case 2: // ("DDMM.mmm");
		wp = (WndProperty*)wf->FindByName(TEXT("prpLongitudeM"));
		if (wp) {
		  wp->GetDataField()->SetAsFloat(mm);
		  wp->RefreshDisplay();
		}
		wp = (WndProperty*)wf->FindByName(TEXT("prpLongitudemmm"));
		if (wp) {
		  wp->GetDataField()->SetAsFloat(1000.0*ss/60.0);
		  wp->RefreshDisplay();
		}
		break;
	  case 3: // ("DD.dddd");
		wp = (WndProperty*)wf->FindByName(TEXT("prpLongitudeDDDD"));
		if (wp) {
		  wp->GetDataField()->SetAsFloat(10000.0*(mm+ss/60.0)/60.0);
		  wp->RefreshDisplay();
		}
		break;
	  case 4:
		  break;
	  }
  
	  Units::LatitudeToDMS(global_wpt->Latitude,
				   &dd, &mm, &ss, &sign);

	  wp = (WndProperty*)wf->FindByName(TEXT("prpLatitudeSign"));
	  if (wp) {
		DataFieldEnum* dfe;
		dfe = (DataFieldEnum*)wp->GetDataField();
//.........这里部分代码省略.........
开发者ID:acasadoalonso,项目名称:LK8000,代码行数:101,代码来源:dlgWaypointEdit.cpp

示例2: SetWaypointValues

static void SetWaypointValues(bool first=false) {
  WndProperty* wp;

  wp = (WndProperty*)wf->FindByName(TEXT("prpAATType"));
  if (wp) {
    DataFieldEnum* dfe;
    dfe = (DataFieldEnum*)wp->GetDataField();
    if (first) {
	// LKTOKEN  [email protected]_ = "Cylinder" 
      dfe->addEnumText(gettext(TEXT("[email protected]_")));
	// LKTOKEN  [email protected]_ = "Sector" 
      dfe->addEnumText(gettext(TEXT("[email protected]_")));
    }
    dfe->SetDetachGUI(true); // disable call to OnAATEnabled
    dfe->Set(Task[twItemIndex].AATType);
    dfe->SetDetachGUI(false);
    wp->RefreshDisplay();
  }

  wp = (WndProperty*)wf->FindByName(TEXT("prpAATCircleRadius"));
  if (wp) {
    wp->GetDataField()->SetAsFloat(lround(Task[twItemIndex].AATCircleRadius
                                          *DISTANCEMODIFY*DISTANCE_ROUNDING)/DISTANCE_ROUNDING);
    wp->GetDataField()->SetUnits(Units::GetDistanceName());
    wp->SetVisible(Task[twItemIndex].AATType==0);
    wp->RefreshDisplay();
  }

  wp = (WndProperty*)wf->FindByName(TEXT("prpAATSectorRadius"));
  if (wp) {
    wp->GetDataField()->SetAsFloat(lround(Task[twItemIndex].AATSectorRadius
                                          *DISTANCEMODIFY*DISTANCE_ROUNDING)/DISTANCE_ROUNDING);
    wp->GetDataField()->SetUnits(Units::GetDistanceName());
    wp->SetVisible(Task[twItemIndex].AATType>0);
    wp->RefreshDisplay();    
  }

  wp = (WndProperty*)wf->FindByName(TEXT("prpAATStartRadial"));
  if (wp) {
    wp->GetDataField()->SetAsFloat(Task[twItemIndex].AATStartRadial);
    wp->SetVisible(Task[twItemIndex].AATType>0);
    wp->RefreshDisplay();
  }

  wp = (WndProperty*)wf->FindByName(TEXT("prpAATFinishRadial"));
  if (wp) {
    wp->GetDataField()->SetAsFloat(Task[twItemIndex].AATFinishRadial);
    wp->SetVisible(Task[twItemIndex].AATType>0);
    wp->RefreshDisplay();
  }

  wp = (WndProperty*)wf->FindByName(TEXT("prpOutCircle"));
  if (wp) {
	  DataFieldEnum* dfe;
	  dfe = (DataFieldEnum*)wp->GetDataField();
	  if (dfe) {
		  if (first) {
			  // LKTOKEN  [email protected]_ = "Enter" 
			  dfe->addEnumText(gettext(TEXT("[email protected]_")));
			  // LKTOKEN  [email protected]_ = "Exit" 
			  dfe->addEnumText(gettext(TEXT("[email protected]_")));
		  }
		  dfe->Set(Task[twItemIndex].OutCircle);
	  }
	  wp->SetVisible(Task[twItemIndex].AATType==0 && DoOptimizeRoute());
	  wp->RefreshDisplay();
  }
}
开发者ID:Acrobot,项目名称:LK8000,代码行数:68,代码来源:dlgTaskWaypoint.cpp

示例3: dlgWeatherShowModal

void dlgWeatherShowModal(void){

  if (!InfoBoxLayout::landscape) {
    char filename[MAX_PATH];
    LocalPathS(filename, TEXT("dlgWeather_L.xml"));
    wf = dlgLoadFromXML(CallBackTable, 
                        filename, 
                        hWndMainWindow,
                        TEXT("IDR_XML_WEATHER_L"));
  } else {
    char filename[MAX_PATH];
    LocalPathS(filename, TEXT("dlgWeather.xml"));
    wf = dlgLoadFromXML(CallBackTable, 
                        filename, 
                        hWndMainWindow,
                        TEXT("IDR_XML_WEATHER"));
  }

  WndProperty* wp;
    
  if (wf) {

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

      RASPGetTime(dfe);

      wp->RefreshDisplay();
    }

    wp = (WndProperty*)wf->FindByName(TEXT("prpDisplayItem"));
    DataFieldEnum* dfe;
    if (wp) {
      dfe = (DataFieldEnum*)wp->GetDataField();
	// LKTOKEN  [email protected]_ = "Terrain" 
      dfe->addEnumText(gettext(TEXT("[email protected]_")));

      TCHAR Buffer[20];
      for (int i=1; i<=15; i++) {
        RASP.ItemLabel(i, Buffer);
        if (_tcslen(Buffer)) {
          dfe->addEnumText(Buffer);
        }
      }
      dfe->Set(RasterTerrain::render_weather);
      wp->RefreshDisplay();
    }

    wf->ShowModal();

    wp = (WndProperty*)wf->FindByName(TEXT("prpTime"));
    if (wp) {
      DataFieldEnum* dfe;
      dfe = (DataFieldEnum*)wp->GetDataField();
      RASPSetTime(dfe);
    }

    wp = (WndProperty*)wf->FindByName(TEXT("prpDisplayItem"));
    if (wp) {
      RasterTerrain::render_weather = 
        wp->GetDataField()->GetAsInteger();
    }

    delete wf;
  }
  wf = NULL;
}
开发者ID:miza,项目名称:LK8000,代码行数:77,代码来源:dlgWeather.cpp

示例4: Show

    int Show(DeviceDescriptor_t *d) {
        int nRet = IdCancel;
        TCHAR filename[MAX_PATH];
        const TCHAR *resName = NULL;
        pDevice = d;
        Init = true;

        if (ScreenLandscape) {
            LocalPathS(filename, TEXT("dlgBlueFlyConfig.xml"));
            resName = TEXT("IDR_XML_BLUEFLYCONFIG");
        } else {
            LocalPathS(filename, TEXT("dlgBlueFlyConfig_L.xml"));
            resName = TEXT("IDR_XML_BLUEFLYCONFIG_L");
        }

        wfDlg = dlgLoadFromXML(CallBackTable, filename, resName);
        if (wfDlg) {
            // build list of page WindowConrol*
            lstPageWnd.clear();
            lstPageWnd.reserve(std::distance(std::begin(lstPageName), std::end(lstPageName)));
            std::transform(std::begin(lstPageName), std::end(lstPageName),
                    std::inserter(lstPageWnd, lstPageWnd.begin()),
                    std::bind(&WndForm::FindByName, wfDlg, _1));

            if(!lstPageWnd.empty()) {
                // Show First Page
                CurrentPage=0;
                NextPage(0);

                // Hide All Next Page
                std::for_each(++lstPageWnd.begin(), lstPageWnd.end(), std::bind(&WindowControl::Close, _1));
            }

            // Init Enum WndProperty
            WndProperty* pWnd = (WndProperty*)wfDlg->FindByName(_T("BOM"));
            if(pWnd) {
                DataFieldEnum* pData =(DataFieldEnum*)pWnd->GetDataField();
                if(pData) {
                    pData->addEnumText(_T("BlueFlyVario"));
                    pData->addEnumText(_T("LK8EX1"));
                    pData->addEnumText(_T("LX"));
                    pData->addEnumText(_T("FlyNet"));
                }
            }

            // Set Value to all WndProperty
            CHardwareParameters& HardwareParameters = gHardwareParameters[pDevice];
            AssocFieldParam.clear();
            std::for_each(HardwareParameters.begin(), HardwareParameters.end(), std::ptr_fun(FillProperty));

            Init = false;
            if (wfDlg->ShowModal(true)) {
                nRet = IdOk;
            }
            AssocFieldParam.clear();
            lstPageWnd.clear();
            delete wfDlg;
            wfDlg = NULL;
            pDevice = NULL;
        }

        return nRet;
    }
开发者ID:alberiolima,项目名称:LK8000,代码行数:63,代码来源:devBlueFlyVario.cpp

示例5: assert

void
LayoutConfigPanel::Init(WndForm *_wf)
{
  assert(_wf != NULL);
  wf = _wf;
  WndProperty *wp;

  if (Display::RotateSupported()) {
    wp = (WndProperty*)wf->FindByName(_T("prpDisplayOrientation"));
    assert(wp != NULL);

    DataFieldEnum *dfe = (DataFieldEnum *)wp->GetDataField();
    dfe->addEnumText(_("Default"));
    dfe->addEnumText(_("Portrait"));
    dfe->addEnumText(_("Landscape"));
    dfe->Set(Profile::GetDisplayOrientation());
    wp->RefreshDisplay();
  } else {
    wp = (WndProperty*)wf->FindByName(_T("prpDisplayOrientation"));
    assert(wp != NULL);
    wp->hide();
  }

  wp = (WndProperty*)wf->FindByName(_T("prpAppInfoBoxGeom"));
  if (wp) {
    DataFieldEnum* dfe;
    dfe = (DataFieldEnum*)wp->GetDataField();

    dfe->addEnumText(_("8 Top + Bottom (Portrait)"),
                     InfoBoxLayout::ibTop4Bottom4);
    dfe->addEnumText(_("8 Bottom (Portrait)"), InfoBoxLayout::ibBottom8);
    dfe->addEnumText(_("8 Top (Portrait)"), InfoBoxLayout::ibTop8);
    dfe->addEnumText(_("8 Left + Right (Landscape)"),
                     InfoBoxLayout::ibLeft4Right4);
    dfe->addEnumText(_("8 Left (Landscape)"), InfoBoxLayout::ibLeft8);
    dfe->addEnumText(_("8 Right (Landscape)"), InfoBoxLayout::ibRight8);
    dfe->addEnumText(_("9 Right + Vario (Landscape)"), InfoBoxLayout::ibGNav);
    dfe->addEnumText(_("5 Right (Square)"), InfoBoxLayout::ibSquare);
    dfe->addEnumText(_("12 Right (Landscape)"), InfoBoxLayout::ibRight12);
    dfe->addEnumText(_("12 Bottom (Portrait)"), InfoBoxLayout::ibBottom12);
    dfe->addEnumText(_("24 Right (Landscape)"), InfoBoxLayout::ibRight24);
    dfe->Set(InfoBoxLayout::InfoBoxGeometry);
    wp->RefreshDisplay();
  }

  wp = (WndProperty*)wf->FindByName(_T("prpAppStatusMessageAlignment"));
  if (wp) {
    DataFieldEnum* dfe;
    dfe = (DataFieldEnum*)wp->GetDataField();
    dfe->addEnumText(_("Center"));
    dfe->addEnumText(_("Topleft"));
    dfe->Set(Appearance.StateMessageAlign);
    wp->RefreshDisplay();
  }

  wp = (WndProperty*)wf->FindByName(_T("prpDialogStyle"));
  if (wp) {
    DataFieldEnum* dfe;
    dfe = (DataFieldEnum*)wp->GetDataField();
    dfe->addEnumText(_("Full width"));
    dfe->addEnumText(_("Scaled"));
    dfe->addEnumText(_("Scaled centered"));
    dfe->addEnumText(_("Fixed"));
    dfe->Set(DialogStyleSetting);
    wp->RefreshDisplay();
  }

  LoadFormProperty(*wf, _T("prpAppInverseInfoBox"),
                   Appearance.InverseInfoBox);

  LoadFormProperty(*wf, _T("prpAppInfoBoxColors"), Appearance.InfoBoxColors);

  wp = (WndProperty*)wf->FindByName(_T("prpAppInfoBoxBorder"));
  if (wp) {
    DataFieldEnum* dfe;
    dfe = (DataFieldEnum*)wp->GetDataField();
    dfe->addEnumText(_("Box"));
    dfe->addEnumText(_("Tab"));
    dfe->Set(Appearance.InfoBoxBorder);
    wp->RefreshDisplay();
  }

  wp = (WndProperty*)wf->FindByName(_T("prpTabDialogStyle"));
  if (wp) {
    DataFieldEnum* dfe;
    dfe = (DataFieldEnum*)wp->GetDataField();
    dfe->addEnumText(_("Text"));
    dfe->addEnumText(_("Icons"));
    dfe->Set(Appearance.DialogTabStyle);
    wp->RefreshDisplay();
  }

}
开发者ID:Mrdini,项目名称:XCSoar,代码行数:93,代码来源:LayoutConfigPanel.cpp

示例6: LoadDialog

void
dlgWindSettingsShowModal(void)
{
  wf = LoadDialog(CallBackTable, XCSoarInterface::main_window,
		                  _T("IDR_XML_WINDSETTINGS"));
  if (wf == NULL)
    return;

  const bool external_wind = XCSoarInterface::Basic().ExternalWindAvailable &&
    XCSoarInterface::SettingsComputer().ExternalWind;

  WndProperty* wp;

  wp = (WndProperty*)wf->FindByName(_T("prpSpeed"));
  if (wp) {
    wp->set_enabled(!external_wind);
    DataFieldFloat &df = *(DataFieldFloat *)wp->GetDataField();
    df.SetMax(Units::ToUserWindSpeed(Units::ToSysUnit(fixed(200), unKiloMeterPerHour)));
    df.SetUnits(Units::GetSpeedName());
    df.Set(Units::ToUserWindSpeed(CommonInterface::Calculated().wind.norm));
    wp->RefreshDisplay();
  }

  wp = (WndProperty*)wf->FindByName(_T("prpDirection"));
  if (wp) {
    wp->set_enabled(!external_wind);
    DataFieldFloat &df = *(DataFieldFloat *)wp->GetDataField();
    df.Set(CommonInterface::Calculated().wind.bearing.value_degrees());
    wp->RefreshDisplay();
  }

  wp = (WndProperty*)wf->FindByName(_T("prpAutoWind"));
  assert(wp != NULL);
  if (external_wind) {
    wp->set_enabled(false);
    DataFieldEnum &df = *(DataFieldEnum *)wp->GetDataField();
    df.addEnumText(_("External"));
    df.Set(0);
    wp->RefreshDisplay();
  } else {
    DataFieldEnum* dfe;
    dfe = (DataFieldEnum*)wp->GetDataField();
    dfe->addEnumText(_("Manual"));
    dfe->addEnumText(_("Circling"));
    dfe->addEnumText(_("ZigZag"));
    dfe->addEnumText(_("Both"));
    dfe->Set(XCSoarInterface::SettingsComputer().AutoWindMode);
    wp->RefreshDisplay();
  }

  wp = (WndProperty*)wf->FindByName(_T("prpTrailDrift"));
  if (wp) {
    DataFieldBoolean &df = *(DataFieldBoolean *)wp->GetDataField();
    df.Set(XCSoarInterface::SettingsMap().EnableTrailDrift);
    wp->RefreshDisplay();
  }

  if (wf->ShowModal() != mrOK) {
    delete wf;
    return;
  }

  if (!external_wind) {
    wp = (WndProperty*)wf->FindByName(_T("prpSpeed"));
    if (wp != NULL) {
      DataFieldFloat &df = *(DataFieldFloat *)wp->GetDataField();
      XCSoarInterface::SetSettingsComputer().ManualWind.norm =
        Units::ToSysWindSpeed(df.GetAsFixed());
      XCSoarInterface::SetSettingsComputer().ManualWindAvailable.Update(XCSoarInterface::Basic().clock);
    }

    wp = (WndProperty*)wf->FindByName(_T("prpDirection"));
    if (wp != NULL) {
      DataFieldFloat &df = *(DataFieldFloat *)wp->GetDataField();
      XCSoarInterface::SetSettingsComputer().ManualWind.bearing =
        Angle::degrees(df.GetAsFixed());
      XCSoarInterface::SetSettingsComputer().ManualWindAvailable.Update(XCSoarInterface::Basic().clock);
    }

    SaveFormProperty(*wf, _T("prpAutoWind"), szProfileAutoWind,
                     XCSoarInterface::SetSettingsComputer().AutoWindMode);
  }

  SaveFormProperty(*wf, _T("prpTrailDrift"),
                   XCSoarInterface::SetSettingsMap().EnableTrailDrift);

  ActionInterface::SendSettingsMap();

  delete wf;
}
开发者ID:joachimwieland,项目名称:xcsoar-jwieland,代码行数:90,代码来源:dlgWindSettings.cpp

示例7: temptask

void
TaskDefaultsConfigPanel::Prepare(ContainerWindow &parent, const PixelRect &rc)
{
    WndProperty *wp;
    const ComputerSettings &settings_computer = XCSoarInterface::GetComputerSettings();
    const TaskBehaviour &task_behaviour = settings_computer.task;
    OrderedTask temptask(task_behaviour);
    temptask.SetFactory(TaskFactoryType::RACING);

    RowFormWidget::Prepare(parent, rc);

    wp = AddEnum(_("Start point"),
                 _("Default start type for new tasks you create."),
                 this);
    if (wp) {
        const auto point_types = temptask.GetFactory().GetValidStartTypes();
        DataFieldEnum* dfe = (DataFieldEnum*)wp->GetDataField();
        dfe->EnableItemHelp(true);

        for (auto i = point_types.begin(), end = point_types.end();
                i != end; ++i) {
            const AbstractTaskFactory::LegalPointType type = *i;
            dfe->addEnumText(OrderedTaskPointName(type), (unsigned)type,
                             OrderedTaskPointDescription(type));
            if (type == task_behaviour.sector_defaults.start_type)
                dfe->Set((unsigned)type);
        }
        wp->RefreshDisplay();
    }

    AddFloat(Caption_GateWidth, _("Default radius or gate width of the start zone for new tasks."),
             _T("%.1f %s"), _T("%.1f"), fixed(0.1), fixed(100), fixed(1.0), true, UnitGroup::DISTANCE,
             task_behaviour.sector_defaults.start_radius);

    AddSpacer();

    wp = AddEnum(_("Finish point"),
                 _("Default finish type for new tasks you create."),
                 this);
    if (wp) {
        const auto point_types = temptask.GetFactory().GetValidFinishTypes();
        DataFieldEnum* dfe = (DataFieldEnum*)wp->GetDataField();
        dfe->EnableItemHelp(true);

        for (auto i = point_types.begin(), end = point_types.end();
                i != end; ++i) {
            const AbstractTaskFactory::LegalPointType type = *i;
            dfe->addEnumText(OrderedTaskPointName(type), (unsigned)type,
                             OrderedTaskPointDescription(type));
            if (type == task_behaviour.sector_defaults.finish_type)
                dfe->Set((unsigned)type);
        }
        wp->RefreshDisplay();
    }

    AddFloat(Caption_GateWidth, _("Default radius or gate width of the finish zone in new tasks."),
             _T("%.1f %s"), _T("%.1f"), fixed(0.1), fixed(100), fixed(1.0), true, UnitGroup::DISTANCE,
             task_behaviour.sector_defaults.finish_radius);

    AddSpacer();

    wp = AddEnum(_("Turn point"), _("Default turn point type for new tasks you create."));
    if (wp) {
        const auto point_types = temptask.GetFactory().GetValidIntermediateTypes();
        DataFieldEnum* dfe = (DataFieldEnum*)wp->GetDataField();
        dfe->EnableItemHelp(true);

        for (auto i = point_types.begin(), end = point_types.end();
                i != end; ++i) {
            const AbstractTaskFactory::LegalPointType type = *i;
            dfe->addEnumText(OrderedTaskPointName(type), (unsigned)type,
                             OrderedTaskPointDescription(type));
            if (type == task_behaviour.sector_defaults.turnpoint_type) {
                dfe->Set((unsigned)type);
            }
        }
        wp->RefreshDisplay();
    }

    AddFloat(Caption_Radius, _("Default radius of turnpoint cylinders and sectors in new tasks."),
             _T("%.1f %s"), _T("%.1f"), fixed(0.1), fixed(100), fixed(1.0), true, UnitGroup::DISTANCE,
             task_behaviour.sector_defaults.turnpoint_radius);

    AddSpacer();

    wp = AddEnum(_("Task"), _("Default task type for new tasks you create."));
    if (wp) {
        const std::vector<TaskFactoryType> factory_types =
            temptask.GetFactoryTypes();
        DataFieldEnum* dfe = (DataFieldEnum*)wp->GetDataField();
        dfe->EnableItemHelp(true);

        for (unsigned i = 0; i < factory_types.size(); i++) {
            dfe->addEnumText(OrderedTaskFactoryName(factory_types[i]),
                             (unsigned)factory_types[i], OrderedTaskFactoryDescription(
                                 factory_types[i]));
            if (factory_types[i] == task_behaviour.task_type_default)
                dfe->Set((unsigned)factory_types[i]);
        }
        wp->RefreshDisplay();
//.........这里部分代码省略.........
开发者ID:aharrison24,项目名称:XCSoar,代码行数:101,代码来源:TaskDefaultsConfigPanel.cpp

示例8: dlgTarget

void dlgTarget(void) {

  if (!ValidTaskPoint(ActiveWayPoint)) {
    return;
  }
  ActiveWayPointOnEntry = ActiveWayPoint;

#if USEIBOX
  if (!InfoBoxLayout::landscape) {
#else
  if (!ScreenLandscape) {
#endif
    char filename[MAX_PATH];
    LocalPathS(filename, TEXT("dlgTarget_L.xml"));
    wf = dlgLoadFromXML(CallBackTable, 
                        filename, 
                        hWndMainWindow,
                        TEXT("IDR_XML_TARGET_L"));
  } else {
    char filename[MAX_PATH];
    LocalPathS(filename, TEXT("dlgTarget.xml"));
    wf = dlgLoadFromXML(CallBackTable, 
                        filename, 
                        hWndMainWindow,
                        TEXT("IDR_XML_TARGET"));
  }

  if (!wf) return;

  TargetDialogOpen = true;
  TargetMoveMode = false;

  WndFrame *wf2 = (WndFrame*)wf->FindByName(TEXT("frmTarget"));
  if (wf2) {
#if USEIBOX
    if (InfoBoxLayout::landscape) 
#else
    if (ScreenLandscape) 
#endif
    {// make flush right in landscape mode (at top in portrait mode)
      dlgSize = wf2->GetWidth();
#if USEIBOX
      wf->SetLeft(MapWindow::MapRectBig.right- dlgSize);
#else
      wf->SetLeft(MapWindow::MapRect.right- dlgSize);
#endif
    }
    else {
      dlgSize = wf2->GetHeight();
    }
  }

  btnMove = (WindowControl*)wf->FindByName(TEXT("btnMove"));

  wf->SetKeyDownNotify(FormKeyDown);

  WndProperty *wp;
  wp = (WndProperty*)wf->FindByName(TEXT("prpTaskPoint"));
  DataFieldEnum* dfe;
  dfe = (DataFieldEnum*)wp->GetDataField();
  TCHAR tp_label[80];
  TCHAR tp_short[21];
  LockTaskData();
  if (!ValidTaskPoint(target_point)) {
    target_point = ActiveWayPointOnEntry;
  } else {
    target_point = max(target_point, ActiveWayPointOnEntry);
  }
  for (int i=ActiveWayPointOnEntry; i<MAXTASKPOINTS; i++) {
    if (ValidTaskPoint(i)) {
      _tcsncpy(tp_short, WayPointList[Task[i].Index].Name, 20);
      tp_short[20] = 0;
      _stprintf(tp_label, TEXT("%d %s"), i, tp_short);
      dfe->addEnumText(tp_label);
    } else {
      if (target_point>= i) {
        target_point= ActiveWayPointOnEntry;
      }
    }
  }
  dfe->Set(max(0,target_point-ActiveWayPointOnEntry));
  UnlockTaskData();
  wp->RefreshDisplay();

  RefreshTargetPoint();

  wf->SetTimerNotify(OnTimerNotify);

  wf->ShowModal(true); // enable map

  MapWindow::SetTargetPan(false, 0);

  TargetDialogOpen = false;

  delete wf;
  wf = NULL;
}
开发者ID:JanezKolar,项目名称:LK8000,代码行数:97,代码来源:dlgTarget.cpp

示例9: assert

void
TaskDefaultsConfigPanel::Init(WndForm *_wf)
{
  assert(_wf != NULL);
  wf = _wf;
  WndProperty *wp;
  const SETTINGS_COMPUTER &settings_computer = XCSoarInterface::SettingsComputer();
  OrderedTask* temptask = protected_task_manager->task_blank();
  temptask->set_factory(TaskBehaviour::FACTORY_RT);


  wp = (WndProperty*)wf->FindByName(_T("prpStartType"));
  if (wp) {
    const AbstractTaskFactory::LegalPointVector point_types =
        temptask->get_factory().getValidStartTypes();
    DataFieldEnum* dfe = (DataFieldEnum*)wp->GetDataField();
    dfe->EnableItemHelp(true);

    for (unsigned i = 0; i < point_types.size(); i++) {
      dfe->addEnumText(OrderedTaskPointName(point_types[i]), (unsigned)point_types[i],
          OrderedTaskPointDescription(point_types[i]));
      if (point_types[i] == settings_computer.sector_defaults.start_type)
        dfe->Set((unsigned)point_types[i]);
    }
    wp->RefreshDisplay();
  }

  LoadFormProperty(*wf, _T("prpStartRadius"), ugDistance,
                   settings_computer.sector_defaults.start_radius);

  wp = (WndProperty*)wf->FindByName(_T("prpFinishType"));
  if (wp) {
    const AbstractTaskFactory::LegalPointVector point_types =
        temptask->get_factory().getValidFinishTypes();
    DataFieldEnum* dfe = (DataFieldEnum*)wp->GetDataField();
    dfe->EnableItemHelp(true);

    for (unsigned i = 0; i < point_types.size(); i++) {
      dfe->addEnumText(OrderedTaskPointName(point_types[i]), (unsigned)point_types[i],
          OrderedTaskPointDescription(point_types[i]));
      if (point_types[i] == settings_computer.sector_defaults.finish_type)
        dfe->Set((unsigned)point_types[i]);
    }
    wp->RefreshDisplay();
  }

  LoadFormProperty(*wf, _T("prpFinishRadius"), ugDistance,
                   settings_computer.sector_defaults.finish_radius);

  wp = (WndProperty*)wf->FindByName(_T("prpTurnpointType"));
  if (wp) {
    const AbstractTaskFactory::LegalPointVector point_types =
        temptask->get_factory().getValidIntermediateTypes();
    DataFieldEnum* dfe = (DataFieldEnum*)wp->GetDataField();
    dfe->EnableItemHelp(true);

    for (unsigned i = 0; i < point_types.size(); i++) {
      dfe->addEnumText(OrderedTaskPointName(point_types[i]),
          (unsigned)point_types[i],
          OrderedTaskPointDescription(point_types[i]));
      if (point_types[i] == settings_computer.sector_defaults.turnpoint_type) {
        dfe->Set((unsigned)point_types[i]);
      }
    }
    wp->RefreshDisplay();
  }

  LoadFormProperty(*wf, _T("prpTurnpointRadius"), ugDistance,
                   settings_computer.sector_defaults.turnpoint_radius);

  wp = (WndProperty*)wf->FindByName(_T("prpTaskType"));
  if (wp) {
    const std::vector<TaskBehaviour::Factory_t> factory_types =
        temptask->get_factory_types();
    DataFieldEnum* dfe = (DataFieldEnum*)wp->GetDataField();
    dfe->EnableItemHelp(true);

    for (unsigned i = 0; i < factory_types.size(); i++) {
      dfe->addEnumText(OrderedTaskFactoryName(factory_types[i]),
          (unsigned)factory_types[i], OrderedTaskFactoryDescription(
              factory_types[i]));
      if (factory_types[i] == settings_computer.task_type_default)
        dfe->Set((unsigned)factory_types[i]);
    }
    wp->RefreshDisplay();
  }

  LoadFormProperty(*wf, _T("prpAATMinTime"),
                   (unsigned)(settings_computer.ordered_defaults.aat_min_time / 60));

  LoadFormProperty(*wf, _T("prpAATTimeMargin"),
                   (unsigned)(settings_computer.optimise_targets_margin / 60));

  delete temptask;
}
开发者ID:Mrdini,项目名称:XCSoar,代码行数:95,代码来源:TaskDefaultsConfigPanel.cpp

示例10: WndButton

bool
dlgConfigInfoboxesShowModal(SingleWindow &parent,
                            const DialogLook &dialog_look,
                            const InfoBoxLook &_look,
                            InfoBoxSettings::Geometry geometry,
                            InfoBoxSettings::Panel &data_r,
                            bool allow_name_change)
{
  current_preview = 0;
  look = &_look;
  data = data_r;

  PixelRect rc = parent.GetClientRect();
  wf = new WndForm(parent, dialog_look, rc);

#ifdef _WIN32_WCE
  if (IsAltair())
    wf->SetKeyDownFunction(OnKeyDown);
#endif

  ContainerWindow &client_area = wf->GetClientAreaWindow();
  rc = client_area.GetClientRect();
  rc.Grow(Layout::FastScale(-2));
  info_box_layout = InfoBoxLayout::Calculate(rc, geometry);

  WindowStyle preview_style;
  preview_style.EnableDoubleClicks();
  for (unsigned i = 0; i < info_box_layout.count; ++i) {
    rc = info_box_layout.positions[i];
    previews[i].Create(client_area, rc, preview_style);
  }

  rc = info_box_layout.remaining;

  WindowStyle style;
  style.TabStop();

  PixelRect control_rc = rc;
  control_rc.right -= Layout::FastScale(2);

  const UPixelScalar height = Layout::Scale(22);
  const UPixelScalar caption_width = Layout::Scale(60);

  ButtonWindowStyle button_style;
  button_style.TabStop();

  control_rc.bottom = control_rc.top + height;
  edit_name = new WndProperty(client_area, dialog_look, _("Name"),
                              control_rc, caption_width,
                              style);
  DataFieldString *dfs = new DataFieldString(allow_name_change
                                             ? (const TCHAR *)data.name
                                             : gettext(data.name));
  edit_name->SetDataField(dfs);
  edit_name->SetReadOnly(!allow_name_change);

  control_rc.top = control_rc.bottom;
  control_rc.bottom = control_rc.top + height;

  edit_select = new WndProperty(client_area, dialog_look, _("InfoBox"),
                                control_rc, caption_width,
                                style);

  DataFieldEnum *dfe = new DataFieldEnum(OnSelectAccess);
  for (unsigned i = 0; i < info_box_layout.count; ++i) {
    TCHAR label[32];
    _stprintf(label, _T("%u"), i + 1);
    dfe->addEnumText(label, i);
  }

  edit_select->SetDataField(dfe);

  control_rc.top += height;
  control_rc.bottom += height;

  edit_content = new WndProperty(client_area, dialog_look, _("Content"),
                                 control_rc, caption_width,
                                 style);

  dfe = new DataFieldEnum(OnContentAccess);
  for (unsigned i = InfoBoxFactory::MIN_TYPE_VAL; i < InfoBoxFactory::NUM_TYPES; i++) {
    const TCHAR *name = InfoBoxFactory::GetName((InfoBoxFactory::Type) i);
    const TCHAR *desc = InfoBoxFactory::GetDescription((InfoBoxFactory::Type) i);
    if (name != NULL)
      dfe->addEnumText(gettext(name), i, desc != NULL ? gettext(desc) : NULL);
  }

  dfe->EnableItemHelp(true);
  dfe->Sort(0);

  edit_content->SetDataField(dfe);

  control_rc.top += height;
  control_rc.bottom += height * 5;
  edit_content_description = new WndFrame(client_area, dialog_look,
                                          control_rc, style);

  RefreshEditContent();

  const UPixelScalar button_width = Layout::Scale(60);
//.........这里部分代码省略.........
开发者ID:Adrien81,项目名称:XCSoar,代码行数:101,代码来源:dlgConfigInfoboxes.cpp

示例11: assert

void
WaypointDisplayConfigPanel::Init(WndForm *_wf)
{
  assert(_wf != NULL);
  wf = _wf;
  WndProperty *wp;

  const WaypointRendererSettings &settings =
    CommonInterface::SettingsMap().waypoint;

  wp = (WndProperty*)wf->FindByName(_T("prpWaypointLabels"));
  if (wp) {
    DataFieldEnum* dfe;
    dfe = (DataFieldEnum*)wp->GetDataField();
    dfe->EnableItemHelp(true);
    dfe->addEnumText(_("Full name"), DISPLAYNAME, _("The full name of each waypoint is displayed."));
    dfe->addEnumText(_("First word of name"), DISPLAYUNTILSPACE, _("The first word of the waypoint name is displayed."));
    dfe->addEnumText(_("First 3 letters"), DISPLAYFIRSTTHREE, _("The first 3 letters of the waypoint name are displayed."));
    dfe->addEnumText(_("First 5 letters"), DISPLAYFIRSTFIVE, _("The first 5 letters of the waypoint name are displayed."));
    dfe->addEnumText(_("None"), DISPLAYNONE, _("No waypoint name is displayed."));
    dfe->Set(settings.display_text_type);
    wp->RefreshDisplay();
  }

  wp = (WndProperty*)wf->FindByName(_T("prpWaypointArrivalHeightDisplay"));
  if (wp) {
    DataFieldEnum* dfe;
    dfe = (DataFieldEnum*)wp->GetDataField();
    dfe->EnableItemHelp(true);
    dfe->addEnumText(_("None"), WP_ARRIVAL_HEIGHT_NONE, _("No arrival height is displayed."));
    dfe->addEnumText(_("Straight glide"), WP_ARRIVAL_HEIGHT_GLIDE, _("Straight glide arrival height (no terrain is considered)."));
    dfe->addEnumText(_("Terrain avoidance glide"), WP_ARRIVAL_HEIGHT_TERRAIN, _("Arrival height considering terrain avoidance"));
    dfe->addEnumText(_("Straight & terrain glide"), WP_ARRIVAL_HEIGHT_GLIDE_AND_TERRAIN, _("Both arrival heights are displayed."));
    dfe->Set(settings.arrival_height_display);
    wp->RefreshDisplay();
  }

  wp = (WndProperty*)wf->FindByName(_T("prpWaypointLabelStyle"));
  if (wp) {
    DataFieldEnum* dfe;
    dfe = (DataFieldEnum*)wp->GetDataField();
    dfe->addEnumText(_("Rounded rectangle"), RoundedBlack);
    dfe->addEnumText(_("Outlined"), OutlinedInverted);
    dfe->Set(settings.landable_render_mode);
    wp->RefreshDisplay();
  }

  wp = (WndProperty*)wf->FindByName(_T("prpWaypointLabelSelection"));
  if (wp) {
    //Determines what waypoint labels are displayed for each waypoint (space permitting):&#10;
    DataFieldEnum* dfe;
    dfe = (DataFieldEnum*)wp->GetDataField();
    dfe->EnableItemHelp(true);
    dfe->addEnumText(_("All"), wlsAllWaypoints,
                     _("All waypoint labels will be displayed."));
    dfe->addEnumText(_("Task waypoints & landables"),
                     wlsTaskAndLandableWaypoints,
                     _("All waypoints part of a task and all landables will be displayed."));
    dfe->addEnumText(_("Task waypoints"), wlsTaskWaypoints,
                     _("All waypoints part of a task will be displayed."));
    dfe->addEnumText(_("None"), wlsNoWaypoints,
                     _("No waypoint labels will be displayed."));
    dfe->Set(settings.label_selection);
    wp->RefreshDisplay();
  }

  wp = (WndProperty*)wf->FindByName(_T("prpAppIndLandable"));
  if (wp) {
    DataFieldEnum* dfe;
    dfe = (DataFieldEnum*)wp->GetDataField();
    dfe->EnableItemHelp(true);
    dfe->addEnumText(_("Purple circle"), wpLandableWinPilot,
                     _("Airports and outlanding fields are displayed as purple circles. If the waypoint is reachable a bigger green circle is added behind the purple one. If the waypoint is blocked by a mountain the green circle will be red instead."));
    dfe->addEnumText(_("B/W"), wpLandableAltA,
                     _("Airports and outlanding fields are displayed in white/grey. If the waypoint is reachable the color is changed to green. If the waypoint is blocked by a mountain the color is changed to red instead."));
    dfe->addEnumText(_("Traffic lights"), wpLandableAltB,
                     _("Airports and outlanding fields are displayed in the colors of a traffic light. Green if reachable, Orange if blocked by mountain and red if not reachable at all."));
    dfe->Set(settings.landable_style);
    wp->RefreshDisplay();
  }

  LoadFormProperty(*wf, _T("prpAppUseSWLandablesRendering"),
                   settings.vector_landable_rendering);

  LoadFormProperty(*wf, _T("prpAppLandableRenderingScale"),
                   settings.landable_rendering_scale);

  LoadFormProperty(*wf, _T("prpAppScaleRunwayLength"),
                   settings.scale_runway_length);

  UpdateVisibilities();
}
开发者ID:joachimwieland,项目名称:xcsoar-jwieland,代码行数:92,代码来源:WaypointDisplayConfigPanel.cpp

示例12: AddTime

void
TaskPropertiesPanel::Prepare(ContainerWindow &parent, const PixelRect &rc)
{
  AddTime(_("AAT min. time"), _("Minimum AAT task time in minutes."),
          0, 36000, 60, 180);

  AddFloat(_("Start max. speed"),
           _("Maximum speed allowed in start observation zone.  Set to 0 for no limit."),
           _T("%.0f %s"), _T("%.0f"),
           fixed_zero, fixed(300), fixed(5), false, fixed_zero);

  AddFloat(_("Start max. height"),
           _("Maximum height based on start height reference (AGL or MSL) while starting the task.  Set to 0 for no limit."),
           _T("%.0f %s"), _T("%.0f"),
           fixed_zero, fixed(10000), fixed(25), false, fixed_zero);

  static gcc_constexpr_data StaticEnumChoice start_max_height_ref_list[] = {
    { (unsigned)HeightReferenceType::AGL, N_("AGL"), N_("Reference AGL for start maximum height rule (above start point).") },
    { (unsigned)HeightReferenceType::MSL, N_("MSL"), N_("Reference MSL for start maximum height rule (above sea level).") },
    { 0 }
  };

  AddEnum(_("Start height ref."),
          _("Reference used for start max height rule\n"
            "[MSL] Reference is altitude above mean sea level\n"
            "[AGL] Reference is the height above the start point"),
          start_max_height_ref_list);

  AddFloat(_("Finish min. height"),
           _("Minimum height based on finish height reference (AGL or MSL) while finishing the task.  Set to 0 for no limit."),
           _T("%.0f %s"), _T("%.0f"),
           fixed_zero, fixed(10000), fixed(25), false, fixed_zero);

  static gcc_constexpr_data StaticEnumChoice finish_min_height_ref_list[] = {
    { (unsigned)HeightReferenceType::AGL, N_("AGL"), N_("Reference AGL for finish minimum height rule (above finish point).") },
    { (unsigned)HeightReferenceType::MSL, N_("MSL"), N_("Reference MSL for finish minimum height rule (above sea level).") },
    { 0 }
  };
  AddEnum(_("Finish height ref."),
          _("Reference used for finish min height rule\n"
            "[MSL] Reference is altitude above mean sea level\n"
            "[AGL] Reference is the height above the finish point"),
          finish_min_height_ref_list);

  AddBoolean(_("FAI start / finish rules"),
             _("If enabled, has no max start height or max start speed and requires the minimum height above ground for finish to be greater than 1000m below the start height."),
             false, this);

  DataFieldEnum *dfe = new DataFieldEnum(NULL);
  dfe->SetListener(this);
  dfe->EnableItemHelp(true);
  const std::vector<TaskFactoryType> factory_types =
    ordered_task->GetFactoryTypes();
  for (unsigned i = 0; i < factory_types.size(); i++) {
    dfe->addEnumText(OrderedTaskFactoryName(factory_types[i]),
                     (unsigned)factory_types[i],
                     OrderedTaskFactoryDescription(factory_types[i]));
    if (factory_types[i] == ordered_task->GetFactoryType())
      dfe->Set((unsigned)factory_types[i]);
  }
  Add(_("Task type"), _("Sets the behaviour for the current task."), dfe);
}
开发者ID:FlorianR,项目名称:XCSoar,代码行数:62,代码来源:TaskPropertiesPanel.cpp

示例13: assert

void
RouteConfigPanel::Init(WndForm *_wf)
{
  assert(_wf != NULL);
  wf = _wf;
  WndProperty *wp;
  const SETTINGS_COMPUTER &settings_computer = XCSoarInterface::SettingsComputer();

  wp = (WndProperty*)wf->FindByName(_T("prpFinalGlideTerrain"));
  if (wp) {
    DataFieldEnum* dfe;
    dfe = (DataFieldEnum*)wp->GetDataField();
    dfe->addEnumText(_("Off"), SETTINGS_COMPUTER::FGT_OFF);
    dfe->addEnumText(_("Line"), SETTINGS_COMPUTER::FGT_LINE);
    dfe->addEnumText(_("Shade"), SETTINGS_COMPUTER::FGT_SHADE);
    dfe->Set(settings_computer.FinalGlideTerrain);
    wp->RefreshDisplay();
  }

  wp = (WndProperty*)wf->FindByName(_T("prpRoutePlannerMode"));
  if (wp) {
    DataFieldEnum* dfe;
    dfe = (DataFieldEnum*)wp->GetDataField();
    dfe->addEnumText(_("None"));
    dfe->addEnumText(_("Terrain"));
    dfe->addEnumText(_("Airspace"));
    dfe->addEnumText(_("Both"));
    dfe->Set(settings_computer.route_planner.mode);
    wp->RefreshDisplay();
  }

  LoadFormProperty(*wf, _T("prpRoutePlannerAllowClimb"),
                   settings_computer.route_planner.allow_climb);

  LoadFormProperty(*wf, _T("prpRoutePlannerUseCeiling"),
                   settings_computer.route_planner.use_ceiling);

  wp = (WndProperty*)wf->FindByName(_T("prpTurningReach"));
  if (wp) {
    DataFieldEnum* dfe;
    dfe = (DataFieldEnum*)wp->GetDataField();
    dfe->addEnumText(_("Off"));
    dfe->addEnumText(_("Straight"));
    dfe->addEnumText(_("Turning"));
    dfe->Set(settings_computer.route_planner.reach_calc_mode);
    wp->RefreshDisplay();
  }

  wp = (WndProperty*)wf->FindByName(_T("prpReachPolarMode"));
  if (wp) {
    DataFieldEnum* dfe;
    dfe = (DataFieldEnum*)wp->GetDataField();
    dfe->addEnumText(_("Task"));
    dfe->addEnumText(_("Safety MC"));
    dfe->Set(settings_computer.route_planner.reach_polar_mode);
    wp->RefreshDisplay();
  }
}
开发者ID:Mrdini,项目名称:XCSoar,代码行数:58,代码来源:RouteConfigPanel.cpp

示例14: if

static void
SetValues()
{
  WndProperty* wp;
  bool sign;
  int dd,mm,ss;

  Units::LongitudeToDMS(global_wpt->location.Longitude, &dd, &mm, &ss, &sign);

  wp = (WndProperty*)wf->FindByName(_T("prpLongitudeSign"));
  assert(wp != NULL);

  DataFieldEnum* dfe;
  dfe = (DataFieldEnum*)wp->GetDataField();
  dfe->addEnumText((_T("W")));
  dfe->addEnumText((_T("E")));
  dfe->Set(sign);
  wp->RefreshDisplay();

  LoadFormProperty(*wf, _T("prpLongitudeD"), dd);

  switch (Units::GetCoordinateFormat()) {
  case cfDDMMSS: // ("DDMMSS");
  case cfDDMMSSss: // ("DDMMSS.ss");
    LoadFormProperty(*wf, _T("prpLongitudeM"), mm);
    LoadFormProperty(*wf, _T("prpLongitudeS"), ss);
    break;
  case cfDDMMmmm: // ("DDMM.mmm");
    LoadFormProperty(*wf, _T("prpLongitudeM"), mm);
    LoadFormProperty(*wf, _T("prpLongitudemmm"), 1000 * fixed(ss) / 60);
    break;
  case cfDDdddd: // ("DD.dddd");
    LoadFormProperty(*wf, _T("prpLongitudeDDDD"),
                     10000 * (fixed)(mm + ss) / 3600);
    break;
  }

  Units::LatitudeToDMS(global_wpt->location.Latitude, &dd, &mm, &ss, &sign);

  LoadFormProperty(*wf, _T("prpLatitudeD"), dd);

  wp = (WndProperty*)wf->FindByName(_T("prpLatitudeSign"));
  assert(wp != NULL);
  dfe = (DataFieldEnum*)wp->GetDataField();
  dfe->addEnumText((_T("S")));
  dfe->addEnumText((_T("N")));
  dfe->Set(sign);
  wp->RefreshDisplay();

  wp = (WndProperty*)wf->FindByName(_T("prpLatitudeD"));
  assert(wp != NULL);
  wp->GetDataField()->SetAsInteger(dd);
  wp->RefreshDisplay();

  switch (Units::GetCoordinateFormat()) {
  case cfDDMMSS: // ("DDMMSS");
  case cfDDMMSSss: // ("DDMMSS.ss");
    LoadFormProperty(*wf, _T("prpLatitudeM"), mm);
    LoadFormProperty(*wf, _T("prpLatitudeS"), ss);
    break;
  case cfDDMMmmm: // ("DDMM.mmm");
    LoadFormProperty(*wf, _T("prpLatitudeM"), mm);
    LoadFormProperty(*wf, _T("prpLatitudemmm"), 1000 * fixed(ss) / 60);
    break;
  case cfDDdddd: // ("DD.dddd");
    LoadFormProperty(*wf, _T("prpLatitudeDDDD"),
                     10000 * (fixed)(mm + ss) / 3600);
    break;
  }

  LoadFormProperty(*wf, _T("prpAltitude"), ugAltitude, global_wpt->altitude);

  wp = (WndProperty*)wf->FindByName(_T("prpFlags"));
  assert(wp != NULL);
  dfe = (DataFieldEnum*)wp->GetDataField();

  dfe->addEnumText(_T("Turnpoint"));
  dfe->addEnumText(_T("Airport"));
  dfe->addEnumText(_T("Landpoint"));

  if (global_wpt->IsAirport())
    dfe->Set(1);
  else if (global_wpt->IsLandable())
    dfe->Set(2);
  else
    dfe->Set(0);

  wp->RefreshDisplay();
}
开发者ID:macsux,项目名称:XCSoar,代码行数:89,代码来源:dlgWaypointEdit.cpp

示例15: LoadGUI

void LoadGUI() 
{
#define MAX_ENUM 10
  IsInitialized=false;
  int i=0;
  WndProperty* wp;

  wp = (WndProperty*)wf->FindByName(TEXT("prpFontName"));
  if (wp) {
    DataFieldEnum* dfe;
    dfe = (DataFieldEnum*)wp->GetDataField();
    if (dfe) 
    {
      for (i=0 ;i < MAX_ENUM ; i++) { 
        dfe->Dec();
      } // rewind

      bool bFound=false;
      for (i=0 ;i < MAX_ENUM ; i++ ) {
        if (_tcsncmp(dfe->GetAsString(), NewLogFont.lfFaceName, LF_FACESIZE) == 0) {
          bFound=true;
          break;
        }
        dfe->Inc();
      }
      if (!bFound) {
        dfe->addEnumText(NewLogFont.lfFaceName);
        for (i=0 ;i < MAX_ENUM ; i++) { 
          dfe->Dec();
        } // rewind
        for (i=0 ;i < MAX_ENUM ; i++ ) {
          if (_tcsncmp(dfe->GetAsString(), NewLogFont.lfFaceName,LF_FACESIZE) == 0) {
            break;
          }
          dfe->Inc();
        }
      }
    }
    wp->RefreshDisplay();
  }

  wp = (WndProperty*)wf->FindByName(TEXT("prpFontHeight"));
  if (wp) {
    DataFieldInteger * dfi;
    dfi = (DataFieldInteger*)wp->GetDataField();
    if (dfi)
    {
      dfi->Set(NewLogFont.lfHeight);
    }
    wp->RefreshDisplay();
  }
  wp = (WndProperty*)wf->FindByName(TEXT("prpFontWeight"));
  if (wp) {
    DataFieldInteger* dfi;
    dfi = (DataFieldInteger*)wp->GetDataField();
    if (dfi)
    {
      dfi->Set(NewLogFont.lfWeight);
    }
    wp->RefreshDisplay();
  }
  wp = (WndProperty*)wf->FindByName(TEXT("prpFontItalic"));
  if (wp) {
    DataFieldBoolean* dfb;
    dfb = (DataFieldBoolean*)wp->GetDataField();
    if (dfb)
    {
      dfb->Set(NewLogFont.lfItalic);
    }
    wp->RefreshDisplay();
  }
  wp = (WndProperty*)wf->FindByName(TEXT("prpFontPitchAndFamily"));
  if (wp) {
    DataFieldEnum * dfe;
    dfe = (DataFieldEnum*)wp->GetDataField();
    if (dfe)
    {
      dfe->SetAsInteger(NewLogFont.lfPitchAndFamily);
    }
    wp->RefreshDisplay();
  }

  wp = (WndProperty*)wf->FindByName(TEXT("prpFontTrueType"));
  if (wp) {
    DataFieldBoolean* dfb;
    dfb = (DataFieldBoolean*)wp->GetDataField();
    if (dfb)
    {
      dfb->Set(NewLogFont.lfQuality != NONANTIALIASED_QUALITY); //was dfb->Set(NewLogFont.lfQuality == LKFONT_QUALITY); dont know why
    }
    wp->RefreshDisplay();
  }

  IsInitialized=true;

  RedrawSampleFont();
}
开发者ID:miza,项目名称:LK8000,代码行数:97,代码来源:dlgFontEdit.cpp


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