private void setupSliders() { SingleSlider temp; int col, row; this.SuspendLayout(); for (int i = 0; i < numSlider; i++) { temp = new SingleSlider(i + 1); //temp.Channel = i + 1; temp.ValueChanged += singleSlider1_ValueChanged; temp.Scroll += singleSlider1_Scroll; temp.LabelChanged += singleSlider1_LabelChanged; col = i % itemsPerRow + (i % itemsPerRow) / itemsPerHGrp; row = (i / itemsPerRow); temp.Left = (temp.Width) * col + ((col + 1) * temp.Margin.Left); temp.Top = (temp.Height) * row + ((row + 1) * 10); mSliders[i] = temp; this.Controls.Add(temp); //this.components.Add(temp); if (mLabels == null) { continue; } if (mLabels.Length >= temp.Channel) { temp.textBox1.Text = mLabels[temp.Channel - 1]; } } this.ResumeLayout(false); }
private void singleSlider1_LabelChanged(object sender, EventArgs e) { SingleSlider s = (SingleSlider)sender; //mLabels[s.Channel - 1] = s.textBox1.Text; mSubmasters[s.Channel - 1].SubName = s.textBox1.Text; if (LabelChanged != null) { LabelChanged(this, new LabelChangedArgs(sender as SingleSlider)); return; } }
private void singleSlider1_LabelChanged(object sender, EventArgs e) { if (LabelChanged != null) { LabelChanged(this, new LabelChangedArgs(sender as SingleSlider)); return; } SingleSlider s = (SingleSlider)sender; if (Labels.Length < (s.Channel)) { string[] temp = new string[s.Channel]; Array.Copy(Labels, temp, Labels.Length); Labels = temp; } Labels[s.Channel - 1] = s.textBox1.Text; }
public SliderGroup() { InitializeComponent(); setupPatch(); // construct the list of sliders based what is already in the control SingleSlider temp; //tableLayoutPanel1.RowCount=(numChannels/itemsPerRow)*2-1 ; // 1 row is a spacer. 5 rows = 4 spaces = 9 Total; //tableLayoutPanel1.ColumnCount=itemsPerRow + itemsPerRow/itemsPerHGrp-1; // items/(itemspergrp)=groups. 3 groups=2 spaces this.SuspendLayout(); int col, row; for (int i = 0; i < numChannels; i++) { temp = new SingleSlider(i + 1); temp.ValueChanged += singleSlider1_ValueChanged; temp.Scroll += singleSlider1_Scroll; temp.LabelChanged += singleSlider1_LabelChanged; m_sliders[i] = temp; col = i % itemsPerRow + (i % itemsPerRow) / itemsPerHGrp; row = (i / itemsPerRow); temp.Left = (temp.Width) * col + ((col + 1) * temp.Margin.Left); temp.Top = (temp.Height) * row + ((row + 1) * 10); this.Controls.Add(temp); if (Labels == null) { continue; } if (Labels.Length >= temp.Channel) { temp.textBox1.Text = Labels[temp.Channel - 1]; } } this.ResumeLayout(); }
public SliderGroup() { InitializeComponent(); setupPatch(); // construct the list of sliders based what is already in the control SingleSlider temp; //tableLayoutPanel1.RowCount=(numChannels/itemsPerRow)*2-1 ; // 1 row is a spacer. 5 rows = 4 spaces = 9 Total; //tableLayoutPanel1.ColumnCount=itemsPerRow + itemsPerRow/itemsPerHGrp-1; // items/(itemspergrp)=groups. 3 groups=2 spaces this.SuspendLayout(); int col,row; for (int i = 0; i < numChannels; i++) { temp = new SingleSlider(i + 1); temp.ValueChanged += singleSlider1_ValueChanged; temp.Scroll += singleSlider1_Scroll; temp.LabelChanged += singleSlider1_LabelChanged; m_sliders[i] = temp; col = i % itemsPerRow + (i % itemsPerRow) / itemsPerHGrp; row = (i / itemsPerRow); temp.Left = (temp.Width) * col + ((col + 1) * temp.Margin.Left); temp.Top = (temp.Height) * row + ((row + 1) * 10); this.Controls.Add(temp); if (Labels == null) continue; if (Labels.Length >=temp.Channel) temp.textBox1.Text = Labels[temp.Channel - 1]; } this.ResumeLayout(); }
public LabelChangedArgs(SingleSlider s) { slider = s; }
private void setupSliders() { SingleSlider temp; int col, row; this.SuspendLayout(); for (int i = 0; i < numSlider; i++) { temp = new SingleSlider(i + 1); //temp.Channel = i + 1; temp.ValueChanged += singleSlider1_ValueChanged; temp.Scroll += singleSlider1_Scroll; temp.LabelChanged += singleSlider1_LabelChanged; col = i % itemsPerRow + (i % itemsPerRow) / itemsPerHGrp; row = (i / itemsPerRow); temp.Left = (temp.Width) * col + ((col + 1) * temp.Margin.Left); temp.Top = (temp.Height) * row + ((row + 1) * 10); mSliders[i] = temp; this.Controls.Add(temp); //this.components.Add(temp); if (mLabels == null) continue; if (mLabels.Length >= temp.Channel) temp.textBox1.Text = mLabels[temp.Channel - 1]; } this.ResumeLayout(false); }