public void generateWickiEyeden() { Buttons = new WickiEyedenButton[wickiEyedenHeight, 10]; canvas.Children.Clear(); int baseNote = GraphicsChest.getChest().netytarGenNote; int side = this.side; int halfSide = this.side / 2; bool isPairRow; int startRowPitch = pitchMax - 11; for (int row = 0; row < wickiEyedenHeight; row++) { #region Is row pair? if ((row + 1) % 2 != 0) { isPairRow = false; } else { isPairRow = true; } #endregion int buttonsNumber; int spacer; if (!isPairRow) { buttonsNumber = oddButtons; spacer = halfSide; startRowPitch -= 5; // Deducted from maths! } else { buttonsNumber = evenButtons; spacer = 0; startRowPitch -= 7; // Deducted from maths! } for (int col = 0; col < buttonsNumber; col++) { Point generator = new Point(wickiEyedenStart.X + spacer + (col * side), wickiEyedenStart.Y + (side * row)); // Button spawning Buttons[row, col] = new WickiEyedenButton(startRowPitch + (col * 2)); Buttons[row, col].Height = side; Buttons[row, col].Width = side; Canvas.SetLeft(Buttons[row, col], generator.X); Canvas.SetTop(Buttons[row, col], generator.Y); Panel.SetZIndex(Buttons[row, col], 0); canvas.Children.Add(Buttons[row, col]); } } // Center assignment GraphicsChest.getChest().WickiEyedenCenter = new Point(canvas.Width / 2, canvas.Height / 2); }
private void button_OnGaze(object sender, RoutedEventArgs e) { if (tempButton != null) { tempButton.Background = tempBrush; } if (((WickiEyedenButton)sender).GetHasGaze()) { tempButton = ((WickiEyedenButton)sender); tempBrush = tempButton.Background; tempButton.Background = selectedBrush; InstrumentChest.getChest().Instrument.setNote(tempButton.Pitch); GraphicsChest.getChest().WickiEyedenWatched = new Point(Canvas.GetLeft(tempButton), Canvas.GetTop(tempButton)); } }