public LabelSelectParameter(string paramName, bool multiSelect, SequenceSingleSelectParameter parent) : base(paramName) { Value = new List <string>(); Parent = parent; MultiSelect = multiSelect; }
public override Panel CreatePanel(SequenceProcEnv environment) { Panel ret = new Panel(); GroupBox group = new GroupBox(); group.Text = this.ParamName; group.Dock = DockStyle.Fill; SequenceIndexSelectControl ctrl = new SequenceIndexSelectControl(); ctrl.SelectionMode = SelectionMode.MultiExtended; if (Parent == null) { ctrl.SetItemsFromSequence(environment.SelectedSequence); } else { Parent.ValueChanged += new EventHandler((s, e) => { SequenceSingleSelectParameter parent = s as SequenceSingleSelectParameter; var sequence = parent.Value; if (sequence != null) { ctrl.SetItemsFromSequence(sequence); } }); } if (this.Value != null && this.Value.Count > 0) { ctrl.SelectedIndices.Clear(); foreach (int index in this.Value) { if (index < 0 || index >= ctrl.Items.Count) { continue; } ctrl.SelectedIndices.Add(index); } } this.Value = new List <int>(ctrl.SelectedIndices.OfType <int>()); ctrl.SelectedIndexChanged += new EventHandler((s, e) => { this.Value = new List <int>(ctrl.SelectedIndices.OfType <int>()); DoValueChanged(); }); ctrl.Dock = DockStyle.Fill; group.Controls.Add(ctrl); ret.Controls.Add(group); ret.Height = 128; return(ret); }
public override Panel CreatePanel(SequenceProcEnv environment) { Panel ret = new Panel(); GroupBox group = new GroupBox(); group.Text = ParamName; group.Dock = DockStyle.Fill; BorderSelectionControl border = new BorderSelectionControl(); border.SelectionMode = MultiSelect ? SelectionMode.MultiExtended : SelectionMode.One; if (Parent == null) { border.AttachBorder(environment.SelectedSequence.Borders); } else { var sequences = Parent.Value; if (sequences != null) { border.AttachBorder(sequences.Borders); } Parent.ValueChanged += new EventHandler((s, e) => { SequenceSingleSelectParameter parent = s as SequenceSingleSelectParameter; var sequences2 = parent.Value; if (sequences2 != null) { border.AttachBorder(sequences2.Borders); } }); } border.SelectRange(Value); border.SelectedIndexChanged += new EventHandler((s, e) => { var labels = new List <string>(); foreach (var item in border.SelectedItems) { labels.Add((string)item); } Value = labels; DoValueChanged(); }); border.Dock = DockStyle.Fill; group.Controls.Add(border); ret.Controls.Add(group); ret.Height = 160; return(ret); }
public override Panel CreatePanel(SequenceProcEnv environment) { Panel ret = new Panel(); GroupBox group = new GroupBox(); group.Text = ParamName; group.Dock = DockStyle.Fill; LabelReplaceControl border = new LabelReplaceControl(); if (this.Parent == null) { border.AttachSequenceData(environment.SelectedSequence); } else { var sequences = this.Parent.Value; if (sequences != null) { border.AttachSequenceData(sequences); } this.Parent.ValueChanged += new EventHandler((s, e) => { SequenceSingleSelectParameter parent = s as SequenceSingleSelectParameter; var sequences2 = parent.Value; if (sequences2 != null) { border.AttachSequenceData(sequences2); } }); } border.AddReplaceMap(this.Value); border.ReplaceMapChanged += new EventHandler((s, e) => { this.Value = border.GetReplaceMap().Where(pair => pair.Key != pair.Value).ToDictionary(pair => pair.Key, pair => pair.Value); this.DoValueChanged(); }); border.Dock = DockStyle.Fill; group.Controls.Add(border); ret.Controls.Add(group); ret.Height = 360; return(ret); }
public override Panel CreatePanel(SequenceProcEnv environment) { Panel ret = new Panel(); GroupBox group = new GroupBox(); group.Text = ParamName; group.Dock = DockStyle.Fill; TargetSequenceIndexControl target = new TargetSequenceIndexControl(); if (this.Parent == null) { target.AttachSequence(environment.SelectedSequence); } else { this.Parent.ValueChanged += new EventHandler((s, e) => { SequenceSingleSelectParameter parent = s as SequenceSingleSelectParameter; var sequence = parent.Value; if (sequence != null) { target.AttachSequence(sequence); } }); } if (Value >= -1 && Value < target.ItemCount) { target.SelectedIndex = Value; } target.SelectedIndexChanged += new EventHandler((s, e) => { this.Value = target.SelectedIndex; this.DoValueChanged(); }); target.Dock = DockStyle.Fill; group.Controls.Add(target); ret.Controls.Add(group); ret.Height = 48; return(ret); }
public LabelReplaceParameter(string paramName, SequenceSingleSelectParameter parent) : base(paramName) { this.Parent = parent; }
public SequenceColumnMultiSelectParameter(string paramName, SequenceSingleSelectParameter parent) : base(paramName) { Value = new List <int>(); Parent = parent; }
public SequenceColumnSelectParameter(string paramName, SequenceSingleSelectParameter parent) : base(paramName) { this.Value = 0; this.Parent = parent; }