public MainWindow() { dbManager = new DBManager(); //Create the component info control componentInfoControl = new componentInfoUserControl(this, dbManager); componentInfoControl.Location = new System.Drawing.Point(9, 428); //Create the component tree control treeControl = new componentTreeUserControl(this, componentInfoControl, dbManager); treeControl.Location = new System.Drawing.Point(9, 6); //Set the info panel to use the TreeUserControl being used by the Main Window componentInfoControl.setTreeControl(treeControl); //Create a default aircraft layout and add it to the middle panel aircraftControl = new SinglePropellerLayout(this, treeControl); aircraftControl.Location = new Point(10, 10); InitializeComponent(); //Add controls to their appropriate containers splitContainer1.Panel1.Controls.Add(treeControl); splitContainer1.Panel1.Controls.Add(componentInfoControl); splitContainer1.Panel2.Controls.Add(aircraftControl); }
public componentTreeUserControl(MainWindow mainWindow, componentInfoUserControl infoControl, DBManager dbManager) { this.mainWindow = mainWindow; this.infoControl = infoControl; this.dbManager = dbManager; InitializeComponent(); initializeComponentTree(); }
public AddBatteryPanel(NewComponentWindow newComponentWindow, DBManager dbManager) { this.dbManager = dbManager; this.newComponentWindow = newComponentWindow; InitializeComponent(); cellConfigurationComboItems = new List<string> { "1S", "2S", "3S", "4S", "5S", "6S", "7S", "8S" }; cellComboBox.DataSource = cellConfigurationComboItems; Enabled = false; Visible = false; }
public AddPropellerPanel(NewComponentWindow newComponentWindow, DBManager dbManager) { this.dbManager = dbManager; this.newComponentWindow = newComponentWindow; bladeCountComboBoxItems = new List<int> { 2,3,4,5 }; InitializeComponent(); bladeCountComboBox.DataSource = bladeCountComboBoxItems; }
public AddMotorPanel(NewComponentWindow newComponentWindow, DBManager dbManager) { this.newComponentWindow = newComponentWindow; this.dbManager = dbManager; InitializeComponent(); //Populate the combo boxes minCellComboBoxItems = new List<string> { "1S", "2S", "3S", "4S", "5S", "6S", "7S", "8S" }; maxCellComboBoxItems = new List<string> { "1S", "2S", "3S", "4S", "5S", "6S", "7S", "8S" }; minCellComboBox.DataSource = minCellComboBoxItems; maxCellComboBox.DataSource = maxCellComboBoxItems; }
public componentInfoUserControl(MainWindow mainWindow, DBManager dbManager) { this.dbManager = dbManager; this.mainWindow = mainWindow; batteryPanel = new BatteryInfo(this, dbManager); motorPanel = new MotorInfo(this, dbManager); propellerPanel = new PropellerInfo(this, dbManager); batteryPanel.Location = new Point(10, 50); motorPanel.Location = new Point(10, 50); propellerPanel.Location = new Point(10, 50); InitializeComponent(); Controls.Add(batteryPanel); Controls.Add(motorPanel); Controls.Add(propellerPanel); batteryPanel.deactivateControl(); }
public NewComponentWindow(MainWindow mainWindow, DBManager dbManager) { this.mainWindow = mainWindow; this.dbManager = dbManager; //Enables the main window on close FormClosed += new FormClosedEventHandler(NewComponentWindow_FormClosed); //Component combo box choices componentComboItems = new List<string> { "Choose component type...", "Battery", "Motor", "Propeller" }; InitializeComponent(); //Populates the Choose Component combo box with choices componentComboBox.DataSource = componentComboItems; //Set up component user controls batteryPanel = new AddBatteryPanel(this, dbManager); motorPanel = new AddMotorPanel(this, dbManager); propellerPanel = new AddPropellerPanel(this, dbManager); batteryPanel.Location = new Point(12, 124); motorPanel.Location = new Point(12, 124); propellerPanel.Location = new Point(12, 124); Controls.Add(batteryPanel); Controls.Add(motorPanel); Controls.Add(propellerPanel); motorPanel.Visible = false; motorPanel.Enabled = false; propellerPanel.Visible = false; propellerPanel.Enabled = false; }
public BatteryInfo(componentInfoUserControl infoControl, DBManager dbManager) : base(infoControl, dbManager) { InitializeComponent(); }
public PropellerInfo(componentInfoUserControl infoControl, DBManager dbManager) : base(infoControl, dbManager) { InitializeComponent(); }
public InfoPanel(componentInfoUserControl infoControl, DBManager dbManager) { this.dbManager = dbManager; this.infoControl = infoControl; InitializeComponent(); }