Search Results for

    Show / Hide Table of Contents

    Class Wizard

    Provides navigation and a user interface (UI) to collect related data across multiple steps. Each step (Wizard.WizardStep) can host arbitrary Views, much like a Dialog. Each step also has a pane for help text. Along the bottom of the Wizard view are customizable buttons enabling the user to navigate forward and backward through the Wizard.
    Inheritance
    System.Object
    Responder
    View
    Toplevel
    Window
    Dialog
    Wizard
    Implements
    System.IDisposable
    System.ComponentModel.ISupportInitializeNotification
    System.ComponentModel.ISupportInitialize
    Inherited Members
    Dialog.AddButton(Button)
    Dialog.ButtonAlignment
    Window.Border
    Window.Add(View)
    Window.Remove(View)
    Window.RemoveAll()
    Window.Redraw(Rect)
    Window.OnCanFocusChanged()
    Window.Text
    Window.TextAlignment
    Window.OnTitleChanging(ustring, ustring)
    Window.TitleChanging
    Window.OnTitleChanged(ustring, ustring)
    Window.TitleChanged
    Toplevel.Running
    Toplevel.Loaded
    Toplevel.Ready
    Toplevel.Unloaded
    Toplevel.Activate
    Toplevel.Deactivate
    Toplevel.ChildClosed
    Toplevel.AllChildClosed
    Toplevel.Closing
    Toplevel.Closed
    Toplevel.ChildLoaded
    Toplevel.ChildUnloaded
    Toplevel.Resized
    Toplevel.OnLoaded()
    Toplevel.AlternateForwardKeyChanged
    Toplevel.OnAlternateForwardKeyChanged(Key)
    Toplevel.AlternateBackwardKeyChanged
    Toplevel.OnAlternateBackwardKeyChanged(Key)
    Toplevel.QuitKeyChanged
    Toplevel.OnQuitKeyChanged(Key)
    Toplevel.Create()
    Toplevel.CanFocus
    Toplevel.MenuBar
    Toplevel.StatusBar
    Toplevel.IsMdiContainer
    Toplevel.IsMdiChild
    Toplevel.OnKeyDown(KeyEvent)
    Toplevel.OnKeyUp(KeyEvent)
    Toplevel.ProcessColdKey(KeyEvent)
    Toplevel.PositionToplevel(Toplevel)
    Toplevel.MouseEvent(MouseEvent)
    Toplevel.WillPresent()
    Toplevel.MoveNext()
    Toplevel.MovePrevious()
    Toplevel.RequestStop()
    Toplevel.RequestStop(Toplevel)
    Toplevel.PositionCursor()
    Toplevel.GetTopMdiChild(Type, String[])
    Toplevel.ShowChild(Toplevel)
    View.Added
    View.Removed
    View.Enter
    View.Leave
    View.MouseEnter
    View.MouseLeave
    View.MouseClick
    View.CanFocusChanged
    View.EnabledChanged
    View.VisibleChanged
    View.HotKeyChanged
    View.HotKey
    View.HotKeySpecifier
    View.Shortcut
    View.ShortcutTag
    View.ShortcutAction
    View.Data
    View.Driver
    View.Subviews
    View.TabIndexes
    View.TabIndex
    View.TabStop
    View.Id
    View.IsCurrentTop
    View.WantMousePositionReports
    View.WantContinuousButtonPressed
    View.Frame
    View.LayoutStyle
    View.Bounds
    View.X
    View.Y
    View.Width
    View.Height
    View.ForceValidatePosDim
    View.GetMinWidthHeight(Size)
    View.SetMinWidthHeight()
    View.TextFormatter
    View.SuperView
    View.UpdateTextFormatterText()
    View.ProcessResizeView()
    View.SetNeedsDisplay()
    View.ClearLayoutNeeded()
    View.SetNeedsDisplay(Rect)
    View.SetChildNeedsDisplay()
    View.Add(View[])
    View.BringSubviewToFront(View)
    View.SendSubviewToBack(View)
    View.SendSubviewBackwards(View)
    View.BringSubviewForward(View)
    View.Clear()
    View.Clear(Rect)
    View.ScreenToView(Int32, Int32)
    View.ClipToBounds()
    View.SetClip(Rect)
    View.DrawFrame(Rect, Int32, Boolean)
    View.DrawHotString(ustring, Attribute, Attribute)
    View.DrawHotString(ustring, Boolean, ColorScheme)
    View.Move(Int32, Int32, Boolean)
    View.HasFocus
    View.OnAdded(View)
    View.OnRemoved(View)
    View.OnEnter(View)
    View.OnLeave(View)
    View.Focused
    View.MostFocused
    View.ColorScheme
    View.AddRune(Int32, Int32, Rune)
    View.ClearNeedsDisplay()
    View.DrawContent
    View.OnDrawContent(Rect)
    View.DrawContentComplete
    View.OnDrawContentComplete(Rect)
    View.SetFocus()
    View.KeyPress
    View.InvokeKeybindings(KeyEvent)
    View.AddKeyBinding(Key, Command)
    View.ReplaceKeyBinding(Key, Key)
    View.ContainsKeyBinding(Key)
    View.ClearKeybindings()
    View.ClearKeybinding(Key)
    View.ClearKeybinding(Command)
    View.AddCommand(Command, Func<Nullable<Boolean>>)
    View.GetSupportedCommands()
    View.GetKeyFromCommand(Command)
    View.ProcessHotKey(KeyEvent)
    View.KeyDown
    View.KeyUp
    View.EnsureFocus()
    View.FocusFirst()
    View.FocusLast()
    View.FocusPrev()
    View.FocusNext()
    View.LayoutStarted
    View.LayoutComplete
    View.Initialized
    View.LayoutSubviews()
    View.AutoSize
    View.PreserveTrailingSpaces
    View.VerticalTextAlignment
    View.TextDirection
    View.IsInitialized
    View.IsAdded
    View.Enabled
    View.Visible
    View.ToString()
    View.GetAutoSize()
    View.GetHotKeySpecifierLength(Boolean)
    View.GetTextFormatterBoundsSize()
    View.GetBoundsTextFormatterSize()
    View.OnMouseEnter(MouseEvent)
    View.OnMouseLeave(MouseEvent)
    View.OnMouseEvent(MouseEvent)
    View.OnMouseClick(View.MouseEventArgs)
    View.OnEnabledChanged()
    View.OnVisibleChanged()
    View.Dispose(Boolean)
    View.BeginInit()
    View.EndInit()
    View.SetWidth(Int32, Int32)
    View.SetHeight(Int32, Int32)
    View.GetCurrentWidth(Int32)
    View.GetCurrentHeight(Int32)
    View.GetNormalColor()
    View.GetTopSuperView()
    Responder.Dispose()
    System.Object.Equals(System.Object)
    System.Object.Equals(System.Object, System.Object)
    System.Object.GetHashCode()
    System.Object.GetType()
    System.Object.MemberwiseClone()
    System.Object.ReferenceEquals(System.Object, System.Object)
    Namespace: Terminal.Gui
    Assembly: Terminal.Gui.dll
    Syntax
    public class Wizard : Dialog, IDisposable, ISupportInitializeNotification, ISupportInitialize
    Remarks
    The Wizard can be displayed either as a modal (pop-up) Window (like Dialog) or as an embedded View. By default, Modal is true; launch the Wizard using `Application.Run(wizard)`. Set Modal to `false` to use Wizard as an embedded View, and add the Wizard to a containing view with Add(View). When used as a modal pop-up window, the Esc key will cause the Cancelled event to fire and (if the event is not cancelled), will cause RequestStop(Toplevel) to be called, closing the Wizard. When used as an embedded View, no frame is drawn around the Wizard. To detect if the user wants to cancel the Wizard, subscrie to the Cancelled event.

    Constructors

    Wizard()

    Initializes a new instance of the Wizard class using Computed positioning.
    Declaration
    public Wizard()
    Remarks
    The Wizard will be vertically and horizontally centered in the container. After initialization use X, Y, Width, and Height change size and position.

    Wizard(ustring)

    Initializes a new instance of the Wizard class using Computed positioning.
    Declaration
    public Wizard(ustring title)
    Parameters
    Type Name Description
    NStack.ustring title Sets the Title for the Wizard.
    Remarks
    The Wizard will be vertically and horizontally centered in the container. After initialization use X, Y, Width, and Height change size and position.

    Properties

    BackButton

    If the CurrentStep is not the first step in the wizard, this button causes the MovingBack event to be fired and the wizard moves to the previous step.
    Declaration
    public Button BackButton { get; }
    Property Value
    Type Description
    Button
    Remarks
    Use the MovingBack event to be notified when the user attempts to go back.

    CurrentStep

    Gets or sets the currently active Wizard.WizardStep.
    Declaration
    public Wizard.WizardStep CurrentStep { get; set; }
    Property Value
    Type Description
    Wizard.WizardStep

    Modal

    Determines whether the Wizard is displayed as modal pop-up or not. The default is `true`. The Wizard will be shown with a frame with Title and will behave like any Toplevel window. If set to `false` the Wizard will have no frame and will behave like any embedded View.
    Declaration
    public bool Modal { get; set; }
    Property Value
    Type Description
    System.Boolean

    NextFinishButton

    If the CurrentStep is the last step in the wizard, this button causes the Finished event to be fired and the wizard to close. If the step is not the last step, the MovingNext event will be fired and the wizard will move next step.
    Declaration
    public Button NextFinishButton { get; }
    Property Value
    Type Description
    Button
    Remarks
    Use the MovingNext and Finished events to be notified when the user attempts go to the next step or finish the wizard.

    Title

    The title of the Wizard, shown at the top of the Wizard with " - currentStep.Title" appended.
    Declaration
    public ustring Title { get; set; }
    Property Value
    Type Description
    NStack.ustring
    Remarks
    The Title is only displayed when the Wizard is used as a modal pop-up.

    Methods

    AddStep(Wizard.WizardStep)

    Adds a step to the wizard. The Next and Back buttons navigate through the added steps in the order they were added.
    Declaration
    public void AddStep(Wizard.WizardStep newStep)
    Parameters
    Type Name Description
    Wizard.WizardStep newStep
    Remarks
    The "Next..." button of the last step added will read "Finish" (unless changed from default).

    GetFirstStep()

    Returns the first enabled step in the Wizard
    Declaration
    public Wizard.WizardStep GetFirstStep()
    Returns
    Type Description
    Wizard.WizardStep The last enabled step

    GetLastStep()

    Returns the last enabled step in the Wizard
    Declaration
    public Wizard.WizardStep GetLastStep()
    Returns
    Type Description
    Wizard.WizardStep The last enabled step

    GetNextStep()

    Returns the next enabled Wizard.WizardStep after the current step. Takes into account steps which are disabled. If CurrentStep is `null` returns the first enabled step.
    Declaration
    public Wizard.WizardStep GetNextStep()
    Returns
    Type Description
    Wizard.WizardStep The next step after the current step, if there is one; otherwise returns `null`, which indicates either there are no enabled steps or the current step is the last enabled step.

    GetPreviousStep()

    Returns the first enabled Wizard.WizardStep before the current step. Takes into account steps which are disabled. If CurrentStep is `null` returns the last enabled step.
    Declaration
    public Wizard.WizardStep GetPreviousStep()
    Returns
    Type Description
    Wizard.WizardStep The first step ahead of the current step, if there is one; otherwise returns `null`, which indicates either there are no enabled steps or the current step is the first enabled step.

    GoBack()

    Causes the wizad to move to the previous enabled step (or first step if CurrentStep is not set). If there is no previous step, does nothing.
    Declaration
    public void GoBack()

    GoNext()

    Causes the wizad to move to the next enabled step (or last step if CurrentStep is not set). If there is no previous step, does nothing.
    Declaration
    public void GoNext()

    GoToStep(Wizard.WizardStep)

    Changes to the specified Wizard.WizardStep.
    Declaration
    public bool GoToStep(Wizard.WizardStep newStep)
    Parameters
    Type Name Description
    Wizard.WizardStep newStep The step to go to.
    Returns
    Type Description
    System.Boolean True if the transition to the step succeeded. False if the step was not found or the operation was cancelled.

    OnStepChanged(Wizard.WizardStep, Wizard.WizardStep)

    Called when the Wizard has completed transition to a new Wizard.WizardStep. Fires the StepChanged event.
    Declaration
    public virtual bool OnStepChanged(Wizard.WizardStep oldStep, Wizard.WizardStep newStep)
    Parameters
    Type Name Description
    Wizard.WizardStep oldStep The step the Wizard changed from
    Wizard.WizardStep newStep The step the Wizard has changed to
    Returns
    Type Description
    System.Boolean True if the change is to be cancelled.

    OnStepChanging(Wizard.WizardStep, Wizard.WizardStep)

    Called when the Wizard is about to transition to another Wizard.WizardStep. Fires the StepChanging event.
    Declaration
    public virtual bool OnStepChanging(Wizard.WizardStep oldStep, Wizard.WizardStep newStep)
    Parameters
    Type Name Description
    Wizard.WizardStep oldStep The step the Wizard is about to change from
    Wizard.WizardStep newStep The step the Wizard is about to change to
    Returns
    Type Description
    System.Boolean True if the change is to be cancelled.

    ProcessKey(KeyEvent)

    Declaration
    public override bool ProcessKey(KeyEvent kb)
    Parameters
    Type Name Description
    KeyEvent kb
    Returns
    Type Description
    System.Boolean
    Overrides
    Dialog.ProcessKey(KeyEvent)

    Events

    Cancelled

    This event is raised when the user has cancelled the Wizard by pressin the Esc key. To prevent a Modal Wizard from closing, cancel the event by setting Cancel to `true` before returning from the event handler.
    Declaration
    public event Action<Wizard.WizardButtonEventArgs> Cancelled
    Event Type
    Type Description
    System.Action<Wizard.WizardButtonEventArgs>

    Finished

    This event is raised when the Next/Finish button in the Wizard is clicked. The Next/Finish button is always the last button in the array of Buttons passed to the Wizard constructor, if any. This event is only raised if the CurrentStep is the last Step in the Wizard flow (otherwise the Finished event is raised).
    Declaration
    public event Action<Wizard.WizardButtonEventArgs> Finished
    Event Type
    Type Description
    System.Action<Wizard.WizardButtonEventArgs>

    MovingBack

    This event is raised when the Back button in the Wizard is clicked. The Back button is always the first button in the array of Buttons passed to the Wizard constructor, if any.
    Declaration
    public event Action<Wizard.WizardButtonEventArgs> MovingBack
    Event Type
    Type Description
    System.Action<Wizard.WizardButtonEventArgs>

    MovingNext

    This event is raised when the Next/Finish button in the Wizard is clicked (or the user presses Enter). The Next/Finish button is always the last button in the array of Buttons passed to the Wizard constructor, if any. This event is only raised if the CurrentStep is the last Step in the Wizard flow (otherwise the Finished event is raised).
    Declaration
    public event Action<Wizard.WizardButtonEventArgs> MovingNext
    Event Type
    Type Description
    System.Action<Wizard.WizardButtonEventArgs>

    StepChanged

    This event is raised after the Wizard has changed the CurrentStep.
    Declaration
    public event Action<Wizard.StepChangeEventArgs> StepChanged
    Event Type
    Type Description
    System.Action<Wizard.StepChangeEventArgs>

    StepChanging

    This event is raised when the current CurrentStep) is about to change. Use Cancel to abort the transition.
    Declaration
    public event Action<Wizard.StepChangeEventArgs> StepChanging
    Event Type
    Type Description
    System.Action<Wizard.StepChangeEventArgs>

    Implements

    System.IDisposable
    System.ComponentModel.ISupportInitializeNotification
    System.ComponentModel.ISupportInitialize
    In This Article
    Back to top Generated by DocFX