public System.Windows.Forms.DialogResult ShowDialog(FamiStudioForm parent) { #if FAMISTUDIO_LINUX Run(); Hide(); #else Show(); if (WindowPosition == WindowPosition.CenterOnParent) { var mainWinRect = parent.Bounds; int x = mainWinRect.Left + (mainWinRect.Width - Allocation.Width) / 2; int y = mainWinRect.Top + (mainWinRect.Height - Allocation.Height) / 2; Move(x, y); } MacUtils.SetNSWindowAlwayOnTop(MacUtils.NSWindowFromGdkWindow(GdkWindow.Handle)); while (result == System.Windows.Forms.DialogResult.None) { Application.RunIteration(); } Hide(); MacUtils.RestoreMainNSWindowFocus(); #endif return(result); }
public System.Windows.Forms.DialogResult ShowDialog(FamiStudioForm parent = null) { #if FAMISTUDIO_MACOS Show(); int x = parent.Bounds.Left + (parent.Bounds.Width - Allocation.Width) / 2; int y = parent.Bounds.Top + (parent.Bounds.Height - Allocation.Height) / 2; Move(x, y); MacUtils.SetNSWindowAlwayOnTop(MacUtils.NSWindowFromGdkWindow(GdkWindow.Handle)); while (result == System.Windows.Forms.DialogResult.None) { Application.RunIteration(); } Hide(); MacUtils.RestoreMainNSWindowFocus(); #else Run(); Hide(); #endif return(result); }
public System.Windows.Forms.DialogResult ShowDialog(FamiStudioForm parent = null) { Show(); if (topAlign || leftAlign) { var pt = initialLocation; if (leftAlign) { pt.X -= Allocation.Width; } if (topAlign) { pt.Y -= Allocation.Height; } Move(pt.X, pt.Y); } #if FAMISTUDIO_MACOS MacUtils.SetNSWindowAlwayOnTop(MacUtils.NSWindowFromGdkWindow(GdkWindow.Handle)); #endif while (result == System.Windows.Forms.DialogResult.None) { Application.RunIteration(); } Hide(); #if FAMISTUDIO_MACOS MacUtils.RestoreMainNSWindowFocus(); #endif return(result); }
public void UpdateModalEvents() { if (result != System.Windows.Forms.DialogResult.None) { Hide(); #if FAMISTUDIO_MACOS MacUtils.RestoreMainNSWindowFocus(); #endif } Application.RunIteration(false); }
public System.Windows.Forms.DialogResult ShowDialog(FamiStudioForm parent) { Show(); if (topAlign || leftAlign) { Debug.Assert(WindowPosition == WindowPosition.None); var pt = initialLocation; if (leftAlign) { pt.X -= Allocation.Width; } if (topAlign) { pt.Y -= Allocation.Height; } Move(pt.X, pt.Y); } #if FAMISTUDIO_MACOS if (WindowPosition == WindowPosition.CenterOnParent) { var mainWinRect = parent.Bounds; int x = mainWinRect.Left + (mainWinRect.Width - Allocation.Width) / 2; int y = mainWinRect.Top + (mainWinRect.Height - Allocation.Height) / 2; Move(x, y); } MacUtils.SetNSWindowAlwayOnTop(MacUtils.NSWindowFromGdkWindow(GdkWindow.Handle)); #endif while (result == System.Windows.Forms.DialogResult.None) { Application.RunIteration(); } Hide(); #if FAMISTUDIO_MACOS MacUtils.RestoreMainNSWindowFocus(); #endif return(result); }
public System.Windows.Forms.DialogResult ShowDialog() { Show(); #if FAMISTUDIO_MACOS MacUtils.SetNSWindowAlwayOnTop(MacUtils.NSWindowFromGdkWindow(GdkWindow.Handle)); #endif while (result == System.Windows.Forms.DialogResult.None) { Application.RunIteration(); } Hide(); #if FAMISTUDIO_MACOS MacUtils.RestoreMainNSWindowFocus(); #endif return(result); }
public System.Windows.Forms.DialogResult ShowDialog() { Show(); if (topAlign || leftAlign) { GetPosition(out var x, out var y); if (leftAlign) { x -= Allocation.Width; } if (topAlign) { y -= Allocation.Height; } Move(x, y); } #if FAMISTUDIO_MACOS MacUtils.SetNSWindowAlwayOnTop(MacUtils.NSWindowFromGdkWindow(GdkWindow.Handle)); #endif while (result == System.Windows.Forms.DialogResult.None) { Application.RunIteration(); } Hide(); #if FAMISTUDIO_MACOS MacUtils.RestoreMainNSWindowFocus(); #else PlatformUtils.ProcessPendingEvents(); #endif return(result); }
public void TemporarelyHide() { GetPosition(out tempPosX, out tempPosY); Hide(); MacUtils.RestoreMainNSWindowFocus(); }