forked from gui-cs/Terminal.Gui
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request gui-cs#3571 from tig/v2_3570-TextView-ENTER
Fixes gui-cs#3570 & gui-cs#3561. Fixes a bunch of `EventArgs` sins
- Loading branch information
Showing
86 changed files
with
1,603 additions
and
2,067 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
#nullable enable | ||
using System.ComponentModel; | ||
|
||
namespace Terminal.Gui; | ||
|
||
#pragma warning disable CS1711 | ||
|
||
/// <summary> | ||
/// <see cref="EventArgs"/> for events that convey changes to a property of type <typeparamref name="T"/>. | ||
/// </summary> | ||
/// <typeparam name="T">The type of the value that was part of the change being canceled.</typeparam> | ||
/// <remarks> | ||
/// Events that use this class can be cancellable. Where applicable, the <see cref="CancelEventArgs.Cancel"/> property | ||
/// should be set to | ||
/// <see langword="true"/> to prevent the state change from occurring. | ||
/// </remarks> | ||
public class CancelEventArgs<T> : CancelEventArgs where T : notnull | ||
{ | ||
/// <summary>Initializes a new instance of the <see cref="CancelEventArgs{T}"/> class.</summary> | ||
/// <param name="currentValue">The current (old) value of the property.</param> | ||
/// <param name="newValue">The value the property will be set to if the event is not cancelled.</param> | ||
/// <param name="cancel">Whether the event should be canceled or not.</param> | ||
/// <typeparam name="T">The type of the value for the change being canceled.</typeparam> | ||
public CancelEventArgs (ref readonly T currentValue, ref T newValue, bool cancel = false) : base (cancel) | ||
{ | ||
CurrentValue = currentValue; | ||
NewValue = newValue; | ||
} | ||
|
||
/// <summary>The current value of the property.</summary> | ||
public T CurrentValue { get; } | ||
|
||
/// <summary>The value the property will be set to if the event is not cancelled.</summary> | ||
public T NewValue { get; set; } | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#nullable enable | ||
namespace Terminal.Gui; | ||
|
||
#pragma warning disable CS1711 | ||
/// <summary> | ||
/// <see cref="EventArgs"/> for events that convey changes to a property of type <typeparamref name="T"/>. | ||
/// </summary> | ||
/// <typeparam name="T">The type of the value that was part of the change being canceled.</typeparam> | ||
public class EventArgs<T> : EventArgs where T : notnull | ||
{ | ||
/// <summary>Initializes a new instance of the <see cref="EventArgs{T}"/> class.</summary> | ||
/// <param name="currentValue">The current value of the property.</param> | ||
/// <typeparam name="T">The type of the value.</typeparam> | ||
public EventArgs (ref readonly T currentValue) { CurrentValue = currentValue; } | ||
|
||
/// <summary>The current value of the property.</summary> | ||
public T CurrentValue { get; } | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
namespace Terminal.Gui; | ||
|
||
/// <summary> | ||
/// Describes the highlight style of a view. | ||
/// </summary> | ||
[Flags] | ||
public enum HighlightStyle | ||
{ | ||
/// <summary> | ||
/// No highlight. | ||
/// </summary> | ||
None = 0, | ||
|
||
#if HOVER | ||
/// <summary> | ||
/// The mouse is hovering over the view. | ||
/// </summary> | ||
Hover = 1, | ||
#endif | ||
|
||
/// <summary> | ||
/// The mouse is pressed within the <see cref="View.Viewport"/>. | ||
/// </summary> | ||
Pressed = 2, | ||
|
||
/// <summary> | ||
/// The mouse is pressed but moved outside the <see cref="View.Viewport"/>. | ||
/// </summary> | ||
PressedOutside = 4 | ||
} |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.