Class TimeField
Time editing View
Implements
System.IDisposable
System.ComponentModel.ISupportInitializeNotification
System.ComponentModel.ISupportInitialize
Remarks
Inherited Members
Namespace: Terminal.Gui
Assembly: Terminal.Gui.dll
Syntax
public class TimeField : TextField
Constructors
TimeField()
Declaration
public TimeField()
TimeField(Int32, Int32, TimeSpan, Boolean)
Declaration
public TimeField(int x, int y, TimeSpan time, bool isShort = false)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | x | The x coordinate. |
System.Int32 | y | The y coordinate. |
System.TimeSpan | time | Initial time. |
System.Boolean | isShort | If true, the seconds are hidden. Sets the IsShortFormat property. |
TimeField(TimeSpan)
Declaration
public TimeField(TimeSpan time)
Parameters
Type | Name | Description |
---|---|---|
System.TimeSpan | time | Initial time |
Properties
CursorPosition
Sets or gets the current cursor position.
Declaration
public override int CursorPosition { get; set; }
Property Value
Type | Description |
---|---|
System.Int32 |
Overrides
IsShortFormat
Get or sets whether TimeField uses the short or long time format.
Declaration
public bool IsShortFormat { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
Time
Gets or sets the time of the TimeField.
Declaration
public TimeSpan Time { get; set; }
Property Value
Type | Description |
---|---|
System.TimeSpan |
Methods
DeleteCharLeft(Boolean)
Deletes the left character.
Declaration
public override void DeleteCharLeft(bool useOldCursorPos = true)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | useOldCursorPos |
Overrides
DeleteCharRight()
Deletes the right character.
Declaration
public override void DeleteCharRight()
Overrides
MouseEvent(MouseEvent)
Method invoked when a mouse event is generated
Declaration
public override bool MouseEvent(MouseEvent ev)
Parameters
Type | Name | Description |
---|---|---|
MouseEvent | ev |
Returns
Type | Description |
---|---|
System.Boolean | true , if the event was handled, false otherwise. |
Overrides
OnTimeChanged(DateTimeEventArgs<TimeSpan>)
Event firing method that invokes the TimeChanged event.
Declaration
public virtual void OnTimeChanged(DateTimeEventArgs<TimeSpan> args)
Parameters
Type | Name | Description |
---|---|---|
DateTimeEventArgs<System.TimeSpan> | args | The event arguments |
ProcessKey(KeyEvent)
Processes key presses for the TextField.
Declaration
public override bool ProcessKey(KeyEvent kb)
Parameters
Type | Name | Description |
---|---|---|
KeyEvent | kb |
Returns
Type | Description |
---|---|
System.Boolean |
Overrides
Events
TimeChanged
TimeChanged event, raised when the Date has changed.
Declaration
public event Action<DateTimeEventArgs<TimeSpan>> TimeChanged
Event Type
Type | Description |
---|---|
System.Action<DateTimeEventArgs<System.TimeSpan>> |
Implements
System.IDisposable
System.ComponentModel.ISupportInitializeNotification
System.ComponentModel.ISupportInitialize