public PreviewSetElements(List <PreviewBaseShape> shapes) { InitializeComponent(); Icon = Resources.Icon_Vixen3; ThemeUpdateControls.UpdateControls(this); contextMenuLinkedElements.Renderer = new ThemeToolStripRenderer(); int imageSize = (int)(16 * ScalingTools.GetScaleFactor()); contextMenuLinkedElements.ImageScalingSize = new Size(imageSize, imageSize); buttonHelp.Image = Tools.GetIcon(Resources.help, imageSize); _shapes = shapes; connectStandardStrings = shapes[0].connectStandardStrings; int i = 1; foreach (PreviewBaseShape shape in _shapes) { if (shape.Pixels.Count == 0) { continue; } var newString = new PreviewSetElementString(); // If this is a Standard string, only set the first pixel of the string if (shape.StringType == PreviewBaseShape.StringTypes.Standard) { //Console.WriteLine("Standard String"); PreviewPixel pixel = shape.Pixels[0]; //Console.WriteLine(shape.Pixels[0].Node.Name.ToString()); newString.Pixels.Add(pixel.Clone()); } // If this is a pixel string, let them set every pixel else if (shape.StringType == PreviewBaseShape.StringTypes.Pixel) { foreach (PreviewPixel pixel in shape.Pixels) { newString.Pixels.Add(pixel.Clone()); } } else if (shape.StringType == PreviewBaseShape.StringTypes.Custom) { foreach (var pixel in shape.Pixels) { newString.Pixels.Add(pixel.Clone()); } } newString.StringName = "String " + i.ToString(); _strings.Add(newString); i++; } if (_shapes[0].Parent != null) { string shapeType = ""; shapeType = _shapes[0].Parent.GetType().ToString(); if ((shapeType.Contains("Icicle") && _shapes[0].StringType != PreviewBaseShape.StringTypes.Standard) || shapeType.Contains("MultiString")) { tblLightCountControls.Visible = true; } } }
public PreviewSetElements(List <PreviewBaseShape> shapes) { InitializeComponent(); _shapes = shapes; connectStandardStrings = shapes[0].connectStandardStrings; int i = 1; foreach (PreviewBaseShape shape in _shapes) { PreviewSetElementString newString = new PreviewSetElementString(); // If this is a Standard string, only set the first pixel of the string if (shape.StringType == PreviewBaseShape.StringTypes.Standard) { //Console.WriteLine("Standard String"); PreviewPixel pixel = shape.Pixels[0]; ; //Console.WriteLine(shape.Pixels[0].Node.Name.ToString()); newString.Pixels.Add(pixel.Clone()); } // If this is a pixel string, let them set every pixel else { foreach (PreviewPixel pixel in shape.Pixels) { newString.Pixels.Add(pixel.Clone()); } } newString.StringName = "String " + i.ToString(); _strings.Add(newString); i++; } }
private void UpdateListLinkedElements() { listLinkedElements.Items.Clear(); Common.Controls.ComboBoxItem comboBoxItem = comboStrings.SelectedItem as Common.Controls.ComboBoxItem; if (comboBoxItem != null) { PreviewSetElementString elementString = comboBoxItem.Value as PreviewSetElementString; if (elementString != null) { foreach (PreviewPixel pixel in elementString.Pixels) { ListViewItem item = new ListViewItem((listLinkedElements.Items.Count + 1).ToString()); item.Tag = pixel; listLinkedElements.Items.Add(item); SetLinkedElementItems(item, pixel.Node); } } else { Console.WriteLine("elementString==null"); } var count = elementString.Pixels.Count(); numericUpDownLightCount.Value = count > 0?count:1; AdjustColumnWidths(); } }
public PreviewSetElements(List<PreviewBaseShape> shapes) { InitializeComponent(); _shapes = shapes; connectStandardStrings = shapes[0].connectStandardStrings; int i = 1; foreach (PreviewBaseShape shape in _shapes) { PreviewSetElementString newString = new PreviewSetElementString(); // If this is a Standard string, only set the first pixel of the string if (shape.StringType == PreviewBaseShape.StringTypes.Standard) { //Console.WriteLine("Standard String"); PreviewPixel pixel = shape.Pixels[0]; ; //Console.WriteLine(shape.Pixels[0].Node.Name.ToString()); newString.Pixels.Add(pixel.Clone()); } // If this is a pixel string, let them set every pixel else { foreach (PreviewPixel pixel in shape.Pixels) { newString.Pixels.Add(pixel.Clone()); } } newString.StringName = "String " + i.ToString(); _strings.Add(newString); i++; } }
public void AddString(string stringName, List<PreviewPixel> pixels) { PreviewSetElementString lightString = new PreviewSetElementString(); lightString.StringName = stringName; for (int i = 0; i < pixels.Count; i++) { lightString.Pixels.Add(pixels[i].Clone()); } _strings.Add(lightString); }
public void AddString(string stringName, List <PreviewPixel> pixels) { PreviewSetElementString lightString = new PreviewSetElementString(); lightString.StringName = stringName; for (int i = 0; i < pixels.Count; i++) { lightString.Pixels.Add(pixels[i].Clone()); } _strings.Add(lightString); }
private void buttonOK_Click(object sender, EventArgs e) { if (connectStandardStrings && _shapes[0].StringType == PreviewBaseShape.StringTypes.Standard) { PreviewBaseShape shape = _shapes[0]; for (int i = 0; i < _shapes.Count; i++) { foreach (PreviewPixel pixel in _shapes[i]._pixels) { pixel.Node = _strings[0].Pixels[0].Node; pixel.NodeId = _strings[0].Pixels[0].NodeId; } } } else { // shapes with count==0 don't show up in combo box so keep separate index int comboidx = -1; for (int i = 0; i < _shapes.Count; i++) { //Console.WriteLine("i=" + i.ToString()); if (_shapes[i].Pixels.Count == 0) { continue; } comboidx++; Common.Controls.ComboBoxItem item = comboStrings.Items[comboidx] as Common.Controls.ComboBoxItem; PreviewSetElementString lightString = item.Value as PreviewSetElementString; PreviewBaseShape shape = _shapes[i]; for (int pixelNum = 0; pixelNum < lightString.Pixels.Count; pixelNum++) { //Console.WriteLine(" pixelNum=" + pixelNum.ToString()); // If this is a standard light string, assing ALL pixels to the first node if (shape.StringType == PreviewBaseShape.StringTypes.Standard) { foreach (PreviewPixel pixel in shape._pixels) { //Console.WriteLine(" pixel:" + lightString.Pixels[0].Node.Id.ToString()); pixel.Node = _strings[i].Pixels[0].Node; pixel.NodeId = _strings[i].Pixels[0].NodeId; } } else { shape.Pixels[pixelNum] = lightString.Pixels[pixelNum]; } } } } DialogResult = System.Windows.Forms.DialogResult.OK; Close(); }
public PreviewSetElements(List <PreviewBaseShape> shapes) { InitializeComponent(); Icon = Resources.Icon_Vixen3; ForeColor = ThemeColorTable.ForeColor; BackColor = ThemeColorTable.BackgroundColor; ThemeUpdateControls.UpdateControls(this); contextMenuLinkedElements.Renderer = new ThemeToolStripRenderer(); _shapes = shapes; connectStandardStrings = shapes[0].connectStandardStrings; int i = 1; foreach (PreviewBaseShape shape in _shapes) { if (shape.Pixels.Count == 0) { continue; } var newString = new PreviewSetElementString(); // If this is a Standard string, only set the first pixel of the string if (shape.StringType == PreviewBaseShape.StringTypes.Standard) { //Console.WriteLine("Standard String"); PreviewPixel pixel = shape.Pixels[0]; //Console.WriteLine(shape.Pixels[0].Node.Name.ToString()); newString.Pixels.Add(pixel.Clone()); } // If this is a pixel string, let them set every pixel else if (shape.StringType == PreviewBaseShape.StringTypes.Pixel) { foreach (PreviewPixel pixel in shape.Pixels) { newString.Pixels.Add(pixel.Clone()); } } newString.StringName = "String " + i.ToString(); _strings.Add(newString); i++; } if (_shapes[0].Parent != null) { string shapeType = ""; shapeType = _shapes[0].Parent.GetType().ToString(); if ((shapeType.Contains("Icicle") && _shapes[0].StringType != PreviewBaseShape.StringTypes.Standard) || shapeType.Contains("MultiString")) { panelSetLightCount.Visible = true; } } }
public PreviewSetElements(List<PreviewBaseShape> shapes) { InitializeComponent(); Icon = Resources.Icon_Vixen3; ForeColor = ThemeColorTable.ForeColor; BackColor = ThemeColorTable.BackgroundColor; ThemeUpdateControls.UpdateControls(this); contextMenuLinkedElements.Renderer = new ThemeToolStripRenderer(); _shapes = shapes; connectStandardStrings = shapes[0].connectStandardStrings; int i = 1; foreach (PreviewBaseShape shape in _shapes) { if (shape.Pixels.Count == 0) continue; var newString = new PreviewSetElementString(); // If this is a Standard string, only set the first pixel of the string if (shape.StringType == PreviewBaseShape.StringTypes.Standard) { //Console.WriteLine("Standard String"); PreviewPixel pixel = shape.Pixels[0]; //Console.WriteLine(shape.Pixels[0].Node.Name.ToString()); newString.Pixels.Add(pixel.Clone()); } // If this is a pixel string, let them set every pixel else if (shape.StringType == PreviewBaseShape.StringTypes.Pixel) { foreach (PreviewPixel pixel in shape.Pixels) { newString.Pixels.Add(pixel.Clone()); } } newString.StringName = "String " + i.ToString(); _strings.Add(newString); i++; } if (_shapes[0].Parent != null) { string shapeType = ""; shapeType = _shapes[0].Parent.GetType().ToString(); if ((shapeType.Contains("Icicle") && _shapes[0].StringType != PreviewBaseShape.StringTypes.Standard) || shapeType.Contains("MultiString") ) { panelSetLightCount.Visible = true; } } }
public PreviewSetElements(List <PreviewBaseShape> shapes) { InitializeComponent(); _shapes = shapes; connectStandardStrings = shapes[0].connectStandardStrings; int i = 1; foreach (PreviewBaseShape shape in _shapes) { if (shape.Pixels.Count == 0) { continue; } var newString = new PreviewSetElementString(); // If this is a Standard string, only set the first pixel of the string if (shape.StringType == PreviewBaseShape.StringTypes.Standard) { //Console.WriteLine("Standard String"); PreviewPixel pixel = shape.Pixels[0]; //Console.WriteLine(shape.Pixels[0].Node.Name.ToString()); newString.Pixels.Add(pixel.Clone()); } // If this is a pixel string, let them set every pixel else if (shape.StringType == PreviewBaseShape.StringTypes.Pixel) { foreach (PreviewPixel pixel in shape.Pixels) { newString.Pixels.Add(pixel.Clone()); } } newString.StringName = "String " + i.ToString(); _strings.Add(newString); i++; } if (_shapes[0].Parent != null) { string shapeType = ""; shapeType = _shapes[0].Parent.GetType().ToString(); if ((shapeType.Contains("Icicle") && _shapes[0].StringType != PreviewBaseShape.StringTypes.Standard) || shapeType.Contains("MultiString")) { panelSetLightCount.Visible = true; } } }
private void reverseElementLinkingInThisStringToolStripMenuItem_Click(object sender, EventArgs e) { ComboBoxItem comboBoxItem = comboStrings.SelectedItem as Common.Controls.ComboBoxItem; if (comboBoxItem != null) { PreviewSetElementString elementString = comboBoxItem.Value as PreviewSetElementString; if (elementString != null) { elementString.Pixels.Reverse(); } else { Console.WriteLine("elementString==null"); } numericUpDownLightCount.Value = elementString.Pixels.Count(); UpdateListLinkedElements(); } }
public PreviewSetElements(List<PreviewBaseShape> shapes) { InitializeComponent(); _shapes = shapes; connectStandardStrings = shapes[0].connectStandardStrings; int i = 1; foreach (PreviewBaseShape shape in _shapes) { if (shape.Pixels.Count == 0) continue; var newString = new PreviewSetElementString(); // If this is a Standard string, only set the first pixel of the string if (shape.StringType == PreviewBaseShape.StringTypes.Standard) { //Console.WriteLine("Standard String"); PreviewPixel pixel = shape.Pixels[0]; //Console.WriteLine(shape.Pixels[0].Node.Name.ToString()); newString.Pixels.Add(pixel.Clone()); } // If this is a pixel string, let them set every pixel else if (shape.StringType == PreviewBaseShape.StringTypes.Pixel) { foreach (PreviewPixel pixel in shape.Pixels) { newString.Pixels.Add(pixel.Clone()); } } newString.StringName = "String " + i.ToString(); _strings.Add(newString); i++; } if (_shapes[0].Parent != null) { string shapeType = ""; shapeType = _shapes[0].Parent.GetType().ToString(); if ((shapeType.Contains("Icicle") && _shapes[0].StringType != PreviewBaseShape.StringTypes.Standard) || shapeType.Contains("MultiString") ) { panelSetLightCount.Visible = true; } } }
private void buttonSetLightCount_Click(object sender, EventArgs e) { Common.Controls.ComboBoxItem comboBoxItem = comboStrings.SelectedItem as Common.Controls.ComboBoxItem; if (comboBoxItem != null) { PreviewSetElementString elementString = comboBoxItem.Value as PreviewSetElementString; if (elementString != null) { while (elementString.Pixels.Count > numericUpDownLightCount.Value) { elementString.Pixels.RemoveAt(elementString.Pixels.Count - 1); } while (elementString.Pixels.Count < numericUpDownLightCount.Value) { PreviewPixel pixel = new PreviewPixel(); elementString.Pixels.Add(pixel); } } UpdateListLinkedElements(); } }
private void UpdateListLinkedElements() { listLinkedElements.Items.Clear(); ComboBoxItem comboBoxItem = comboStrings.SelectedItem as ComboBoxItem; if (comboBoxItem != null) { PreviewSetElementString elementString = comboBoxItem.Value as PreviewSetElementString; if (elementString != null) { foreach (PreviewPixel pixel in elementString.Pixels) { ListViewItem item = new ListViewItem((listLinkedElements.Items.Count + 1).ToString()); item.Tag = pixel; listLinkedElements.Items.Add(item); SetLinkedElementItems(item, pixel.Node); } } else { Console.WriteLine("elementString==null"); } } }