Example #1
0
        private void btnDefaults_Click(object sender, System.EventArgs e)
        {
            SettingsCover s = new SettingsCover();

            theSettings = s;
            gridOptions.Refresh();
            _bColorsSettingsChanged = true;
        }
Example #2
0
        private void frmOptions_Load(object sender, System.EventArgs e)
        {
            // Add items to the TreeView
            treeView1.Nodes.Add(new TreeNode("Environment"));
            treeView1.Nodes.Add(new TreeNode("Assembler"));
            treeView1.Nodes.Add(new TreeNode("Simulator"));

            // Load Settings
            theSettings = new SettingsCover();
            theSettings.UpdateGlobalSettings(false);

            // Environment Settings
            bagEnvironment           = new PropertyBag();
            bagEnvironment.GetValue += new PropertySpecEventHandler(this.bagEnvironment_GetValue);
            bagEnvironment.SetValue += new PropertySpecEventHandler(this.bagEnvironment_SetValue);

            bagEnvironment.Properties.Add(new PropertySpec("Text Color", typeof(Color),
                                                           "Colors", "Normal text color."));
            bagEnvironment.Properties.Add(new PropertySpec("Comments Color", typeof(Color),
                                                           "Colors", "Comments start after # sign."));
            bagEnvironment.Properties.Add(new PropertySpec("Labels Color", typeof(Color),
                                                           "Colors", "Labels are identifiers following by : that appears on start of lines."));
            bagEnvironment.Properties.Add(new PropertySpec("OS Functions Color", typeof(Color),
                                                           "Colors", "The simulator supports some high-level functions, as printf, getchar, etc.\nThese functions are known as operation system functions."));
            bagEnvironment.Properties.Add(new PropertySpec("Directives Color", typeof(Color),
                                                           "Colors", "Directives are commands meant for the assembler, that doesn't appear on the final machine code. Examples: .word, .space"));
            bagEnvironment.Properties.Add(new PropertySpec("Commands Color", typeof(Color),
                                                           "Colors", "VAX11 commands (opcodes) color."));
            bagEnvironment.Properties.Add(new PropertySpec("Strings Color", typeof(Color),
                                                           "Colors", "Strings are text appear betweens \"\"."));
            bagEnvironment.Properties.Add(new PropertySpec("Background Color", typeof(Color),
                                                           "Colors", "Documents Background Color."));
            bagEnvironment.Properties.Add(new PropertySpec("Current Line Color", typeof(Color),
                                                           "Colors", "Color of the next line that will be executed (debug mode)"));
            bagEnvironment.Properties.Add(new PropertySpec("Break Point Color", typeof(Color),
                                                           "Colors", "Break Point Color"));
            bagEnvironment.Properties.Add(new PropertySpec("Errors Color", typeof(Color),
                                                           "Colors", "The background color of the lines that the assembler finds errors at"));

            curScheme = InterfaceColorSchemes.Current;
            bagEnvironment.Properties.Add(new PropertySpec("Color Scheme", typeof(InterfaceColorSchemes),
                                                           "Colors", "Color scheme is predefined sets of colors for the simulator"));

            bagEnvironment.Properties.Add(new PropertySpec("Do Syntax Highlight", typeof(bool),
                                                           "General", "Select if the environment should highlight special VAX11 words."));
            bagEnvironment.Properties.Add(new PropertySpec("Show LST file after compile", typeof(bool),
                                                           "General", "If set, the LST file created during the compilation will be displayed after compile ends successfully."));
            bagEnvironment.Properties.Add(new PropertySpec("Show Agent on Startup", typeof(bool),
                                                           "General", "The agent, Merlin, is welcome the users of VAX11 Simulator every time the program runs."));

            // Canceled due to .Net bug.
//			bagEnvironment.Properties.Add(new PropertySpec("Load last opened file on startup", typeof(bool),
//				"General", "If selected, every time the program runs, it will try to open the last file the user worked on."));

            // Assembler
            bagAssembler           = new PropertyBag();
            bagAssembler.GetValue += new PropertySpecEventHandler(this.bagAssembler_GetValue);
            bagAssembler.SetValue += new PropertySpecEventHandler(this.bagAssembler_SetValue);
            bagAssembler.Properties.Add(new PropertySpec("Optimize Code", typeof(bool),
                                                         "General", "VAX11 Simulator generates smaller code than the old SIM simulator used by the Technion. Set this option to false if you wish the assembler to generate code as SIM does, without its enhancements."));
            bagAssembler.Properties.Add(new PropertySpec("Save LST file after compile", typeof(bool),
                                                         "General", "Select if the assembler should save LST file after successful compilation. LST file is text file containing the machine code and the source code of the compiled program."));

            // Simulator
            bagSimulator           = new PropertyBag();
            bagSimulator.GetValue += new PropertySpecEventHandler(this.bagSimulator_GetValue);
            bagSimulator.SetValue += new PropertySpecEventHandler(this.bagSimulator_SetValue);

            bagSimulator.Properties.Add(new PropertySpec("Clock Resolution", typeof(int),
                                                         "Clock", "Time in milliseconds between clock ticks."));

            bagSimulator.Properties.Add(new PropertySpec("Text Color", typeof(Color),
                                                         "Console", "The color of the console's output."));
            bagSimulator.Properties.Add(new PropertySpec("Background Color", typeof(Color),
                                                         "Console", "Background color for the console."));
            bagSimulator.Properties.Add(new PropertySpec("Always On Top on Debug Mode", typeof(bool),
                                                         "Console", "If selected, the console window of debugged application will be above all other windows, even when deactived."));

            bagSimulator.Properties.Add(new PropertySpec("Show Registers in Hex", typeof(bool),
                                                         "General", "If true, while debugging, the registers values will be displayed in Hex basis. Else it will be displayed as decimal numbers."));
            bagSimulator.Properties.Add(new PropertySpec("Show Special Registers", typeof(bool),
                                                         "General", "If true, while debugging, the special VAX11 registers will be displayed among the general registers."));
            bagSimulator.Properties.Add(new PropertySpec("Show Debug Information", typeof(bool),
                                                         "General", "If true, detailed information about the machine state will be printed when run-time errors occurs."));

            bagSimulator.Properties.Add(new PropertySpec("SP Startup Location", typeof(int),
                                                         "Stack", "Select the startup location for the simulator's Stack Pointer."));
            bagSimulator.Properties.Add(new PropertySpec("Stack Maximum Size", typeof(int),
                                                         "Stack", "Select the maximum size for the simulator's Stack Pointer."));

            bagSimulator.Properties.Add(new PropertySpec("Page Size", typeof(int),
                                                         "Memory", "Memory Page Size"));
            bagSimulator.Properties.Add(new PropertySpec("Physical Memory Size", typeof(int),
                                                         "Memory", "Physical Memory Size. The memory size should be multiple of the page size."));
            bagSimulator.Properties.Add(new PropertySpec("Show Memory Accesses", typeof(bool),
                                                         "Memory", "If selected, the simulator will display information about accesses to memory after each command."));
            bagSimulator.Properties.Add(new PropertySpec("Enable Physical Memory Simulation", typeof(bool),
                                                         "Memory", "If selected, the physical memory simulation engine will be enabled. Note that it will reduce the simulator performance by around 30%"));
            bagSimulator.Properties.Add(new PropertySpec("Show Physical Addresses", typeof(bool),
                                                         "Memory", "If selected, the simulator will show \"physical\" addressing for every virtual address."));
            bagSimulator.Properties.Add(new PropertySpec("Show Page Faults", typeof(bool),
                                                         "Memory", "If selected, the simulator will display message when page-fault occurs."));
            bagSimulator.Properties.Add(new PropertySpec("Fill Memory with Garbage", typeof(bool),
                                                         "Memory", "If true, uninitalize memory cells will contain garbage. If false, it will contain zeros"));

            // Select the environment settings
            treeView1.SelectedNode = treeView1.Nodes[0];
        }