//when we remove a usercontrol from the flowlayout, it usually means we have removed a surface. Regenerate the aircraft's picture private void flowLayoutPanel1_ControlRemoved(object sender, ControlEventArgs e) { if (m_ap != null) { this.pictureBox1.Image = GeometryModeler.DrawAirplane(m_ap, m_currentView); } }
private void frontButton_Click(object sender, EventArgs e) { if (m_ap != null) { this.pictureBox1.Image = GeometryModeler.DrawAirplane(m_ap, GeometryModeler.Views.Front, selected_surf, selected_section); } m_currentView = GeometryModeler.Views.Front; }
private void SurfaceUC_OnUpdateSelection(SurfaceUC sender, SurfaceUC.SectionSelectEventArgs e) { if (sender == null) { return; } if (m_ap.Initial_AVL_File.Surfaces.Contains(sender.DispSurface)) { selected_section = e.Selected_Section; selected_surf = sender.DispSurface.Name; this.pictureBox1.Image = GeometryModeler.DrawAirplane(m_ap, m_currentView, sender.DispSurface.Name, e.Selected_Section); } }
public void SetAircraft(Aircraft ap) { if (ap == null) { return; } //if the displayed aircraft is the one we want to change to, dont bother changing if (m_ap != null && m_ap == ap) { return; } this.SuspendLayout(); this.flowLayoutPanel1.Controls.Clear(); m_ap = ap; this.designLabel.Text = m_ap.Configuration_Name; //this.pictureBox1.Image = m_ap.PrimaryInstance.Geometry_Image; this.pictureBox1.Image = GeometryModeler.DrawAirplane(m_ap, GeometryModeler.Views.Isomeric); RefreshValues(); foreach (AVL_File.Surface surf in ap.Initial_AVL_File.Surfaces) { SurfaceUC suc = new SurfaceUC(surf); this.flowLayoutPanel1.Controls.Add(suc); } this.cmdPrmpButton.Visible = true; foreach (Control c in flowLayoutPanel2.Controls) { c.Visible = true; } this.revertButton.Enabled = m_ap.HasBackup; this.ResumeLayout(); }
//when we add a surfaceUC to the flow panel, set it's width to be that of the flowlayoutpanel private void flowLayoutPanel1_ControlAdded(object sender, ControlEventArgs e) { e.Control.Width = flowLayoutPanel1.Width; this.pictureBox1.Image = GeometryModeler.DrawAirplane(m_ap, GeometryModeler.Views.Isomeric); }