void PlanePolarWidget::UpdateInvalidLabel() { PolarShapeEditWidget &widget = GetShapeEditor(); bool changed = false; bool valid = widget.Save(changed) && widget.GetPolarShape().IsValid(); bool visible = !valid; SetRowVisible(INVALID, visible); if (visible) { TextWidget &widget = (TextWidget &)GetRowWidget(INVALID); widget.SetText(_("Invalid")); widget.SetColor(COLOR_RED); } }
void TaskCalculatorPanel::Show(const PixelRect &rc) { const GlidePolar &polar = CommonInterface::GetComputerSettings().polar.glide_polar_task; cruise_efficiency = polar.GetCruiseEfficiency(); emc = CommonInterface::Calculated().ordered_task_stats.effective_mc; Refresh(); CommonInterface::GetLiveBlackboard().AddListener(*this); RowFormWidget::Show(rc); const bool modified = instance->IsTaskModified(); SetRowVisible(WARNING, modified); if (modified) { TextWidget &widget = (TextWidget &)GetRowWidget(WARNING); widget.SetText(_("Calculator excludes unsaved task changes!")); widget.SetColor(COLOR_RED); } }
PolarShapeEditWidget &GetShapeEditor() { return (PolarShapeEditWidget &)GetRowWidget(SHAPE); }