void RASPSettingsPanel::Prepare(ContainerWindow &parent, const PixelRect &rc) { WndProperty *wp; wp = AddEnum(_("Field"), nullptr); DataFieldEnum *dfe = (DataFieldEnum *)wp->GetDataField(); dfe->EnableItemHelp(true); dfe->addEnumText(_("Terrain")); for (unsigned i = 1; i < RasterWeather::MAX_WEATHER_MAP; i++) { const TCHAR *label = RASP.ItemLabel(i); if (label != NULL) dfe->AddChoice(i, label, nullptr, RASP.ItemHelp(i)); } dfe->Set(RASP.GetParameter()); wp->RefreshDisplay(); wp = AddEnum(_("Time"), nullptr); dfe = (DataFieldEnum *)wp->GetDataField(); dfe->addEnumText(_("Now")); for (unsigned i = 1; i < RasterWeather::MAX_WEATHER_TIMES; i++) { if (RASP.isWeatherAvailable(i)) { TCHAR timetext[10]; _stprintf(timetext, _T("%04d"), RASP.IndexToTime(i)); dfe->addEnumText(timetext, i); } } dfe->Set(RASP.GetTime()); wp->RefreshDisplay(); }
void RASPSettingsPanel::Prepare(ContainerWindow &parent, const PixelRect &rc) { const WeatherUIState &state = CommonInterface::GetUIState().weather; time = state.time; WndProperty *wp; wp = AddEnum(_("Field"), nullptr, this); DataFieldEnum *dfe = (DataFieldEnum *)wp->GetDataField(); dfe->EnableItemHelp(true); for (unsigned i = 0; i < rasp.GetItemCount(); i++) { const auto &mi = rasp.GetItemInfo(i); const TCHAR *label = mi.label; if (label != nullptr) label = gettext(label); const TCHAR *help = mi.help; if (help != nullptr) help = gettext(help); dfe->AddChoice(i, mi.name, label, help); } dfe->Set(state.map); wp->RefreshDisplay(); AddEnum(_("Time"), nullptr, this); UpdateTimeControl(); }
void dlgWeatherShowModal() { WndForm *wf = LoadDialog(nullptr, UIGlobals::GetMainWindow(), _T("IDR_XML_WEATHER")); if (wf == NULL) return; WndProperty* wp; wp = (WndProperty*)wf->FindByName(_T("prpTime")); assert(wp != nullptr); DataFieldEnum *dfe = (DataFieldEnum *)wp->GetDataField(); dfe->addEnumText(_("Now")); for (unsigned i = 1; i < RasterWeather::MAX_WEATHER_TIMES; i++) { if (RASP.isWeatherAvailable(i)) { TCHAR timetext[10]; _stprintf(timetext, _T("%04d"), RASP.IndexToTime(i)); dfe->addEnumText(timetext, i); } } dfe->Set(RASP.GetTime()); wp->RefreshDisplay(); wp = (WndProperty *)wf->FindByName(_T("prpDisplayItem")); assert(wp != nullptr); dfe = (DataFieldEnum *)wp->GetDataField(); dfe->EnableItemHelp(true); dfe->addEnumText(_("Terrain")); for (int i = 1; i <= 15; i++) { const TCHAR *label = RASP.ItemLabel(i); if (label != NULL) dfe->AddChoice(i, label, nullptr, RASP.ItemHelp(i)); } dfe->Set(RASP.GetParameter()); wp->RefreshDisplay(); wf->ShowModal(); wp = (WndProperty *)wf->FindByName(_T("prpTime")); assert(wp != nullptr); dfe = (DataFieldEnum *)wp->GetDataField(); RASP.SetTime(dfe->GetValue()); wp = (WndProperty *)wf->FindByName(_T("prpDisplayItem")); assert(wp != nullptr); dfe = (DataFieldEnum *)wp->GetDataField(); RASP.SetParameter(dfe->GetValue()); delete wf; }
WndProperty * RowFormWidget::AddEnum(const TCHAR *label, const TCHAR *help, const StaticEnumChoice *list, unsigned value, DataField::DataAccessCallback callback) { assert(list != NULL); WndProperty *edit = Add(label, help); DataFieldEnum *df = new DataFieldEnum(callback); if (list[0].help != NULL) df->EnableItemHelp(true); df->AddChoices(list); df->Set(value); edit->SetDataField(df); return edit; }
WndProperty * RowFormWidget::AddEnum(const TCHAR *label, const TCHAR *help, const StaticEnumChoice *list, unsigned value, DataFieldListener *listener) { assert(list != nullptr); WndProperty *edit = Add(label, help); DataFieldEnum *df = new DataFieldEnum(listener); if (list[0].help != nullptr) df->EnableItemHelp(true); df->AddChoices(list); df->Set(value); edit->SetDataField(df); return edit; }
static void FillAndroidIOIOPorts(DataFieldEnum &df, const DeviceConfig &config) { #if defined(ANDROID) df.EnableItemHelp(true); TCHAR tempID[4]; TCHAR tempName[15]; for (unsigned i = 0; i < AndroidIOIOUartPort::getNumberUarts(); i++) { StringFormatUnsafe(tempID, _T("%u"), i); StringFormat(tempName, sizeof(tempName), _T("IOIO Uart %u"), i); unsigned id = AddPort(df, DeviceConfig::PortType::IOIOUART, tempID, tempName, AndroidIOIOUartPort::getPortHelp(i)); if (config.port_type == DeviceConfig::PortType::IOIOUART && config.ioio_uart_id == i) df.Set(id); } #endif }
static void FillAndroidIOIOPorts(DataFieldEnum &df, const DeviceConfig &config) { #if defined(ANDROID) && defined(IOIOLIB) df.EnableItemHelp(true); TCHAR tempID[4]; TCHAR tempName[15]; for (unsigned i = 0; i < AndroidIOIOUartPort::getNumberUarts(); i++) { _sntprintf(tempID, sizeof(tempID), _T("%d"), i); _sntprintf(tempName, sizeof(tempName), _T("IOIO Uart %d"), i); AddPort(df, DeviceConfig::PortType::IOIOUART, tempID, tempName, AndroidIOIOUartPort::getPortHelp(i)); } if (config.port_type == DeviceConfig::PortType::IOIOUART && config.ioio_uart_id < AndroidIOIOUartPort::getNumberUarts()) { _sntprintf(tempID, sizeof(tempID), _T("%d"), config.ioio_uart_id); df.SetAsString(tempID); } #endif }
void TaskPropertiesPanel::InitView() { WndProperty* wp; 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 } }; LoadFormProperty(form, _T("prpStartHeightRef"), start_max_height_ref_list, (unsigned)HeightReferenceType::AGL); 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 } }; LoadFormProperty(form, _T("prpFinishHeightRef"), finish_min_height_ref_list, (unsigned)HeightReferenceType::AGL); wp = (WndProperty *)form.FindByName(_T("prpTaskType")); if (wp) { const std::vector<TaskFactoryType> factory_types = ordered_task->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] == ordered_task->GetFactoryType()) dfe->Set((unsigned)factory_types[i]); } wp->RefreshDisplay(); } }
static void InitView() { WndProperty* wp; static const StaticEnumChoice start_max_height_ref_list[] = { { hrAGL, N_("AGL"), N_("Reference AGL for start maximum height rule (above start point)") }, { hrMSL, N_("MSL"), N_("Reference MSL for start maximum height rule (above sea level)") }, { 0 } }; LoadFormProperty(*wf, _T("prpStartHeightRef"), start_max_height_ref_list, hrAGL); static const StaticEnumChoice finish_min_height_ref_list[] = { { hrAGL, N_("AGL"), N_("Reference AGL for finish minimum height rule (above finish point)") }, { hrMSL, N_("MSL"), N_("Reference MSL for finish minimum height rule (above sea level)") }, { 0 } }; LoadFormProperty(*wf, _T("prpFinishHeightRef"), finish_min_height_ref_list, hrAGL); wp = (WndProperty*)wf->FindByName(_T("prpTaskType")); if (wp) { const std::vector<TaskBehaviour::Factory_t> factory_types = ordered_task->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] == ordered_task->get_factory_type()) dfe->Set((unsigned)factory_types[i]); } wp->RefreshDisplay(); } }
void InfoBoxesConfigWidget::Prepare(ContainerWindow &parent, const PixelRect &rc) { const Layout layout(rc, geometry); AddText(_("Name"), nullptr, allow_name_change ? (const TCHAR *)data.name : gettext(data.name)); SetReadOnly(NAME, !allow_name_change); DataFieldEnum *dfe = new DataFieldEnum(this); for (unsigned i = 0; i < layout.info_boxes.count; ++i) { TCHAR label[32]; _stprintf(label, _T("%u"), i + 1); dfe->addEnumText(label, i); } Add(_("InfoBox"), nullptr, dfe); dfe = new DataFieldEnum(this); 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); Add(_("Content"), nullptr, dfe); ContainerWindow &form_parent = (ContainerWindow &)RowFormWidget::GetWindow(); AddRemaining(new WndFrame(form_parent, GetLook(), rc)); WindowStyle button_style; button_style.Hide(); button_style.TabStop(); const auto &button_look = GetLook().button; copy_button.Create(parent, button_look, _("Copy"), layout.copy_button, button_style, *this, COPY); paste_button.Create(parent, button_look, _("Paste"), layout.paste_button, button_style, *this, PASTE); close_button.Create(parent, button_look, _("Close"), layout.close_button, button_style, dialog, mrOK); WindowStyle preview_style; preview_style.EnableDoubleClicks(); preview_style.Hide(); previews.resize(layout.info_boxes.count); for (unsigned i = 0; i < layout.info_boxes.count; ++i) { previews[i].SetParent(*this, i); previews[i].Create(parent, layout.info_boxes.positions[i], preview_style); } current_preview = 0; RefreshEditContent(); RefreshPasteButton(); }
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(); } AddTime(_("AAT min. time"), _("Default AAT min. time for new AAT tasks."), 60, 10 * 60 * 60, 60, (unsigned)task_behaviour.ordered_defaults.aat_min_time); AddTime(_("Optimisation margin"), _("Safety margin for AAT task optimisation. Optimisation " "seeks to complete the task at the minimum time plus this margin time."), 0, 30 * 60, 60, (unsigned)task_behaviour.optimise_targets_margin); SetExpertRow(AATTimeMargin); SetStartLabel(); SetFinishLabel(); }
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; }
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); const UPixelScalar button_height = Layout::Scale(28); PixelRect button_rc = rc; button_rc.right = button_rc.left + button_width; button_rc.top = button_rc.bottom - button_height; WndButton *close_button = new WndButton(client_area, dialog_look.button, _("Close"), button_rc, button_style, *wf, mrOK); button_rc.left += button_width + Layout::Scale(2); button_rc.right += button_width + Layout::Scale(2); WndButton *copy_button = new WndButton(client_area, dialog_look.button, _("Copy"), button_rc, button_style, OnCopy); button_rc.left += button_width + Layout::Scale(2); button_rc.right += button_width + Layout::Scale(2); buttonPaste = new WndButton(client_area, dialog_look.button, _("Paste"), button_rc, button_style, OnPaste); RefreshPasteButton(); int result = wf->ShowModal(); if (result == mrOK && allow_name_change) data.name = edit_name->GetDataField()->GetAsString(); delete wf; delete edit_name; delete edit_select; delete edit_content; delete close_button; delete copy_button; delete buttonPaste; bool changed = false; if (result == mrOK) { for (unsigned i = 0; i < InfoBoxSettings::Panel::MAX_CONTENTS; ++i) if (data.contents[i] != data_r.contents[i]) changed = true; changed |= (_tcscmp(data.name, data_r.name) != 0); if (changed) data_r = data; } return changed; }
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): 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(); }
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); }