/** * Checks whether the selection is still on the valid target and if not tries * to select the next one */ void FlarmTrafficWindow::UpdateSelector() { if (small || !data.FLARM_Available) SetTarget(-1); else if (selection < 0 || (!data.FLARM_Traffic[selection].defined() && !SelectNearTarget(sc[selection].x, sc[selection].y, radius * 2))) NextTarget(); }
bool FlarmTrafficControl::OnMouseUp(PixelScalar x, PixelScalar y) { const TCHAR *gesture = gestures.Finish(); if (gesture && on_mouse_gesture(gesture)) return true; if (!WarningMode()) SelectNearTarget(x, y, Layout::Scale(15)); return true; }
bool FlarmTrafficControl::on_mouse_up(int x, int y) { if (XCSoarInterface::SettingsComputer().EnableGestures) { const char* gesture = gestures.Finish(); if (gesture && on_mouse_gesture(gesture)) return true; } if (!WarningMode()) SelectNearTarget(x, y, Layout::Scale(15)); return true; }
bool FlarmTrafficControl::OnMouseUp(PixelScalar x, PixelScalar y) { if (dragging) { StopDragging(); const TCHAR *gesture = gestures.Finish(); if (gesture && OnMouseGesture(gesture)) return true; } if (!WarningMode()) SelectNearTarget(x, y, Layout::Scale(15)); return true; }
/** * Checks whether the selection is still on the valid target and if not tries * to select the next one */ void FlarmTrafficWindow::UpdateSelector(const FlarmId id, const RasterPoint pt) { // Update #selection if (!id.IsDefined()) SetTarget(-1); else SetTarget(id); // If we don't have a valid selection and we can't find // a target close to to the RasterPoint we select the next one // on the internal list if (selection < 0 && ( pt.x < 0 || pt.y < 0 || !SelectNearTarget(pt.x, pt.y, radius * 2)) ) NextTarget(); }