Skip to content

Fixes #4050 - Select->Activate #4126

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 117 commits into
base: v2_develop
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 8 commits
Commits
Show all changes
117 commits
Select commit Hold shift + click to select a range
6402f3a
Remove continous press code from Application
tznind Jun 3, 2025
a7a5d1a
WIP prototype code to handle continuous press as subcomponent of View
tznind Jun 3, 2025
8f43909
Prototype with Button
tznind Jun 3, 2025
cbb20ff
Implement CWP
tznind Jun 3, 2025
b91a9ca
Move to seperate classes and prevent double entry to Start
tznind Jun 4, 2025
a19145a
Fix repeat clicking when moving mouse by removing phantom click code …
tznind Jun 4, 2025
d8335c4
Remove initial tick because it results in double activation e.g. butt…
tznind Jun 4, 2025
91c1da0
Command.Select->Activate
tig Jun 4, 2025
49e8054
Finished migration
tig Jun 4, 2025
0881342
Backed out erroneous change
tig Jun 4, 2025
d2c4ac0
Backed out erroneous change2
tig Jun 4, 2025
fa40200
Backed out erroneous change3
tig Jun 4, 2025
5bfd876
Backed out erroneous change5
tig Jun 4, 2025
4b4e286
Backed out erroneous change66
tig Jun 4, 2025
d998d3a
Backed out erroneous change7
tig Jun 4, 2025
9eda420
Backed out erroneous change8
tig Jun 4, 2025
0551edc
weaked md'
tig Jun 4, 2025
d10489c
updated command.md
tig Jun 5, 2025
4d685aa
Fixes #4122
tig Jun 5, 2025
7d940de
Enhance Command and Mouse APIs; update documentation
tig Jun 6, 2025
c4bf114
WIP: Broken.
tig Jun 6, 2025
2d2641d
WIP: Broken.
tig Jun 7, 2025
8ccb476
Merge branch 'v2_4050-Activate' of tig:tig/Terminal.Gui into v2_4050-…
tig Jun 9, 2025
8d9ecc1
Added a Selectors Scenario
tig Jun 9, 2025
c5edc79
Merge branch 'v2_4050-Activate' of tig:tig/Terminal.Gui into v2_4050-…
tig Jun 10, 2025
1ba4f0c
Tweaked FlagSelector
tig Jun 10, 2025
b656258
Merge branch 'v2_4050-Activate' of tig:tig/Terminal.Gui into v2_4050-…
tig Jun 10, 2025
0165aba
More tweaks
tig Jun 11, 2025
0e8c7f1
Merge branch 'v2_4050-Activate' of tig:tig/Terminal.Gui into v2_4050-…
tig Jun 11, 2025
b871ff9
Added a Selectors Scenario2
tig Jun 12, 2025
e27c0fb
Merge branch 'v2_develop' into v2_4050-Activate
tig Jun 13, 2025
8262b2d
Merge branch 'v2_4050-Activate' of tig:tig/Terminal.Gui into v2_4050-…
tig Jun 13, 2025
bc13f34
Merge branch 'v2_4050-Activate' of tig:tig/Terminal.Gui into v2_4050-…
tig Jun 13, 2025
98947ba
Refactor DatePicker lamdas
tznind Jun 14, 2025
e946638
Merge branch 'v2_develop' into 4101_continuous_press
tznind Jun 14, 2025
550ef03
WIP investigate subcomponents instead of statics
tznind Jun 14, 2025
a28cc6c
Add IMouseGrabHandler to IApplication
tznind Jun 14, 2025
6d794f2
Make mouse grabbing non static activity
tznind Jun 14, 2025
ee7ea86
Make MouseHeldDown suppress when null fields e.g. app not initialized…
tznind Jun 14, 2025
887631d
Update test and remove dependency on Application
tznind Jun 14, 2025
0d75ef0
Fix other mouse click and hold tests
tznind Jun 14, 2025
c3c6c70
Code cleanup
tznind Jun 14, 2025
f717be5
Update class diagram
tznind Jun 14, 2025
32d747a
Fix bad xml doc references
tznind Jun 14, 2025
e9a33cb
Fix timed events not getting passed through in v2 applications
tznind Jun 14, 2025
48e80f3
Make timed events nullable for tests that dont create an Application
tznind Jun 14, 2025
06e45e1
Remove strange blocking test
tznind Jun 15, 2025
c414695
Refactors OptionSelector, FlagSelector to removed duplicate code.
tig Jun 16, 2025
c106ff0
WIP remove all idles and replace with zero timeouts
tznind Jun 19, 2025
6f11fd6
Fix build of tests
tznind Jun 19, 2025
c597454
Fix unit tests
tznind Jun 20, 2025
aba2e43
Add wakeup call back in
tznind Jun 20, 2025
2dfe6b3
Comment out incredibly complicated test and fix others
tznind Jun 20, 2025
f18b752
Fix test
tznind Jun 20, 2025
34bc316
test fix
tznind Jun 20, 2025
0016a18
Make Post execute immediately if already on UI thread
tznind Jun 20, 2025
e85cccd
Re enable test and simplify Invoke to just execute if in UI thread (u…
tznind Jun 20, 2025
e4c7f0f
Remove xml doc references to idles
tznind Jun 21, 2025
e13ed63
Remove more references to idles
tznind Jun 21, 2025
c588e04
Make Screen initialization threadsafe
tznind Jun 21, 2025
c2390ad
merge 4101_continuous_press into branch
tznind Jun 21, 2025
49dc897
Add more exciting timeouts
tznind Jun 21, 2025
394794a
WIP add tests
tznind Jun 21, 2025
308b26f
fix log
tznind Jun 21, 2025
e20b489
fix test
tznind Jun 21, 2025
78c5d0d
make continuous key press use smoth acceleration
tznind Jun 21, 2025
966178e
Rename _lock to _lockScreen
tznind Jun 21, 2025
8721ea3
Remove section on idles, they are not a thing anymore - and they kind…
tznind Jun 21, 2025
53de140
Add nullable enable
tznind Jun 21, 2025
7fb15fa
Add xml comment
tznind Jun 21, 2025
889e071
Fix namings and cleanup code
tznind Jun 21, 2025
68c2a0d
Makes mouse event handling more deterministic.
tig Jun 23, 2025
bfcbd4b
Temporarily setup Generic.cs to show bug is fixed
tig Jun 23, 2025
28b99a4
Removed most uses of OnMouseClick/MouseClick
tig Jun 23, 2025
d8b7c97
Removed all of OnMouseClick/MouseClick
tig Jun 24, 2025
e42f52d
Test cleanup
tig Jun 24, 2025
d2b1eba
RadioGroup->Obsolete - use OptionSelector instead
tig Jun 24, 2025
846a686
Test cleanup2
tig Jun 24, 2025
f118645
Merge branch 'v2_develop' into v2_4050-Activate
tig Jun 24, 2025
77e8675
Merge branch 'v2_develop' into logarithmic-timeout
tig Jun 24, 2025
6a2477b
Tons of fixes
tig Jun 26, 2025
91e9ef5
Fixed AdvanceFocus bug
tig Jun 26, 2025
2c4353d
Fixed Shortcut rendering
tig Jun 26, 2025
4dd7f14
Revisiting Command prop
tig Jun 27, 2025
dc3a67e
Merge branch 'v2_4050-Activate' of tig:tig/Terminal.Gui into v2_4050-…
tig Jun 27, 2025
3a0f348
Merge branch 'v2_4050-Activate' of tig:tig/Terminal.Gui into v2_4050-…
tig Jun 27, 2025
4e36e7a
Merge branch 'v2_develop' into v2_4050-Activate
tig Jun 27, 2025
49bba53
Tweaked UICatalog
tig Jun 27, 2025
8a07e26
Fixed menu details
tig Jun 27, 2025
ec5bae6
Fixed stuff related to https://github.com/gui-cs/Terminal.Gui/issues/…
tig Jun 27, 2025
144b027
Merge branch 'v2_develop' into logarithmic-timeout
tig Jun 27, 2025
2dd3525
code cleanup
tig Jun 27, 2025
0efefdf
Merge branch 'v2_4050-Activate' of tig:tig/Terminal.Gui into v2_4050-…
tig Jun 27, 2025
54b63f0
Shortcut code cleanup
tig Jun 27, 2025
5e0d487
Merge branch 'v2_develop' into v2_4050-Activate
tig Jun 30, 2025
6b05319
POC implementation of fix for https://github.com/gui-cs/Terminal.Gui/…
tig Jun 30, 2025
ebcf66c
Merge branch 'v2_4050-Activate' of tig:tig/Terminal.Gui into v2_4050-…
tig Jun 30, 2025
7c00793
Fixed OptionSelector focus bug
tig Jul 1, 2025
de953f7
Merge branch 'v2_develop' into logarithmic-timeout
tznind Jul 5, 2025
f6b9fe7
xmldoc fix
tznind Jul 5, 2025
65207ad
Rename LockAndRunTimers to just RunTimers
tznind Jul 5, 2025
079a4c5
Rename AddTimeout and RemoveTimeout (and event) to just Add/Remove
tznind Jul 5, 2025
768e5bd
Update description of MainLoop
tznind Jul 5, 2025
a3316ca
WIP
tig Jul 7, 2025
fb19bfa
Merge branch 'v2_develop' into logarithmic-timeout
tig Jul 7, 2025
87fe518
Merge branch 'v2_develop' of tig:tig/Terminal.Gui into v2_develop
tig Jul 7, 2025
62fd462
Merge branch 'v2_develop' of tig:tig/Terminal.Gui into v2_develop
tig Jul 7, 2025
b7a7f1c
Reverted Activate WIP code
tig Jul 7, 2025
c25a4d5
Merge branch 'v2_develop' into v2_4050-Activate
tig Jul 7, 2025
1efaf49
Merge branch 'v2_develop' into logarithmic-timeout
tig Jul 7, 2025
837298a
Merge branch 'logarithmic-timeout' of github.com:tznind/gui.cs into t…
tig Jul 7, 2025
a1ea545
Commented out Run_T_Call_Init_ForceDriver_Should_Pick_Correct_Driver
tig Jul 7, 2025
8abb13c
Again? Commented out Run_T_Call_Init_ForceDriver_Should_Pick_Correct_…
tig Jul 7, 2025
6515d88
Revert Commented out Run_T_Call_Init_ForceDriver_Should_Pick_Correct_…
tig Jul 7, 2025
966e2f7
Atttempting to merge #4173
tig Jul 7, 2025
83c63a2
Merge branch 'v2_develop' of tig:tig/Terminal.Gui into v2_develop
tig Jul 10, 2025
0581c26
Merged
tig Jul 10, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Examples/UICatalog/Scenarios/EditorsAndHelpers/DimEditor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ private void DimEditor_Initialized (object? sender, EventArgs e)
};
Add (label);
_dimRadioGroup = new () { X = 0, Y = Pos.Bottom (label), RadioLabels = _radioItems };
_dimRadioGroup.SelectedItemChanged += OnRadioGroupOnSelectedItemChanged;
_dimRadioGroup.SelectedItemChanged += OnRadioGroupOnSelectedtemChanged;
_valueEdit = new ()
{
X = Pos.Right (label) + 1,
Expand Down Expand Up @@ -121,7 +121,7 @@ private void DimEditor_Initialized (object? sender, EventArgs e)

}

private void OnRadioGroupOnSelectedItemChanged (object? s, SelectedItemChangedArgs selected) { DimChanged (); }
private void OnRadioGroupOnSelectedtemChanged (object? s, SelectedItemChangedArgs selected) { DimChanged (); }

// These need to have same order
private readonly List<string> _dimNames = ["Absolute", "Auto", "Fill", "Func", "Percent",];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ public View? ViewToLog
_viewToLog.MouseClick += (s, args) => { Log ($"MouseClick: {args}"); };
_viewToLog.MouseWheel += (s, args) => { Log ($"MouseWheel: {args}"); };
_viewToLog.HandlingHotKey += (s, args) => { Log ($"HandlingHotKey: {args.Context}"); };
_viewToLog.Selecting += (s, args) => { Log ($"Selecting: {args.Context}"); };
_viewToLog.Activating += (s, args) => { Log ($"Activating: {args.Context}"); };
_viewToLog.Accepting += (s, args) => { Log ($"Accepting: {args.Context}"); };
}
}
Expand Down
2 changes: 1 addition & 1 deletion Examples/UICatalog/Scenarios/ListViewWithSelection.cs
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ public override void Main ()
_listView.OpenSelectedItem += (s, a) => LogEvent (s as View, a, "OpenSelectedItem");
_listView.CollectionChanged += (s, a) => LogEvent (s as View, a, "CollectionChanged");
_listView.Accepting += (s, a) => LogEvent (s as View, a, "Accept");
_listView.Selecting += (s, a) => LogEvent (s as View, a, "Select");
_listView.Activating += (s, a) => LogEvent (s as View, a, "Activating");
_listView.VerticalScrollBar.AutoShow = true;
_listView.HorizontalScrollBar.AutoShow = true;

Expand Down
10 changes: 5 additions & 5 deletions Examples/UICatalog/Scenarios/Shortcuts.cs
Original file line number Diff line number Diff line change
Expand Up @@ -427,7 +427,7 @@ select peer.Key.ToString ().GetColumns ()).Prepend (max)
BoxWidth = 1
};

bgColorShortcut.Selecting += (o, args) =>
bgColorShortcut.Activating += (o, args) =>
{
//args.Cancel = true;
};
Expand Down Expand Up @@ -482,26 +482,26 @@ select peer.Key.ToString ().GetColumns ()).Prepend (max)

foreach (Shortcut shortcut in Application.Top.SubViews.OfType<Shortcut> ())
{
shortcut.Selecting += (o, args) =>
shortcut.Activating += (o, args) =>
{
if (args.Handled)
{
return;
}

eventSource.Add ($"{shortcut!.Id}.Selecting: {shortcut!.CommandView.Text} {shortcut!.CommandView.GetType ().Name}");
eventSource.Add ($"{shortcut!.Id}.Activating: {shortcut!.CommandView.Text} {shortcut!.CommandView.GetType ().Name}");
eventLog.MoveDown ();
};

shortcut.CommandView.Selecting += (o, args) =>
shortcut.CommandView.Activating += (o, args) =>
{
if (args.Handled)
{
return;
}

eventSource.Add (
$"{shortcut!.Id}.CommandView.Selecting: {shortcut!.CommandView.Text} {shortcut!.CommandView.GetType ().Name}");
$"{shortcut!.Id}.CommandView.Activating: {shortcut!.CommandView.Text} {shortcut!.CommandView.GetType ().Name}");
eventLog.MoveDown ();
args.Handled = true;
};
Expand Down
9 changes: 6 additions & 3 deletions Terminal.Gui/Input/Command.cs
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,15 @@ public enum Command
HotKey,

/// <summary>
/// Selects the View or an item in the View (e.g. a list item or menu item) without necessarily accepting it.
/// Activates the View or an item in the View (e.g. a list item or menu item) without necessarily accepting it.
/// <para>
/// The default implementation in <see cref="View"/> calls <see cref="View.RaiseSelecting"/>.
/// In some cases, activating a View just sets focus to it, while in others it may trigger an action.
/// </para>
/// <para>
/// The default implementation in <see cref="View"/> calls <see cref="View.RaiseActivating"/>.
/// </para>
/// </summary>
Select,
Activate,

#endregion

Expand Down
34 changes: 17 additions & 17 deletions Terminal.Gui/ViewBase/View.Command.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,12 @@ private void SetupCommands ()
return true;
});

// Space or single-click - Raise Selecting
// Space or single-click - Raise Activating
AddCommand (
Command.Select,
Command.Activate,
ctx =>
{
if (RaiseSelecting (ctx) is true)
if (RaiseActivating (ctx) is true)
{
return true;
}
Expand Down Expand Up @@ -107,7 +107,7 @@ private void SetupCommands ()
/// <remarks>
/// <para>
/// The <see cref="Accepting"/> event should be raised after the state of the View has changed (after
/// <see cref="Selecting"/> is raised).
/// <see cref="Activating"/> is raised).
/// </para>
/// <para>
/// If the Accepting event is not handled, <see cref="Command.Accept"/> will be invoked on the SuperView, enabling
Expand Down Expand Up @@ -203,12 +203,12 @@ private void SetupCommands ()
public event EventHandler<CommandEventArgs>? Accepting;

/// <summary>
/// Called when the user has performed an action (e.g. <see cref="Command.Select"/>) causing the View to change state.
/// Calls <see cref="OnSelecting"/> which can be cancelled; if not cancelled raises <see cref="Accepting"/>.
/// event. The default <see cref="Command.Select"/> handler calls this method.
/// Called when the user has performed an action (e.g. <see cref="Command.Activate"/>) causing the View to be activated.
/// Calls <see cref="OnActivating"/> which can be cancelled; if not cancelled raises <see cref="Accepting"/>.
/// event. The default <see cref="Command.Activate"/> handler calls this method.
/// </summary>
/// <remarks>
/// The <see cref="Selecting"/> event should be raised after the state of the View has been changed and before see
/// The <see cref="Activating"/> event should be raised after the state of the View has been changed and before see
/// <see cref="Accepting"/>.
/// </remarks>
/// <returns>
Expand All @@ -217,40 +217,40 @@ private void SetupCommands ()
/// continue.
/// <see langword="true"/> if the event was raised and handled (or cancelled); input processing should stop.
/// </returns>
protected bool? RaiseSelecting (ICommandContext? ctx)
protected bool? RaiseActivating (ICommandContext? ctx)
{
//Logging.Debug ($"{Title} ({ctx?.Source?.Title})");
CommandEventArgs args = new () { Context = ctx };

// Best practice is to invoke the virtual method first.
// This allows derived classes to handle the event and potentially cancel it.
if (OnSelecting (args) || args.Handled)
if (OnActivating (args) || args.Handled)
{
return true;
}

// If the event is not canceled by the virtual method, raise the event to notify any external subscribers.
Selecting?.Invoke (this, args);
Activating?.Invoke (this, args);

return Selecting is null ? null : args.Handled;
return Activating is null ? null : args.Handled;
}

/// <summary>
/// Called when the user has performed an action (e.g. <see cref="Command.Select"/>) causing the View to change state.
/// Called when the user has performed an action (e.g. <see cref="Command.Activate"/>) causing the View to be activated.
/// Set CommandEventArgs.Handled to <see langword="true"/> and return <see langword="true"/> to indicate the event was
/// handled and processing should stop.
/// </summary>
/// <param name="args">The event arguments.</param>
/// <returns><see langword="true"/> to stop processing.</returns>
protected virtual bool OnSelecting (CommandEventArgs args) { return false; }
protected virtual bool OnActivating (CommandEventArgs args) { return false; }

/// <summary>
/// Cancelable event raised when the user has performed an action (e.g. <see cref="Command.Select"/>) causing the View
/// to change state.
/// Cancelable event raised when the user has performed an action (e.g. <see cref="Command.Activate"/>) causing the View
/// be activated.
/// Set CommandEventArgs.Handled to <see langword="true"/> to indicate the event was handled and processing should
/// stop.
/// </summary>
public event EventHandler<CommandEventArgs>? Selecting;
public event EventHandler<CommandEventArgs>? Activating;

/// <summary>
/// Called when the View is handling the user pressing the View's <see cref="HotKey"/>s. Calls
Expand Down
2 changes: 1 addition & 1 deletion Terminal.Gui/ViewBase/View.Keyboard.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ public partial class View // Keyboard APIs
private void SetupKeyboard ()
{
KeyBindings = new (this);
KeyBindings.Add (Key.Space, Command.Select);
KeyBindings.Add (Key.Space, Command.Activate);
KeyBindings.Add (Key.Enter, Command.Accept);

HotKeyBindings = new (this);
Expand Down
12 changes: 6 additions & 6 deletions Terminal.Gui/ViewBase/View.Mouse.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@ private void SetupMouse ()
MouseBindings = new ();

// TODO: Should the default really work with any button or just button1?
MouseBindings.Add (MouseFlags.Button1Clicked, Command.Select);
MouseBindings.Add (MouseFlags.Button2Clicked, Command.Select);
MouseBindings.Add (MouseFlags.Button3Clicked, Command.Select);
MouseBindings.Add (MouseFlags.Button4Clicked, Command.Select);
MouseBindings.Add (MouseFlags.Button1Clicked | MouseFlags.ButtonCtrl, Command.Select);
MouseBindings.Add (MouseFlags.Button1Clicked, Command.Activate);
MouseBindings.Add (MouseFlags.Button2Clicked, Command.Activate);
MouseBindings.Add (MouseFlags.Button3Clicked, Command.Activate);
MouseBindings.Add (MouseFlags.Button4Clicked, Command.Activate);
MouseBindings.Add (MouseFlags.Button1Clicked | MouseFlags.ButtonCtrl, Command.Activate);
}

/// <summary>
Expand Down Expand Up @@ -476,7 +476,7 @@ protected bool RaiseMouseClickEvent (MouseEventArgs args)

// Post-conditions

// By default, this will raise Selecting/OnSelecting - Subclasses can override this via AddCommand (Command.Select ...).
// By default, this will raise Activating/OnActivating - Subclasses can override this via AddCommand (Command.Select ...).
args.Handled = InvokeCommandsBoundToMouse (args) == true;

return args.Handled;
Expand Down
2 changes: 1 addition & 1 deletion Terminal.Gui/Views/Button.cs
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ public Button ()
{
bool cachedIsDefault = IsDefault; // Supports "Swap Default" in Buttons scenario where IsDefault changes

if (RaiseSelecting (commandContext) is true)
if (RaiseActivating (commandContext) is true)
{
return true;
}
Expand Down
6 changes: 3 additions & 3 deletions Terminal.Gui/Views/CharMap/CharMap.cs
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public CharMap ()
AddCommand (Command.ScrollLeft, () => ScrollHorizontal (-1));

AddCommand (Command.Accept, HandleAcceptCommand);
AddCommand (Command.Select, HandleSelectCommand);
AddCommand (Command.Activate, HandleSelectCommand);
AddCommand (Command.Context, HandleContextCommand);

KeyBindings.Add (Key.CursorUp, Command.Up);
Expand Down Expand Up @@ -114,7 +114,7 @@ private void PaddingOnGettingAttributeForRole (object? sender, VisualRoleEventAr

private bool? Move (ICommandContext? commandContext, int cpOffset)
{
if (RaiseSelecting (commandContext) is true)
if (RaiseActivating (commandContext) is true)
{
return true;
}
Expand Down Expand Up @@ -462,7 +462,7 @@ public static string ToCamelCase (string str)
}
}

if (RaiseSelecting (commandContext) is true)
if (RaiseActivating (commandContext) is true)
{
return true;
}
Expand Down
4 changes: 2 additions & 2 deletions Terminal.Gui/Views/CheckBox.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public CheckBox ()
CanFocus = true;

// Select (Space key and single-click) - Advance state and raise Select event - DO NOT raise Accept
AddCommand (Command.Select, AdvanceAndSelect);
AddCommand (Command.Activate, AdvanceAndSelect);

// Hotkey - Advance state and raise Select event - DO NOT raise Accept
AddCommand (Command.HotKey, ctx =>
Expand Down Expand Up @@ -58,7 +58,7 @@ public CheckBox ()
return true;
}

if (RaiseSelecting (commandContext) is true)
if (RaiseActivating (commandContext) is true)
{
return true;
}
Expand Down
10 changes: 5 additions & 5 deletions Terminal.Gui/Views/Color/ColorPicker.16.cs
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ public Point Cursor
/// <returns></returns>
private bool MoveDown (ICommandContext? commandContext)
{
if (RaiseSelecting (commandContext) == true)
if (RaiseActivating (commandContext) == true)
{
return true;
}
Expand All @@ -86,7 +86,7 @@ private bool MoveDown (ICommandContext? commandContext)
/// <returns></returns>
private bool MoveLeft (ICommandContext? commandContext)
{
if (RaiseSelecting (commandContext) == true)
if (RaiseActivating (commandContext) == true)
{
return true;
}
Expand All @@ -103,7 +103,7 @@ private bool MoveLeft (ICommandContext? commandContext)
/// <returns></returns>
private bool MoveRight (ICommandContext? commandContext)
{
if (RaiseSelecting (commandContext) == true)
if (RaiseActivating (commandContext) == true)
{
return true;
}
Expand All @@ -119,7 +119,7 @@ private bool MoveRight (ICommandContext? commandContext)
/// <returns></returns>
private bool MoveUp (ICommandContext? commandContext)
{
if (RaiseSelecting (commandContext) == true)
if (RaiseActivating (commandContext) == true)
{
return true;
}
Expand Down Expand Up @@ -195,7 +195,7 @@ private void AddCommands ()
AddCommand (Command.Up, (ctx) => MoveUp (ctx));
AddCommand (Command.Down, (ctx) => MoveDown (ctx));

AddCommand (Command.Select, (ctx) =>
AddCommand (Command.Activate, (ctx) =>
{
var set = false;

Expand Down
4 changes: 2 additions & 2 deletions Terminal.Gui/Views/ComboBox.cs
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@
}

/// <inheritdoc />
protected override bool OnSettingScheme (ValueChangingEventArgs<Scheme?> args)

Check warning on line 114 in Terminal.Gui/Views/ComboBox.cs

View workflow job for this annotation

GitHub Actions / build_release

The annotation for nullable reference types should only be used in code within a '#nullable' annotations context.

Check warning on line 114 in Terminal.Gui/Views/ComboBox.cs

View workflow job for this annotation

GitHub Actions / build_and_test_debug (ubuntu-latest)

The annotation for nullable reference types should only be used in code within a '#nullable' annotations context.

Check warning on line 114 in Terminal.Gui/Views/ComboBox.cs

View workflow job for this annotation

GitHub Actions / Parallel Unit Tests (macos-latest)

The annotation for nullable reference types should only be used in code within a '#nullable' annotations context.

Check warning on line 114 in Terminal.Gui/Views/ComboBox.cs

View workflow job for this annotation

GitHub Actions / Parallel Unit Tests (ubuntu-latest)

The annotation for nullable reference types should only be used in code within a '#nullable' annotations context.

Check warning on line 114 in Terminal.Gui/Views/ComboBox.cs

View workflow job for this annotation

GitHub Actions / Non-Parallel Unit Tests (macos-latest)

The annotation for nullable reference types should only be used in code within a '#nullable' annotations context.

Check warning on line 114 in Terminal.Gui/Views/ComboBox.cs

View workflow job for this annotation

GitHub Actions / build_and_test_debug (macos-latest)

The annotation for nullable reference types should only be used in code within a '#nullable' annotations context.

Check warning on line 114 in Terminal.Gui/Views/ComboBox.cs

View workflow job for this annotation

GitHub Actions / Non-Parallel Unit Tests (ubuntu-latest)

The annotation for nullable reference types should only be used in code within a '#nullable' annotations context.

Check warning on line 114 in Terminal.Gui/Views/ComboBox.cs

View workflow job for this annotation

GitHub Actions / build_and_test_debug (windows-latest)

The annotation for nullable reference types should only be used in code within a '#nullable' annotations context.

Check warning on line 114 in Terminal.Gui/Views/ComboBox.cs

View workflow job for this annotation

GitHub Actions / Parallel Unit Tests (windows-latest)

The annotation for nullable reference types should only be used in code within a '#nullable' annotations context.

Check warning on line 114 in Terminal.Gui/Views/ComboBox.cs

View workflow job for this annotation

GitHub Actions / Non-Parallel Unit Tests (windows-latest)

The annotation for nullable reference types should only be used in code within a '#nullable' annotations context.
{
_listview.SetScheme(args.NewValue);
return base.OnSettingScheme (args);
Expand Down Expand Up @@ -972,9 +972,9 @@
}
}

public override bool OnSelectedChanged ()
public override bool OnActivatedChanged ()
{
bool res = base.OnSelectedChanged ();
bool res = base.OnActivatedChanged ();

_highlighted = SelectedItem;

Expand Down
2 changes: 1 addition & 1 deletion Terminal.Gui/Views/FileDialogs/FileDialog.cs
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,9 @@
private readonly TextField _tbFind;
private readonly TextField _tbPath;
private readonly TreeView<IFileSystemInfo> _treeView;
private MenuBarItem _allowedTypeMenu;

Check warning on line 47 in Terminal.Gui/Views/FileDialogs/FileDialog.cs

View workflow job for this annotation

GitHub Actions / build_release

'MenuBarItem' is obsolete: 'Use MenuBarItemv2 instead.'

Check warning on line 47 in Terminal.Gui/Views/FileDialogs/FileDialog.cs

View workflow job for this annotation

GitHub Actions / build_and_test_debug (ubuntu-latest)

'MenuBarItem' is obsolete: 'Use MenuBarItemv2 instead.'

Check warning on line 47 in Terminal.Gui/Views/FileDialogs/FileDialog.cs

View workflow job for this annotation

GitHub Actions / Parallel Unit Tests (macos-latest)

'MenuBarItem' is obsolete: 'Use MenuBarItemv2 instead.'

Check warning on line 47 in Terminal.Gui/Views/FileDialogs/FileDialog.cs

View workflow job for this annotation

GitHub Actions / Parallel Unit Tests (ubuntu-latest)

'MenuBarItem' is obsolete: 'Use MenuBarItemv2 instead.'

Check warning on line 47 in Terminal.Gui/Views/FileDialogs/FileDialog.cs

View workflow job for this annotation

GitHub Actions / Non-Parallel Unit Tests (macos-latest)

'MenuBarItem' is obsolete: 'Use MenuBarItemv2 instead.'

Check warning on line 47 in Terminal.Gui/Views/FileDialogs/FileDialog.cs

View workflow job for this annotation

GitHub Actions / build_and_test_debug (macos-latest)

'MenuBarItem' is obsolete: 'Use MenuBarItemv2 instead.'

Check warning on line 47 in Terminal.Gui/Views/FileDialogs/FileDialog.cs

View workflow job for this annotation

GitHub Actions / Non-Parallel Unit Tests (ubuntu-latest)

'MenuBarItem' is obsolete: 'Use MenuBarItemv2 instead.'

Check warning on line 47 in Terminal.Gui/Views/FileDialogs/FileDialog.cs

View workflow job for this annotation

GitHub Actions / build_and_test_debug (windows-latest)

'MenuBarItem' is obsolete: 'Use MenuBarItemv2 instead.'

Check warning on line 47 in Terminal.Gui/Views/FileDialogs/FileDialog.cs

View workflow job for this annotation

GitHub Actions / Parallel Unit Tests (windows-latest)

'MenuBarItem' is obsolete: 'Use MenuBarItemv2 instead.'

Check warning on line 47 in Terminal.Gui/Views/FileDialogs/FileDialog.cs

View workflow job for this annotation

GitHub Actions / Non-Parallel Unit Tests (windows-latest)

'MenuBarItem' is obsolete: 'Use MenuBarItemv2 instead.'
private MenuBar _allowedTypeMenuBar;

Check warning on line 48 in Terminal.Gui/Views/FileDialogs/FileDialog.cs

View workflow job for this annotation

GitHub Actions / build_release

'MenuBar' is obsolete: 'Use MenuBarv2 instead.'

Check warning on line 48 in Terminal.Gui/Views/FileDialogs/FileDialog.cs

View workflow job for this annotation

GitHub Actions / build_and_test_debug (ubuntu-latest)

'MenuBar' is obsolete: 'Use MenuBarv2 instead.'

Check warning on line 48 in Terminal.Gui/Views/FileDialogs/FileDialog.cs

View workflow job for this annotation

GitHub Actions / Parallel Unit Tests (macos-latest)

'MenuBar' is obsolete: 'Use MenuBarv2 instead.'

Check warning on line 48 in Terminal.Gui/Views/FileDialogs/FileDialog.cs

View workflow job for this annotation

GitHub Actions / Parallel Unit Tests (ubuntu-latest)

'MenuBar' is obsolete: 'Use MenuBarv2 instead.'

Check warning on line 48 in Terminal.Gui/Views/FileDialogs/FileDialog.cs

View workflow job for this annotation

GitHub Actions / Non-Parallel Unit Tests (macos-latest)

'MenuBar' is obsolete: 'Use MenuBarv2 instead.'

Check warning on line 48 in Terminal.Gui/Views/FileDialogs/FileDialog.cs

View workflow job for this annotation

GitHub Actions / build_and_test_debug (macos-latest)

'MenuBar' is obsolete: 'Use MenuBarv2 instead.'

Check warning on line 48 in Terminal.Gui/Views/FileDialogs/FileDialog.cs

View workflow job for this annotation

GitHub Actions / Non-Parallel Unit Tests (ubuntu-latest)

'MenuBar' is obsolete: 'Use MenuBarv2 instead.'

Check warning on line 48 in Terminal.Gui/Views/FileDialogs/FileDialog.cs

View workflow job for this annotation

GitHub Actions / build_and_test_debug (windows-latest)

'MenuBar' is obsolete: 'Use MenuBarv2 instead.'

Check warning on line 48 in Terminal.Gui/Views/FileDialogs/FileDialog.cs

View workflow job for this annotation

GitHub Actions / Parallel Unit Tests (windows-latest)

'MenuBar' is obsolete: 'Use MenuBarv2 instead.'

Check warning on line 48 in Terminal.Gui/Views/FileDialogs/FileDialog.cs

View workflow job for this annotation

GitHub Actions / Non-Parallel Unit Tests (windows-latest)

'MenuBar' is obsolete: 'Use MenuBarv2 instead.'
private MenuItem [] _allowedTypeMenuItems;

Check warning on line 49 in Terminal.Gui/Views/FileDialogs/FileDialog.cs

View workflow job for this annotation

GitHub Actions / build_release

'MenuItem' is obsolete: 'Use MenuItemv2 instead.'

Check warning on line 49 in Terminal.Gui/Views/FileDialogs/FileDialog.cs

View workflow job for this annotation

GitHub Actions / build_and_test_debug (ubuntu-latest)

'MenuItem' is obsolete: 'Use MenuItemv2 instead.'

Check warning on line 49 in Terminal.Gui/Views/FileDialogs/FileDialog.cs

View workflow job for this annotation

GitHub Actions / Parallel Unit Tests (macos-latest)

'MenuItem' is obsolete: 'Use MenuItemv2 instead.'

Check warning on line 49 in Terminal.Gui/Views/FileDialogs/FileDialog.cs

View workflow job for this annotation

GitHub Actions / Parallel Unit Tests (ubuntu-latest)

'MenuItem' is obsolete: 'Use MenuItemv2 instead.'

Check warning on line 49 in Terminal.Gui/Views/FileDialogs/FileDialog.cs

View workflow job for this annotation

GitHub Actions / Non-Parallel Unit Tests (macos-latest)

'MenuItem' is obsolete: 'Use MenuItemv2 instead.'

Check warning on line 49 in Terminal.Gui/Views/FileDialogs/FileDialog.cs

View workflow job for this annotation

GitHub Actions / build_and_test_debug (macos-latest)

'MenuItem' is obsolete: 'Use MenuItemv2 instead.'

Check warning on line 49 in Terminal.Gui/Views/FileDialogs/FileDialog.cs

View workflow job for this annotation

GitHub Actions / Non-Parallel Unit Tests (ubuntu-latest)

'MenuItem' is obsolete: 'Use MenuItemv2 instead.'

Check warning on line 49 in Terminal.Gui/Views/FileDialogs/FileDialog.cs

View workflow job for this annotation

GitHub Actions / build_and_test_debug (windows-latest)

'MenuItem' is obsolete: 'Use MenuItemv2 instead.'

Check warning on line 49 in Terminal.Gui/Views/FileDialogs/FileDialog.cs

View workflow job for this annotation

GitHub Actions / Parallel Unit Tests (windows-latest)

'MenuItem' is obsolete: 'Use MenuItemv2 instead.'

Check warning on line 49 in Terminal.Gui/Views/FileDialogs/FileDialog.cs

View workflow job for this annotation

GitHub Actions / Non-Parallel Unit Tests (windows-latest)

'MenuItem' is obsolete: 'Use MenuItemv2 instead.'
private int _currentSortColumn;
private bool _currentSortIsAsc = true;
private bool _disposed;
Expand Down Expand Up @@ -172,7 +172,7 @@
FullRowSelect = true,
};
_tableView.CollectionNavigator = new FileDialogCollectionNavigator (this, _tableView);
_tableView.KeyBindings.ReplaceCommands (Key.Space, Command.Select);
_tableView.KeyBindings.ReplaceCommands (Key.Space, Command.Activate);
_tableView.MouseClick += OnTableViewMouseClick;
_tableView.Style.InvertSelectedCellFirstCharacter = true;
Style.TableStyle = _tableView.Style;
Expand Down Expand Up @@ -605,7 +605,7 @@
bool addCurrentStateToHistory,
bool setPathText = true,
bool clearForward = true,
string pathText = null

Check warning on line 608 in Terminal.Gui/Views/FileDialogs/FileDialog.cs

View workflow job for this annotation

GitHub Actions / build_release

Cannot convert null literal to non-nullable reference type.

Check warning on line 608 in Terminal.Gui/Views/FileDialogs/FileDialog.cs

View workflow job for this annotation

GitHub Actions / build_and_test_debug (ubuntu-latest)

Cannot convert null literal to non-nullable reference type.

Check warning on line 608 in Terminal.Gui/Views/FileDialogs/FileDialog.cs

View workflow job for this annotation

GitHub Actions / Parallel Unit Tests (macos-latest)

Cannot convert null literal to non-nullable reference type.

Check warning on line 608 in Terminal.Gui/Views/FileDialogs/FileDialog.cs

View workflow job for this annotation

GitHub Actions / Parallel Unit Tests (ubuntu-latest)

Cannot convert null literal to non-nullable reference type.

Check warning on line 608 in Terminal.Gui/Views/FileDialogs/FileDialog.cs

View workflow job for this annotation

GitHub Actions / Non-Parallel Unit Tests (macos-latest)

Cannot convert null literal to non-nullable reference type.

Check warning on line 608 in Terminal.Gui/Views/FileDialogs/FileDialog.cs

View workflow job for this annotation

GitHub Actions / build_and_test_debug (macos-latest)

Cannot convert null literal to non-nullable reference type.

Check warning on line 608 in Terminal.Gui/Views/FileDialogs/FileDialog.cs

View workflow job for this annotation

GitHub Actions / Non-Parallel Unit Tests (ubuntu-latest)

Cannot convert null literal to non-nullable reference type.

Check warning on line 608 in Terminal.Gui/Views/FileDialogs/FileDialog.cs

View workflow job for this annotation

GitHub Actions / build_and_test_debug (windows-latest)

Cannot convert null literal to non-nullable reference type.

Check warning on line 608 in Terminal.Gui/Views/FileDialogs/FileDialog.cs

View workflow job for this annotation

GitHub Actions / Parallel Unit Tests (windows-latest)

Cannot convert null literal to non-nullable reference type.

Check warning on line 608 in Terminal.Gui/Views/FileDialogs/FileDialog.cs

View workflow job for this annotation

GitHub Actions / Non-Parallel Unit Tests (windows-latest)

Cannot convert null literal to non-nullable reference type.
)
{
// no change of state
Expand Down Expand Up @@ -1109,7 +1109,7 @@
bool addCurrentStateToHistory,
bool setPathText = true,
bool clearForward = true,
string pathText = null

Check warning on line 1112 in Terminal.Gui/Views/FileDialogs/FileDialog.cs

View workflow job for this annotation

GitHub Actions / build_release

Cannot convert null literal to non-nullable reference type.

Check warning on line 1112 in Terminal.Gui/Views/FileDialogs/FileDialog.cs

View workflow job for this annotation

GitHub Actions / build_and_test_debug (ubuntu-latest)

Cannot convert null literal to non-nullable reference type.

Check warning on line 1112 in Terminal.Gui/Views/FileDialogs/FileDialog.cs

View workflow job for this annotation

GitHub Actions / Parallel Unit Tests (macos-latest)

Cannot convert null literal to non-nullable reference type.

Check warning on line 1112 in Terminal.Gui/Views/FileDialogs/FileDialog.cs

View workflow job for this annotation

GitHub Actions / Parallel Unit Tests (ubuntu-latest)

Cannot convert null literal to non-nullable reference type.

Check warning on line 1112 in Terminal.Gui/Views/FileDialogs/FileDialog.cs

View workflow job for this annotation

GitHub Actions / Non-Parallel Unit Tests (macos-latest)

Cannot convert null literal to non-nullable reference type.

Check warning on line 1112 in Terminal.Gui/Views/FileDialogs/FileDialog.cs

View workflow job for this annotation

GitHub Actions / build_and_test_debug (macos-latest)

Cannot convert null literal to non-nullable reference type.

Check warning on line 1112 in Terminal.Gui/Views/FileDialogs/FileDialog.cs

View workflow job for this annotation

GitHub Actions / Non-Parallel Unit Tests (ubuntu-latest)

Cannot convert null literal to non-nullable reference type.

Check warning on line 1112 in Terminal.Gui/Views/FileDialogs/FileDialog.cs

View workflow job for this annotation

GitHub Actions / build_and_test_debug (windows-latest)

Cannot convert null literal to non-nullable reference type.

Check warning on line 1112 in Terminal.Gui/Views/FileDialogs/FileDialog.cs

View workflow job for this annotation

GitHub Actions / Parallel Unit Tests (windows-latest)

Cannot convert null literal to non-nullable reference type.

Check warning on line 1112 in Terminal.Gui/Views/FileDialogs/FileDialog.cs

View workflow job for this annotation

GitHub Actions / Non-Parallel Unit Tests (windows-latest)

Cannot convert null literal to non-nullable reference type.
)
{
if (State is SearchState search)
Expand Down
4 changes: 2 additions & 2 deletions Terminal.Gui/Views/FlagSelector.cs
Original file line number Diff line number Diff line change
Expand Up @@ -372,9 +372,9 @@ protected virtual CheckBox CreateCheckBox (string name, uint flag)
// }
// };

checkbox.Selecting += (sender, args) =>
checkbox.Activating += (sender, args) =>
{
if (RaiseSelecting (args.Context) is true)
if (RaiseActivating (args.Context) is true)
{
args.Handled = true;

Expand Down
8 changes: 4 additions & 4 deletions Terminal.Gui/Views/HexView.cs
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public HexView (Stream? source)
_leftSideHasFocus = true;
_firstNibble = true;

AddCommand (Command.Select, HandleMouseClick);
AddCommand (Command.Activate, HandleMouseClick);
AddCommand (Command.Left, () => MoveLeft ());
AddCommand (Command.Right, () => MoveRight ());
AddCommand (Command.Down, () => MoveDown (BytesPerLine));
Expand Down Expand Up @@ -101,8 +101,8 @@ public HexView (Stream? source)
KeyBindings.Remove (Key.Enter);

// The Select handler deals with both single and double clicks
MouseBindings.ReplaceCommands (MouseFlags.Button1Clicked, Command.Select);
MouseBindings.Add (MouseFlags.Button1DoubleClicked, Command.Select);
MouseBindings.ReplaceCommands (MouseFlags.Button1Clicked, Command.Activate);
MouseBindings.Add (MouseFlags.Button1DoubleClicked, Command.Activate);
MouseBindings.Add (MouseFlags.WheeledUp, Command.ScrollUp);
MouseBindings.Add (MouseFlags.WheeledDown, Command.ScrollDown);

Expand Down Expand Up @@ -363,7 +363,7 @@ public int AddressWidth
return false;
}

if (RaiseSelecting (commandContext) is true)
if (RaiseActivating (commandContext) is true)
{
return true;
}
Expand Down
Loading
Loading