本文整理汇总了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;
}
示例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);
}
示例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);
}
示例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;
}
示例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"));
}
示例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;
}