本文整理汇总了C++中InfoBoxWindow::SetValueInvalid方法的典型用法代码示例。如果您正苦于以下问题:C++ InfoBoxWindow::SetValueInvalid方法的具体用法?C++ InfoBoxWindow::SetValueInvalid怎么用?C++ InfoBoxWindow::SetValueInvalid使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类InfoBoxWindow
的用法示例。
在下文中一共展示了InfoBoxWindow::SetValueInvalid方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: if
void
InfoBoxContentTeamBearing::Update(InfoBoxWindow &infobox)
{
if (XCSoarInterface::SettingsComputer().TeamFlarmIdTarget.defined() ||
XCSoarInterface::SettingsComputer().TeammateCodeValid == true){
// Set Value
infobox.SetValue(XCSoarInterface::Calculated().TeammateBearing,
_T("T"));
}
else
infobox.SetValueInvalid();
// Set Comment
if (!XCSoarInterface::SettingsComputer().TeamFlarmIdTarget.defined())
infobox.SetCommentInvalid();
else if (!string_is_empty(XCSoarInterface::SettingsComputer().TeamFlarmCNTarget))
infobox.SetComment(XCSoarInterface::SettingsComputer().TeamFlarmCNTarget);
else
infobox.SetComment(_T("???"));
if (XCSoarInterface::Basic().flarm.FindTraffic(
XCSoarInterface::SettingsComputer().TeamFlarmIdTarget) != NULL)
infobox.SetColorBottom(2);
else
infobox.SetColorBottom(1);
}
示例2: SetTitleFromWaypointName
void
InfoBoxContentNextWaypoint::Update(InfoBoxWindow &infobox)
{
// use proper non-terminal next task stats
const Waypoint* way_point = protected_task_manager != NULL
? protected_task_manager->getActiveWaypoint()
: NULL;
if (!way_point) {
infobox.SetTitle(_("Next"));
infobox.SetInvalid();
return;
}
SetTitleFromWaypointName(infobox, way_point);
// Set Comment
if (way_point->radio_frequency.IsDefined()) {
StaticString<128> comment;
const unsigned freq = way_point->radio_frequency.GetKiloHertz();
_sntprintf(comment.buffer(), comment.MAX_SIZE, _T("%u.%03u %s"),
freq / 1000, freq % 1000, way_point->Comment.c_str());
infobox.SetComment(comment);
}
else
infobox.SetComment(way_point->Comment.c_str());
const GlideResult &solution_remaining =
XCSoarInterface::Calculated().task_stats.current_leg.solution_remaining;
if (!XCSoarInterface::Basic().track_available ||
!XCSoarInterface::Calculated().task_stats.task_valid ||
!solution_remaining.defined() ||
solution_remaining.Vector.Distance <= fixed(10)) {
infobox.SetValueInvalid();
return;
}
// Set Value
Angle Value =
solution_remaining.Vector.Bearing - XCSoarInterface::Basic().track;
SetValueBearingDifference(infobox, Value);
// Set Color (blue/black)
infobox.SetColor(solution_remaining.is_final_glide() ? 2 : 0);
}
示例3: switch
void
InfoBoxContentBattery::Update(InfoBoxWindow &infobox)
{
#ifdef HAVE_BATTERY
TCHAR tmp[32];
bool DisplaySupplyVoltageAsValue=false;
switch (Power::External::Status) {
case Power::External::OFF:
infobox.SetComment(_("AC Off"));
break;
case Power::External::ON:
if (!XCSoarInterface::Basic().voltage_available)
infobox.SetComment(_("AC ON"));
else{
DisplaySupplyVoltageAsValue = true;
SetValueFromFixed(infobox, _T("%2.1fV"),
XCSoarInterface::Basic().voltage);
}
break;
case Power::External::UNKNOWN:
default:
infobox.SetCommentInvalid();
}
#ifndef ANDROID
switch (Power::Battery::Status){
case Power::Battery::HIGH:
case Power::Battery::LOW:
case Power::Battery::CRITICAL:
case Power::Battery::CHARGING:
if (Power::Battery::RemainingPercentValid){
#endif
_stprintf(tmp, _T("%d%%"), Power::Battery::RemainingPercent);
if (!DisplaySupplyVoltageAsValue)
infobox.SetValue(tmp);
else
infobox.SetComment(tmp);
#ifndef ANDROID
}
else
if (!DisplaySupplyVoltageAsValue)
infobox.SetValueInvalid();
else
infobox.SetCommentInvalid();
break;
case Power::Battery::NOBATTERY:
case Power::Battery::UNKNOWN:
if (!DisplaySupplyVoltageAsValue)
infobox.SetValueInvalid();
else
infobox.SetCommentInvalid();
}
#endif
return;
#endif
if (XCSoarInterface::Basic().voltage_available) {
SetValueFromFixed(infobox, _T("%2.1fV"),
XCSoarInterface::Basic().voltage);
return;
}
infobox.SetInvalid();
}