static void OnAirspaceListEnter(WindowControl * Sender, WndListFrame::ListInfo_t *ListInfo) { (void)Sender; ItemIndex = ListInfo->ItemIndex + ListInfo->ScrollIndex; if (ItemIndex>=AIRSPACECLASSCOUNT) { ItemIndex = AIRSPACECLASSCOUNT-1; } if (ItemIndex>=0) { if (colormode) { int c = dlgAirspaceColoursShowModal(); if (c>=0) { MapWindow::iAirspaceColour[ItemIndex] = c; changed = true; } int p = dlgAirspacePatternsShowModal(); if (p>=0) { MapWindow::iAirspaceBrush[ItemIndex] = p; changed = true; } } else { int v = (MapWindow::iAirspaceMode[ItemIndex]+1)%4; MapWindow::iAirspaceMode[ItemIndex] = v; // wAirspaceList->Redraw(); changed = true; } } }
static void OnAirspaceListEnter(WindowControl * Sender, WndListFrame::ListInfo_t *ListInfo) { (void)Sender; ItemIndex = ListInfo->ItemIndex + ListInfo->ScrollIndex; if (ItemIndex>=AIRSPACECLASSCOUNT) { ItemIndex = AIRSPACECLASSCOUNT-1; } if (ItemIndex>=0) { if (colormode) { int c = dlgAirspaceColoursShowModal(); if (c>=0) { XCSoarInterface::SetSettingsMap().iAirspaceColour[ItemIndex] = c; SetRegistryColour(ItemIndex, XCSoarInterface::SettingsMap().iAirspaceColour[ItemIndex]); changed = true; } int p = dlgAirspacePatternsShowModal(); if (p>=0) { XCSoarInterface::SetSettingsMap().iAirspaceBrush[ItemIndex] = p; SetRegistryBrush(ItemIndex, XCSoarInterface::SettingsMap().iAirspaceBrush[ItemIndex]); changed = true; } } else { int v = (XCSoarInterface::SettingsComputer().iAirspaceMode[ItemIndex]+1)%4; XCSoarInterface::SetSettingsComputer().iAirspaceMode[ItemIndex] = v; Profile::SetRegistryAirspaceMode(ItemIndex); changed = true; } } }
static void OnAirspaceListEnter(unsigned index) { assert(index < AIRSPACECLASSCOUNT); AirspaceComputerSettings &computer = CommonInterface::SetComputerSettings().airspace; AirspaceRendererSettings &renderer = CommonInterface::SetMapSettings().airspace; if (color_mode) { AirspaceLook &look = CommonInterface::main_window.SetLook().map.airspace; int color_index = dlgAirspaceColoursShowModal(); if (color_index >= 0) { renderer.classes[index].color = AirspaceLook::preset_colors[color_index]; ActionInterface::SendMapSettings(); Profile::SetAirspaceColor(index, renderer.classes[index].color); changed = true; look.Initialise(renderer); } #ifdef HAVE_HATCHED_BRUSH #ifdef HAVE_ALPHA_BLEND if (!renderer.transparency || !AlphaBlendAvailable()) { #endif int pattern_index = dlgAirspacePatternsShowModal(look); if (pattern_index >= 0) { renderer.classes[index].brush = pattern_index; ActionInterface::SendMapSettings(); Profile::SetAirspaceBrush(index, renderer.classes[index].brush); changed = true; } #ifdef HAVE_ALPHA_BLEND } #endif #endif } else { renderer.classes[index].display = !renderer.classes[index].display; if (!renderer.classes[index].display) computer.warnings.class_warnings[index] = !computer.warnings.class_warnings[index]; Profile::SetAirspaceMode(index, renderer.classes[index].display, computer.warnings.class_warnings[index]); changed = true; } airspace_list->Invalidate(); ActionInterface::SendMapSettings(); }
static void OnAirspaceListEnter(unsigned ItemIndex) { assert(ItemIndex < AIRSPACECLASSCOUNT); AirspaceComputerSettings &computer = CommonInterface::SetComputerSettings().airspace; AirspaceRendererSettings &renderer = CommonInterface::SetMapSettings().airspace; if (colormode) { int c = dlgAirspaceColoursShowModal(); if (c >= 0) { renderer.colours[ItemIndex] = c; ActionInterface::SendMapSettings(); Profile::SetAirspaceColor(ItemIndex, renderer.colours[ItemIndex]); changed = true; AirspaceLook &look = CommonInterface::main_window.SetLook().map.airspace; look.Initialise(renderer); } #ifdef HAVE_HATCHED_BRUSH #ifdef HAVE_ALPHA_BLEND if (!renderer.transparency || !AlphaBlendAvailable()) { #endif int p = dlgAirspacePatternsShowModal(); if (p >= 0) { renderer.brushes[ItemIndex] = p; ActionInterface::SendMapSettings(); Profile::SetAirspaceBrush(ItemIndex, renderer.brushes[ItemIndex]); changed = true; } #ifdef HAVE_ALPHA_BLEND } #endif #endif } else { renderer.display[ItemIndex] = !renderer.display[ItemIndex]; if (!renderer.display[ItemIndex]) computer.warnings.class_warnings[ItemIndex] = !computer.warnings.class_warnings[ItemIndex]; Profile::SetAirspaceMode(ItemIndex); changed = true; } wAirspaceList->invalidate(); ActionInterface::SendMapSettings(); }
static void OnAirspaceListEnter(unsigned ItemIndex) { assert(ItemIndex < AIRSPACECLASSCOUNT); AirspaceComputerSettings &computer = CommonInterface::SetSettingsComputer().airspace; AirspaceRendererSettings &renderer = CommonInterface::SetSettingsMap().airspace; if (colormode) { int c = dlgAirspaceColoursShowModal(); if (c >= 0) { renderer.colours[ItemIndex] = c; ActionInterface::SendSettingsMap(); Profile::SetAirspaceColor(ItemIndex, renderer.colours[ItemIndex]); changed = true; Graphics::InitAirspacePens(renderer); } #ifndef ENABLE_SDL #ifdef HAVE_ALPHA_BLEND if (!renderer.transparency || !AlphaBlendAvailable()) { #endif int p = dlgAirspacePatternsShowModal(); if (p >= 0) { renderer.brushes[ItemIndex] = p; ActionInterface::SendSettingsMap(); Profile::SetAirspaceBrush(ItemIndex, renderer.brushes[ItemIndex]); changed = true; } #ifdef HAVE_ALPHA_BLEND } #endif #endif } else { renderer.display[ItemIndex] = !renderer.display[ItemIndex]; if (!renderer.display[ItemIndex]) computer.warnings.class_warnings[ItemIndex] = !computer.warnings.class_warnings[ItemIndex]; Profile::SetAirspaceMode(ItemIndex); changed = true; } wAirspaceList->invalidate(); ActionInterface::SendSettingsMap(); }
void AirspaceClassRendererSettingsPanel::OnAction(int id) { if (id == BorderColor) border_color_changed |= ShowColorListDialog(settings.border_color); if (id == FillColor) fill_color_changed |= ShowColorListDialog(settings.fill_color); #ifdef HAVE_HATCHED_BRUSH if (id == FillBrush) { int pattern_index = dlgAirspacePatternsShowModal(UIGlobals::GetLook().map.airspace); if (pattern_index >= 0 && pattern_index != settings.brush) { settings.brush = pattern_index; fill_brush_changed = true; } } #endif }
static void OnAirspaceListEnter(unsigned ItemIndex) { assert(ItemIndex < AIRSPACECLASSCOUNT); if (colormode) { int c = dlgAirspaceColoursShowModal(); if (c >= 0) { XCSoarInterface::SetSettingsMap().iAirspaceColour[ItemIndex] = c; Profile::SetAirspaceColor(ItemIndex, XCSoarInterface::SettingsMap().iAirspaceColour[ItemIndex]); changed = true; Graphics::InitAirspacePens(XCSoarInterface::SettingsMap()); } int p = dlgAirspacePatternsShowModal(); if (p >= 0) { XCSoarInterface::SetSettingsMap().iAirspaceBrush[ItemIndex] = p; Profile::SetAirspaceBrush(ItemIndex, XCSoarInterface::SettingsMap().iAirspaceBrush[ItemIndex]); changed = true; } } else { SETTINGS_AIRSPACE &settings_airspace = XCSoarInterface::SetSettingsComputer(); bool display = settings_airspace.DisplayAirspaces[ItemIndex]; settings_airspace.DisplayAirspaces[ItemIndex] = !display; if (display) settings_airspace.airspace_warnings.class_warnings[ItemIndex] = !settings_airspace.airspace_warnings.class_warnings[ItemIndex]; Profile::SetAirspaceMode(ItemIndex); changed = true; } wAirspaceList->invalidate(); }