public LoadedCollectorsForm(Graph graph, string fileName, bool hint)
            : base(graph, hint)
        {
            // Init panel before ApplyResources
            Panel = new GraphPanel();
            InitializeComponent();
            // TODO: different for precise & scan
            Panel.Init(graph);

            _fileName = fileName;
            Text = DisplayedFileName;
        }
        protected CollectorsForm2(Graph graph, bool hint)
            : base()
        {
            InitializeComponent();

            var items = MainMenuStrip.Items;
            ((ToolStripMenuItem)items["FileMenu"]).DropDownItems.Add(distractFromCurrentToolStripMenuItem);

            this.graph = graph;

            preciseSpectrumDisplayed = hint;
            setTitles();
            string prefix = (graph.DisplayingMode == Graph.Displaying.Diff) ? DIFF_TITLE : "";

            {
                int count = graph.Collectors.Count;
                graphs = new ZedGraphControlPlus[count];
                minX = new ushort[count];
                maxX = new ushort[count];
                setXScaleLimits();
            }

            SuspendLayout();
            tabControl.SuspendLayout();
            for (int i = 0; i < graph.Collectors.Count; ++i) {
                var collector = graph.Collectors[i];
                if (DisableTabPage(collector)) {
                    graphs[i] = null;
                    continue;
                }
                var tabPage = new TabPage(prefix + i + modeText) { UseVisualStyleBackColor = true };
                tabPage.SuspendLayout();
                tabControl.Controls.Add(tabPage);
                {
                    var zgc = new ZedGraphControlPlus() { ScrollMaxX = maxX[i], ScrollMinX = minX[i], Tag = (byte)(i + 1) };
                    zgc.PointValueEvent += ZedGraphControlPlus_PointValueEvent;
                    zgc.ContextMenuBuilder += ZedGraphControlPlus_ContextMenuBuilder;
                    tabPage.Controls.Add(zgc);
                    graphs[i] = zgc;
                }
                tabPage.ResumeLayout(false);
            }
            tabControl.ResumeLayout(false);
            ResumeLayout(false);
            PerformLayout();

            graph.GraphDataModified += InvokeRefreshGraph;
            graph.AxisModeChanged += InvokeAxisModeChange;
            graph.DisplayModeChanged += InvokeGraphModified;
        }
 void GraphModified(Graph.Displaying mode)
 {
     if (mode == Graph.Displaying.Diff) {
         setTitles();
         Modified = true;
     }
 }