Class Dialog
The Dialog View is a Window that by default is centered and contains one
or more Buttons. It defaults to the Dialog color scheme and has a 1 cell padding around the edges.
Implements
System.IDisposable
System.ComponentModel.ISupportInitializeNotification
System.ComponentModel.ISupportInitialize
Inherited Members
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 Dialog : Window, IDisposable, ISupportInitializeNotification, ISupportInitialize
Remarks
To run the Dialog modally, create the Dialog, and pass it to Run(Func<Exception, Boolean>).
This will execute the dialog until it terminates via the [ESC] or [CTRL-Q] key, or when one of the views
or buttons added to the dialog calls RequestStop(Toplevel).
Constructors
Dialog()
Declaration
public Dialog()
Remarks
Te Dialog will be vertically and horizontally centered in the container and the size will be 85% of the container.
After initialization use X
, Y
, Width
, and Height
to override this with a location or size.
Use AddButton(Button) to add buttons to the dialog.
Dialog(ustring, Int32, Int32, Button[])
Initializes a new instance of the Dialog class using Computed positioning
and an optional set of Buttons to display
Declaration
public Dialog(ustring title, int width, int height, params Button[] buttons)
Parameters
Type | Name | Description |
---|---|---|
NStack.ustring | title | Title for the dialog. |
System.Int32 | width | Width for the dialog. |
System.Int32 | height | Height for the dialog. |
Button[] | buttons | Optional buttons to lay out at the bottom of the dialog. |
Remarks
if
width
and height
are both 0, the Dialog will be vertically and horizontally centered in the
container and the size will be 85% of the container.
After initialization use X
, Y
, Width
, and Height
to override this with a location or size.
Dialog(ustring, Button[])
Initializes a new instance of the Dialog class using Computed positioning
and with an optional set of Buttons to display
Declaration
public Dialog(ustring title, params Button[] buttons)
Parameters
Type | Name | Description |
---|---|---|
NStack.ustring | title | Title for the dialog. |
Button[] | buttons | Optional buttons to lay out at the bottom of the dialog. |
Remarks
Te Dialog will be vertically and horizontally centered in the container and the size will be 85% of the container.
After initialization use
X
, Y
, Width
, and Height
to override this with a location or size.
Methods
AddButton(Button)
Declaration
public void AddButton(Button button)
Parameters
Type | Name | Description |
---|---|---|
Button | button | Button to add. |
ProcessKey(KeyEvent)
Declaration
public override bool ProcessKey(KeyEvent kb)
Parameters
Type | Name | Description |
---|---|---|
KeyEvent | kb |
Returns
Type | Description |
---|---|
System.Boolean |
Overrides
Implements
System.IDisposable
System.ComponentModel.ISupportInitializeNotification
System.ComponentModel.ISupportInitialize