UI: Fixed menustrips/toolstrips not responding to first click when window was out of focus
This commit is contained in:
parent
ea99b8a792
commit
608880e6a3
12 changed files with 70 additions and 22 deletions
21
GUI.NET/Controls/ctrlMesenMenuStrip.cs
Normal file
21
GUI.NET/Controls/ctrlMesenMenuStrip.cs
Normal file
|
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
21
GUI.NET/Controls/ctrlMesenToolStrip.cs
Normal file
21
GUI.NET/Controls/ctrlMesenToolStrip.cs
Normal file
|
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
4
GUI.NET/Debugger/frmAssembler.Designer.cs
generated
4
GUI.NET/Debugger/frmAssembler.Designer.cs
generated
|
@ -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;
|
||||
|
|
8
GUI.NET/Debugger/frmDebugger.Designer.cs
generated
8
GUI.NET/Debugger/frmDebugger.Designer.cs
generated
|
@ -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;
|
||||
|
|
4
GUI.NET/Debugger/frmEventViewer.Designer.cs
generated
4
GUI.NET/Debugger/frmEventViewer.Designer.cs
generated
|
@ -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;
|
||||
|
|
4
GUI.NET/Debugger/frmMemoryViewer.Designer.cs
generated
4
GUI.NET/Debugger/frmMemoryViewer.Designer.cs
generated
|
@ -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;
|
||||
|
|
4
GUI.NET/Debugger/frmPpuViewer.Designer.cs
generated
4
GUI.NET/Debugger/frmPpuViewer.Designer.cs
generated
|
@ -33,7 +33,7 @@ namespace Mesen.GUI.Debugger
|
|||
/// </summary>
|
||||
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;
|
||||
|
|
8
GUI.NET/Debugger/frmScript.Designer.cs
generated
8
GUI.NET/Debugger/frmScript.Designer.cs
generated
|
@ -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;
|
||||
|
|
4
GUI.NET/Debugger/frmTraceLogger.Designer.cs
generated
4
GUI.NET/Debugger/frmTraceLogger.Designer.cs
generated
|
@ -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;
|
||||
|
|
4
GUI.NET/Forms/Cheats/frmCheatList.Designer.cs
generated
4
GUI.NET/Forms/Cheats/frmCheatList.Designer.cs
generated
|
@ -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;
|
||||
|
|
4
GUI.NET/Forms/frmMain.Designer.cs
generated
4
GUI.NET/Forms/frmMain.Designer.cs
generated
|
@ -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;
|
||||
|
|
|
@ -272,6 +272,12 @@
|
|||
<Compile Include="Controls\ctrlLoadingRom.Designer.cs">
|
||||
<DependentUpon>ctrlLoadingRom.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Controls\ctrlMesenMenuStrip.cs">
|
||||
<SubType>Component</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Controls\ctrlMesenToolStrip.cs">
|
||||
<SubType>Component</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Controls\ctrlNsfPlayer.cs">
|
||||
<SubType>UserControl</SubType>
|
||||
</Compile>
|
||||
|
|
Loading…
Add table
Reference in a new issue