コード例 #1
0
 /// <summary>
 /// Opens the panel modal with the specified transition.
 /// </summary>
 /// <param name="transition">The transition that specifies the animation.</param>
 public void ShowModal(ShowTransition transition)
 {
     modalBackground = new ModalBackground();
     modalBackground.ShowMaximized();
     Show(transition);
     Anchor = AnchorAll;
 }
コード例 #2
0
        private Rectangle GetShowStartBounds(ShowTransition transition)
        {
            FluidHost host   = FluidHost.Instance;
            Rectangle client = host.ClientBounds;
            int       h      = client.Height;
            int       w      = client.Width;

            switch (transition)
            {
            case ShowTransition.FromBottom:
                return(new Rectangle(0, h, w, Height));

            case ShowTransition.FromTop:
                return(new Rectangle(0, -Height, w, Height));

            case ShowTransition.FromLeft:
                return(new Rectangle(-Width, 0, Width, h));

            case ShowTransition.FromRight:
                return(new Rectangle(w, 0, Width, h));

            case ShowTransition.Zoom:
                throw new NotImplementedException();


            default:
                return(Bounds);
            }
        }
コード例 #3
0
        public virtual void ShowMaximized(ShowTransition transition)
        {
            Visible = false;
            FluidHost host = FluidHost.Instance;

            host.Add(this);
            Bounds = host.ClientBounds;
            Show(transition);
        }
コード例 #4
0
        public ITransition Show(IWindow window)
        {
            ShowTransition transition = new ShowTransition(this, (Window)window);
            GetTransitionExecutor().Execute(transition);
            return transition.OnStateChanged((w, state) =>
                {
                    /* Control the layer of the window */
                    if (state == WindowState.VISIBLE)
                        this.MoveToIndex(w, transition.Layer);

                    //if (state == WindowState.INVISIBLE)
                    //    this.MoveToLast(w);
                });
        }
コード例 #5
0
 private void checkBoxFile_OnChange(object sender, EventArgs e)
 {
     if (!checkHasFileIni)
     {
         if (checkBoxFile.Checked)
         {
             TitleTransition.ShowSync(panelHeaderQuesFile);
             ShowTransition.ShowSync(panelContentQuesFile);
             panelHeaderQuesFile.Visible  = true;
             panelContentQuesFile.Visible = true;
         }
         else
         {
             TitleTransition.Hide(panelHeaderQuesFile);
             ShowTransition.Hide(panelContentQuesFile);
         }
     }
 }
コード例 #6
0
        /// <summary>
        /// Closes the panel with the specified transition.
        /// </summary>
        /// <param name="transition">The transition to perform.</param>
        public virtual void Close(ShowTransition transition)
        {
            if (!Visible)
            {
                return;
            }

            RestorePreviousFocusedControl();

            EnsureTopAnimation();

            FluidHost host   = FluidHost.Instance;
            Rectangle client = host.ClientBounds;
            int       h      = client.Height;
            int       w      = client.Width;

            bool modal = true;

            switch (transition)
            {
            case ShowTransition.None:
                Hide();
                HideModalBackground();
                break;

            case ShowTransition.FromBottom:
                topAnimation.Completed += new EventHandler(OnTopAnimationCompleted);
                AnimateTop(h, Animation.DefaultDuration, modal);
                break;

            case ShowTransition.FromTop:
                topAnimation.Completed += new EventHandler(OnTopAnimationCompleted);
                AnimateTop(0 - Bounds.Height, Animation.DefaultDuration, modal);
                break;

            default:
                throw new NotImplementedException();
            }
            OnClosing();
        }
コード例 #7
0
        /// <summary>
        /// Opens the panel with the specified transition.
        /// </summary>
        /// <param name="transition">The transition to perform while the panel is shown.</param>
        public virtual void Show(ShowTransition transition)
        {
            previousFocusedControl          = Host != null ? Host.FocusedControl : null;
            showTransition                  = transition;
            FluidTextBox.InputPanel.Enabled = false;
            Visible = false;
            FluidHost host   = FluidHost.Instance;
            Rectangle client = host.ClientBounds;
            int       h      = client.Height;
            int       w      = client.Width;

            host.Add(this);
            bool modal = false;

            Bounds  = GetShowStartBounds(transition);
            Visible = true;

            switch (transition)
            {
            case ShowTransition.None:
                Show();
                break;

            case ShowTransition.FromBottom:
                AnimateTop(h - Bounds.Height, Animation.DefaultDuration, modal);
                break;

            case ShowTransition.FromTop:
                AnimateTop(Bounds.Height, Animation.DefaultDuration, modal);
                break;

            default:
                throw new NotImplementedException();
            }
            Focus();
            OnShowing();
        }
コード例 #8
0
ファイル: MessageDialog.cs プロジェクト: Radytz/DroppedBoxx
 public override void Show(ShowTransition transition)
 {
     CenterButtonIfSingle();
     base.Show(transition);
 }
コード例 #9
0
ファイル: Panel.cs プロジェクト: Radytz/DroppedBoxx
        private Rectangle GetShowStartBounds(ShowTransition transition)
        {
            FluidHost host = FluidHost.Instance;
            Rectangle client = host.ClientBounds;
            int h = client.Height;
            int w = client.Width;

            switch (transition)
            {
                case ShowTransition.FromBottom:
                    return new Rectangle(0, h, w, Height);

                case ShowTransition.FromTop:
                    return new Rectangle(0, -Height, w, Height);

                case ShowTransition.FromLeft:
                    return new Rectangle(-Width, 0, Width, h);

                case ShowTransition.FromRight:
                    return new Rectangle(w, 0, Width, h);

                case ShowTransition.Zoom:
                    throw new NotImplementedException();

                default:
                    return Bounds;
            }
        }
コード例 #10
0
ファイル: Panel.cs プロジェクト: Radytz/DroppedBoxx
 /// <summary>
 /// Opens the panel modal with the specified transition.
 /// </summary>
 /// <param name="transition">The transition to perform.</param>
 public void ShowModal(ShowTransition transition)
 {
     modalBackground = new ModalBackground();
     modalBackground.ShowMaximized();
     Show(transition);
     Anchor = AnchorAll;
 }
コード例 #11
0
ファイル: Panel.cs プロジェクト: Radytz/DroppedBoxx
 /// <summary>
 /// Shows the panel maximized in the host.
 /// </summary>
 /// <param name="transition">The transition to perform while the panel is shown.</param>
 public virtual void ShowMaximized(ShowTransition transition)
 {
     Visible = false;
     FluidHost host = FluidHost.Instance;
     host.Add(this);
     Bounds = host.ClientBounds;
     Show(transition);
 }
コード例 #12
0
ファイル: Panel.cs プロジェクト: Radytz/DroppedBoxx
        /// <summary>
        /// Opens the panel with the specified transition.
        /// </summary>
        /// <param name="transition">The transition to perform while the panel is shown.</param>
        public virtual void Show(ShowTransition transition)
        {
            previousFocusedControl = Host != null ? Host.FocusedControl : null;
            showTransition = transition;
            FluidTextBox.InputPanel.Enabled = false;
            Visible = false;
            FluidHost host = FluidHost.Instance;
            Rectangle client = host.ClientBounds;
            int h = client.Height;
            int w = client.Width;

            host.Add(this);
            bool modal = false;

            Bounds = GetShowStartBounds(transition);
            Visible = true;

            switch (transition)
            {
                case ShowTransition.None:
                    Show();
                    break;

                case ShowTransition.FromBottom:
                    AnimateTop(h - Bounds.Height, Animation.DefaultDuration, modal);
                    break;

                case ShowTransition.FromTop:
                    AnimateTop(Bounds.Height, Animation.DefaultDuration, modal);
                    break;

                default:
                    throw new NotImplementedException();
            }
            Focus();
            OnShowing();
        }
コード例 #13
0
ファイル: Panel.cs プロジェクト: Radytz/DroppedBoxx
        /// <summary>
        /// Closes the panel with the specified transition.
        /// </summary>
        /// <param name="transition">The transition to perform.</param>
        public virtual void Close(ShowTransition transition)
        {
            if (!Visible) return;

            RestorePreviousFocusedControl();

            EnsureTopAnimation();

            FluidHost host = FluidHost.Instance;
            Rectangle client = host.ClientBounds;
            int h = client.Height;
            int w = client.Width;

            bool modal = true;

            switch (transition)
            {
                case ShowTransition.None:
                    Hide();
                    HideModalBackground();
                    break;

                case ShowTransition.FromBottom:
                    topAnimation.Completed += new EventHandler(OnTopAnimationCompleted);
                    AnimateTop(h, Animation.DefaultDuration, modal);
                    break;

                case ShowTransition.FromTop:
                    topAnimation.Completed += new EventHandler(OnTopAnimationCompleted);
                    AnimateTop(0 - Bounds.Height, Animation.DefaultDuration, modal);
                    break;

                default:
                    throw new NotImplementedException();
            }
            OnClosing();
        }
コード例 #14
0
 protected virtual void Awake()
 {
     showTransition = GetComponent <ShowTransition>();
     hideTransition = GetComponent <HideTransition>();
 }
コード例 #15
0
ファイル: MessageDialog.cs プロジェクト: windygu/haina
 public override void Show(ShowTransition transition)
 {
     CenterButtonIfSingle();
     base.Show(transition);
 }