public FilterForm(SubSelectionControl subSelectionControl) { InitializeComponent(); this.subSelectionControl = subSelectionControl; addButton.Image = GraphUtils.ToBitmap(Bitmap2.GetImage("plus1.bmp")); removeButton.Image = GraphUtils.ToBitmap(Bitmap2.GetImage("minus1.bmp")); //Icon = GraphUtils.ToBitmap(Bitmap2.GetImage("Perseus.jpg")); addButton.Click += AddButton_OnClick; removeButton.Click += RemoveButton_OnClick; RebuildGui(); }
public void Init(IList <string> items1, IList <string> selectorNames, IList <Func <string[], Parameters> > subParams) { items = items1; foreach (string s in items1) { AllListBox.Items.Add(s); } AllListBox.Dock = DockStyle.Fill; AllListBox.Margin = new Padding(0); AllListBox.SelectionMode = SelectionMode.MultiExtended; int n = selectorNames.Count; TableLayoutPanel tableLayoutPanel2 = new TableLayoutPanel(); subSelection = new SubSelectionControl[n]; for (int i = 0; i < n; i++) { subSelection[i] = new SubSelectionControl { MultiListSelectorControl = this, Text1 = selectorNames[i], Dock = DockStyle.Fill, Margin = new Padding(0) }; if (subParams != null && i < subParams.Count && subParams[i] != null) { subSelection[i].ParameterFuncs = subParams[i]; } } tableLayoutPanel2.Margin = new Padding(0); tableLayoutPanel2.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 100)); for (int i = 0; i < n; i++) { tableLayoutPanel2.RowStyles.Add(new RowStyle(SizeType.Percent, 10)); } for (int i = 0; i < n; i++) { tableLayoutPanel2.Controls.Add(subSelection[i], 0, i); } tableLayoutPanel2.Dock = DockStyle.Fill; tableLayoutPanel1.Controls.Add(tableLayoutPanel2, 1, 0); }
internal void SelectionHasChanged(SubSelectionControl sender, EventArgs e) { SelectionChanged?.Invoke(this, e); }
public void Init(IList<string> items1, IList<string> selectorNames, IList<Func<string[], Parameters>> subParams) { items = items1; foreach (string s in items1){ AllListBox.Items.Add(s); } AllListBox.Dock = DockStyle.Fill; AllListBox.Margin = new Padding(0); AllListBox.SelectionMode = SelectionMode.MultiExtended; int n = selectorNames.Count; TableLayoutPanel tableLayoutPanel2 = new TableLayoutPanel(); subSelection = new SubSelectionControl[n]; for (int i = 0; i < n; i++){ subSelection[i] = new SubSelectionControl{ MultiListSelectorControl = this, Text1 = selectorNames[i], Dock = DockStyle.Fill, Margin = new Padding(0) }; if (subParams != null && i < subParams.Count && subParams[i] != null){ subSelection[i].ParameterFuncs = subParams[i]; } } tableLayoutPanel2.Margin = new Padding(0); tableLayoutPanel2.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 100)); for (int i = 0; i < n; i++){ tableLayoutPanel2.RowStyles.Add(new RowStyle(SizeType.Percent, 10)); } for (int i = 0; i < n; i++){ tableLayoutPanel2.Controls.Add(subSelection[i], 0, i); } tableLayoutPanel2.Dock = DockStyle.Fill; tableLayoutPanel1.Controls.Add(tableLayoutPanel2, 1, 0); }