Remove tree processing in OnDraw for keyboard hooks
This commit is contained in:
parent
156f44dce8
commit
7808ffe221
1 changed files with 0 additions and 55 deletions
|
|
@ -815,8 +815,6 @@ namespace MatterHackers.MatterControl.PartPreviewWindow
|
|||
return gcodeViewWidget;
|
||||
}
|
||||
|
||||
private GuiWidget widgetThatHasKeyDownHooked = null;
|
||||
|
||||
public override void OnDraw(Graphics2D graphics2D)
|
||||
{
|
||||
bool printerIsRunningPrint = PrinterConnection.Instance.PrinterIsPaused || PrinterConnection.Instance.PrinterIsPrinting;
|
||||
|
|
@ -826,8 +824,6 @@ namespace MatterHackers.MatterControl.PartPreviewWindow
|
|||
SetAnimationPosition();
|
||||
}
|
||||
|
||||
EnsureKeyDownHooked();
|
||||
|
||||
if (partToStartLoadingOnFirstDraw != null)
|
||||
{
|
||||
gcodeViewWidget.LoadInBackground(partToStartLoadingOnFirstDraw);
|
||||
|
|
@ -836,45 +832,6 @@ namespace MatterHackers.MatterControl.PartPreviewWindow
|
|||
base.OnDraw(graphics2D);
|
||||
}
|
||||
|
||||
private void EnsureKeyDownHooked()
|
||||
{
|
||||
// let's just check that we are still hooked up to our parent window (this is to make pop outs work correctly)
|
||||
if (widgetThatHasKeyDownHooked != null)
|
||||
{
|
||||
GuiWidget topParent = Parent;
|
||||
while (topParent as SystemWindow == null)
|
||||
{
|
||||
topParent = topParent.Parent;
|
||||
}
|
||||
|
||||
if (topParent != widgetThatHasKeyDownHooked)
|
||||
{
|
||||
widgetThatHasKeyDownHooked.KeyDown -= Parent_KeyDown;
|
||||
widgetThatHasKeyDownHooked = null;
|
||||
}
|
||||
}
|
||||
|
||||
if (widgetThatHasKeyDownHooked == null)
|
||||
{
|
||||
GuiWidget parent = Parent;
|
||||
while (parent as SystemWindow == null)
|
||||
{
|
||||
parent = parent.Parent;
|
||||
}
|
||||
UnHookWidgetThatHasKeyDownHooked();
|
||||
parent.KeyDown += Parent_KeyDown;
|
||||
widgetThatHasKeyDownHooked = parent;
|
||||
}
|
||||
}
|
||||
|
||||
private void UnHookWidgetThatHasKeyDownHooked()
|
||||
{
|
||||
if (widgetThatHasKeyDownHooked != null)
|
||||
{
|
||||
widgetThatHasKeyDownHooked.KeyDown -= Parent_KeyDown;
|
||||
}
|
||||
}
|
||||
|
||||
private void Parent_KeyDown(object sender, KeyEventArgs keyEvent)
|
||||
{
|
||||
if (keyEvent.KeyCode == Keys.Up)
|
||||
|
|
@ -924,16 +881,6 @@ namespace MatterHackers.MatterControl.PartPreviewWindow
|
|||
gcodeProcessingStateInfoText.Text = message;
|
||||
}
|
||||
|
||||
private static bool RunningIn32Bit()
|
||||
{
|
||||
if (IntPtr.Size == 4)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
private void DoneLoadingGCode(object sender, EventArgs e)
|
||||
{
|
||||
SetProcessingMessage("");
|
||||
|
|
@ -1047,8 +994,6 @@ namespace MatterHackers.MatterControl.PartPreviewWindow
|
|||
|
||||
public override void OnClosed(ClosedEventArgs e)
|
||||
{
|
||||
UnHookWidgetThatHasKeyDownHooked();
|
||||
|
||||
unregisterEvents?.Invoke(this, null);
|
||||
|
||||
if (printItem != null)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue