mirror of
https://git.do.srb2.org/STJr/UltimateZoneBuilder.git
synced 2024-11-27 06:02:11 +00:00
@ Some fixes in the behavior of docker controls and added WhenButtonsClicked event to the ButtonsNumericTextbox
This commit is contained in:
parent
fcde15398a
commit
1f73d1a105
4 changed files with 38 additions and 8 deletions
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue