Beispiel #1
0
 /// <summary>
 /// Draw (print) the values of longitude and latitude
 /// </summary>
 /// <param name="editor">The patheditor for which we need to draw the status</param>
 public void Draw(PathEditor editor)
 {
     if (editor == null)
     {
         return;
     }
     if (!Properties.Settings.Default.showEditorAction)
     {
         return;
     }
     BasicShapes.DrawString(lowerLeft, DrawColors.colorsNormal.Text, editor.CurrentActionDescription);
 }
        /// <summary>
        /// Create the context menu. Needs to be done only once.
        /// </summary>
        public EditorContextMenu(PathEditor pathEditor, List <EditorAction> editorActions)
        {
            this.pathEditor = pathEditor;
            contextMenu     = new ContextMenu();

            noActionPossibleMenuItem        = new MenuItem();
            noActionPossibleMenuItem.Header = "No action possible\nPerhaps paths are not drawn.";
            contextMenu.Items.Add(noActionPossibleMenuItem);

            foreach (EditorAction action in editorActions)
            {
                contextMenu.Items.Add(action.ActionMenuItem);
            }
        }
Beispiel #3
0
        private void _Fixall(Collection <Path> Paths, Action <string> callback)
        {
            modifiedPaths = new List <PathEditor>();

            // Loop through all available paths and fix each of them
            foreach (ORTS.Menu.Path path in Paths)
            {
                callback(TrackViewer.catalog.GetString("Processing .pat file ") + path.FilePath);
                string     pathName     = ORTS.TrackViewer.UserInterface.MenuControl.MakePathMenyEntryName(path);
                PathEditor pathFixer    = new PathEditor(this.routeData, this.drawTrackDB, path);
                bool       fixSucceeded = pathFixer.AutoFixAllBrokenNodes();
                if (pathFixer.HasModifiedPath)
                {
                    if (pathFixer.HasBrokenPath)
                    {
                        pathsThatAre["ModifiedBroken"].Add(pathName);
                    }
                    else
                    {
                        pathsThatAre["ModifiedFine"].Add(pathName);
                    }
                    modifiedPaths.Add(pathFixer);
                }
                else
                {
                    if (pathFixer.HasBrokenPath)
                    {
                        pathsThatAre["UnmodifiedBroken"].Add(pathName);
                    }
                    else
                    {
                        pathsThatAre["UnmodifiedFine"].Add(pathName);
                    }
                }
            }
        }