@ Some fixes in the behavior of docker controls and added WhenButtonsClicked event to the ButtonsNumericTextbox

This commit is contained in:
codeimp 2009-08-21 08:37:02 +00:00
parent fcde15398a
commit 1f73d1a105
4 changed files with 38 additions and 8 deletions

View file

@ -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;
}
}

View file

@ -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;
}
}

View file

@ -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
}
}

View file

@ -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();
}