private void OnPaneMinimize(object sender, EventArgs e) { PaneCaption caption = (PaneCaption)sender; PaneData paneData = (PaneData)caption.Tag; _paneButtons.SetButtonPressed(paneData.PaneId, false); }
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); } }
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; }
private static void OnPaneCaptionClick(object sender, EventArgs e) { PaneCaption caption = (PaneCaption)sender; AbstractViewPane pane = ((PaneData)caption.Tag).Pane; if (!pane.ContainsFocus) { pane.Focus(); // HACK: Remove when all panes are converted to JetListView if (!(pane is ResourceTreePaneBase)) { IResource node = pane.SelectedResource; if (node != null) { pane.SelectResource(node, false); } } } }