internal bool OnShortcut(Keys keys) { if (keys == Keys.F3) { FindNextMatch(filterTextBox.Text); return(true); } else if (keys == (Keys.Shift | Keys.F3)) { FindPrevMatch(filterTextBox.Text); return(true); } else if (keys == Keys.F5 || keys == (Keys.Control | Keys.J)) { UpdateTree(); return(true); } else if (keys == Keys.Escape) { if (panelCtrl.DockState == DockState.Float) { panelCtrl.Hide(); } if (PluginBase.MainForm.CurrentDocument.IsEditable) { PluginBase.MainForm.CurrentDocument.SciControl.Focus(); } } return(false); }
private void StartupWindow_CheckedChanged(object sender, EventArgs e) { ToolStripMenuItem menuItem = sender as ToolStripMenuItem; if (menuItem != null) { DockContent dockContent = menuItem.Tag as DockContent; if (dockContent != null) { if (menuItem.Checked) { dockContent.Show(); if (dockContent.IsHidden) { //todo: Find a better solution. //This is a hack since apparently the docking suite doesn't save/load //the layout correctly when the window was floating. //Loading the editor will hide all windows that were floating //and the previous dockContent.Show will not bring them back and the window stays hidden! dockContent.Show(_dockPanel, DockState.Float); } } else { dockContent.Hide(); } } } }
/// <summary> /// Does a command</summary> /// <param name="commandTag">Command</param> public void DoCommand(object commandTag) { Control control = commandTag as Control; if (control != null) { DockContent dockContent = FindContent(control); if (dockContent.Visible) { dockContent.Hide(); } else { dockContent.Show(); } } if (commandTag is StandardCommand) { switch ((StandardCommand)commandTag) { case StandardCommand.WindowTileHorizontal: TileDocumentContent(DockStyle.Right); break; case StandardCommand.WindowTileVertical: TileDocumentContent(DockStyle.Bottom); break; case StandardCommand.WindowTileTabbed: TileDocumentContent(DockStyle.Fill); break; } } }
public PanelsHelper(PluginMain pluginMain, Image pluginImage) { localsUI = new LocalsUI(pluginMain); localsUI.Text = TextHelper.GetString("Title.LocalVariables"); localsPanel = PluginBase.MainForm.CreateDockablePanel(localsUI, localsGuid, pluginImage, DockState.DockLeft); localsPanel.Hide(); stackframeUI = new StackframeUI(pluginMain, MenusHelper.imageList); stackframeUI.Text = TextHelper.GetString("Title.StackTrace"); stackframePanel = PluginBase.MainForm.CreateDockablePanel(stackframeUI, stackframeGuid, pluginImage, DockState.DockLeft); stackframePanel.Hide(); watchUI = new WatchUI(); watchUI.Text = TextHelper.GetString("Title.Watch"); watchPanel = PluginBase.MainForm.CreateDockablePanel(watchUI, watchGuid, pluginImage, DockState.DockLeft); watchPanel.Hide(); breakPointUI = new BreakPointUI(pluginMain, PluginMain.breakPointManager); breakPointUI.Text = TextHelper.GetString("Title.Breakpoints"); breakPointPanel = PluginBase.MainForm.CreateDockablePanel(breakPointUI, breakPointGuid, pluginImage, DockState.DockLeft); breakPointPanel.Hide(); immediateUI = new ImmediateUI(); immediateUI.Text = TextHelper.GetString("Title.Immediate"); immediatePanel = PluginBase.MainForm.CreateDockablePanel(immediateUI, immediateGuid, pluginImage, DockState.DockLeft); immediatePanel.Hide(); threadsUI = new ThreadsUI(pluginMain, MenusHelper.imageList); threadsUI.Text = TextHelper.GetString("Title.Threads"); threadsPanel = PluginBase.MainForm.CreateDockablePanel(threadsUI, threadsGuid, pluginImage, DockState.DockLeft); threadsPanel.Hide(); }
internal void HideContent(DockContent dc) { if (!dc.IsDisposed) { dc.Hide(); } }
private void dockContent_FormClosing(object sender, FormClosingEventArgs e) { DockContent dockContent = (DockContent)sender; Control control = dockContent.Controls[0]; ControlInfo controlInfo = FindControlInfo(control); // close document forms if client allows; just hide other forms if (controlInfo.Client.Close(control)) { // unregister center controls for the client if they haven't already done it if (IsCenterGroup(controlInfo.Group)) { UnregisterControl(control); if (m_activeDockContent == dockContent) { m_activeDockContent = null; } } else { dockContent.Hide(); e.Cancel = true; } } else { e.Cancel = true; } }
public PanelsHelper(PluginMain pluginMain, Image pluginImage) { pluginUI = new PluginUI(pluginMain); pluginUI.Text = TextHelper.GetString("Title.LocalVariables"); pluginPanel = PluginBase.MainForm.CreateDockablePanel(pluginUI, pluginGuid, pluginImage, DockState.DockLeft); pluginPanel.Hide(); stackframeUI = new StackframeUI(pluginMain, MenusHelper.imageList); stackframeUI.Text = TextHelper.GetString("Title.StackTrace"); stackframePanel = PluginBase.MainForm.CreateDockablePanel(stackframeUI, stackframeGuid, pluginImage, DockState.DockLeft); stackframePanel.Hide(); watchUI = new WatchUI(); watchUI.Text = TextHelper.GetString("Title.Watch"); watchPanel = PluginBase.MainForm.CreateDockablePanel(watchUI, watchGuid, pluginImage, DockState.DockLeft); watchPanel.Hide(); breakPointUI = new BreakPointUI(pluginMain, PluginMain.breakPointManager); breakPointUI.Text = TextHelper.GetString("Title.Breakpoints"); breakPointPanel = PluginBase.MainForm.CreateDockablePanel(breakPointUI, breakPointGuid, pluginImage, DockState.DockLeft); breakPointPanel.Hide(); virtualMachinesUI = new VirtualMachinesUI(pluginMain, MenusHelper.imageList); virtualMachinesUI.Text = TextHelper.GetString("Title.VirtualMachines"); virtualMachinesPanel = PluginBase.MainForm.CreateDockablePanel(virtualMachinesUI, virtualMachinesGuid, pluginImage, DockState.DockLeft); virtualMachinesPanel.Hide(); }
private void PanelPane_Layout(object sender, LayoutEventArgs e) { DockPane panelPane = (DockPane)sender; int floating = 0; DockContent defaultDock = null; foreach (DockContent cont in panelPane.Contents) { if (cont.Name != String.Empty) { if (cont.IsFloat) { floating++; } } else { defaultDock = cont; } } if (panelPane.Contents.Count - floating > 1 && defaultDock != null && !defaultDock.IsHidden) { defaultDock.Hide(); } }
/// <summary> /// Unregisters control</summary> /// <param name="control">Control to unregister</param> public void UnregisterControl(Control control) { ControlInfo info = FindControlInfo(control); if (info != null) { // Undoes the effects of RegisterControl(), in the reverse order. DockContent dockContent = FindContent(info); UnregisterMenuCommand(control); dockContent.FormClosing -= new FormClosingEventHandler(dockContent_FormClosing); dockContent.Controls.Remove(control); // Restore any properties we set on Control. control.Dock = info.OriginalDock; m_dockContent.Remove(info); m_controls.Remove(info); info.Changed -= new EventHandler(info_Changed); m_uniqueNamer.Retire(dockContent.Text); dockContent.Hide(); dockContent.Dispose(); info.HostControl = null; } }
public void Hide(Type type) { if (formContainer.ContainsKey(type)) { DockContent form = formContainer[type]; form.Hide(); } }
/// <summary> /// 关闭当前Dock窗口 /// </summary> private void CloseCurDock() { DockContent dc = this.GetCurDock(); if (dc != null) { dc.Hide(); } }
/// <summary> /// 关闭窗口 /// </summary> /// <param name="form"></param> private void CloseForm(DockContent form) { DockContent hasDockContent = FindDocument(form.Text); if (hasDockContent != null) { hasDockContent.Hide(); } }
public void HideDockPanel(DockContent panel) { if (panel == null) { return; } panel.Hide(); }
public static void Init(DockPanel panel, ToolStripDropDownButton menu) { foreach (var type in typeof(ModuleAtribute).Assembly.GetTypes()) { foreach (var a in type.GetCustomAttributes(typeof(ModuleAtribute), false)) { ModuleAtribute atrib = a as ModuleAtribute; DockContent form = type.GetConstructor(new Type[] { }).Invoke(null) as DockContent; ToolStripMenuItem btn = new ToolStripMenuItem(atrib.dysplayName); menu.DropDownItems.Add(btn); btn.Click += (s, e) => { if (form.Visible) { form.Hide(); } else { Show(type); } }; form.TabText = atrib.dysplayName; form.FormClosing += (s, e) => { e.Cancel = true; form.Hide(); }; forms.Add(type, new key() { form = form, dock = atrib.dock, panel = panel }); if (atrib.defaultShow) { Show(type); } } } }
public void ShowDockContent(DockContent content, DockContent defaultDock, ContentCategory category) { try { content.FormClosed += content_FormClosed; List <DockContent> typeList; Type type = content.GetType(); if (!DockContents.TryGetValue(type, out typeList)) { typeList = new List <DockContent>(); DockContents.Add(type, typeList); } typeList.Add(content); var handler = DockContentAdded; if (handler != null) { handler(this, new DockContentEventArgs(content)); } if (defaultDock == null) { content.Show(this.dockPanel, DockState.Float); } else { content.Show(defaultDock.Pane, null); if (((defaultDock == DockFiles) || (defaultDock == DockEditors)) && !defaultDock.IsHidden) { defaultDock.Hide(); } } SetDocking(content, dockingToolStripMenuItem.Checked); if (category != ContentCategory.None) { ((FormQuickAccess)DockQuickAccess).RegisterOpenFile(content, category); } foreach (Control c in content.Controls) { if (c is MenuStrip) { MenuStrip ms = (MenuStrip)c; InstallStatusLineHandler(ms.Items); } } } catch (Exception ex) { Utility.ReportException(ex); } }
private void mainPageToolStripMenuItem_Click(object sender, EventArgs e) { if (mainPageToolStripMenuItem.Checked) { webBrowserDockPanel.Hide(); } else { webBrowserDockPanel.Show(dockPanel1); } }
private void ToggleDocked(DockContent dockContent) { if (dockContent.Visible) { dockContent.Hide(); } else { ShowDocked(dockContent); } }
private void projectPanelToolStripMenuItem_Click(object sender, EventArgs e) { if (projectPanelToolStripMenuItem.Checked) { projectDockPanel.Hide(); } else { projectDockPanel.Show(dockPanel1); } }
protected void TogglePanel(DockContent dContent, bool show) { if (show) { dContent.Show(); } else { dContent.Hide(); } }
private void objectRelationsBuilderPageToolStripMenuItem_Click(object sender, EventArgs e) { if (objectRelationsBuilderPageToolStripMenuItem.Checked) { objectRelationsBuilderDockPanel.Hide(); } else { objectRelationsBuilderDockPanel.Show(dockPanel1); } }
/// <summary> /// Opens the plugin panel again if closed /// </summary> public void OpenPanel(object sender, EventArgs e) { if (sender is ToolStripButton && profilerPanel.Visible && profilerPanel.DockState.ToString().IndexOf("AutoHide") < 0) { profilerPanel.Hide(); } else { profilerPanel.Show(); } }
private void objectPropertiesPanelToolStripMenuItem_Click(object sender, EventArgs e) { if (objectPropertiesPanelToolStripMenuItem.Checked) { propertyGridDockPanel.Hide(); } else { propertyGridDockPanel.Show(dockPanel1); } }
public void SyncPanelFromMenuItem(DockContent panel, ToolStripMenuItem menuItem) { if (menuItem.Checked) { if (!panel.Visible) panel.Show(); } else { if (panel.Visible) panel.Hide(); } }
/// <summary> /// Handles the Click event of the show message details <see cref="ToolStripButton"/>. /// <para> /// Shows or hides the message details window. /// </para> /// </summary> private void TsbShowMessageDetailsClick(object sender, EventArgs e) { if (mMessageDetails != null) { if (tsbShowMessageDetails.Checked) { mMessageDetails.Show(LogDockPanel); } else { mMessageDetails.Hide(); } } }
/// <summary> /// Handles the Click event of the show logger tree <see cref="ToolStripButton"/>. /// <para> /// Shows or hides the logger tree window. /// </para> /// </summary> private void TsbShowLoggerTreeClick(object sender, EventArgs e) { if (mLoggerTree != null) { if (tsbShowLoggerTree.Checked) { mLoggerTree.Show(LogDockPanel); } else { mLoggerTree.Hide(); } } }
/// <summary> /// Handles the Click event of the show bookmarks <see cref="ToolStripButton"/>. /// <para> /// Shows or hides the bookmarks window. /// </para> /// </summary> private void TsbShowBookmarksClick(object sender, EventArgs e) { if (mBookmarks != null) { if (tsbShowBookmarks.Checked) { mBookmarks.Show(LogDockPanel); } else { mBookmarks.Hide(); } } }
/// <summary> /// Handles the Click event of the show filter <see cref="ToolStripButton"/>. /// <para> /// Shows or hides the filter window. /// </para> /// </summary> private void TsbShowFilterClick(object sender, EventArgs e) { if (mFilter != null) { if (tsbShowFilter.Checked) { mFilter.Show(LogDockPanel); } else { mFilter.Hide(); } } }
/// <summary> /// Handles the Click event of the show statistic <see cref="ToolStripButton"/>. /// <para> /// Shows or hides the statistic window. /// </para> /// </summary> private void TsbShowStatisticClick(object sender, EventArgs e) { if (mLogStatistic != null) { if (tsbShowStatistic.Checked) { mLogStatistic.Show(LogDockPanel); } else { mLogStatistic.Hide(); } } }
public void ShowDockContent(DockContent content, DockContent defaultDock, ContentCategory category) { try { content.FormClosed += content_FormClosed; List <DockContent> typeList; Type type = content.GetType(); if (!DockContents.TryGetValue(type, out typeList)) { typeList = new List <DockContent>(); DockContents.Add(type, typeList); } typeList.Add(content); var handler = DockContentAdded; if (handler != null) { handler(this, new DockContentEventArgs(content)); } if (defaultDock == null) { content.Show(this.dockPanel, DockState.Float); } else { content.Show(defaultDock.Pane, null); if (((defaultDock == DockFiles) || (defaultDock == DockEditors)) && !defaultDock.IsHidden) { defaultDock.Hide(); } } if (category != ContentCategory.None) { ((FormQuickAccess)DockQuickAccess).RegisterOpenFile(content, category); } } catch (Exception ex) { Utility.ReportException(ex); } }
void AddContent(string name, DockContent content, DockState state) { content.Text = name; content.TabText = name; content.Show(dockPanel1, state); content.HideOnClose = true; _contentMap.Add(name, content); var cb = new ToolStripMenuItem(); cb.Checked = true; cb.CheckOnClick = true; cb.Text = name; cb.Name = "chk_" + name; cb.CheckedChanged += (o, e) => { var check = ((ToolStripMenuItem)o).Checked; if (check == content.Visible) { return; } if (check) { //Console.WriteLine(string.Format("checked: {0}", name)); content.Show(); } else { //Console.WriteLine(string.Format("unchecked: {0}", name)); content.Hide(); } }; viewToolStripMenuItem.DropDownItems.Add(cb); content.VisibleChanged += (o, e) => { //Console.WriteLine(string.Format("visible: {0}.{1}", name, content.Visible)); cb.Checked = content.Visible; }; }