コード例 #1
0
        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);
        }
コード例 #2
0
        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);
        }
コード例 #3
0
        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);
        }
コード例 #4
0
        public void UpdateModalEvents()
        {
            if (result != System.Windows.Forms.DialogResult.None)
            {
                Hide();

#if FAMISTUDIO_MACOS
                MacUtils.RestoreMainNSWindowFocus();
#endif
            }

            Application.RunIteration(false);
        }
コード例 #5
0
        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);
        }
コード例 #6
0
ファイル: PropertyDialog.cs プロジェクト: LesCol/FamiStudio
        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);
        }
コード例 #7
0
        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);
        }
コード例 #8
0
 public void TemporarelyHide()
 {
     GetPosition(out tempPosX, out tempPosY);
     Hide();
     MacUtils.RestoreMainNSWindowFocus();
 }