public IngressListDialog(ListBox lb) { _instance = this; System.Drawing.Size size = new System.Drawing.Size(300, 200); //Form inputBox = new Form(); inputBox = new Form(); inputBox.Name = "ListDialog"; inputBox.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog; inputBox.ClientSize = size; parentListBox = lb; listBox = new ListBox(); //textBox.Size = new System.Drawing.Size(size.Width - 10, 23); listBox.Location = new System.Drawing.Point(5, 5); //textBox.Text = input; for (int i = 0; i < lb.Items.Count; i++) { listBox.Items.Add(lb.Items[i]); } if (listBox.Items.Count > 0) { listBox.SelectedIndex = 0; } inputBox.Controls.Add(listBox); addSceneButton = new Button(); //addSceneButton.DialogResult = System.Windows.Forms.DialogResult.OK; addSceneButton.Name = "addSceneButton"; addSceneButton.Size = new System.Drawing.Size(75, 23); addSceneButton.Text = "&+"; addSceneButton.Location = new System.Drawing.Point(size.Width - 80 - 80, 79); addSceneButton.Click += new System.EventHandler(staticAddSceneButton_Click); inputBox.Controls.Add(addSceneButton); okButton = new Button(); okButton.DialogResult = System.Windows.Forms.DialogResult.OK; okButton.Name = "okButton"; okButton.Size = new System.Drawing.Size(75, 23); okButton.Text = "&OK"; okButton.Location = new System.Drawing.Point(size.Width - 80 - 80, 39); inputBox.Controls.Add(okButton); cancelButton = new Button(); cancelButton.DialogResult = System.Windows.Forms.DialogResult.Cancel; cancelButton.Name = "cancelButton"; cancelButton.Size = new System.Drawing.Size(75, 23); cancelButton.Text = "&Cancel"; cancelButton.Location = new System.Drawing.Point(size.Width - 80, 39); inputBox.Controls.Add(cancelButton); inputBox.AcceptButton = okButton; inputBox.CancelButton = cancelButton; }
private static void staticAddSceneButton_Click(object sender, EventArgs e) { string input = ""; if (IngressForm.ShowInputDialog("Enter Scene Name", ref input) == DialogResult.OK) { IngressForm.GetInstance().AddScene(input); IngressListDialog.GetInstance().updateListBox(); IngressListDialog.GetInstance().listBox.SelectedIndex = IngressListDialog.GetInstance().listBox.Items.Count - 1; //if (!_scenes.Contains(input)) //{ // _scenes.Add(input); // sender.SceneListBox.Items.Add(input); //} } }
private void AddCopyButton_Click(object sender, EventArgs e) { if (_selectedCamNode == null) { Console.WriteLine("No Selected Node"); } else { Console.WriteLine("Copy using \"" + _selectedCamNode.DorF.Name() + "\""); } if (!_sources.Contains(_selectedCamNode.DorF)) { _sources.Add(_selectedCamNode.DorF); IngressListBoxItem ib = new IngressListBoxItem(); ib.DisplayName = _selectedCamNode.DorF.Name(); ib.Identifier = _selectedCamNode.DorF; ////SourceListBox.Items.Add(_selectedCamNode.DorF.Name()); //SourceListBox.Items.Add(ib); //_sourceCams.Add(_currentCamera); //CamNumListBox.Items.Add(_currentCamera); int sel = -1; IngressListDialog dlg = new IngressListDialog(SceneListBox); if (dlg.ShowListDialog("Select Scene", ref sel) == DialogResult.OK) { _destinationScenes.Add(_scenes[sel]); //DestListBox.SelectedIndex = SceneListBox.Items.Count - 1; ib.CamNum = _currentCamera; ib.SceneName = _scenes[sel]; SourceListBox.Items.Add(ib); _sourceCams.Add(_currentCamera); EnableExecuteCopyButton(); } } }