Пример #1
0
        private void OnEditorLoad(object Sender, EventArgs Args)
        {
            // 初期化
            InitializeList(MacroName);
            InitializeEditorColor();

            // ドキュメントをロード
            Llbl_Document.Text = "Open " + MacroName + " document";
            DocumentLink       = SettingsFunctionLibrary.GetDocumentLink(MacroName);

            // 編集モードならパラメータをUIに反映させる
            if (!string.IsNullOrEmpty(EditTarget))
            {
                ReflectParameterInList();
            }

            // テンプレートのチェックボックスの設定
            TemplateString = SettingsFunctionLibrary.GetTemplateString(MacroName);
            if (string.IsNullOrEmpty(TemplateString) || !string.IsNullOrEmpty(EditTarget))
            {
                Cb_WithTemplate.Enabled = false;
                Cb_WithTemplate.Checked = false;
                Cb_WithTemplate.Visible = false;
            }
        }
Пример #2
0
        private void InitializeEditorColor()
        {
            Color MainFrameColor  = SettingsFunctionLibrary.GetMainFrameColor();
            Color BackgroundColor = SettingsFunctionLibrary.GetBackgroundColor();
            Color TextColor       = SettingsFunctionLibrary.GetTextColor();
            Color LinkColor       = SettingsFunctionLibrary.GetLinkColor();

            Pnl_Parameters.BackColor = MainFrameColor;
            Flp_Document.BackColor   = MainFrameColor;
            Tlp_ArgsPannel.BackColor = MainFrameColor;
            Tlp_Arguments.BackColor  = MainFrameColor;
            Btn_OK.BackColor         = MainFrameColor;
            Btn_Cancel.BackColor     = MainFrameColor;
            this.BackColor           = BackgroundColor;
            Lbl_Arguments.ForeColor  = TextColor;
            Lbl_Name.ForeColor       = TextColor;
            Lbl_Type.ForeColor       = TextColor;
            Cb_IsEvent.ForeColor     = TextColor;
            Cb_HasRetVal.ForeColor   = TextColor;
            Cb_IsDynamic.ForeColor   = TextColor;
            Cb_IsMulticast.ForeColor = TextColor;
            Btn_OK.ForeColor         = TextColor;
            Btn_Cancel.ForeColor     = TextColor;
            Llbl_Document.ForeColor  = LinkColor;
        }
Пример #3
0
        private void OnEditorLoad(object Sender, EventArgs Args)
        {
            // ドキュメントをロード
            DocumentLink = SettingsFunctionLibrary.GetDocumentLink("Delegate");

            InitializeList();
            InitializeEditorColor();

            if (!string.IsNullOrEmpty(EditTarget))
            {
                ReflectParameterInList();
            }
        }
Пример #4
0
        private Button CreateArgumentsButton(bool bIsAdd)
        {
            Button ArgumentsButton = new Button();

            ArgumentsButton.FlatStyle = FlatStyle.Popup;
            ArgumentsButton.BackColor = SettingsFunctionLibrary.GetBackgroundColor();
            ArgumentsButton.ForeColor = SettingsFunctionLibrary.GetTextColor();
            ArgumentsButton.Width     = 150;
            ArgumentsButton.Text      = (bIsAdd ? " + Add" : " - Remove");
            ArgumentsButton.Click    += (bIsAdd ? new EventHandler(OnAddArgumentsButtonClicked) : new EventHandler(OnRemoveArgumentsButtonClicked));

            return(ArgumentsButton);
        }
Пример #5
0
        private void InitializeEditorColor()
        {
            Color MainFrameColor  = SettingsFunctionLibrary.GetMainFrameColor();
            Color BackgroundColor = SettingsFunctionLibrary.GetBackgroundColor();
            Color TextColor       = SettingsFunctionLibrary.GetTextColor();

            Lb_Selecter.BackColor = MainFrameColor;
            Btn_OK.BackColor      = MainFrameColor;
            Btn_Cancel.BackColor  = MainFrameColor;
            this.BackColor        = BackgroundColor;
            Lb_Selecter.ForeColor = TextColor;
            Btn_OK.ForeColor      = TextColor;
            Btn_Cancel.ForeColor  = TextColor;
        }
Пример #6
0
        private void InitializeEditorColor()
        {
            Color MainFrameColor  = SettingsFunctionLibrary.GetMainFrameColor();
            Color BackgroundColor = SettingsFunctionLibrary.GetBackgroundColor();
            Color TextColor       = SettingsFunctionLibrary.GetTextColor();
            Color LinkColor       = SettingsFunctionLibrary.GetLinkColor();

            Pnl_Parameters.BackColor = MainFrameColor;
            Flp_Document.BackColor   = MainFrameColor;
            Tlp_ArgsPannel.BackColor = MainFrameColor;
            Tlp_Arguments.BackColor  = MainFrameColor;
            Btn_OK.BackColor         = MainFrameColor;
            Btn_Cancel.BackColor     = MainFrameColor;
            this.BackColor           = BackgroundColor;
            Lbl_Arguments.ForeColor  = TextColor;
            Lbl_Selecter1.ForeColor  = TextColor;
            Lbl_Selecter2.ForeColor  = TextColor;
            Lbl_Input.ForeColor      = TextColor;
            Btn_OK.ForeColor         = TextColor;
            Btn_Cancel.ForeColor     = TextColor;
            Llbl_Document.ForeColor  = LinkColor;
        }
Пример #7
0
        private void InitializeEditorColor()
        {
            Color MainFrameColor  = SettingsFunctionLibrary.GetMainFrameColor();
            Color BackgroundColor = SettingsFunctionLibrary.GetBackgroundColor();
            Color TextColor       = SettingsFunctionLibrary.GetTextColor();
            Color LinkColor       = SettingsFunctionLibrary.GetLinkColor();

            Cl_MacroSpecifiers.BackColor           = MainFrameColor;
            Tlp_AdvancedSettings.BackColor         = MainFrameColor;
            Tlp_MetaSpecifiers.BackColor           = MainFrameColor;
            Flp_Document.BackColor                 = MainFrameColor;
            ScrollPanel_AdvancedSettings.BackColor = MainFrameColor;
            ScrollPanel_MetaSpecifiers.BackColor   = MainFrameColor;
            Btn_OK.BackColor             = MainFrameColor;
            Btn_Cancel.BackColor         = MainFrameColor;
            this.BackColor               = BackgroundColor;
            Cl_MacroSpecifiers.ForeColor = TextColor;
            Cb_WithTemplate.ForeColor    = TextColor;
            Btn_OK.ForeColor             = TextColor;
            Btn_Cancel.ForeColor         = TextColor;
            Llbl_Document.ForeColor      = LinkColor;
        }
Пример #8
0
        private void InitializeList()
        {
            Tlp_Arguments.SuspendLayout();
            Tlp_Arguments.RowCount = 0;
            Tlp_Arguments.RowStyles.Clear();

            string[]        SelecterNames = new string[2];
            Label[]         Labels        = new Label[] { Lbl_Selecter1, Lbl_Selecter2 };
            List <string[]> SelecterItems = new List <string[]>();

            ComboBox[] Selecters = new ComboBox[] { Cb_Selecter1, Cb_Selecter2 };

            if (MacroName == "UE_LOG")
            {
                SelecterItems.Add(SettingsFunctionLibrary.GetLogCategory());
                SelecterItems.Add(XmlFunctionLibrary.GetLogVerbosity());
                SelecterNames[0]      = "CategoryName";
                SelecterNames[1]      = "Verbosity";
                Lbl_Input.Text        = "Format";
                Tb_Input.TextChanged += new EventHandler(OnTextChanged);

                Cb_Selecter1.SelectedText = "LogTemp";
                Cb_Selecter2.SelectedText = "Log";
            }
            else
            {
                var Verbosities = XmlFunctionLibrary.GetLogVerbosity();
                SelecterItems.Add(Verbosities);
                SelecterItems.Add(Verbosities);
                SelecterNames[0]          = "DefaultVerbosity";
                SelecterNames[1]          = "CompileTimeVerbosity";
                Cb_Selecter1.SelectedText = "Log";
                Cb_Selecter2.SelectedText = "All";
                Lbl_Input.Text            = "CategoryName";
                Lbl_Arguments.Text        = "MacroType";

                string[]      MacroTypes    = XmlFunctionLibrary.GetMacroTypes(false, false, true);
                List <string> LogMacroTypes = new List <string>();
                foreach (var MacroType in MacroTypes)
                {
                    if (MacroType.Contains("LOG_CATEGORY"))
                    {
                        LogMacroTypes.Add(MacroType);
                    }
                }

                ComboBox Type = new ComboBox();
                Type.Items.AddRange(LogMacroTypes.ToArray());
                Type.Width = 300;
                Type.SelectedIndexChanged += new EventHandler(OnMacroTypeChanged);

                if (!string.IsNullOrEmpty(EditTarget))
                {
                    Type.Text = MacroName;
                }
                else
                {
                    Type.SelectedIndex = 0;
                    MacroName          = Type.Text;
                }

                Tlp_Arguments.Controls.Add(Type);
            }

            for (int Index = 0; Index < Selecters.Length; Index++)
            {
                if (!string.IsNullOrEmpty(SelecterNames[Index]))
                {
                    Labels[Index].Text = SelecterNames[Index];
                    Selecters[Index].Items.AddRange(SelecterItems[Index]);
                }
                else
                {
                    Labels[Index].Visible    = false;
                    Selecters[Index].Visible = false;
                }
            }

            Tlp_Arguments.Dock         = DockStyle.Top;
            Tlp_Arguments.AutoSize     = true;
            Tlp_Arguments.AutoSizeMode = AutoSizeMode.GrowAndShrink;
            Tlp_Arguments.Padding      = new Padding(0, 0, SystemInformation.VerticalScrollBarWidth, 0);

            Tlp_Arguments.ResumeLayout();
        }
Пример #9
0
        private void InitializeList(string MacroType)
        {
            MacroSpecifierData TableData = SettingsFunctionLibrary.GetMacroSpecifierData(MacroType);

            // 通常指定子のリストを初期化
            Cl_MacroSpecifiers.Items.AddRange(TableData.MacroSpecifiers);
            for (int Index = 0; Index < TableData.MacroSpecifiers.Length; Index++)
            {
                CachedMacroSpecifiersUI.Add(TableData.MacroSpecifiers[Index], Index);
            }

            // 詳細指定子のリストを初期化
            Tlp_AdvancedSettings.Dock = DockStyle.Top;
            Tlp_AdvancedSettings.SuspendLayout();
            Tlp_AdvancedSettings.RowCount = 0;
            Tlp_AdvancedSettings.RowStyles.Clear();
            Tlp_AdvancedSettings.AutoSize     = true;
            Tlp_AdvancedSettings.AutoSizeMode = AutoSizeMode.GrowAndShrink;
            Tlp_AdvancedSettings.Padding      = new Padding(0, 0, SystemInformation.VerticalScrollBarWidth, 0);

            foreach (var AdvancedSetting in TableData.AdvancedSettings)
            {
                Label Title = new Label();
                Title.Text      = AdvancedSetting;
                Title.ForeColor = SettingsFunctionLibrary.GetTextColor();
                Title.Margin    = new Padding(3, 5, 3, 0);
                Title.AutoSize  = true;

                TextBox Input = new TextBox();
                Input.ScrollBars  = ScrollBars.Horizontal;
                Input.BorderStyle = BorderStyle.FixedSingle;

                Tlp_AdvancedSettings.RowCount++;
                Tlp_AdvancedSettings.RowStyles.Add(new RowStyle(SizeType.Absolute, 25F));
                Tlp_AdvancedSettings.Controls.Add(Title);
                Tlp_AdvancedSettings.Controls.Add(Input);

                CachedAdvancedSettingsUI.Add(AdvancedSetting, Input);
            }

            Tlp_AdvancedSettings.ResumeLayout();

            // メタ指定子のリストを初期化
            Tlp_MetaSpecifiers.Dock = DockStyle.Top;
            Tlp_MetaSpecifiers.SuspendLayout();
            Tlp_MetaSpecifiers.RowCount = 0;
            Tlp_MetaSpecifiers.RowStyles.Clear();
            Tlp_MetaSpecifiers.AutoSize     = true;
            Tlp_MetaSpecifiers.AutoSizeMode = AutoSizeMode.GrowAndShrink;
            Tlp_MetaSpecifiers.Padding      = new Padding(0, 0, SystemInformation.VerticalScrollBarWidth, 0);

            foreach (var MetaSpecifier in TableData.MetaSpecifiers)
            {
                Label Name = new Label();
                Name.Text      = MetaSpecifier.Data;
                Name.ForeColor = SettingsFunctionLibrary.GetTextColor();
                Name.Margin    = new Padding(3, 5, 3, 0);
                Name.AutoSize  = true;

                Tlp_MetaSpecifiers.RowCount++;
                Tlp_MetaSpecifiers.RowStyles.Add(new RowStyle(SizeType.Absolute, 25F));
                Tlp_MetaSpecifiers.Controls.Add(Name);

                if (MetaSpecifier.Type == InputType.NoInput)
                {
                    CheckBox Input = new CheckBox();
                    Input.Tag       = InputType.NoInput;
                    Input.ForeColor = SettingsFunctionLibrary.GetTextColor();
                    Name.Tag        = Input;
                    Name.Click     += new EventHandler(OnCheckBoxLabelClicked);
                    Tlp_MetaSpecifiers.Controls.Add(Input);
                    CachedMetaSpecifiersUI.Add(MetaSpecifier.Data, Input);
                }
                else if (MetaSpecifier.Type == InputType.String)
                {
                    TextBox Input = new TextBox();
                    Input.Tag         = InputType.String;
                    Input.ScrollBars  = ScrollBars.Horizontal;
                    Input.BorderStyle = BorderStyle.FixedSingle;
                    Tlp_MetaSpecifiers.Controls.Add(Input);
                    CachedMetaSpecifiersUI.Add(MetaSpecifier.Data, Input);
                }
                else if (MetaSpecifier.Type == InputType.Bool)
                {
                    CheckBox Input = new CheckBox();
                    Input.Tag       = InputType.Bool;
                    Input.ForeColor = SettingsFunctionLibrary.GetTextColor();
                    Name.Tag        = Input;
                    Name.Click     += new EventHandler(OnCheckBoxLabelClicked);
                    Tlp_MetaSpecifiers.Controls.Add(Input);
                    CachedMetaSpecifiersUI.Add(MetaSpecifier.Data, Input);
                }
                else if (MetaSpecifier.Type == InputType.Int)
                {
                    NumericUpDown Input = new NumericUpDown();
                    Input.Tag         = InputType.Int;
                    Input.BorderStyle = BorderStyle.FixedSingle;
                    Input.Text        = string.Empty;
                    Tlp_MetaSpecifiers.Controls.Add(Input);
                    CachedMetaSpecifiersUI.Add(MetaSpecifier.Data, Input);
                }
                else if (MetaSpecifier.Type == InputType.Float)
                {
                    NumericUpDown Input = new NumericUpDown();
                    Input.Tag           = InputType.Float;
                    Input.BorderStyle   = BorderStyle.FixedSingle;
                    Input.DecimalPlaces = 2;
                    Input.Text          = string.Empty;
                    Input.Increment     = (decimal)0.5;
                    Tlp_MetaSpecifiers.Controls.Add(Input);
                    CachedMetaSpecifiersUI.Add(MetaSpecifier.Data, Input);
                }
            }

            Tlp_MetaSpecifiers.ResumeLayout();
        }