private void OnRemoveArgumentsButtonClicked(object Sender, EventArgs Args) { Tlp_Arguments.SuspendLayout(); // 最後の項目を削除 for (int Index = 0; Index < 2; Index++) { Tlp_Arguments.Controls.RemoveAt(Tlp_Arguments.Controls.Count - 1); Tlp_Arguments.Controls.RemoveAt(Tlp_Arguments.Controls.Count - 1); Tlp_Arguments.RowStyles.RemoveAt(Tlp_Arguments.RowCount - 1); Tlp_Arguments.RowCount--; } // 追加・削除ボタンを作成 Tlp_Arguments.RowCount++; Tlp_Arguments.RowStyles.Add(new RowStyle(SizeType.Absolute, 30F)); Button RemoveButton = CreateArgumentsButton(false); if (Tlp_Arguments.RowCount - 1 == 0) { RemoveButton.Enabled = false; } Tlp_Arguments.Controls.Add(CreateArgumentsButton(true)); Tlp_Arguments.Controls.Add(RemoveButton); Tlp_Arguments.ResumeLayout(); }
private void ReflectCheckBox() { bool bIsEvent = (Cb_IsEvent.Checked && Cb_IsEvent.Visible); bool bHasRetVal = (Cb_HasRetVal.Checked && Cb_HasRetVal.Visible); bool bIsDynamic = (Cb_IsDynamic.Checked && Cb_IsDynamic.Visible); bool bIsMulticast = (Cb_IsMulticast.Checked && Cb_IsMulticast.Visible); // Name Lbl_Name.Text = (bIsEvent ? "Event Name" : "Delegate Name"); // Type Lbl_Type.Text = (bIsEvent ? "Owning Type" : "Return Value Type"); Lbl_Type.Visible = (bIsEvent || bHasRetVal); Tb_Type.Visible = (bIsEvent || bHasRetVal); // Event Cb_IsEvent.Visible = (!bHasRetVal && !bIsDynamic && !bIsMulticast); // RetVal Cb_HasRetVal.Visible = (!bIsEvent && !bIsMulticast); // Dynamic Cb_IsDynamic.Visible = !bIsEvent; // Multicast Cb_IsMulticast.Visible = (!bIsEvent && !bHasRetVal); // ArgumentsName Lbl_Arguments.Text = (bIsDynamic ? "ArgumentsType ArgumentsName" : "ArgumentsType"); for (int Row = 0; Row < Tlp_Arguments.RowCount - 1; Row++) { var TextBox = Tlp_Arguments.GetControlFromPosition(1, Row); TextBox.Enabled = bIsDynamic; } }
private void AdjustArgumentsTable(string Format) { // フォーマット文字列内の入力フォーマット指定子を数える int SpecifierCount = StringFunctionLibrary.CountOfString(Format, InputFormatSpecifiers); Tlp_Arguments.SuspendLayout(); int Different = Math.Abs(SpecifierCount - Tlp_Arguments.RowCount); //増えた if (SpecifierCount > Tlp_Arguments.RowCount) { for (int Index = 0; Index < Different; Index++) { TextBox Input = new TextBox(); Input.ScrollBars = ScrollBars.Horizontal; Input.BorderStyle = BorderStyle.FixedSingle; Input.Width = 240; Tlp_Arguments.RowCount++; Tlp_Arguments.RowStyles.Add(new RowStyle(SizeType.Absolute, 25F)); Tlp_Arguments.Controls.Add(Input); } } // 減った else if (SpecifierCount < Tlp_Arguments.RowCount) { for (int Index = 0; Index < Different; Index++) { Tlp_Arguments.Controls.RemoveAt(Tlp_Arguments.Controls.Count - 1); Tlp_Arguments.RowStyles.RemoveAt(Tlp_Arguments.RowCount - 1); Tlp_Arguments.RowCount--; } } Tlp_Arguments.ResumeLayout(); }
private void AddArgumets() { Tlp_Arguments.SuspendLayout(); // 項目を追加 Tlp_Arguments.Controls.RemoveAt(Tlp_Arguments.Controls.Count - 1); Tlp_Arguments.Controls.RemoveAt(Tlp_Arguments.Controls.Count - 1); Tlp_Arguments.RowStyles.RemoveAt(Tlp_Arguments.RowCount - 1); Tlp_Arguments.RowCount--; Tlp_Arguments.RowCount++; TextBox ArgumetsType = new TextBox(); ArgumetsType.Tag = InputType.String; ArgumetsType.ScrollBars = ScrollBars.Horizontal; ArgumetsType.BorderStyle = BorderStyle.FixedSingle; ArgumetsType.Width = 150; TextBox ArgumentsName = new TextBox(); ArgumentsName.Tag = InputType.String; ArgumentsName.ScrollBars = ScrollBars.Horizontal; ArgumentsName.BorderStyle = BorderStyle.FixedSingle; ArgumentsName.Width = 150; ArgumentsName.Enabled = (Cb_IsDynamic.Checked && Cb_IsDynamic.Visible); Tlp_Arguments.Controls.AddRange(new TextBox[] { ArgumetsType, ArgumentsName }); Tlp_Arguments.RowStyles.Add(new RowStyle(SizeType.Absolute, 30F)); // 追加・削除ボタンを作成 Tlp_Arguments.RowCount++; Tlp_Arguments.RowStyles.Add(new RowStyle(SizeType.Absolute, 30F)); Button AddButton = CreateArgumentsButton(true); if (Tlp_Arguments.RowCount - 1 >= 9) { AddButton.Enabled = false; } Tlp_Arguments.Controls.Add(AddButton); Tlp_Arguments.Controls.Add(CreateArgumentsButton(false)); Tlp_Arguments.ResumeLayout(); }
private void InitializeList() { Tlp_Arguments.SuspendLayout(); Tlp_Arguments.RowCount = 0; Tlp_Arguments.Controls.Clear(); Tlp_Arguments.RowStyles.Clear(); 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.RowCount++; Tlp_Arguments.RowStyles.Add(new RowStyle(SizeType.Absolute, 30F)); Tlp_Arguments.Controls.Add(CreateArgumentsButton(true)); Button RemoveButton = CreateArgumentsButton(false); RemoveButton.Enabled = false; Tlp_Arguments.Controls.Add(RemoveButton); Tlp_Arguments.ResumeLayout(); }
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(); }