/// <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; }
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); } }
public virtual void ShowMaximized(ShowTransition transition) { Visible = false; FluidHost host = FluidHost.Instance; host.Add(this); Bounds = host.ClientBounds; Show(transition); }
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); }); }
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); } } }
/// <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(); }
/// <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(); }
public override void Show(ShowTransition transition) { CenterButtonIfSingle(); base.Show(transition); }
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; } }
/// <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; }
/// <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); }
/// <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(); }
protected virtual void Awake() { showTransition = GetComponent <ShowTransition>(); hideTransition = GetComponent <HideTransition>(); }