Class Toplevel
Toplevel views can be modally executed.
Inheritance
System.Object
Toplevel
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)
Assembly: Terminal.Gui.dll
Syntax
public class Toplevel : View, IDisposable, ISupportInitializeNotification, ISupportInitialize
Constructors
Toplevel()
Initializes a new instance of the
Toplevel class with
Computed layout, defaulting to full screen.
Declaration
Toplevel(Rect)
Initializes a new instance of the
Toplevel class with the specified absolute layout.
Declaration
public Toplevel(Rect frame)
Parameters
Type |
Name |
Description |
Rect |
frame |
A superview-relative rectangle specifying the location and size for the new Toplevel |
Properties
CanFocus
Gets or sets a value indicating whether this
Toplevel can focus.
Declaration
public override bool CanFocus { get; }
Property Value
Type |
Description |
System.Boolean |
true if can focus; otherwise, false . |
Overrides
IsMdiChild
Gets or sets if this Toplevel is a Mdi child.
Declaration
public bool IsMdiChild { get; }
Property Value
Type |
Description |
System.Boolean |
|
IsMdiContainer
Gets or sets if this Toplevel is a Mdi container.
Declaration
public bool IsMdiContainer { get; set; }
Property Value
Type |
Description |
System.Boolean |
|
Gets or sets the menu for this Toplevel
Declaration
public virtual MenuBar MenuBar { get; set; }
Property Value
Modal
Declaration
public bool Modal { get; set; }
Property Value
Type |
Description |
System.Boolean |
|
Running
Declaration
public bool Running { get; set; }
Property Value
Type |
Description |
System.Boolean |
|
StatusBar
Gets or sets the status bar for this Toplevel
Declaration
public virtual StatusBar StatusBar { get; set; }
Property Value
Methods
Add(View)
Declaration
public override void Add(View view)
Parameters
Type |
Name |
Description |
View |
view |
|
Overrides
Create()
Convenience factory method that creates a new Toplevel with the current terminal dimensions.
Declaration
public static Toplevel Create()
Returns
GetTopMdiChild(Type, String[])
Gets the current visible toplevel Mdi child that match the arguments pattern.
Declaration
public View GetTopMdiChild(Type type = null, string[] exclude = null)
Parameters
Type |
Name |
Description |
System.Type |
type |
The type. |
System.String[] |
exclude |
The strings to exclude. |
Returns
Type |
Description |
View |
The matched view. |
MouseEvent(MouseEvent)
Declaration
public override bool MouseEvent(MouseEvent mouseEvent)
Parameters
Returns
Type |
Description |
System.Boolean |
|
Overrides
MoveNext()
Move to the next Mdi child from the
MdiTop.
Declaration
public virtual void MoveNext()
MovePrevious()
Move to the previous Mdi child from the
MdiTop.
Declaration
public virtual void MovePrevious()
OnKeyDown(KeyEvent)
Declaration
public override bool OnKeyDown(KeyEvent keyEvent)
Parameters
Returns
Type |
Description |
System.Boolean |
|
Overrides
OnKeyUp(KeyEvent)
Declaration
public override bool OnKeyUp(KeyEvent keyEvent)
Parameters
Returns
Type |
Description |
System.Boolean |
|
Overrides
PositionCursor()
Declaration
public override void PositionCursor()
Overrides
PositionToplevel(Toplevel)
Virtual method which allow to be overridden to implement specific positions for inherited
Toplevel.
Declaration
public virtual void PositionToplevel(Toplevel top)
Parameters
Type |
Name |
Description |
Toplevel |
top |
The toplevel. |
ProcessColdKey(KeyEvent)
Declaration
public override bool ProcessColdKey(KeyEvent keyEvent)
Parameters
Returns
Type |
Description |
System.Boolean |
|
Overrides
ProcessKey(KeyEvent)
Declaration
public override bool ProcessKey(KeyEvent keyEvent)
Parameters
Returns
Type |
Description |
System.Boolean |
|
Overrides
Redraw(Rect)
Declaration
public override void Redraw(Rect bounds)
Parameters
Type |
Name |
Description |
Rect |
bounds |
|
Overrides
Remove(View)
Declaration
public override void Remove(View view)
Parameters
Type |
Name |
Description |
View |
view |
|
Overrides
RemoveAll()
Declaration
public override void RemoveAll()
Overrides
RequestStop()
Declaration
public virtual void RequestStop()
RequestStop(Toplevel)
Declaration
public virtual void RequestStop(Toplevel top)
Parameters
Type |
Name |
Description |
Toplevel |
top |
The toplevel to request stop. |
ShowChild(Toplevel)
Shows the Mdi child indicated by the
top
setting as
Current.
Declaration
public virtual bool ShowChild(Toplevel top = null)
Parameters
Type |
Name |
Description |
Toplevel |
top |
The toplevel. |
Returns
Type |
Description |
System.Boolean |
true if the toplevel can be showed.false otherwise. |
WillPresent()
Declaration
public virtual void WillPresent()
Events
Activate
Declaration
public event Action<Toplevel> Activate
Event Type
Type |
Description |
System.Action<Toplevel> |
|
AllChildClosed
Invoked once the last child Toplevel's
Application.RunState is closed from the
Terminal.Gui.Application.End(Terminal.Gui.View)
Declaration
public event Action AllChildClosed
Event Type
Type |
Description |
System.Action |
|
ChildClosed
Invoked once the child Toplevel's
Application.RunState is closed from the
Terminal.Gui.Application.End(Terminal.Gui.View)
Declaration
public event Action<Toplevel> ChildClosed
Event Type
Type |
Description |
System.Action<Toplevel> |
|
ChildLoaded
Declaration
public event Action<Toplevel> ChildLoaded
Event Type
Type |
Description |
System.Action<Toplevel> |
|
ChildUnloaded
Declaration
public event Action<Toplevel> ChildUnloaded
Event Type
Type |
Description |
System.Action<Toplevel> |
|
Closed
Invoked once the Toplevel's
Application.RunState is closed from the
Terminal.Gui.Application.End(Terminal.Gui.View)
Declaration
public event Action<Toplevel> Closed
Event Type
Type |
Description |
System.Action<Toplevel> |
|
Closing
Declaration
public event Action<ToplevelClosingEventArgs> Closing
Event Type
Deactivate
Declaration
public event Action<Toplevel> Deactivate
Event Type
Type |
Description |
System.Action<Toplevel> |
|
Loaded
Declaration
public event Action Loaded
Event Type
Type |
Description |
System.Action |
|
Ready
Fired once the Toplevel's
MainLoop has started it's first iteration.
Subscribe to this event to perform tasks when the
Toplevel has been laid out and focus has been set.
changes. A Ready event handler is a good place to finalize initialization after calling `
Run(Func<Exception, Boolean>)(topLevel)`.
Declaration
public event Action Ready
Event Type
Type |
Description |
System.Action |
|
Unloaded
Declaration
public event Action Unloaded
Event Type
Type |
Description |
System.Action |
|
Implements
System.IDisposable
System.ComponentModel.ISupportInitializeNotification
System.ComponentModel.ISupportInitialize