Пример #1
0
        private static void SetPathColors(IPreferenceChanger preferenceChanger)
        {
            ColorWithHighlights brokenPath = new ColorWithHighlights(Color.Salmon, 40);

            brokenPath.MakeIntoUserPreference(preferenceChanger, "brokenpath",
                                              TrackViewer.catalog.GetString("Select broken path color"));

            ColorWithHighlights brokenNode = new ColorWithHighlights(Color.Red, 40);

            ColorWithHighlights pathMain = new ColorWithHighlights(Color.Yellow, 20);

            pathMain.MakeIntoUserPreference(preferenceChanger, "pathmain",
                                            TrackViewer.catalog.GetString("Select path color (main)"));
            ColorsGroupTrack pathMainGroup = new ColorsGroupTrack();

            pathMainGroup.TrackCurved   = pathMain;
            pathMainGroup.TrackStraight = pathMain;
            pathMainGroup.BrokenNode    = brokenNode;
            pathMainGroup.BrokenPath    = brokenPath;
            colorsPathMain.TrackColors  = pathMainGroup;

            ColorWithHighlights pathSiding = new ColorWithHighlights(Color.Orange, 20);

            pathSiding.MakeIntoUserPreference(preferenceChanger, "pathsiding",
                                              TrackViewer.catalog.GetString("Select path color (siding)"));
            ColorsGroupTrack pathSidingGroup = new ColorsGroupTrack();

            pathSidingGroup.TrackCurved   = pathSiding;
            pathSidingGroup.TrackStraight = pathSiding;
            pathSidingGroup.BrokenNode    = brokenNode;
            pathSidingGroup.BrokenPath    = brokenPath;
            colorsPathSiding.TrackColors  = pathSidingGroup;
        }
Пример #2
0
        private static void SetItemColors(IPreferenceChanger preferenceChanger)
        {
            ColorsGroupBasic itemColors = new ColorsGroupBasic();

            ColorWithHighlights itemColor;

            itemColor = new ColorWithHighlights(Color.Black, 40);
            itemColor.MakeIntoUserPreference(preferenceChanger, "text",
                                             TrackViewer.catalog.GetString("Select item text color"));
            itemColors.Text = itemColor;

            itemColor = new ColorWithHighlights(Color.Blue, 120);
            itemColor.MakeIntoUserPreference(preferenceChanger, "junction",
                                             TrackViewer.catalog.GetString("Select junction color"));
            itemColors.Junction = itemColor;

            itemColor = new ColorWithHighlights(Color.LimeGreen, 40);
            itemColor.MakeIntoUserPreference(preferenceChanger, "endnode",
                                             TrackViewer.catalog.GetString("Select endnode color"));
            itemColors.EndNode = itemColor;

            itemColor = new ColorWithHighlights(Color.Sienna, 40);
            itemColor.MakeIntoUserPreference(preferenceChanger, "siding",
                                             TrackViewer.catalog.GetString("Select siding color"));
            itemColors.Siding = itemColor;

            itemColor = new ColorWithHighlights(Color.Gray, 40);
            itemColor.MakeIntoUserPreference(preferenceChanger, "crossing",
                                             TrackViewer.catalog.GetString("Select crossing color"));
            itemColors.Crossing = itemColor;

            itemColor = new ColorWithHighlights(Color.DarkGray, 40);
            itemColor.MakeIntoUserPreference(preferenceChanger, "roadcrossing",
                                             TrackViewer.catalog.GetString("Select road crossing color"));
            itemColors.RoadCrossing = itemColor;

            itemColor = new ColorWithHighlights(Color.Purple, 40);
            itemColor.MakeIntoUserPreference(preferenceChanger, "speedpost",
                                             TrackViewer.catalog.GetString("Select speedpost color"));
            itemColors.Speedpost = itemColor;

            itemColor = new ColorWithHighlights(Color.Blue, 40);
            itemColors.CandidateNode = itemColor;

            itemColor             = new ColorWithHighlights(Color.Purple, 40);
            itemColors.ActiveNode = itemColor;

            itemColor = new ColorWithHighlights(Color.LightBlue, 40);
            itemColors.ClearWindowInset = itemColor;

            colorsNormal.TrackItemColors         = itemColors;
            colorsHighlight.TrackItemColors      = itemColors;
            colorsHotlight.TrackItemColors       = itemColors;
            colorsPathMain.TrackItemColors       = itemColors;
            colorsPathSiding.TrackItemColors     = itemColors;
            colorsRoads.TrackItemColors          = itemColors;
            colorsRoadsHighlight.TrackItemColors = itemColors;
            colorsRoadsHotlight.TrackItemColors  = itemColors;
        }
Пример #3
0
        private static void SetBasicColors(IPreferenceChanger preferenceChanger)
        {
            ColorsGroupBasic basicColors = new ColorsGroupBasic();

            ColorWithHighlights basicColor;

            basicColor = new ColorWithHighlights(Color.Black, 40);
            basicColor.MakeIntoUserPreference(preferenceChanger, "text",
                                              TrackViewer.catalog.GetString("Select text color"));
            basicColors.Text = basicColor;
        }
Пример #4
0
        private static void SetBackgroundColors(IPreferenceChanger preferenceChanger)
        {
            ColorWithHighlights fixedBackgroundColor    = new ColorWithHighlights(Color.White, 20);
            ColorWithHighlights changingBackgroundColor = new ColorWithHighlights(Color.PaleGreen, 20);

            changingBackgroundColor.MakeIntoUserPreference(preferenceChanger, "background",
                                                           TrackViewer.catalog.GetString("Select background color"));
            backgroundWithoutTilesGroup.Tile        = changingBackgroundColor;
            backgroundWithoutTilesGroup.ClearWindow = changingBackgroundColor;
            backgroundWithTilesGroup.Tile           = changingBackgroundColor;
            backgroundWithTilesGroup.ClearWindow    = fixedBackgroundColor;
        }
Пример #5
0
        private static void SetTrackColors(IPreferenceChanger preferenceChanger)
        {
            ColorWithHighlights trackColorColouredStraight     = new ColorWithHighlights(Color.Black, Color.Red, Color.LightGoldenrodYellow);
            ColorWithHighlights trackColorColouredCurved       = new ColorWithHighlights(Color.Green, Color.Tomato, Color.LightGoldenrodYellow);
            ColorWithHighlights roadTrackColorColouredStraight = new ColorWithHighlights(Color.Gray, 40);
            ColorWithHighlights roadTrackColorColouredCurved   = new ColorWithHighlights(Color.DarkOliveGreen, 40);

            trackGroupColoured.TrackStraight     = trackColorColouredStraight;
            trackGroupColoured.TrackCurved       = trackColorColouredCurved;
            roadTrackGroupColoured.TrackStraight = roadTrackColorColouredStraight;
            roadTrackGroupColoured.TrackCurved   = roadTrackColorColouredCurved;

            ColorWithHighlights trackColorFlat     = new ColorWithHighlights(Color.Black, Color.Tomato, Color.Red);
            ColorWithHighlights roadTrackColorFlat = new ColorWithHighlights(Color.DarkGray, 20);

            trackGroupFlat.TrackStraight     = trackColorFlat;
            trackGroupFlat.TrackCurved       = trackColorFlat;
            roadTrackGroupFlat.TrackStraight = roadTrackColorFlat;
            roadTrackGroupFlat.TrackCurved   = roadTrackColorFlat;

            ColorWithHighlights trackColorTerrain     = new ColorWithHighlights(Color.Aquamarine, 0);
            ColorWithHighlights roadTrackColorTerrain = new ColorWithHighlights(Color.LightGray, 0);

            trackGroupTerrain.TrackStraight     = trackColorTerrain;
            trackGroupTerrain.TrackCurved       = trackColorTerrain;
            roadTrackGroupTerrain.TrackStraight = roadTrackColorTerrain;
            roadTrackGroupTerrain.TrackCurved   = roadTrackColorTerrain;

            trackColorColouredStraight.MakeIntoUserPreference(preferenceChanger, "track_colored_straight", TrackViewer.catalog.GetString("Select color for multi-colored straight tracks"), true);
            trackColorColouredCurved.MakeIntoUserPreference(preferenceChanger, "track_colored_curved", TrackViewer.catalog.GetString("Select color for multi-colored curved tracks"), true);
            trackColorFlat.MakeIntoUserPreference(preferenceChanger, "track_flat", TrackViewer.catalog.GetString("Select color for mono-colored tracks"), true);
            trackColorTerrain.MakeIntoUserPreference(preferenceChanger, "track_terrain", TrackViewer.catalog.GetString("Select color for tracks on terrain"));

            roadTrackColorColouredStraight.MakeIntoUserPreference(preferenceChanger, "road_colored_straight", TrackViewer.catalog.GetString("Select color for multi-colored straight roads"), true);
            roadTrackColorColouredCurved.MakeIntoUserPreference(preferenceChanger, "road_colored_curved", TrackViewer.catalog.GetString("Select color for multi-colored curved roads"), true);
            roadTrackColorFlat.MakeIntoUserPreference(preferenceChanger, "road_flat", TrackViewer.catalog.GetString("Select color for mono-colored roads"), true);
            roadTrackColorTerrain.MakeIntoUserPreference(preferenceChanger, "road_terrain", TrackViewer.catalog.GetString("Select color for roads on terrain"));
        }
Пример #6
0
 /// <summary>
 /// Set the colors that (can) appear multiple times, each time with another shade.
 /// </summary>
 static void SetShadedColors(IPreferenceChanger preferenceChanger)
 {
     otherPathsReferenceColor = new ColorWithHighlights(Color.Fuchsia, 0);
     otherPathsReferenceColor.MakeIntoUserPreference(preferenceChanger, "otherPaths",
                                                     TrackViewer.catalog.GetString("Select other-paths color"));
 }