Exemplo n.º 1
0
        public void SetupUI(IDebugUI UI)
        {
            #region Menu Bar

            var stepMenuItem = UI.NewMenuItem();
            {
                stepMenuItem.Label    = "Step One";
                stepMenuItem.Icon     = Properties.Resources.arrow_right;
                stepMenuItem.Clicked += this.Step;
            }
            var continueMenuItem = UI.NewMenuItem();
            {
                continueMenuItem.Label    = "Continue";
                continueMenuItem.Icon     = Properties.Resources.right_circular;
                continueMenuItem.Clicked += this.Continue;
            }

            UI.AddMenuItem(stepMenuItem, "Debug");
            UI.AddMenuItem(continueMenuItem, "Debug");

            #endregion

            #region Toolbar Panel

            var panel = UI.NewToolbarPanel();
            panel.Title = "Execution";

            var stepItem = UI.NewToolbarItem();
            {
                stepItem.ToolTip  = "Step";
                stepItem.Icon     = Properties.Resources.arrow_right;
                stepItem.Clicked += this.Step;
            }
            var continueItem = UI.NewToolbarItem();
            {
                continueItem.ToolTip  = "Continue";
                continueItem.Icon     = Properties.Resources.right_circular;
                continueItem.Clicked += this.Continue;
            }
            var stopItem = UI.NewToolbarItem();
            {
                stopItem.ToolTip  = "End Debugging";
                stopItem.Icon     = Properties.Resources.stop;
                stopItem.Clicked += this.End;
            }
            panel.AddToolbarItem(stepItem);
            panel.AddToolbarItem(continueItem);
            panel.AddToolbarItem(stopItem);

            UI.AddToolbarPanel(panel);
            #endregion

            UI.AddSearchCategory(new FileSearchCategory(UI));
            UI.AddSearchCategory(new SymbolSearchCategory());
        }
Exemplo n.º 2
0
        /// <summary>
        /// Builds the extension's user interface.
        /// </summary>
        public void SetupUI(IDebugUI UI)
        {
            Application.DebuggerChanged += OnDebuggerChanged;

            /* == Menu Items == */
            var clearAllMenu = UI.NewMenuItem();
            {
                clearAllMenu.Label    = "Clear all breakpoints";
                clearAllMenu.Clicked += clearAllBreakpoints;
            }
            UI.AddMenuItem(clearAllMenu, "Debug");

            /* == Toolbar Items == */
            var panel = UI.NewToolbarPanel();
            panel.Title = "Breakpoints";

            // Add "Clear all breakpoints" item
            var clearAllItem = UI.NewToolbarItem();
            {
                clearAllItem.ToolTip = "Clears all breakpoints";
                clearAllItem.Clicked += clearAllBreakpoints;
            }
            // Add "Toggle breakpoint on mode change" item
            this.cpuModeToggleItem = UI.NewToolbarItem(isToggle: true);
            {
                this.cpuModeToggleItem.IsEnabled = Application.Debugger is Bochs.BochsDebugger;
                this.cpuModeToggleItem.ToolTip   = "Toggle breakpoint on CPU mode change";
                this.cpuModeToggleItem.Clicked  += this.toggleBPOnModeChange;
            }
            panel.AddToolbarItem(clearAllItem);
            panel.AddToolbarItem(cpuModeToggleItem);

            // Add the panel to the UI
            UI.AddToolbarPanel(panel);

            // Add the search category
            UI.AddSearchCategory(new SearchCategory());
        }