Exemple #1
0
        public void RegisterPane(AbstractViewPane pane, string id, string caption, Image icon)
        {
            PaneCaption paneCaption = new PaneCaption();

            paneCaption.Text           = caption;
            paneCaption.Dock           = DockStyle.Top;
            paneCaption.CaptionButtons = PaneCaptionButtons.Minimize;
            paneCaption.Click         += OnPaneCaptionClick;
            paneCaption.MinimizeClick += OnPaneMinimize;
            paneCaption.ColorScheme    = _colorScheme;
            _contentPane.Controls.Add(paneCaption);
            _contentPane.Controls.SetChildIndex(paneCaption, 0);

            int paneHeight = pane.Height;

            SidebarPaneBackground background = new SidebarPaneBackground();

            background.SetContents(pane);
            background.ColorScheme = _colorScheme;
            background.Dock        = DockStyle.Top;
            background.Visible     = false;
            background.Height      = 0;
            _contentPane.Controls.Add(background);
            _contentPane.Controls.SetChildIndex(background, 0);

            pane.ShowSelection = false;
            pane.Enter        += OnPaneEnter;
            pane.Leave        += OnPaneLeave;

            Splitter paneSplitter = new Splitter();

            paneSplitter.Dock   = DockStyle.Top;
            paneSplitter.Height = 3;
            _contentPane.Controls.Add(paneSplitter);
            _contentPane.Controls.SetChildIndex(paneSplitter, 0);

            PaneData paneData = new PaneData(id, background, pane, paneCaption, paneSplitter, paneHeight);

            paneCaption.Tag = paneData;

            IColorSchemeable schemeable = pane as IColorSchemeable;

            if (schemeable != null)
            {
                schemeable.ColorScheme = _colorScheme;
            }

            ToolStripButton button = _paneButtons.AddButton(paneData, icon, caption);

            button.CheckedChanged += OnToolbarButtonClicked;

            AdjustDockAndSplitters(null, false);
            if (PaneAdded != null)
            {
                PaneAdded(this, EventArgs.Empty);
            }
        }
Exemple #2
0
 public PaneData(string paneID, SidebarPaneBackground paneBackground, AbstractViewPane pane,
                 PaneCaption paneCaption, Splitter paneSplitter, int paneHeight)
 {
     PaneId         = paneID;
     PaneBackground = paneBackground;
     Pane           = pane;
     PaneCaption    = paneCaption;
     PaneSplitter   = paneSplitter;
     PaneHeight     = paneHeight;
 }