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


C++ WndProperty::set_enabled方法代码示例

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


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

示例1:

bool
InfoBoxContentWind::PnlEditOnTabPreShow(TabBarControl::EventType EventType)
{
  const NMEAInfo &basic = XCSoarInterface::Basic();
  const SETTINGS_COMPUTER &settings_computer =
    XCSoarInterface::SettingsComputer();
  const bool external_wind = basic.external_wind_available &&
    settings_computer.ExternalWind;

  WndProperty* wp;

  wp = (WndProperty*)dlgInfoBoxAccess::GetWindowForm()->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*)dlgInfoBoxAccess::GetWindowForm()->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();
  }

  return true;
}
开发者ID:macsux,项目名称:XCSoar,代码行数:31,代码来源:Weather.cpp

示例2: assert

/**
 * for FAI tasks, make the zone sizes disabled so the user can't alter them
 * @param enable
 */
static void
EnableSizeEdit(bool enable)
{
  WndProperty *wp = (WndProperty*)wf->FindByName(_T("prpOZLineLength"));
  assert(wp);
  wp->set_enabled(enable);

  wp = (WndProperty*)wf->FindByName(_T("prpOZCylinderRadius"));
  assert(wp);
  wp->set_enabled(enable);
}
开发者ID:joachimwieland,项目名称:xcsoar-jwieland,代码行数:15,代码来源:dlgTaskPoint.cpp

示例3:

/**
 * Locks target fields if turnpoint does not have adjustable target
 */
static void
LockCalculatorUI()
{
  WndProperty* wp;

  wp = (WndProperty*)wf->FindByName(_T("prpRange"));
  if (wp)
    wp->set_enabled(IsLocked);

  wp = (WndProperty*)wf->FindByName(_T("prpRadial"));
  if (wp)
    wp->set_enabled(IsLocked);
}
开发者ID:davidswelt,项目名称:XCSoar,代码行数:16,代码来源:dlgTarget.cpp

示例4: assert

Window*
InfoBoxContentWind::PnlSetupLoad(SingleWindow &parent, TabBarControl* wTabBar,
                                 WndForm* wf, const int id)
{
  assert(wTabBar);
  assert(wf);

  InfoBoxID = id;

  Window *wInfoBoxAccessSetup =
      LoadWindow(CallBackTable, wf, *wTabBar, _T("IDR_XML_INFOBOXWINDSETUP"));
  assert(wInfoBoxAccessSetup);

  const NMEAInfo &basic = XCSoarInterface::Basic();
  const SETTINGS_COMPUTER &settings_computer =
    XCSoarInterface::SettingsComputer();
  const bool external_wind = basic.external_wind_available &&
    settings_computer.ExternalWind;

  WndProperty* wp;

  wp = (WndProperty*)wf->FindByName(_T("prpAutoWind"));
  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(settings_computer.AutoWindMode);
    wp->RefreshDisplay();
  }

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

  return wInfoBoxAccessSetup;
}
开发者ID:macsux,项目名称:XCSoar,代码行数:48,代码来源:Weather.cpp

示例5: assert

void
SiteConfigPanel::Init(WndForm *_wf)
{
  assert(_wf != NULL);
  wf = _wf;

  buttonWaypoints = ((WndButton *)wf->FindByName(_T("cmdWaypoints")));
  if (buttonWaypoints)
    buttonWaypoints->SetOnClickNotify(OnWaypoints);

  InitFileField(*wf, _T("prpAirspaceFile"),
                szProfileAirspaceFile, _T("*.txt\0*.air\0*.sua\0"));
  InitFileField(*wf, _T("prpAdditionalAirspaceFile"),
                szProfileAdditionalAirspaceFile, _T("*.txt\0*.air\0*.sua\0"));
  InitFileField(*wf, _T("prpWaypointFile"),
                szProfileWayPointFile, _T("*.dat\0*.xcw\0*.cup\0*.wpz\0*.wpt\0"));
  InitFileField(*wf, _T("prpAdditionalWaypointFile"),
                szProfileAdditionalWayPointFile,
                _T("*.dat\0*.xcw\0*.cup\0*.wpz\0*.wpt\0"));
  InitFileField(*wf, _T("prpWatchedWaypointFile"),
                szProfileWatchedWayPointFile,
                _T("*.dat\0*.xcw\0*.cup\0*.wpz\0*.wpt\0"));

  WndProperty *wp = (WndProperty *)wf->FindByName(_T("prpDataPath"));
  wp->set_enabled(false);
  wp->SetText(GetPrimaryDataPath());

  InitFileField(*wf, _T("prpMapFile"),
                szProfileMapFile, _T("*.xcm\0*.lkm\0"));
  InitFileField(*wf, _T("prpTerrainFile"),
                szProfileTerrainFile, _T("*.jp2\0"));
  InitFileField(*wf, _T("prpTopographyFile"),
                szProfileTopographyFile, _T("*.tpl\0"));
  InitFileField(*wf, _T("prpAirfieldFile"),
                szProfileAirfieldFile, _T("*.txt\0"));
}
开发者ID:Mrdini,项目名称:XCSoar,代码行数:36,代码来源:SiteConfigPanel.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


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