diff --git a/Source/Core/Controls/ButtonsNumericTextbox.cs b/Source/Core/Controls/ButtonsNumericTextbox.cs index 3ff333ea..cd9dc8ba 100644 --- a/Source/Core/Controls/ButtonsNumericTextbox.cs +++ b/Source/Core/Controls/ButtonsNumericTextbox.cs @@ -38,6 +38,7 @@ namespace CodeImp.DoomBuilder.Controls #region ================== Events public event EventHandler WhenTextChanged; + public event EventHandler WhenButtonsClicked; #endregion @@ -132,7 +133,12 @@ namespace CodeImp.DoomBuilder.Controls textbox.Text = newvalue.ToString(); } } + buttons.Value = 0; + + if(WhenButtonsClicked != null) + WhenButtonsClicked(this, EventArgs.Empty); + ignorebuttonchange = false; } } diff --git a/Source/Core/Controls/DockersControl.cs b/Source/Core/Controls/DockersControl.cs index 150232a6..a786e894 100644 --- a/Source/Core/Controls/DockersControl.cs +++ b/Source/Core/Controls/DockersControl.cs @@ -262,7 +262,7 @@ namespace CodeImp.DoomBuilder.Controls { if((page.Tag as Docker) == d) { - page.Select(); + tabs.SelectedTab = page; return true; } } @@ -279,7 +279,7 @@ namespace CodeImp.DoomBuilder.Controls { if((page.Tag as Docker).FullName == previousselected) { - page.Select(); + tabs.SelectedTab = page; break; } } diff --git a/Source/Core/Controls/DockersTabsControl.cs b/Source/Core/Controls/DockersTabsControl.cs index 5813fda2..2effaff5 100644 --- a/Source/Core/Controls/DockersTabsControl.cs +++ b/Source/Core/Controls/DockersTabsControl.cs @@ -47,7 +47,7 @@ namespace CodeImp.DoomBuilder.Controls #endregion #region ================== Variables - + private Bitmap tabsimage; private int highlighttab; @@ -286,15 +286,29 @@ namespace CodeImp.DoomBuilder.Controls // Tabs don't process keys protected override void OnKeyDown(KeyEventArgs ke) { - ke.Handled = true; + if(this.Parent is DockersControl) + { + // Only absorb the key press when no focused on an input control, otherwise + // the input controls may not receive certain keys such as delete and arrow keys + DockersControl docker = (this.Parent as DockersControl); + if(!docker.IsFocused) + ke.Handled = true; + } } // Tabs don't process keys protected override void OnKeyUp(KeyEventArgs e) { - e.Handled = true; + if(this.Parent is DockersControl) + { + // Only absorb the key press when no focused on an input control, otherwise + // the input controls may not receive certain keys such as delete and arrow keys + DockersControl docker = (this.Parent as DockersControl); + if(!docker.IsFocused) + e.Handled = true; + } } - + #endregion } } diff --git a/Source/Core/Windows/MainForm.cs b/Source/Core/Windows/MainForm.cs index b0717b96..1bbb1d05 100644 --- a/Source/Core/Windows/MainForm.cs +++ b/Source/Core/Windows/MainForm.cs @@ -1211,7 +1211,7 @@ namespace CodeImp.DoomBuilder.Windows if(alt) mod |= (int)Keys.Alt; if(shift) mod |= (int)Keys.Shift; if(ctrl) mod |= (int)Keys.Control; - + // Don't process any keys when they are meant for other input controls if((ActiveControl == null) || (ActiveControl == display)) { @@ -1226,7 +1226,7 @@ namespace CodeImp.DoomBuilder.Windows e.Handled = true; e.SuppressKeyPress = true; } - + // F1 pressed? if((e.KeyCode == Keys.F1) && (e.Modifiers == Keys.None)) { @@ -2552,6 +2552,10 @@ namespace CodeImp.DoomBuilder.Windows Plugin plugin = General.Plugins.FindPluginByAssembly(Assembly.GetCallingAssembly()); d.MakeFullName(plugin.Name.ToLowerInvariant()); + // We must release all keys because the focus may be stolen when + // this was the selected docker (the previous docker is automatically selected) + ReleaseAllKeys(); + return dockerspanel.Remove(d); } @@ -2562,12 +2566,18 @@ namespace CodeImp.DoomBuilder.Windows Plugin plugin = General.Plugins.FindPluginByAssembly(Assembly.GetCallingAssembly()); d.MakeFullName(plugin.Name.ToLowerInvariant()); + // We must release all keys because the focus will be stolen + ReleaseAllKeys(); + return dockerspanel.SelectDocker(d); } // This selects the previous selected docker public void SelectPreviousDocker() { + // We must release all keys because the focus will be stolen + ReleaseAllKeys(); + dockerspanel.SelectPrevious(); }