// Update currentObj to reflect dragging to the given location. void DragTo(PointF location) { currentObj = (DescriptionCourseObj) startingObj.Clone(); currentObj.MoveHandle(handleDragging, location); }
// Create the course objects associated with this special. Assign the given layer to it. static CourseObj CreateDescriptionSpecial(EventDB eventDB, SymbolDB symbolDB, CourseView.DescriptionView descriptionView, CourseLayer layer) { Special special = eventDB.GetSpecial(descriptionView.SpecialId); Debug.Assert(special.kind == SpecialKind.Descriptions); DescriptionKind descKind; DescriptionLine[] description = GetCourseDescription(eventDB, symbolDB, descriptionView.CourseDesignator, out descKind); CourseObj courseObj = new DescriptionCourseObj(descriptionView.SpecialId, special.locations[0], (float)Geometry.Distance(special.locations[0], special.locations[1]), symbolDB, description, descKind, special.numColumns); courseObj.layer = layer; return courseObj; }
public override MapViewer.DragAction LeftButtonDown(Pane pane, PointF location, float pixelSize, ref bool displayUpdateNeeded) { if (pane != Pane.Map) return MapViewer.DragAction.None; // Begin dragging out the description block; start at 1 column startLocation = location; startingObj = new DescriptionCourseObj(Id<Special>.None, startLocation, 1F, symbolDB, description, kind, 1); handleDragging = new PointF(startingObj.rect.Right, startingObj.rect.Top); DragTo(location); displayUpdateNeeded = true; return MapViewer.DragAction.ImmediateDrag; }