Exemple #1
0
        private void button1_Click(object sender, EventArgs e)
        {
            globalSettings.Save();
            colorSettings.Save();
            prioritySettings.Save();
            opacitySettings.Save();
            sizeSettings.Save();
            shapeSettings.Save();

            SaveSettings(savedEntityBox);

            DialogResult = DialogResult.OK;
            Close();
        }
Exemple #2
0
        public static void LoadSettings(EntityBox entityBox)
        {
            Properties.Settings settings = Properties.Settings.Default;

            /// Load global settings

            GlobalSettings global = new GlobalSettings(entityBox);

            global.SelectEntitiesAfterAdd = settings.SelectEntitiesAfterAdd;
            global.Grayscale         = settings.Grayscale;
            global.Lambda            = settings.Lambda;
            global.LockScroll0       = settings.LockScroll0;
            global.LockScroll1       = settings.LockScroll1;
            global.LockScroll2       = settings.LockScroll2;
            global.LockZoom0         = settings.LockZoom0;
            global.LockZoom1         = settings.LockZoom1;
            global.LockZoom2         = settings.LockZoom2;
            global.HideGrid          = settings.HideGrid;
            global.HideLambdaMetrics = settings.HideLambdaMetrics;
            global.CellTextAlignment = (TextAlignment)settings.CellTextAlignment;
            global.ViasTextAlignment = (TextAlignment)settings.ViasTextAlignment;
            global.WireTextAlignment = (TextAlignment)settings.WireTextAlignment;

            global.Save();

            /// Load color settings
            ///

            ColorSettings color = new ColorSettings(entityBox);

            color.SelectionBoxColor     = settings.SelectionBoxColor;
            color.ViasInputColor        = settings.ViasInputColor;
            color.ViasOutputColor       = settings.ViasOutputColor;
            color.ViasInoutColor        = settings.ViasInoutColor;
            color.ViasConnectColor      = settings.ViasConnectColor;
            color.ViasFloatingColor     = settings.ViasFloatingColor;
            color.ViasPowerColor        = settings.ViasPowerColor;
            color.ViasGroundColor       = settings.ViasGroundColor;
            color.WireInterconnectColor = settings.WireInterconnectColor;
            color.WirePowerColor        = settings.WirePowerColor;
            color.WireGroundColor       = settings.WireGroundColor;
            color.CellNotColor          = settings.CellNotColor;
            color.CellBufferColor       = settings.CellBufferColor;
            color.CellMuxColor          = settings.CellMuxColor;
            color.CellLogicColor        = settings.CellLogicColor;
            color.CellAdderColor        = settings.CellAdderColor;
            color.CellBusSuppColor      = settings.CellBusSuppColor;
            color.CellFlipFlopColor     = settings.CellFlipFlopColor;
            color.CellLatchColor        = settings.CellLatchColor;
            color.CellOtherColor        = settings.CellOtherColor;
            color.UnitRegfileColor      = settings.UnitRegfileColor;
            color.UnitMemoryColor       = settings.UnitMemoryColor;
            color.UnitCustomColor       = settings.UnitCustomColor;
            color.SelectionColor        = settings.SelectionColor;
            color.ViasOverrideColor     = settings.ViasOverrideColor;
            color.WireOverrideColor     = settings.WireOverrideColor;
            color.CellOverrideColor     = settings.CellOverrideColor;
            color.RegionOverrideColor   = settings.RegionOverrideColor;

            color.Save();

            /// Load priority settings
            ///

            PrioritySettings priority = new PrioritySettings(entityBox);

            priority.ViasPriority   = settings.ViasPriority;
            priority.WirePriority   = settings.WirePriority;
            priority.CellPriority   = settings.CellPriority;
            priority.BeaconPriority = settings.BeaconPriority;
            priority.RegionPriority = settings.RegionPriority;
            priority.AutoPriority   = settings.AutoPriority;

            priority.Save();

            /// Load opacity settings
            ///

            OpacitySettings opacity = new OpacitySettings(entityBox);

            opacity.ViasOpacity = settings.ViasOpacity;
            opacity.WireOpacity = settings.WireOpacity;
            opacity.CellOpacity = settings.CellOpacity;

            opacity.Save();

            /// Load shape settings
            ///

            ShapeSettings shape = new ShapeSettings(entityBox);

            shape.ViasShape = (ViasShape)settings.ViasShape;

            shape.Save();

            entityBox.Invalidate();
        }