diff --git a/GUI.NET/Controls/ctrlMesenMenuStrip.cs b/GUI.NET/Controls/ctrlMesenMenuStrip.cs new file mode 100644 index 00000000..2d4d29ec --- /dev/null +++ b/GUI.NET/Controls/ctrlMesenMenuStrip.cs @@ -0,0 +1,21 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Forms; + +namespace Mesen.GUI.Controls +{ + public class ctrlMesenMenuStrip : MenuStrip + { + private const int WM_MOUSEACTIVATE = 0x21; + protected override void WndProc(ref Message m) + { + if(m.Msg == WM_MOUSEACTIVATE && this.CanFocus && !this.Focused) { + this.Focus(); + } + base.WndProc(ref m); + } + } +} diff --git a/GUI.NET/Controls/ctrlMesenToolStrip.cs b/GUI.NET/Controls/ctrlMesenToolStrip.cs new file mode 100644 index 00000000..ea2397ee --- /dev/null +++ b/GUI.NET/Controls/ctrlMesenToolStrip.cs @@ -0,0 +1,21 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Forms; + +namespace Mesen.GUI.Controls +{ + public class ctrlMesenToolStrip : ToolStrip + { + private const int WM_MOUSEACTIVATE = 0x21; + protected override void WndProc(ref Message m) + { + if(m.Msg == WM_MOUSEACTIVATE && this.CanFocus && !this.Focused) { + this.Focus(); + } + base.WndProc(ref m); + } + } +} diff --git a/GUI.NET/Debugger/frmAssembler.Designer.cs b/GUI.NET/Debugger/frmAssembler.Designer.cs index ad577f17..27ce54a8 100644 --- a/GUI.NET/Debugger/frmAssembler.Designer.cs +++ b/GUI.NET/Debugger/frmAssembler.Designer.cs @@ -56,7 +56,7 @@ this.mnuSelectAll = new System.Windows.Forms.ToolStripMenuItem(); this.groupBox2 = new System.Windows.Forms.GroupBox(); this.ctrlHexBox = new Be.Windows.Forms.HexBox(); - this.menuStrip1 = new System.Windows.Forms.MenuStrip(); + this.menuStrip1 = new Mesen.GUI.Controls.ctrlMesenMenuStrip(); this.fileToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.mnuClose = new System.Windows.Forms.ToolStripMenuItem(); this.viewToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); @@ -581,7 +581,7 @@ private System.Windows.Forms.GroupBox groupBox2; private System.Windows.Forms.Button btnExecute; private FastColoredTextBoxNS.FastColoredTextBox txtCode; - private System.Windows.Forms.MenuStrip menuStrip1; + private Mesen.GUI.Controls.ctrlMesenMenuStrip menuStrip1; private System.Windows.Forms.ToolStripMenuItem fileToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem mnuClose; private System.Windows.Forms.ToolStripMenuItem viewToolStripMenuItem; diff --git a/GUI.NET/Debugger/frmDebugger.Designer.cs b/GUI.NET/Debugger/frmDebugger.Designer.cs index 8cdcdca3..f048feac 100644 --- a/GUI.NET/Debugger/frmDebugger.Designer.cs +++ b/GUI.NET/Debugger/frmDebugger.Designer.cs @@ -50,7 +50,7 @@ namespace Mesen.GUI.Debugger this.ctrlBreakpoints = new Mesen.GUI.Debugger.Controls.ctrlBreakpoints(); this.grpCallstack = new System.Windows.Forms.GroupBox(); this.ctrlCallstack = new Mesen.GUI.Debugger.Controls.ctrlCallstack(); - this.menuStrip = new System.Windows.Forms.MenuStrip(); + this.menuStrip = new Mesen.GUI.Controls.ctrlMesenMenuStrip(); this.mnuFile = new System.Windows.Forms.ToolStripMenuItem(); this.mnuSaveRom = new System.Windows.Forms.ToolStripMenuItem(); this.mnuSaveRomAs = new System.Windows.Forms.ToolStripMenuItem(); @@ -169,7 +169,7 @@ namespace Mesen.GUI.Debugger this.lblCyclesElapsed = new System.Windows.Forms.ToolStripStatusLabel(); this.ctrlPpuMemoryMapping = new Mesen.GUI.Debugger.Controls.ctrlMemoryMapping(); this.ctrlCpuMemoryMapping = new Mesen.GUI.Debugger.Controls.ctrlMemoryMapping(); - this.tsToolbar = new System.Windows.Forms.ToolStrip(); + this.tsToolbar = new Mesen.GUI.Controls.ctrlMesenToolStrip(); this.mnuShowMemoryValues = new System.Windows.Forms.ToolStripMenuItem(); ((System.ComponentModel.ISupportInitialize)(this.splitContainer)).BeginInit(); this.splitContainer.Panel1.SuspendLayout(); @@ -1545,7 +1545,7 @@ namespace Mesen.GUI.Debugger private System.Windows.Forms.TableLayoutPanel tableLayoutPanel10; private System.Windows.Forms.GroupBox grpBreakpoints; private System.Windows.Forms.GroupBox grpWatch; - private System.Windows.Forms.MenuStrip menuStrip; + private Mesen.GUI.Controls.ctrlMesenMenuStrip menuStrip; private System.Windows.Forms.ToolStripMenuItem mnuFile; private System.Windows.Forms.ToolStripMenuItem debugToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem mnuContinue; @@ -1674,7 +1674,7 @@ namespace Mesen.GUI.Debugger private System.Windows.Forms.ToolStripMenuItem mnuShowVerifiedData; private System.Windows.Forms.ToolStripMenuItem mnuShowUnidentifiedData; private System.Windows.Forms.ToolStripMenuItem mnuConfigureColors; - private System.Windows.Forms.ToolStrip tsToolbar; + private Mesen.GUI.Controls.ctrlMesenToolStrip tsToolbar; private System.Windows.Forms.ToolStripMenuItem mnuShowToolbar; private System.Windows.Forms.ToolStripMenuItem mnuPpuShowPreviousFrame; private System.Windows.Forms.ToolStripSeparator toolStripMenuItem19; diff --git a/GUI.NET/Debugger/frmEventViewer.Designer.cs b/GUI.NET/Debugger/frmEventViewer.Designer.cs index 61990eb6..de4f0ed6 100644 --- a/GUI.NET/Debugger/frmEventViewer.Designer.cs +++ b/GUI.NET/Debugger/frmEventViewer.Designer.cs @@ -46,7 +46,7 @@ this.chkShowPpuRegisterWrites = new System.Windows.Forms.CheckBox(); this.chkShowMapperRegisterWrites = new System.Windows.Forms.CheckBox(); this.chkShowSpriteZero = new System.Windows.Forms.CheckBox(); - this.menuStrip1 = new System.Windows.Forms.MenuStrip(); + this.menuStrip1 = new Mesen.GUI.Controls.ctrlMesenMenuStrip(); this.fileToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.mnuClose = new System.Windows.Forms.ToolStripMenuItem(); this.viewToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); @@ -333,7 +333,7 @@ private System.Windows.Forms.TabControl tabMain; private System.Windows.Forms.TabPage tpgPpuView; private Controls.ctrlEventViewerPpuView ctrlEventViewerPpuView; - private System.Windows.Forms.MenuStrip menuStrip1; + private Mesen.GUI.Controls.ctrlMesenMenuStrip menuStrip1; private System.Windows.Forms.ToolStripMenuItem fileToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem mnuClose; private System.Windows.Forms.ToolStripMenuItem viewToolStripMenuItem; diff --git a/GUI.NET/Debugger/frmMemoryViewer.Designer.cs b/GUI.NET/Debugger/frmMemoryViewer.Designer.cs index 6221a269..1bbcddb5 100644 --- a/GUI.NET/Debugger/frmMemoryViewer.Designer.cs +++ b/GUI.NET/Debugger/frmMemoryViewer.Designer.cs @@ -35,7 +35,7 @@ this.flowLayoutPanel1 = new System.Windows.Forms.FlowLayoutPanel(); this.lblViewMemoryType = new System.Windows.Forms.Label(); this.cboMemoryType = new Mesen.GUI.Debugger.Controls.ComboBoxWithSeparator(); - this.menuStrip1 = new System.Windows.Forms.MenuStrip(); + this.menuStrip1 = new Mesen.GUI.Controls.ctrlMesenMenuStrip(); this.fileToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.mnuImport = new System.Windows.Forms.ToolStripMenuItem(); this.mnuExport = new System.Windows.Forms.ToolStripMenuItem(); @@ -771,7 +771,7 @@ private System.Windows.Forms.FlowLayoutPanel flowLayoutPanel1; private System.Windows.Forms.Label lblViewMemoryType; private Mesen.GUI.Debugger.Controls.ComboBoxWithSeparator cboMemoryType; - private System.Windows.Forms.MenuStrip menuStrip1; + private Mesen.GUI.Controls.ctrlMesenMenuStrip menuStrip1; private System.Windows.Forms.ToolStripMenuItem toolStripMenuItem1; private System.Windows.Forms.ToolStripMenuItem mnuFind; private System.Windows.Forms.ToolStripMenuItem mnuFindNext; diff --git a/GUI.NET/Debugger/frmPpuViewer.Designer.cs b/GUI.NET/Debugger/frmPpuViewer.Designer.cs index 77a9bc5f..c79f7046 100644 --- a/GUI.NET/Debugger/frmPpuViewer.Designer.cs +++ b/GUI.NET/Debugger/frmPpuViewer.Designer.cs @@ -33,7 +33,7 @@ namespace Mesen.GUI.Debugger /// private void InitializeComponent() { - this.menuStrip1 = new System.Windows.Forms.MenuStrip(); + this.menuStrip1 = new Mesen.GUI.Controls.ctrlMesenMenuStrip(); this.fileToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.mnuClose = new System.Windows.Forms.ToolStripMenuItem(); this.viewToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); @@ -352,7 +352,7 @@ namespace Mesen.GUI.Debugger #endregion - private System.Windows.Forms.MenuStrip menuStrip1; + private Mesen.GUI.Controls.ctrlMesenMenuStrip menuStrip1; private System.Windows.Forms.ToolStripMenuItem fileToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem mnuClose; private System.Windows.Forms.ToolStripMenuItem viewToolStripMenuItem; diff --git a/GUI.NET/Debugger/frmScript.Designer.cs b/GUI.NET/Debugger/frmScript.Designer.cs index b214da68..92696546 100644 --- a/GUI.NET/Debugger/frmScript.Designer.cs +++ b/GUI.NET/Debugger/frmScript.Designer.cs @@ -32,7 +32,7 @@ private void InitializeComponent() { this.components = new System.ComponentModel.Container(); - this.mnuMain = new System.Windows.Forms.MenuStrip(); + this.mnuMain = new Mesen.GUI.Controls.ctrlMesenMenuStrip(); this.fileToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.mnuNewScript = new System.Windows.Forms.ToolStripMenuItem(); this.mnuOpen = new System.Windows.Forms.ToolStripMenuItem(); @@ -59,7 +59,7 @@ this.mnuBlankWindow = new System.Windows.Forms.ToolStripMenuItem(); this.mnuTutorialScript = new System.Windows.Forms.ToolStripMenuItem(); this.mnuAutoLoadLastScript = new System.Windows.Forms.ToolStripMenuItem(); - this.toolStrip1 = new System.Windows.Forms.ToolStrip(); + this.toolStrip1 = new Mesen.GUI.Controls.ctrlMesenToolStrip(); this.btnOpen = new System.Windows.Forms.ToolStripButton(); this.btnSave = new System.Windows.Forms.ToolStripButton(); this.toolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator(); @@ -568,10 +568,10 @@ #endregion - private System.Windows.Forms.MenuStrip mnuMain; + private Mesen.GUI.Controls.ctrlMesenMenuStrip mnuMain; private System.Windows.Forms.ToolStripMenuItem fileToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem mnuOpen; - private System.Windows.Forms.ToolStrip toolStrip1; + private Mesen.GUI.Controls.ctrlMesenToolStrip toolStrip1; private System.Windows.Forms.ToolStripButton btnRun; private System.Windows.Forms.ToolStripSeparator toolStripMenuItem1; private System.Windows.Forms.ToolStripMenuItem mnuClose; diff --git a/GUI.NET/Debugger/frmTraceLogger.Designer.cs b/GUI.NET/Debugger/frmTraceLogger.Designer.cs index badfa1ca..34c84bf1 100644 --- a/GUI.NET/Debugger/frmTraceLogger.Designer.cs +++ b/GUI.NET/Debugger/frmTraceLogger.Designer.cs @@ -56,7 +56,7 @@ this.grpExecutionLog = new System.Windows.Forms.GroupBox(); this.txtTraceLog = new Mesen.GUI.Debugger.ctrlScrollableTextbox(); this.tmrUpdateLog = new System.Windows.Forms.Timer(this.components); - this.menuStrip1 = new System.Windows.Forms.MenuStrip(); + this.menuStrip1 = new Mesen.GUI.Controls.ctrlMesenMenuStrip(); this.showToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.logLinesToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.mnu100Lines = new System.Windows.Forms.ToolStripMenuItem(); @@ -567,7 +567,7 @@ private System.Windows.Forms.TableLayoutPanel tableLayoutPanel3; private System.Windows.Forms.Timer tmrUpdateLog; private System.Windows.Forms.GroupBox grpExecutionLog; - private System.Windows.Forms.MenuStrip menuStrip1; + private Mesen.GUI.Controls.ctrlMesenMenuStrip menuStrip1; private System.Windows.Forms.ToolStripMenuItem showToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem logLinesToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem mnuAutoRefresh; diff --git a/GUI.NET/Forms/Cheats/frmCheatList.Designer.cs b/GUI.NET/Forms/Cheats/frmCheatList.Designer.cs index b2fa031a..6dad95dd 100644 --- a/GUI.NET/Forms/Cheats/frmCheatList.Designer.cs +++ b/GUI.NET/Forms/Cheats/frmCheatList.Designer.cs @@ -45,7 +45,7 @@ namespace Mesen.GUI.Forms.Cheats this.mnuAddCheat = new System.Windows.Forms.ToolStripMenuItem(); this.mnuDeleteCheat = new System.Windows.Forms.ToolStripMenuItem(); this.mnuExportSelectedCheats = new System.Windows.Forms.ToolStripMenuItem(); - this.tsCheatActions = new System.Windows.Forms.ToolStrip(); + this.tsCheatActions = new Mesen.GUI.Controls.ctrlMesenToolStrip(); this.btnAddCheat = new System.Windows.Forms.ToolStripButton(); this.btnDelete = new System.Windows.Forms.ToolStripSplitButton(); this.btnDeleteCheat = new System.Windows.Forms.ToolStripMenuItem(); @@ -463,7 +463,7 @@ namespace Mesen.GUI.Forms.Cheats private System.Windows.Forms.ToolStripMenuItem mnuDeleteCheat; private System.Windows.Forms.TableLayoutPanel tableLayoutPanel2; private System.Windows.Forms.SplitContainer splitContainer1; - private System.Windows.Forms.ToolStrip tsCheatActions; + private Mesen.GUI.Controls.ctrlMesenToolStrip tsCheatActions; private System.Windows.Forms.ToolStripButton btnAddCheat; private System.Windows.Forms.CheckBox chkDisableCheats; private System.Windows.Forms.ListView lstGameList; diff --git a/GUI.NET/Forms/frmMain.Designer.cs b/GUI.NET/Forms/frmMain.Designer.cs index 158fdec7..48b211cd 100644 --- a/GUI.NET/Forms/frmMain.Designer.cs +++ b/GUI.NET/Forms/frmMain.Designer.cs @@ -40,7 +40,7 @@ namespace Mesen.GUI.Forms this.ctrlRecentGames = new Mesen.GUI.Controls.ctrlRecentGames(); this.ctrlNsfPlayer = new Mesen.GUI.Controls.ctrlNsfPlayer(); this.ctrlRenderer = new Mesen.GUI.Controls.ctrlRenderer(); - this.menuStrip = new System.Windows.Forms.MenuStrip(); + this.menuStrip = new Mesen.GUI.Controls.ctrlMesenMenuStrip(); this.mnuFile = new System.Windows.Forms.ToolStripMenuItem(); this.mnuOpen = new System.Windows.Forms.ToolStripMenuItem(); this.toolStripMenuItem4 = new System.Windows.Forms.ToolStripSeparator(); @@ -1633,7 +1633,7 @@ namespace Mesen.GUI.Forms #endregion - private System.Windows.Forms.MenuStrip menuStrip; + private Mesen.GUI.Controls.ctrlMesenMenuStrip menuStrip; private System.Windows.Forms.ToolStripMenuItem mnuFile; private System.Windows.Forms.ToolStripMenuItem mnuOpen; private System.Windows.Forms.ToolStripMenuItem mnuGame; diff --git a/GUI.NET/GUI.NET.csproj b/GUI.NET/GUI.NET.csproj index 6cb9a9ea..112f5363 100644 --- a/GUI.NET/GUI.NET.csproj +++ b/GUI.NET/GUI.NET.csproj @@ -272,6 +272,12 @@ ctrlLoadingRom.cs + + Component + + + Component + UserControl