private void drawVerticalLine(int lindex, DrawingContext dc) { int biTag = lindex * 20; int eiTag = lindex * 20 + 19; CSwitcher btn1 = findButonWith_iTag(biTag); CSwitcher btn2 = findButonWith_iTag(eiTag); Pen linePen = new Pen(Brushes.Gray, 1); if (btn1 != null && btn2 != null) { Point btnPt1 = btn1.TransformToAncestor(this).Transform(new Point(0, 0)); Point btnPt2 = btn2.TransformToAncestor(this).Transform(new Point(0, 0)); Point pt1 = btnPt1; Point pt2 = btnPt2; pt1.X += btn1.ActualWidth / 2; pt2.X = pt1.X; pt1.Y = 62; pt1.Y += btn1.ActualHeight / 2; pt2.Y += btn2.ActualHeight / 2; dc.DrawLine(linePen, pt1, pt2); Rect tmpRect = new Rect(pt1.X - 12, 5, 24, 65); dc.DrawRectangle(null, linePen, tmpRect); } }
/// <summary> /// drawHorizontal /// </summary> /// <param name="lindex"></param> /// <param name="dc"></param> private void drawHorLine(int lindex, DrawingContext dc) { int biTag = lindex; int eiTag = lindex + 380; CSwitcher btn1 = findButonWith_iTag(biTag); CSwitcher btn2 = findButonWith_iTag(eiTag); if (btn1 != null && btn2 != null) { Point btnPt1 = btn1.TransformToAncestor(this).Transform(new Point(0, 0)); Point btnPt2 = btn2.TransformToAncestor(this).Transform(new Point(0, 0)); Point pt1 = btnPt1; Point pt2 = btnPt2; pt1.X -= 85.5; pt1.Y += btn1.ActualHeight / 2; pt2.Y += btn2.ActualHeight / 2; if (lindex % 2 == 0) { dc.DrawLine(new Pen(Brushes.Purple, 1), pt1, pt2); } else { dc.DrawLine(new Pen(Brushes.Gray, 1), pt1, pt2); } } }
/// <summary> /// /// </summary> public void refreshControl() { CSwitcher sbtn = null; string strBtn = ""; for (int i = 0; i < CFinal.ChanelMax; i++) { strBtn = string.Format("sourceBtn{0}", i); sbtn = (CSwitcher)this.FindName(strBtn); if (sbtn != null) { sbtn.IsSelected = (m_DuckerSourch[i] > 0); } } for (int i = 0; i < CFinal.ChanelMax; i++) //btm { strBtn = string.Format("bgmLocalBtn{0}", i); sbtn = (CSwitcher)this.FindName(strBtn); if (sbtn != null) { sbtn.IsSelected = (m_DuckerBgmLocal[i] > 0); } } for (int i = 0; i < CFinal.ChanelMax - 4; i++) { strBtn = string.Format("networkBtn{0}", i); sbtn = (CSwitcher)this.FindName(strBtn); if (sbtn != null) { sbtn.IsSelected = (m_DuckerNetInput[i] > 0); } } //bgmLocalBtn,networkBtn }
private void initialAllPorts() { CSwitcher sw = null; for (int i = 0; i < Max_Port; i++) { String btnName = string.Format("btn_port{0}", i); sw = (CSwitcher)FindName(btnName); if (sw != null) { sw.Click += sw_Click; } } }
/// <summary> /// /// </summary> /// <param name="sgrid"></param> private void retrieve_setMatrixProperty() { TraverseChildrenControls tchildrens = new TraverseChildrenControls(); foreach (object o in tchildrens.GetChildren(RootGrid, 1)) { if (o.GetType() == typeof(CSwitcher)) { CSwitcher cBtn = (CSwitcher)o; // cBtn.Content = cBtn.iTag.ToString(); cBtn.Click += matrixButton_Switch; switcherList.Add(cBtn); } } }
public void refreshControl() { int index = 0; CSwitcher btn = null; for (index = 0; index < 40; index++) { string strBtn = string.Format("inBtn_{0}", index); btn = (CSwitcher)this.FindName(strBtn); if (btn != null) { btn.IsSelected = (m_fbcSwitcher[index] > 0); } } }
//selct all for copy private void btnSelectAll_Click(object sender, RoutedEventArgs e) { CSwitcher bc = sender as CSwitcher; if (bc.IsSelected) { cpyGpx.disSelectAll(); bc.IsSelected = false; } else { cpyGpx.selectEntire(); bc.IsSelected = true; } }
public void refreshAllPorts() { CSwitcher sw = null; for (int i = 0; i < Max_Port; i++) { String btnName = string.Format("btn_port{0}", i); sw = (CSwitcher)FindName(btnName); if (sw != null) { sw.IsSelected = (m_singleZone[i] > 0); } // Debug.WriteLine("singzone status is " + m_singleZone[i] + " " + i); } }
/// public void updateFBCSwitcher(int chindex) { int index = 0; CSwitcher btn = null; int ibegin = (chindex == 0 ? 0 : 20); int iend = (chindex == 0 ? 19 : 39); for (index = ibegin; index <= iend; index++) { string strBtn = string.Format("inBtn_{0}", index); btn = (CSwitcher)this.FindName(strBtn); if (btn != null) { btn.IsSelected = (m_fbcSwitcher[index] > 0); } } }
/// <summary> /// EQ bypass click /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void bypasAllBtn_Click(object sender, RoutedEventArgs e) { // CSwitcher btn = sender as CSwitcher; //only change data ,but not update the GUI if (btn.IsSelected) { mEntireByPass = 0; } else { mEntireByPass = 1; } if (onEQControlChangedEvent != null) //eq flat { onEQControlChangedEvent(this, CFinal.EQEntireBypass); } }
/// <summary> /// search switcher button /// </summary> /// <param name="index"></param> /// <returns></returns> private CSwitcher findButonWith_iTag(int index) //RootGrid { TraverseChildrenControls tchildrens = new TraverseChildrenControls(); CSwitcher sbtn = null; foreach (object o in tchildrens.GetChildren(RootGrid, 1)) { if (o.GetType() == typeof(CSwitcher)) { sbtn = (CSwitcher)o; if (sbtn != null && sbtn.iTag == index) { break; } } } return(sbtn); }
private void sw_Click(object sender, RoutedEventArgs e) { CSwitcher sb = sender as CSwitcher; int index = sb.iTag; byte tmp = 0; if (sb.IsSelected) { tmp = 0; } else { tmp = 1; } m_singleZone[index] = tmp; sb.IsSelected = (tmp > 0); if (m_SingleZoneClickEvent != null) { IPProces.printAryByte("\nSingle Zone bytes: ", m_singleZone); m_SingleZoneClickEvent(iTag, index, m_singleZone, e); } }