Show / Hide Table of Contents

# Class StatusBar

A status bar is a View that snaps to the bottom of a Toplevel displaying set of StatusItems. The StatusBar should be context sensitive. This means, if the main menu and an open text editor are visible, the items probably shown will be ~F1~ Help ~F2~ Save ~F3~ Load. While a dialog to ask a file to load is executed, the remaining commands will probably be ~F1~ Help. So for each context must be a new instance of a statusbar.

##### Inheritance

System.Object
Responder
View
StatusBar

##### Implements

System.Collections.IEnumerable

##### Inherited Members

View.Enter
View.Leave
View.MouseEnter
View.MouseLeave
View.MouseClick
View.Driver
View.Subviews
View.Id
View.IsCurrentTop
View.WantMousePositionReports
View.WantContinuousButtonPressed
View.Frame
View.GetEnumerator()
View.LayoutStyle
View.Bounds
View.X
View.Y
View.Width
View.Height
View.SuperView
View.SetNeedsDisplay()
View.SetNeedsDisplay(Rect)
View.ChildNeedsDisplay()
View.Add(View)
View.Add(View[])
View.RemoveAll()
View.Remove(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)
View.PositionCursor()
View.HasFocus
View.OnEnter()
View.OnLeave()
View.Focused
View.MostFocused
View.ColorScheme
View.AddRune(Int32, Int32, Rune)
View.ClearNeedsDisplay()
View.DrawContent
View.OnDrawContent(Rect)
View.SetFocus(View)
View.KeyPress
View.ProcessKey(KeyEvent)
View.ProcessColdKey(KeyEvent)
View.KeyDown
View.OnKeyDown(KeyEvent)
View.KeyUp
View.OnKeyUp(KeyEvent)
View.EnsureFocus()
View.FocusFirst()
View.FocusLast()
View.FocusPrev()
View.FocusNext()
View.LayoutComplete
View.LayoutSubviews()
View.ToString()
View.OnMouseEnter(MouseEvent)
View.OnMouseLeave(MouseEvent)
View.OnMouseEvent(MouseEvent)
Responder.CanFocus
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 StatusBar : View, IEnumerable

### Constructors

#### StatusBar()

Initializes a new instance of the StatusBar class.

##### Declaration

    public StatusBar()

#### StatusBar(StatusItem[])

Initializes a new instance of the StatusBar class with the specified set of StatusItems. The StatusBar will be drawn on the lowest line of the terminal or Parent (if not null).

##### Declaration

    public StatusBar(StatusItem[] items)

##### Parameters

Type | Name | Description
--- | --- | ---
StatusItem[] | items | A list of statusbar items.

### Properties

#### Items

The items that compose the StatusBar

##### Declaration

    public StatusItem[] Items { get; set; }

##### Property Value

Type | Description
--- | ---
StatusItem[] |

#### Parent

The parent view of the StatusBar.

##### Declaration

    public View Parent { get; set; }

##### Property Value

Type | Description
--- | ---
View |

### Methods

#### MouseEvent(MouseEvent)

Method invoked when a mouse event is generated

##### Declaration

    public override bool MouseEvent(MouseEvent me)

##### Parameters

Type | Name | Description
--- | --- | ---
MouseEvent | me |

##### Returns

Type | Description
--- | ---
System.Boolean | `true`, if the event was handled, `false` otherwise.

##### Overrides

Responder.MouseEvent(MouseEvent)

#### ProcessHotKey(KeyEvent)

This method can be overwritten by view that want to provide accelerator functionality (Alt-key for example).

##### Declaration

    public override bool ProcessHotKey(KeyEvent kb)

##### Parameters

Type | Name | Description
--- | --- | ---
KeyEvent | kb |

##### Returns

Type | Description
--- | ---
System.Boolean |

##### Overrides

View.ProcessHotKey(KeyEvent)

##### Remarks

Before keys are sent to the subview on the current view, all the views are processed and the key is passed to the widgets to allow some of them to process the keystroke as a hot-key.

For example, if you implement a button that has a hotkey ok "o", you would catch the combination Alt-o here. If the event is caught, you must return true to stop the keystroke from being dispatched to other views.

#### Redraw(Rect)

Redraws this view and its subviews; only redraws the views that have been flagged for a re-display.

##### Declaration

    public override void Redraw(Rect bounds)

##### Parameters

Type | Name | Description
--- | --- | ---
Rect | bounds | The bounds (view-relative region) to redraw.

##### Overrides

View.Redraw(Rect)

##### Remarks

Always use Bounds (view-relative) when calling Redraw(Rect), NOT Frame (superview-relative).

Views should set the color that they want to use on entry, as otherwise this will inherit the last color that was set globaly on the driver.

Overrides of Redraw(Rect) must ensure they do not set `Driver.Clip` to a clip region larger than the `region` parameter.

### Implements

System.Collections.IEnumerable