Class CheckBox
The
CheckBox View shows an on/off toggle that the user can set
Inheritance
System.Object
CheckBox
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 CheckBox : View, IDisposable, ISupportInitializeNotification, ISupportInitialize
Constructors
CheckBox()
Initializes a new instance of
CheckBox based on the given text, using
Computed layout.
Declaration
CheckBox(ustring, Boolean)
Initializes a new instance of
CheckBox based on the given text, using
Computed layout.
Declaration
public CheckBox(ustring s, bool is_checked = false)
Parameters
Type |
Name |
Description |
NStack.ustring |
s |
S. |
System.Boolean |
is_checked |
If set to true is checked. |
CheckBox(Int32, Int32, ustring)
Declaration
public CheckBox(int x, int y, ustring s)
Parameters
Type |
Name |
Description |
System.Int32 |
x |
|
System.Int32 |
y |
|
NStack.ustring |
s |
|
CheckBox(Int32, Int32, ustring, Boolean)
Declaration
public CheckBox(int x, int y, ustring s, bool is_checked)
Parameters
Type |
Name |
Description |
System.Int32 |
x |
|
System.Int32 |
y |
|
NStack.ustring |
s |
|
System.Boolean |
is_checked |
|
Properties
Checked
Declaration
public bool Checked { get; set; }
Property Value
Type |
Description |
System.Boolean |
|
Text
Declaration
public ustring Text { get; set; }
Property Value
Type |
Description |
NStack.ustring |
|
Methods
MouseEvent(MouseEvent)
Method invoked when a mouse event is generated
Declaration
public override bool MouseEvent(MouseEvent me)
Parameters
Returns
Type |
Description |
System.Boolean |
true , if the event was handled, false otherwise. |
Overrides
OnEnter(View)
Method invoked when a view gets focus.
Declaration
public override bool OnEnter(View view)
Parameters
Type |
Name |
Description |
View |
view |
The view that is losing focus. |
Returns
Type |
Description |
System.Boolean |
true , if the event was handled, false otherwise. |
Overrides
OnToggled(Boolean)
Declaration
public virtual void OnToggled(bool previousChecked)
Parameters
Type |
Name |
Description |
System.Boolean |
previousChecked |
|
PositionCursor()
Positions the cursor in the right position based on the currently focused view in the chain.
Declaration
public override void PositionCursor()
Overrides
ProcessKey(KeyEvent)
If the view is focused, gives the view a
chance to process the keystroke.
Declaration
public override bool ProcessKey(KeyEvent kb)
Parameters
Returns
Type |
Description |
System.Boolean |
|
Overrides
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
Events
Toggled
Toggled event, raised when the
CheckBox is toggled.
Declaration
public event Action<bool> Toggled
Event Type
Type |
Description |
System.Action<System.Boolean> |
|
Implements
System.IDisposable
System.ComponentModel.ISupportInitializeNotification
System.ComponentModel.ISupportInitialize