Exemplo n.º 1
0
 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);
 }
Exemplo n.º 2
0
        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;
                }
            }
        }
Exemplo n.º 4
0
        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();
        }
Exemplo n.º 5
0
 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;
            }
        }
Exemplo n.º 7
0
        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();
        }
Exemplo n.º 8
0
        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;
            }
        }
Exemplo n.º 10
0
 public void Hide(Type type)
 {
     if (formContainer.ContainsKey(type))
     {
         DockContent form = formContainer[type];
         form.Hide();
     }
 }
Exemplo n.º 11
0
        /// <summary>
        /// 关闭当前Dock窗口
        /// </summary>
        private void CloseCurDock()
        {
            DockContent dc = this.GetCurDock();

            if (dc != null)
            {
                dc.Hide();
            }
        }
Exemplo n.º 12
0
        /// <summary>
        /// 关闭窗口
        /// </summary>
        /// <param name="form"></param>
        private void CloseForm(DockContent form)
        {
            DockContent hasDockContent = FindDocument(form.Text);

            if (hasDockContent != null)
            {
                hasDockContent.Hide();
            }
        }
Exemplo n.º 13
0
        public void HideDockPanel(DockContent panel)
        {
            if (panel == null)
            {
                return;
            }

            panel.Hide();
        }
Exemplo n.º 14
0
        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);
                    }
                }
            }
        }
Exemplo n.º 15
0
        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);
            }
        }
Exemplo n.º 16
0
 private void mainPageToolStripMenuItem_Click(object sender, EventArgs e)
 {
     if (mainPageToolStripMenuItem.Checked)
     {
         webBrowserDockPanel.Hide();
     }
     else
     {
         webBrowserDockPanel.Show(dockPanel1);
     }
 }
Exemplo n.º 17
0
 private void ToggleDocked(DockContent dockContent)
 {
     if (dockContent.Visible)
     {
         dockContent.Hide();
     }
     else
     {
         ShowDocked(dockContent);
     }
 }
Exemplo n.º 18
0
 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();
     }
 }
Exemplo n.º 20
0
 private void objectRelationsBuilderPageToolStripMenuItem_Click(object sender, EventArgs e)
 {
     if (objectRelationsBuilderPageToolStripMenuItem.Checked)
     {
         objectRelationsBuilderDockPanel.Hide();
     }
     else
     {
         objectRelationsBuilderDockPanel.Show(dockPanel1);
     }
 }
Exemplo n.º 21
0
 /// <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();
     }
 }
Exemplo n.º 22
0
 private void objectPropertiesPanelToolStripMenuItem_Click(object sender, EventArgs e)
 {
     if (objectPropertiesPanelToolStripMenuItem.Checked)
     {
         propertyGridDockPanel.Hide();
     }
     else
     {
         propertyGridDockPanel.Show(dockPanel1);
     }
 }
Exemplo n.º 23
0
 public void SyncPanelFromMenuItem(DockContent panel, ToolStripMenuItem menuItem)
 {
     if (menuItem.Checked)
     {
         if (!panel.Visible)
             panel.Show();
     }
     else
     {
         if (panel.Visible)
             panel.Hide();
     }
 }
Exemplo n.º 24
0
 /// <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();
         }
     }
 }
Exemplo n.º 25
0
 /// <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();
         }
     }
 }
Exemplo n.º 26
0
 /// <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();
         }
     }
 }
Exemplo n.º 27
0
 /// <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();
         }
     }
 }
Exemplo n.º 28
0
 /// <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();
         }
     }
 }
Exemplo n.º 29
0
        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);
            }
        }
Exemplo n.º 30
0
        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;
            };
        }