Пример #1
0
        private void GenOutputUI()
        {
            outputPanel = new FlowLayoutPanel() { Dock = DockStyle.Fill, AutoScroll = true };
            contentPanel.Controls.Add(outputPanel);

            #region Controls

            #region File Options

            addToPanel(outputPanel, STP.Rgi.RgiEngine.AddSeparator("File Options"), null);

            addToPanel(outputPanel,
                STP.Rgi.RgiEngine.AddBool(
                    "Use .h extention for enum and struct definition files instead of .nxc",
                    SettingsManager.UseCExtention,
                    true
                ),
                "Use .h Extention"
            );

            #endregion

            #region Formatting

            addToPanel(outputPanel, STP.Rgi.RgiEngine.AddSeparator("Code Formatting"), null);

            addToPanel(outputPanel,
                STP.Rgi.RgiEngine.AddBool(
                    "Include Code Comments in Output",
                    SettingsManager.UseComments,
                    true
                ),
                "comments"
            );
            #endregion

            #region Tabs
            addToPanel(outputPanel, STP.Rgi.RgiEngine.AddSeparator("Tabs"), null);

            #region Controls

            addToPanel(outputPanel,
                STP.Rgi.RgiEngine.AddBool("Use Tabs", SettingsManager.TabString == "\t", true),
                "tabs"
            ).ValueChanged +=new STP.Rgi.RgiValueUpdated(useTabCharCtrl_ValueChanged);

            tabSpacesCtrl =
                STP.Rgi.RgiEngine.AddInteger(
                    "Use Spaces",
                    SettingsManager.TabSpaces,
                    4,  //Default
                    0,  //Min
                    10, //Max
                    true
                );
            (addToPanel(outputPanel, tabSpacesCtrl, "tabSpace") as Control).Enabled =SettingsManager.TabString != "\t";
            #endregion

            #endregion

            #endregion
        }
Пример #2
0
        private void GenCodeAppearanceUI()
        {
            Color commandsColor, constantsColor, keywordsColor;
            string[] commands, constants, keywords;
            StreamReader sReader;

            #region Read Commands

            sReader = File.OpenText(
                new System.IO.FileInfo(System.Reflection.Assembly.GetExecutingAssembly().Location).DirectoryName + "\\Codeview\\commands.shf");
            string read = sReader.ReadLine();
            read = read.Replace("#COLOR=", "");
            commandsColor = Tools.stringToColor(read);
            read = sReader.ReadToEnd();
            commands = read.Split(new string[] { "\r\n" }, StringSplitOptions.RemoveEmptyEntries);
            sReader.Close();
            #endregion

            #region Read Constants

            sReader = File.OpenText(
                new System.IO.FileInfo(System.Reflection.Assembly.GetExecutingAssembly().Location).DirectoryName + "\\Codeview\\constants.shf");
            read = sReader.ReadLine();
            read = read.Replace("#COLOR=", "");
            constantsColor = Tools.stringToColor(read);
            read = sReader.ReadToEnd();
            constants = read.Split(new string[] { "\r\n" }, StringSplitOptions.RemoveEmptyEntries);
            sReader.Close();
            #endregion

            #region Read Keywords

            sReader = File.OpenText(
                new System.IO.FileInfo(System.Reflection.Assembly.GetExecutingAssembly().Location).DirectoryName + "\\Codeview\\keywords.shf");
            read = sReader.ReadLine();
            read = read.Replace("#COLOR=", "");
            keywordsColor = Tools.stringToColor(read);
            read = sReader.ReadToEnd();
            keywords = read.Split(new string[] { "\r\n" }, StringSplitOptions.RemoveEmptyEntries);
            sReader.Close();

            #endregion

            #region Panel Controls

            codeAppearancePanel = new FlowLayoutPanel()
            {
                Dock = DockStyle.Fill,
                AutoScroll = true,
                AutoScrollMargin = new Size(0, 0)
            };

            contentPanel.Controls.Add(codeAppearancePanel);

            #region Color Controls

            addToPanel(codeAppearancePanel,
                STP.Rgi.RgiEngine.AddSeparator("Syntax Colors"),
                null);

            commColor = addToPanel(codeAppearancePanel,
                STP.Rgi.RgiEngine.AddCompactColor("Commands Color", commandsColor, Color.FromArgb(11579568)),
                null);

            consColor = addToPanel(codeAppearancePanel,
                STP.Rgi.RgiEngine.AddCompactColor("Constants Color", constantsColor, Color.FromArgb(8388608)),
                null);

            keywColor = addToPanel(codeAppearancePanel,
                STP.Rgi.RgiEngine.AddCompactColor("Keywords Color", keywordsColor, Color.FromArgb(255)),
                null);

            #endregion

            #region Word Controls

            addToPanel(codeAppearancePanel,
                STP.Rgi.RgiEngine.AddSeparator("Syntax Word Groups"),
                null);

            commandsComp = addToPanel(codeAppearancePanel,
                STP.Rgi.RgiEngine.AddMultilineString(
                    "Commands",
                    commands,
                    new string[] { Properties.Resources.commandsDefault }
                ),
                null
            );

            constantsComp = addToPanel(codeAppearancePanel,
                STP.Rgi.RgiEngine.AddMultilineString(
                    "Constants",
                    constants,
                    new string[] { Properties.Resources.contantsDefault }
                ),
                null
            );

            keywordsComp = addToPanel(codeAppearancePanel,
                STP.Rgi.RgiEngine.AddMultilineString(
                    "Keywords",
                    keywords,
                    new string[] { Properties.Resources.keywordsDefault }
                ),
                null
            );

            #endregion

            #endregion
        }
Пример #3
0
        private void GenCompilerUI()
        {
            compilerPanel = new FlowLayoutPanel() { Dock = DockStyle.Fill, AutoScroll = true };
            contentPanel.Controls.Add(compilerPanel);

            STP.Rgi.IRgiComponent defComp = addToPanel(compilerPanel,
                STP.Rgi.RgiEngine.AddBool(
                    "Use Default Compiler",
                    SettingsManager.UseDefaultCompiler,
                    true
                ),
                "defCompiler"
            );
            defComp.ValueChanged += new STP.Rgi.RgiValueUpdated(defComp_ValueChanged);

            compilerLocCtrl =
                STP.Rgi.RgiEngine.AddFileBrowser(
                    "Compiler Location",
                    SettingsManager.CompilerLocation,
                    "NBC Compiler (nbc.exe)|nbc.exe"
                );

            (compilerLocCtrl as Control).Enabled = !SettingsManager.UseDefaultCompiler;
            addToPanel(compilerPanel, compilerLocCtrl, "compilerLoc");

            addToPanel(compilerPanel,
                STP.Rgi.RgiEngine.AddSeparator("Compiler Arguments"), null);

            addToPanel(compilerPanel,
                STP.Rgi.RgiEngine.AddInteger(
                    "Optimization Level",
                    SettingsManager.CompilerOptimization,
                    2, //Default
                    1, //Min
                    2  //Max
                ),
                "optimization"
            );

            addToPanel(compilerPanel, STP.Rgi.RgiEngine.AddBool(
                "Enhanced Firmware",
                SettingsManager.CompilerEnhFw,
                false),
                "enhFW"
            );
        }