mirror of
https://github.com/libretro/Mesen.git
synced 2025-01-26 11:16:21 +00:00
Linux: Fixed debugger shortcut keys not working most of the time
This commit is contained in:
parent
5b703b8ef5
commit
39f2a1e2ff
@ -255,8 +255,7 @@ namespace Mesen.GUI.Config
|
||||
}
|
||||
|
||||
Keys keys = (XmlKeys)typeof(DebuggerShortcutsConfig).GetField(fieldName).GetValue(ConfigManager.Config.DebugInfo.Shortcuts);
|
||||
|
||||
if(keys != Keys.None && !ToolStripManager.IsValidShortcut(keys)) {
|
||||
if((keys != Keys.None && !ToolStripManager.IsValidShortcut(keys)) || Program.IsMono) {
|
||||
//Support normally invalid shortcut keys as a shortcut
|
||||
item.ShortcutKeys = Keys.None;
|
||||
item.ShortcutKeyDisplayString = GetShortcutDisplay(keys);
|
||||
@ -264,7 +263,7 @@ namespace Mesen.GUI.Config
|
||||
Form parentForm = parent.FindForm();
|
||||
if(parentForm is BaseForm) {
|
||||
ProcessCmdKeyHandler onProcessCmdKeyHandler = (Keys keyData) => {
|
||||
if(keyData == keys) {
|
||||
if(parent.ContainsFocus && keyData == keys) {
|
||||
item.PerformClick();
|
||||
return true;
|
||||
}
|
||||
|
@ -2,6 +2,7 @@ using System.Windows.Forms;
|
||||
using System.Drawing;
|
||||
using Mesen.GUI;
|
||||
using System;
|
||||
using System.ComponentModel;
|
||||
|
||||
namespace Mesen.GUI.Controls
|
||||
{
|
||||
@ -21,6 +22,21 @@ namespace Mesen.GUI.Controls
|
||||
}
|
||||
}
|
||||
|
||||
public bool IsDesignMode
|
||||
{
|
||||
get
|
||||
{
|
||||
try {
|
||||
return (
|
||||
LicenseManager.UsageMode == LicenseUsageMode.Designtime ||
|
||||
System.Diagnostics.Process.GetCurrentProcess().ProcessName == "devenv"
|
||||
);
|
||||
} catch {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static Bitmap DownArrow
|
||||
{
|
||||
get
|
||||
|
@ -42,27 +42,28 @@ namespace Mesen.GUI.Debugger.Controls
|
||||
|
||||
private void InitShortcuts()
|
||||
{
|
||||
mnuEditInMemoryViewer.InitShortcut(this, nameof(DebuggerShortcutsConfig.CodeWindow_EditInMemoryViewer));
|
||||
mnuEditLabel.InitShortcut(this, nameof(DebuggerShortcutsConfig.CodeWindow_EditLabel));
|
||||
mnuSetNextStatement.InitShortcut(this, nameof(DebuggerShortcutsConfig.CodeWindow_SetNextStatement));
|
||||
mnuShowNextStatement.InitShortcut(this, nameof(DebuggerShortcutsConfig.GoToProgramCounter));
|
||||
mnuToggleBreakpoint.InitShortcut(this, nameof(DebuggerShortcutsConfig.CodeWindow_ToggleBreakpoint));
|
||||
Control parent = (Control)Viewer;
|
||||
mnuEditInMemoryViewer.InitShortcut(parent, nameof(DebuggerShortcutsConfig.CodeWindow_EditInMemoryViewer));
|
||||
mnuEditLabel.InitShortcut(parent, nameof(DebuggerShortcutsConfig.CodeWindow_EditLabel));
|
||||
mnuSetNextStatement.InitShortcut(parent, nameof(DebuggerShortcutsConfig.CodeWindow_SetNextStatement));
|
||||
mnuShowNextStatement.InitShortcut(parent, nameof(DebuggerShortcutsConfig.GoToProgramCounter));
|
||||
mnuToggleBreakpoint.InitShortcut(parent, nameof(DebuggerShortcutsConfig.CodeWindow_ToggleBreakpoint));
|
||||
|
||||
mnuUndoPrgChrEdit.InitShortcut(this, nameof(DebuggerShortcutsConfig.Undo));
|
||||
mnuCopySelection.InitShortcut(this, nameof(DebuggerShortcutsConfig.Copy));
|
||||
mnuUndoPrgChrEdit.InitShortcut(parent, nameof(DebuggerShortcutsConfig.Undo));
|
||||
mnuCopySelection.InitShortcut(parent, nameof(DebuggerShortcutsConfig.Copy));
|
||||
|
||||
mnuSwitchView.InitShortcut(this, nameof(DebuggerShortcutsConfig.CodeWindow_SwitchView));
|
||||
mnuSwitchView.InitShortcut(parent, nameof(DebuggerShortcutsConfig.CodeWindow_SwitchView));
|
||||
|
||||
if(!SourceView) {
|
||||
mnuNavigateBackward.InitShortcut(this, nameof(DebuggerShortcutsConfig.CodeWindow_NavigateBack));
|
||||
mnuNavigateForward.InitShortcut(this, nameof(DebuggerShortcutsConfig.CodeWindow_NavigateForward));
|
||||
mnuNavigateBackward.InitShortcut(parent, nameof(DebuggerShortcutsConfig.CodeWindow_NavigateBack));
|
||||
mnuNavigateForward.InitShortcut(parent, nameof(DebuggerShortcutsConfig.CodeWindow_NavigateForward));
|
||||
|
||||
mnuEditSelectedCode.InitShortcut(this, nameof(DebuggerShortcutsConfig.CodeWindow_EditSelectedCode));
|
||||
mnuEditSubroutine.InitShortcut(this, nameof(DebuggerShortcutsConfig.CodeWindow_EditSubroutine));
|
||||
mnuEditSelectedCode.InitShortcut(parent, nameof(DebuggerShortcutsConfig.CodeWindow_EditSelectedCode));
|
||||
mnuEditSubroutine.InitShortcut(parent, nameof(DebuggerShortcutsConfig.CodeWindow_EditSubroutine));
|
||||
|
||||
mnuMarkAsCode.InitShortcut(this, nameof(DebuggerShortcutsConfig.MarkAsCode));
|
||||
mnuMarkAsData.InitShortcut(this, nameof(DebuggerShortcutsConfig.MarkAsData));
|
||||
mnuMarkAsUnidentifiedData.InitShortcut(this, nameof(DebuggerShortcutsConfig.MarkAsUnidentified));
|
||||
mnuMarkAsCode.InitShortcut(parent, nameof(DebuggerShortcutsConfig.MarkAsCode));
|
||||
mnuMarkAsData.InitShortcut(parent, nameof(DebuggerShortcutsConfig.MarkAsData));
|
||||
mnuMarkAsUnidentifiedData.InitShortcut(parent, nameof(DebuggerShortcutsConfig.MarkAsUnidentified));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -15,7 +15,7 @@ namespace Mesen.GUI.Debugger.Controls
|
||||
{
|
||||
void ScrollToLineNumber(int lineNumber, bool scrollToTop = false);
|
||||
void ScrollToAddress(AddressTypeInfo addressInfo, bool scrollToTop = false);
|
||||
void SetConfig(DebugViewInfo config);
|
||||
void SetConfig(DebugViewInfo config, bool disableActions = false);
|
||||
void EditSubroutine();
|
||||
void EditSelectedCode();
|
||||
|
||||
|
@ -21,9 +21,12 @@ namespace Mesen.GUI.Debugger.Controls
|
||||
public ctrlBreakpoints()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
bool designMode = (LicenseManager.UsageMode == LicenseUsageMode.Designtime);
|
||||
if(!designMode) {
|
||||
protected override void OnLoad(EventArgs e)
|
||||
{
|
||||
base.OnLoad(e);
|
||||
if(!IsDesignMode) {
|
||||
_markedColumnFont = new Font(this.Font.FontFamily, 13f);
|
||||
|
||||
mnuShowLabels.Checked = ConfigManager.Config.DebugInfo.ShowBreakpointLabels;
|
||||
|
@ -58,7 +58,13 @@ namespace Mesen.GUI.Debugger.Controls
|
||||
|
||||
this.chkAutoPalette.Checked = ConfigManager.Config.DebugInfo.ChrViewerUseAutoPalette;
|
||||
this.chkLargeSprites.Checked = ConfigManager.Config.DebugInfo.ChrViewerUseLargeSprites;
|
||||
}
|
||||
}
|
||||
|
||||
protected override void OnLoad(EventArgs e)
|
||||
{
|
||||
base.OnLoad(e);
|
||||
if(!IsDesignMode) {
|
||||
mnuCopyToClipboard.InitShortcut(this, nameof(DebuggerShortcutsConfig.Copy));
|
||||
}
|
||||
}
|
||||
|
@ -45,9 +45,12 @@ namespace Mesen.GUI.Debugger
|
||||
{
|
||||
InitializeComponent();
|
||||
_tooltipManager = new CodeTooltipManager(this, this.ctrlCodeViewer);
|
||||
}
|
||||
|
||||
bool designMode = (LicenseManager.UsageMode == LicenseUsageMode.Designtime);
|
||||
if(!designMode) {
|
||||
protected override void OnLoad(EventArgs e)
|
||||
{
|
||||
base.OnLoad(e);
|
||||
if(!IsDesignMode) {
|
||||
_codeViewerActions = new CodeViewerActions(this, false);
|
||||
|
||||
ctrlFindOccurrences.Viewer = this;
|
||||
@ -55,11 +58,12 @@ namespace Mesen.GUI.Debugger
|
||||
}
|
||||
}
|
||||
|
||||
public void SetConfig(DebugViewInfo config)
|
||||
public void SetConfig(DebugViewInfo config, bool disableActions = false)
|
||||
{
|
||||
_config = config;
|
||||
|
||||
_codeViewerActions.InitMenu(config);
|
||||
if(!disableActions) {
|
||||
_codeViewerActions.InitMenu(config);
|
||||
}
|
||||
|
||||
if(this.ctrlCodeViewer.TextZoom != config.TextZoom) {
|
||||
this.ctrlCodeViewer.TextZoom = config.TextZoom;
|
||||
@ -390,12 +394,14 @@ namespace Mesen.GUI.Debugger
|
||||
public AddressTypeInfo GetAddressInfo(int lineNumber)
|
||||
{
|
||||
AddressTypeInfo info = new AddressTypeInfo();
|
||||
info.Address = this._absoluteLineNumbers[lineNumber];
|
||||
switch(this._lineMemoryType[lineNumber]) {
|
||||
case 'P': info.Type = AddressType.PrgRom; break;
|
||||
case 'W': info.Type = AddressType.WorkRam; break;
|
||||
case 'S': info.Type = AddressType.SaveRam; break;
|
||||
case 'N': info.Type = AddressType.InternalRam; break;
|
||||
if(lineNumber < this._absoluteLineNumbers.Count) {
|
||||
info.Address = this._absoluteLineNumbers[lineNumber];
|
||||
switch(this._lineMemoryType[lineNumber]) {
|
||||
case 'P': info.Type = AddressType.PrgRom; break;
|
||||
case 'W': info.Type = AddressType.WorkRam; break;
|
||||
case 'S': info.Type = AddressType.SaveRam; break;
|
||||
case 'N': info.Type = AddressType.InternalRam; break;
|
||||
}
|
||||
}
|
||||
return info;
|
||||
}
|
||||
|
@ -21,10 +21,13 @@ namespace Mesen.GUI.Debugger.Controls
|
||||
public ctrlFunctionList()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
bool designMode = (LicenseManager.UsageMode == LicenseUsageMode.Designtime);
|
||||
if(!designMode) {
|
||||
this.InitShortcuts();
|
||||
protected override void OnLoad(EventArgs e)
|
||||
{
|
||||
base.OnLoad(e);
|
||||
if(!IsDesignMode) {
|
||||
InitShortcuts();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -31,10 +31,15 @@ namespace Mesen.GUI.Debugger.Controls
|
||||
this.ctrlHexBox.ShadowSelectionColor = Color.FromArgb(100, 60, 128, 200);
|
||||
this.ctrlHexBox.InfoBackColor = Color.FromArgb(235, 235, 235);
|
||||
this.ctrlHexBox.InfoForeColor = Color.Gray;
|
||||
}
|
||||
|
||||
if(LicenseManager.UsageMode != LicenseUsageMode.Designtime) {
|
||||
protected override void OnLoad(EventArgs e)
|
||||
{
|
||||
base.OnLoad(e);
|
||||
|
||||
if(!IsDesignMode) {
|
||||
this.cboNumberColumns.SelectedIndex = ConfigManager.Config.DebugInfo.RamColumnCount;
|
||||
this.InitShortcuts();
|
||||
InitShortcuts();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -44,11 +44,14 @@ namespace Mesen.GUI.Debugger.Controls
|
||||
{
|
||||
InitializeComponent();
|
||||
lstLabels.ListViewItemSorter = new LabelComparer(0, false);
|
||||
}
|
||||
|
||||
bool designMode = (LicenseManager.UsageMode == LicenseUsageMode.Designtime);
|
||||
if(!designMode) {
|
||||
this.InitShortcuts();
|
||||
protected override void OnLoad(EventArgs e)
|
||||
{
|
||||
base.OnLoad(e);
|
||||
if(!IsDesignMode) {
|
||||
mnuShowComments.Checked = ConfigManager.Config.DebugInfo.ShowCommentsInLabelList;
|
||||
InitShortcuts();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -24,16 +24,19 @@ namespace Mesen.GUI.Debugger.Controls
|
||||
InitializeComponent();
|
||||
|
||||
this.toolTip.SetToolTip(chkHighlightUninitRead, "The uninitialized memory reads highlight will only be accurate if the debugger was active when the game was loaded (or if the game has been power cycled since)");
|
||||
}
|
||||
|
||||
bool designMode = (LicenseManager.UsageMode == LicenseUsageMode.Designtime);
|
||||
if(!designMode) {
|
||||
InitShortcuts();
|
||||
protected override void OnLoad(EventArgs e)
|
||||
{
|
||||
base.OnLoad(e);
|
||||
if(!IsDesignMode) {
|
||||
InitMemoryTypeDropdown();
|
||||
cboSort.SelectedIndex = 0;
|
||||
InitShortcuts();
|
||||
}
|
||||
}
|
||||
|
||||
public void InitShortcuts()
|
||||
private void InitShortcuts()
|
||||
{
|
||||
mnuCopy.InitShortcut(this, nameof(DebuggerShortcutsConfig.Copy));
|
||||
mnuSelectAll.InitShortcut(this, nameof(DebuggerShortcutsConfig.SelectAll));
|
||||
|
@ -50,7 +50,13 @@ namespace Mesen.GUI.Debugger.Controls
|
||||
chkUseGrayscalePalette.Checked = ConfigManager.Config.DebugInfo.NtViewerUseGrayscalePalette;
|
||||
chkHighlightTileUpdates.Checked = ConfigManager.Config.DebugInfo.NtViewerHighlightTileUpdates;
|
||||
chkHighlightAttributeUpdates.Checked = ConfigManager.Config.DebugInfo.NtViewerHighlightAttributeUpdates;
|
||||
}
|
||||
}
|
||||
|
||||
protected override void OnLoad(EventArgs e)
|
||||
{
|
||||
base.OnLoad(e);
|
||||
if(!IsDesignMode) {
|
||||
mnuCopyToClipboard.InitShortcut(this, nameof(DebuggerShortcutsConfig.Copy));
|
||||
}
|
||||
}
|
||||
|
@ -10,10 +10,11 @@ using System.Windows.Forms;
|
||||
using static Mesen.GUI.Debugger.Ld65DbgImporter;
|
||||
using System.IO;
|
||||
using Mesen.GUI.Config;
|
||||
using Mesen.GUI.Controls;
|
||||
|
||||
namespace Mesen.GUI.Debugger.Controls
|
||||
{
|
||||
public partial class ctrlSourceViewer : UserControl, ICodeViewer
|
||||
public partial class ctrlSourceViewer : BaseControl, ICodeViewer
|
||||
{
|
||||
private UInt32? _currentActiveAddress { get; set; } = null;
|
||||
private CodeTooltipManager _tooltipManager = null;
|
||||
@ -24,11 +25,14 @@ namespace Mesen.GUI.Debugger.Controls
|
||||
public ctrlSourceViewer()
|
||||
{
|
||||
InitializeComponent();
|
||||
_tooltipManager = new CodeTooltipManager(this, this.ctrlCodeViewer);
|
||||
}
|
||||
|
||||
bool designMode = (LicenseManager.UsageMode == LicenseUsageMode.Designtime);
|
||||
if(!designMode) {
|
||||
protected override void OnLoad(EventArgs e)
|
||||
{
|
||||
base.OnLoad(e);
|
||||
if(!IsDesignMode) {
|
||||
_codeViewerActions = new CodeViewerActions(this, true);
|
||||
_tooltipManager = new CodeTooltipManager(this, this.ctrlCodeViewer);
|
||||
}
|
||||
}
|
||||
|
||||
@ -38,10 +42,12 @@ namespace Mesen.GUI.Debugger.Controls
|
||||
this.ctrlCodeViewer.Focus();
|
||||
}
|
||||
|
||||
public void SetConfig(DebugViewInfo config)
|
||||
public void SetConfig(DebugViewInfo config, bool disableActions = false)
|
||||
{
|
||||
_config = config;
|
||||
_codeViewerActions.InitMenu(config);
|
||||
if(!disableActions) {
|
||||
_codeViewerActions.InitMenu(config);
|
||||
}
|
||||
if(this.ctrlCodeViewer.TextZoom != config.TextZoom) {
|
||||
this.ctrlCodeViewer.TextZoom = config.TextZoom;
|
||||
}
|
||||
@ -171,7 +177,7 @@ namespace Mesen.GUI.Debugger.Controls
|
||||
public AddressTypeInfo GetAddressInfo(int lineIndex)
|
||||
{
|
||||
return new AddressTypeInfo() {
|
||||
Address = _symbolProvider.GetPrgAddress(CurrentFile.ID, lineIndex),
|
||||
Address = _symbolProvider?.GetPrgAddress(CurrentFile.ID, lineIndex) ?? -1,
|
||||
Type = AddressType.PrgRom
|
||||
};
|
||||
}
|
||||
|
@ -37,13 +37,16 @@ namespace Mesen.GUI.Debugger.Controls
|
||||
|
||||
picPreview.Image = new Bitmap(256, 240, PixelFormat.Format32bppArgb);
|
||||
picSprites.Image = new Bitmap(256, 512, PixelFormat.Format32bppArgb);
|
||||
}
|
||||
|
||||
bool designMode = (LicenseManager.UsageMode == LicenseUsageMode.Designtime);
|
||||
if(!designMode) {
|
||||
protected override void OnLoad(EventArgs e)
|
||||
{
|
||||
base.OnLoad(e);
|
||||
if(!IsDesignMode) {
|
||||
mnuCopyToClipboard.InitShortcut(this, nameof(DebuggerShortcutsConfig.Copy));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public void GetData()
|
||||
{
|
||||
DebugState state = new DebugState();
|
||||
|
@ -21,12 +21,14 @@ namespace Mesen.GUI.Debugger
|
||||
InitializeComponent();
|
||||
|
||||
this.DoubleBuffered = true;
|
||||
}
|
||||
|
||||
bool designMode = (LicenseManager.UsageMode == LicenseUsageMode.Designtime);
|
||||
if(!designMode) {
|
||||
protected override void OnLoad(EventArgs e)
|
||||
{
|
||||
base.OnLoad(e);
|
||||
if(!IsDesignMode) {
|
||||
this.mnuHexDisplay.Checked = ConfigManager.Config.DebugInfo.HexDisplay;
|
||||
WatchManager.WatchChanged += WatchManager_WatchChanged;
|
||||
|
||||
mnuRemoveWatch.InitShortcut(this, nameof(DebuggerShortcutsConfig.WatchList_Delete));
|
||||
}
|
||||
}
|
||||
|
@ -59,8 +59,6 @@ namespace Mesen.GUI.Debugger
|
||||
ctrlHexBox.ByteProvider = new StaticByteProvider(new byte[0]);
|
||||
|
||||
txtStartAddress.Text = _startAddress.ToString("X4");
|
||||
|
||||
this.InitShortcuts();
|
||||
}
|
||||
|
||||
private void InitShortcuts()
|
||||
@ -95,6 +93,7 @@ namespace Mesen.GUI.Debugger
|
||||
toolTip.SetToolTip(picStartAddressWarning, "Warning: Start address is invalid. Must be a valid hexadecimal string.");
|
||||
|
||||
UpdateWindow();
|
||||
InitShortcuts();
|
||||
}
|
||||
|
||||
private void UpdateCodeHighlighting()
|
||||
|
@ -60,7 +60,7 @@ namespace Mesen.GUI.Debugger
|
||||
_codeViewer.CodeViewer.HideSelection = true;
|
||||
_codeViewer.CodeViewer.ShowScrollbars = false;
|
||||
_codeViewer.CodeViewer.ScrollToLineIndex(_lineIndex, true);
|
||||
_codeViewer.SetConfig(ConfigManager.Config.DebugInfo.LeftView);
|
||||
_codeViewer.SetConfig(ConfigManager.Config.DebugInfo.LeftView, true);
|
||||
|
||||
Control control = _codeViewer as Control;
|
||||
control.Dock = DockStyle.Fill;
|
||||
|
@ -79,7 +79,7 @@ namespace Mesen.GUI.Debugger
|
||||
_codeViewer.CodeViewer.HideSelection = true;
|
||||
_codeViewer.CodeViewer.ShowScrollbars = false;
|
||||
_codeViewer.ScrollToAddress(_previewAddress.Value, true);
|
||||
_codeViewer.SetConfig(ConfigManager.Config.DebugInfo.LeftView);
|
||||
_codeViewer.SetConfig(ConfigManager.Config.DebugInfo.LeftView, true);
|
||||
|
||||
Control control = _codeViewer as Control;
|
||||
control.Dock = DockStyle.Fill;
|
||||
|
@ -53,22 +53,6 @@ namespace Mesen.GUI.Debugger
|
||||
BreakpointManager.BreakpointsChanged += BreakpointManager_BreakpointsChanged;
|
||||
ctrlProfiler.OnFunctionSelected += ctrlProfiler_OnFunctionSelected;
|
||||
|
||||
ctrlDebuggerCode.CodeViewerActions.OnSetNextStatement += ctrlDebuggerCode_OnSetNextStatement;
|
||||
ctrlDebuggerCode.CodeViewerActions.OnShowInSplitView += ctrlDebuggerCode_OnShowInSplitView;
|
||||
ctrlDebuggerCode.CodeViewerActions.OnSwitchView += ctrlDebuggerCode_OnSwitchView;
|
||||
|
||||
ctrlDebuggerCodeSplit.CodeViewerActions.OnSetNextStatement += ctrlDebuggerCode_OnSetNextStatement;
|
||||
ctrlDebuggerCodeSplit.CodeViewerActions.OnShowInSplitView += ctrlDebuggerCode_OnShowInSplitView;
|
||||
ctrlDebuggerCodeSplit.CodeViewerActions.OnSwitchView += ctrlDebuggerCode_OnSwitchView;
|
||||
|
||||
ctrlSourceViewer.CodeViewerActions.OnSetNextStatement += ctrlDebuggerCode_OnSetNextStatement;
|
||||
ctrlSourceViewer.CodeViewerActions.OnShowInSplitView += ctrlDebuggerCode_OnShowInSplitView;
|
||||
ctrlSourceViewer.CodeViewerActions.OnSwitchView += ctrlDebuggerCode_OnSwitchView;
|
||||
|
||||
ctrlSourceViewerSplit.CodeViewerActions.OnSetNextStatement += ctrlDebuggerCode_OnSetNextStatement;
|
||||
ctrlSourceViewerSplit.CodeViewerActions.OnShowInSplitView += ctrlDebuggerCode_OnShowInSplitView;
|
||||
ctrlSourceViewerSplit.CodeViewerActions.OnSwitchView += ctrlDebuggerCode_OnSwitchView;
|
||||
|
||||
Font font = new Font(ConfigManager.Config.DebugInfo.FontFamily, ConfigManager.Config.DebugInfo.FontSize, ConfigManager.Config.DebugInfo.FontStyle);
|
||||
ctrlDebuggerCode.CodeViewer.BaseFont = font;
|
||||
ctrlDebuggerCodeSplit.CodeViewer.BaseFont = font;
|
||||
@ -154,11 +138,6 @@ namespace Mesen.GUI.Debugger
|
||||
|
||||
_lastCodeWindow = ctrlDebuggerCode;
|
||||
|
||||
this.ctrlDebuggerCode.SetConfig(ConfigManager.Config.DebugInfo.LeftView);
|
||||
this.ctrlSourceViewer.SetConfig(ConfigManager.Config.DebugInfo.LeftView);
|
||||
this.ctrlDebuggerCodeSplit.SetConfig(ConfigManager.Config.DebugInfo.RightView);
|
||||
this.ctrlSourceViewerSplit.SetConfig(ConfigManager.Config.DebugInfo.RightView);
|
||||
|
||||
this.toolTip.SetToolTip(this.picWatchHelp,
|
||||
frmBreakpoint.GetConditionTooltip(true) + Environment.NewLine + Environment.NewLine +
|
||||
"Additionally, the watch window supports a syntax to display X bytes starting from a specific address. e.g:" + Environment.NewLine +
|
||||
@ -195,6 +174,38 @@ namespace Mesen.GUI.Debugger
|
||||
tmrCdlRatios.Start();
|
||||
}
|
||||
|
||||
protected override void OnShown(EventArgs e)
|
||||
{
|
||||
base.OnShown(e);
|
||||
|
||||
ctrlDebuggerCode.CodeViewerActions.OnSetNextStatement += ctrlDebuggerCode_OnSetNextStatement;
|
||||
ctrlDebuggerCode.CodeViewerActions.OnShowInSplitView += ctrlDebuggerCode_OnShowInSplitView;
|
||||
ctrlDebuggerCode.CodeViewerActions.OnSwitchView += ctrlDebuggerCode_OnSwitchView;
|
||||
|
||||
ctrlDebuggerCodeSplit.CodeViewerActions.OnSetNextStatement += ctrlDebuggerCode_OnSetNextStatement;
|
||||
ctrlDebuggerCodeSplit.CodeViewerActions.OnShowInSplitView += ctrlDebuggerCode_OnShowInSplitView;
|
||||
ctrlDebuggerCodeSplit.CodeViewerActions.OnSwitchView += ctrlDebuggerCode_OnSwitchView;
|
||||
|
||||
ctrlSourceViewer.Visible = true;
|
||||
ctrlSourceViewerSplit.Visible = true;
|
||||
|
||||
ctrlSourceViewer.CodeViewerActions.OnSetNextStatement += ctrlDebuggerCode_OnSetNextStatement;
|
||||
ctrlSourceViewer.CodeViewerActions.OnShowInSplitView += ctrlDebuggerCode_OnShowInSplitView;
|
||||
ctrlSourceViewer.CodeViewerActions.OnSwitchView += ctrlDebuggerCode_OnSwitchView;
|
||||
|
||||
ctrlSourceViewerSplit.CodeViewerActions.OnSetNextStatement += ctrlDebuggerCode_OnSetNextStatement;
|
||||
ctrlSourceViewerSplit.CodeViewerActions.OnShowInSplitView += ctrlDebuggerCode_OnShowInSplitView;
|
||||
ctrlSourceViewerSplit.CodeViewerActions.OnSwitchView += ctrlDebuggerCode_OnSwitchView;
|
||||
|
||||
ctrlDebuggerCode.SetConfig(ConfigManager.Config.DebugInfo.LeftView);
|
||||
ctrlSourceViewer.SetConfig(ConfigManager.Config.DebugInfo.LeftView);
|
||||
ctrlDebuggerCodeSplit.SetConfig(ConfigManager.Config.DebugInfo.RightView);
|
||||
ctrlSourceViewerSplit.SetConfig(ConfigManager.Config.DebugInfo.RightView);
|
||||
|
||||
ctrlSourceViewer.Visible = false;
|
||||
ctrlSourceViewerSplit.Visible = false;
|
||||
}
|
||||
|
||||
private void InitShortcuts()
|
||||
{
|
||||
mnuIncreaseFontSize.InitShortcut(this, nameof(DebuggerShortcutsConfig.IncreaseFontSize));
|
||||
|
@ -29,15 +29,14 @@ namespace Mesen.GUI.Debugger
|
||||
public frmMemoryViewer()
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
this._selectedTab = this.tabMain.SelectedTab;
|
||||
this.InitShortcuts();
|
||||
}
|
||||
|
||||
protected override void OnLoad(EventArgs e)
|
||||
{
|
||||
base.OnLoad(e);
|
||||
|
||||
this._selectedTab = this.tabMain.SelectedTab;
|
||||
|
||||
DebugInfo config = ConfigManager.Config.DebugInfo;
|
||||
|
||||
this.mnuAutoRefresh.Checked = config.RamAutoRefresh;
|
||||
@ -93,6 +92,8 @@ namespace Mesen.GUI.Debugger
|
||||
this.Size = ConfigManager.Config.DebugInfo.MemoryViewerSize;
|
||||
this.Location = ConfigManager.Config.DebugInfo.MemoryViewerLocation;
|
||||
}
|
||||
|
||||
this.InitShortcuts();
|
||||
}
|
||||
|
||||
protected override void OnFormClosing(FormClosingEventArgs e)
|
||||
|
@ -40,8 +40,6 @@ namespace Mesen.GUI.Debugger
|
||||
this.StartPosition = FormStartPosition.Manual;
|
||||
this.Location = ConfigManager.Config.DebugInfo.PpuWindowLocation.Value;
|
||||
}
|
||||
|
||||
this.InitShortcuts();
|
||||
}
|
||||
|
||||
private void InitShortcuts()
|
||||
@ -71,6 +69,8 @@ namespace Mesen.GUI.Debugger
|
||||
this.ctrlChrViewer.RefreshViewer();
|
||||
this.ctrlSpriteViewer.RefreshViewer();
|
||||
this.ctrlPaletteViewer.RefreshViewer();
|
||||
|
||||
this.InitShortcuts();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -115,13 +115,15 @@ namespace Mesen.GUI.Debugger
|
||||
|
||||
txtScriptContent.Font = new Font(config.ScriptFontFamily, config.ScriptFontSize, config.ScriptFontStyle);
|
||||
txtScriptContent.Zoom = config.ScriptZoom;
|
||||
}
|
||||
|
||||
if(!this.DesignMode) {
|
||||
this._notifListener = new InteropEmu.NotificationListener();
|
||||
this._notifListener.OnNotification += this._notifListener_OnNotification;
|
||||
protected override void OnLoad(EventArgs e)
|
||||
{
|
||||
base.OnLoad(e);
|
||||
this._notifListener = new InteropEmu.NotificationListener();
|
||||
this._notifListener.OnNotification += this._notifListener_OnNotification;
|
||||
|
||||
this.InitShortcuts();
|
||||
}
|
||||
this.InitShortcuts();
|
||||
}
|
||||
|
||||
private void InitShortcuts()
|
||||
|
@ -85,8 +85,6 @@ namespace Mesen.GUI.Debugger
|
||||
"[Align,50]: Align is a special tag that is useful when trying to align some content. [Align,50] will make the next tag start on column 50."
|
||||
);
|
||||
|
||||
this.InitShortcuts();
|
||||
|
||||
this._initialized = true;
|
||||
}
|
||||
|
||||
@ -105,6 +103,8 @@ namespace Mesen.GUI.Debugger
|
||||
UpdateMenu();
|
||||
tmrUpdateLog.Start();
|
||||
RefreshLog(true, true);
|
||||
|
||||
InitShortcuts();
|
||||
}
|
||||
|
||||
protected override void OnFormClosing(FormClosingEventArgs e)
|
||||
|
Loading…
x
Reference in New Issue
Block a user