예제 #1
0
        void DoChangePanel(object state)
        {
            // remember which tab we were on
            int topTabIndex = this.advancedControlsTabControl.SelectedTabIndex;

            // remove the advance control and replace it with new ones build for the selected printer
            int advancedControlsWidgetIndex = Panel2.GetChildIndex(this.advancedControlsTabControl);

            Panel2.RemoveChild(advancedControlsWidgetIndex);
            this.advancedControlsTabControl = CreateNewAdvancedControlsTab(sliceSettingsUiState);
            Panel2.AddChild(this.advancedControlsTabControl, advancedControlsWidgetIndex);

            // set the selected tab back to the one it was before we replace the control
            this.advancedControlsTabControl.SelectTab(topTabIndex);

            // This is a hack to make the pannel remain on the screen.  It would be great to debug it and understand
            // why it does not work without this code in here.
            RectangleDouble localBounds = this.LocalBounds;

            this.LocalBounds = new RectangleDouble(0, 0, this.LocalBounds.Width - 1, 10);
            this.LocalBounds = localBounds;
        }
        public PlotterContainer(string name)
            : base(name, SplitOrientation.Vertical, -240f)
        {
            Plotter = new Graph2DPlotter("plotter");
            Panel1.AddChild(Plotter);

            GRD = new DataGridView("dgv");
            GRD.RowHeaderWidth      = 0;
            GRD.AlternatingRowColor = Color.FromArgb(50, Theme.Colors.Cyan);
            Panel2.AddChild(GRD);

            Graphs = new GraphList();
            GraphBase GB = new GraphBase(null, GRD);

            Graphs.Add(GB);
            GRD.SetDataProvider(GB);
            GB.OnDataLoaded();

            Plotter.Graphs = Graphs;
            Plotter.Graph  = GB;

            GB.GraphColor = Theme.Colors.Orange;
        }