/// <summary> /// USer clicked on Settings icon of keyboard /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void bsClicked(object sender, EventArgs e) { //Show settings control of keyboard KeyboardListPanel k = sender as KeyboardListPanel; KeyboardSettings obj = new KeyboardSettings(k.KeyboardName, k.KeyboardUuid, k.KeyboardPort, k.ConnectedBoardGui); obj.Save += keyboardSave; obj.Delete += keyboardDelete; obj.Location = new Point(0, 0); obj.Visible = true; this.Controls.Add(obj); obj.BringToFront(); }
/// <summary> /// Add a Keyboard to the keyboardList /// </summary> /// <param name="itemName"> /// Uuid of the Keyboard /// </param> /// <param name="uuidItem"> /// Dynamic ID of the keyboard /// </param> /// <param name="comportItem"> /// The com port of the keyboard /// </param> /// <param name="boardGui"> /// The keyboard class it represents /// </param> public void addItem(string itemName, string uuidItem, string comportItem, KeyBoardGUI boardGui) { //Create panel and add to control KeyboardListPanel obj = new KeyboardListPanel(itemName, uuidItem, comportItem, boardGui); obj.Location = _nextPoint; obj.Visible = true; obj.BoardSettingsClicked += bsClicked; obj.OpenBoardClicked += obClicked; MAIN_PANEL.Controls.Add(obj); _KeyboardPanelList.Add(obj); //Draw point on control if (_nextPoint.X == 31) { _nextPoint.X = _nextPoint.X + obj.Width + 31; } else { _nextPoint.X = 31; _nextPoint.Y = _nextPoint.Y + obj.Height + 31; } }