/// <summary> /// Initializes all members of the master graph and checks whether the master graph should load /// </summary> public MasterPaneForm() { InitializeComponent(); m_gMyMaster = new GraphingBase(string.Empty); m_gMyMaster.CreateGraph(MasterGraph); m_gMyMaster.GraphMasterPane.PaneList.Clear(); m_gMyMaster.GraphMasterPane.Title.IsVisible = false; // Fill the pane background with a nice looking color gradient m_gMyMaster.GraphMasterPane.Fill = new Fill(Color.White, Color.LightGoldenrodYellow, 45.0F); // Set the margins and the space between panes to 10 points m_gMyMaster.GraphMasterPane.Margin.All = 10; m_gMyMaster.GraphMasterPane.InnerPaneGap = 10; // Add the new GraphPane to the MasterPane if (GraphCollection.Instance.MainReflGraph.IsDeepCopyFull == true && GraphCollection.Instance.MainReflGraph.Hide == false) { GraphCollection.Instance.SetGraphUpdateLock = true; m_gMyMaster.GraphMasterPane.Add(GraphCollection.Instance.MainReflGraph.Pane); m_bAtleastonegraph = true; } if (GraphCollection.Instance.MainRhoGraph.IsDeepCopyFull == true && GraphCollection.Instance.MainRhoGraph.Hide == false) { GraphCollection.Instance.SetGraphUpdateLock = true; m_gMyMaster.GraphMasterPane.Add(GraphCollection.Instance.MainRhoGraph.Pane); m_bAtleastonegraph = true; } if (GraphCollection.Instance.RhoGraph.IsDeepCopyFull == true && GraphCollection.Instance.RhoGraph.Hide == false) { m_gMyMaster.GraphMasterPane.Add(GraphCollection.Instance.RhoGraph.Pane); m_bAtleastonegraph = true; } if (GraphCollection.Instance.ReflGraph.IsDeepCopyFull == true && GraphCollection.Instance.ReflGraph.Hide == false) { m_gMyMaster.GraphMasterPane.Add(GraphCollection.Instance.ReflGraph.Pane); m_bAtleastonegraph = true; } if (GraphCollection.Instance.ReflEGraph.IsDeepCopyFull == true && GraphCollection.Instance.ReflEGraph.Hide == false) { m_gMyMaster.GraphMasterPane.Add(GraphCollection.Instance.ReflEGraph.Pane); m_bAtleastonegraph = true; } //Align the graphs in a custom fashion. The default options don't maintain aspect ratio if (m_bAtleastonegraph) { int counter = 0; foreach (GraphPane i in m_gMyMaster.GraphMasterPane.PaneList) { if (counter % 2 == 0) { RectangleF recf = new RectangleF(10, (340 / 2) * counter + 30, 439, 350); i.Rect = recf; } else { RectangleF recf = new RectangleF(459, (340 / 2) * (counter - 1) + 30, 439, 350); i.Rect = recf; } counter++; } //Create event handler for the context menu m_gMyMaster.GraphContextMenuBuilder(new ZedGraphControl.ContextMenuBuilderEventHandler(MyLocalGraphContextMenuBuilder)); } }