コード例 #1
0
ファイル: Popup.cs プロジェクト: rneuser/RobustToolbox
 public void Close()
 {
     if (!Visible)
     {
         return;
     }
     UserInterfaceManagerInternal.RemoveModal(this);
 }
コード例 #2
0
ファイル: Popup.cs プロジェクト: modi0012/RobustToolbox
        public void Open(UIBox2?box = null)
        {
            if (box != null)
            {
                Position = box.Value.TopLeft;
                Size     = box.Value.Size;
            }

            Visible = true;
            UserInterfaceManagerInternal.PushModal(this);
        }
コード例 #3
0
        public void Toggle()
        {
            var focus = CommandBar.HasKeyboardFocus();

            Visible = !Visible;
            if (Visible)
            {
                CommandBar.GrabKeyboardFocus();
            }
            else if (focus)
            {
                // We manually need to call this.
                // See https://github.com/godotengine/godot/pull/15074
                UserInterfaceManagerInternal.GDFocusExited(CommandBar);
            }
        }
コード例 #4
0
        public void Open(UIBox2?box = null)
        {
            if (Visible)
            {
                UserInterfaceManagerInternal.RemoveModal(this);
            }

            if (box != null)
            {
                LayoutContainer.SetPosition(this, box.Value.TopLeft);
                LayoutContainer.SetSize(this, box.Value.Size);
            }

            Visible = true;
            UserInterfaceManagerInternal.PushModal(this);
        }
コード例 #5
0
ファイル: Popup.cs プロジェクト: halworsen/RobustToolbox
        public void Open(UIBox2?box = null)
        {
            if (Visible)
            {
                UserInterfaceManagerInternal.RemoveModal(this);
            }

            if (box != null)
            {
                PopupContainer.SetPopupOrigin(this, box.Value.TopLeft);

                _desiredSize = box.Value.Size;
            }

            Visible = true;
            UserInterfaceManagerInternal.PushModal(this);
        }
コード例 #6
0
        public void Open(UIBox2?box = null)
        {
            if (GameController.OnGodot)
            {
                SceneControl.Call("popup", box?.Convert());
            }
            else
            {
                if (box != null)
                {
                    Position = box.Value.TopLeft;
                    Size     = box.Value.Size;
                }

                Visible = true;
                UserInterfaceManagerInternal.PushModal(this);
            }
        }
コード例 #7
0
ファイル: Popup.cs プロジェクト: stvnksslr/RobustToolbox
        public void Open(UIBox2?box = null, Vector2?altPos = null)
        {
            if (Visible)
            {
                UserInterfaceManagerInternal.RemoveModal(this);
            }

            if (box != null && _desiredSize != box.Value.Size)
            {
                PopupContainer.SetPopupOrigin(this, box.Value.TopLeft);
                PopupContainer.SetAltOrigin(this, altPos);

                _desiredSize = box.Value.Size;
                MinimumSizeChanged();
            }

            Visible = true;
            UserInterfaceManagerInternal.PushModal(this);
        }
コード例 #8
0
ファイル: Popup.cs プロジェクト: rneuser/RobustToolbox
        public void Open(UIBox2?box = null, Vector2?altPos = null)
        {
            if (Visible)
            {
                UserInterfaceManagerInternal.RemoveModal(this);
            }

            if (box != null &&
                (_desiredSize != box.Value.Size ||
                 PopupContainer.GetPopupOrigin(this) != box.Value.TopLeft ||
                 PopupContainer.GetAltOrigin(this) != altPos))
            {
                PopupContainer.SetPopupOrigin(this, box.Value.TopLeft);
                PopupContainer.SetAltOrigin(this, altPos);

                _desiredSize = box.Value.Size;
                InvalidateMeasure();
            }

            Visible = true;
            UserInterfaceManagerInternal.PushModal(this);
        }
コード例 #9
0
 private void __treeExitedHook()
 {
     // Eh maybe make a separate event later.
     UserInterfaceManagerInternal.GDFocusEntered(this);
     FocusExited();
 }
コード例 #10
0
 private void __focusExitedHook()
 {
     UserInterfaceManagerInternal.GDFocusExited(this);
     FocusExited();
 }
コード例 #11
0
 private void __mouseExitedHook()
 {
     UserInterfaceManagerInternal.GDMouseExited(this);
     MouseExited();
 }