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 all 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
2 changes: 1 addition & 1 deletion Examples/Example/Example.cs
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ public ExampleWindow ()

// center the login button horizontally
X = Pos.Center (),
IsDefault = true
IsDefaultAcceptView = true
};

// When login button is clicked display a message popup
Expand Down
2 changes: 1 addition & 1 deletion Examples/NativeAot/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ public ExampleWindow ()

// center the login button horizontally
X = Pos.Center (),
IsDefault = true
IsDefaultAcceptView = true
};

// When login button is clicked display a message popup
Expand Down
2 changes: 1 addition & 1 deletion Examples/SelfContained/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ public ExampleWindow ()

// center the login button horizontally
X = Pos.Center (),
IsDefault = true
IsDefaultAcceptView = true
};

// When login button is clicked display a message popup
Expand Down
14 changes: 5 additions & 9 deletions Examples/UICatalog/Scenarios/AllViewsTester.cs
Original file line number Diff line number Diff line change
Expand Up @@ -158,16 +158,13 @@ public override void Main ()

_eventLog = new ()
{
// X = Pos.Right(_layoutEditor),
X = Pos.AnchorEnd () - 1,
Y = 0,
Width = 30,
Height = Dim.Fill (),
SuperViewRendersLineCanvas = true
};
_eventLog.Border!.Thickness = new (1);
_eventLog.X = Pos.AnchorEnd () - 1;
_eventLog.Y = 0;

_eventLog.Height = Dim.Height (_classListView);

//_eventLog.Width = 30;

_layoutEditor.Width = Dim.Fill (
Dim.Func (
Expand All @@ -194,7 +191,6 @@ public override void Main ()
Height = Dim.Fill (),
CanFocus = true,
TabStop = TabBehavior.TabStop,
//SchemeName = SchemeManager.SchemesToSchemeName (Schemes.Base),
Arrangement = ViewArrangement.LeftResizable | ViewArrangement.BottomResizable | ViewArrangement.RightResizable,
BorderStyle = LineStyle.Double,
SuperViewRendersLineCanvas = true
Expand Down Expand Up @@ -228,7 +224,7 @@ private void CreateCurrentView (Type type)
if (type.IsGenericType)
{
// For each of the <T> arguments
List<Type> typeArguments = new ();
List<Type> typeArguments = [];

// use <object> or the original type if applicable
foreach (Type arg in type.GetGenericArguments ())
Expand Down
2 changes: 1 addition & 1 deletion Examples/UICatalog/Scenarios/AnsiRequestsScenario.cs
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ private View BuildSingleTab ()
var tvTerminator = new TextView { X = Pos.Left (label), Y = Pos.Bottom (label), Width = 4, Height = 4, ReadOnly = true };
w.Add (label, tvTerminator);

var btnResponse = new Button { X = Pos.Center (), Y = Pos.Bottom (tvResponse) + 2, Text = "Send Request", IsDefault = true };
var btnResponse = new Button { X = Pos.Center (), Y = Pos.Bottom (tvResponse) + 2, Text = "Send Request", IsDefaultAcceptView = true };

var lblSuccess = new Label { X = Pos.Center (), Y = Pos.Bottom (btnResponse) + 1 };
w.Add (lblSuccess);
Expand Down
4 changes: 2 additions & 2 deletions Examples/UICatalog/Scenarios/Bars.cs
Original file line number Diff line number Diff line change
Expand Up @@ -185,9 +185,9 @@ void PopOverMenuOnAccept (object o, CommandEventArgs args)

menuLikeExamples.Add (popOverMenu);

menuLikeExamples.MouseClick += MenuLikeExamplesMouseClick;
menuLikeExamples.MouseEvent += MenuLikeExamplesMouseEvent;

void MenuLikeExamplesMouseClick (object sender, MouseEventArgs e)
void MenuLikeExamplesMouseEvent (object _, MouseEventArgs e)
{
if (e.Flags.HasFlag (MouseFlags.Button3Clicked))
{
Expand Down
16 changes: 8 additions & 8 deletions Examples/UICatalog/Scenarios/Buttons.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,17 +20,17 @@ public override void Main ()
Title = GetQuitKeyAndName ()
};

// Add a label & text field so we can demo IsDefault
var editLabel = new Label { X = 0, Y = 0, Text = "TextField (to demo IsDefault):" };
// Add a label & text field so we can demo IsDefaultAcceptView
var editLabel = new Label { X = 0, Y = 0, Text = "TextField (to demo IsDefaultAcceptView):" };
main.Add (editLabel);

// Add a TextField using Absolute layout.
var edit = new TextField { X = 31, Width = 15, HotKey = Key.Y.WithAlt };
main.Add (edit);

// This is the default button (IsDefault = true); if user presses ENTER in the TextField
// This is the default button (IsDefaultAcceptView = true); if user presses ENTER in the TextField
// the scenario will quit
var defaultButton = new Button { X = Pos.Center (), Y = Pos.AnchorEnd (), IsDefault = true, Text = "_Quit" };
var defaultButton = new Button { X = Pos.Center (), Y = Pos.AnchorEnd (), IsDefaultAcceptView = true, Text = "_Quit" };

main.Add (defaultButton);

Expand All @@ -48,14 +48,14 @@ public override void Main ()

swapButton.Accepting += (s, e) =>
{
e.Handled = !swapButton.IsDefault;
defaultButton.IsDefault = !defaultButton.IsDefault;
swapButton.IsDefault = !swapButton.IsDefault;
e.Handled = !swapButton.IsDefaultAcceptView;
defaultButton.IsDefaultAcceptView = !defaultButton.IsDefaultAcceptView;
swapButton.IsDefaultAcceptView = !swapButton.IsDefaultAcceptView;
};

defaultButton.Accepting += (s, e) =>
{
e.Handled = !defaultButton.IsDefault;
e.Handled = !defaultButton.IsDefaultAcceptView;

if (e.Handled)
{
Expand Down
10 changes: 8 additions & 2 deletions Examples/UICatalog/Scenarios/CharacterMap/CharacterMap.cs
Original file line number Diff line number Diff line change
Expand Up @@ -106,9 +106,15 @@ public override void Main ()

_categoryList.Table = CreateCategoryTable (0, isDescending);

// if user clicks the mouse in TableView
_categoryList.MouseClick += (s, e) =>
// if user clicks the mouse in TableView, change sorting by that column
_categoryList.Activating += (s, commandEventArgs) =>
{
if (commandEventArgs.Context is not CommandContext<MouseBinding> mouseContext)
{
return;
}

MouseEventArgs e = mouseContext.Binding.MouseEventArgs!;
_categoryList.ScreenToCell (e.Position, out int? clickedCol);

if (clickedCol != null && e.Flags.HasFlag (MouseFlags.Button1Clicked))
Expand Down
58 changes: 28 additions & 30 deletions Examples/UICatalog/Scenarios/ContextMenus.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

namespace UICatalog.Scenarios;

[ScenarioMetadata ("ContextMenus", "Context Menu Sample.")]
[ScenarioMetadata ("ContextMenus", "Demonstrates using PopoverMenu as a Context Menu.")]
[ScenarioCategory ("Menus")]
public class ContextMenus : Scenario
{
Expand All @@ -26,6 +26,21 @@ public override void Main ()
SchemeName = "Toplevel"
};

// Create keyboard and mouse bindings for the context menu.
appWindow.KeyBindings.Add (_winContextMenuKey, Command.Context);
appWindow.MouseBindings.Add (MouseFlags.Button3Clicked, Command.Context);

// View.AddCommand is protected; but we can use the CommandNotBound event to handle Command.Context
appWindow.CommandNotBound += (s, e) =>
{
if (e.Context!.Command == Command.Context)
{
// ReSharper disable once AccessToDisposedClosure
_winContextMenu?.MakeVisible ();
e.Handled = true;
}
};

var text = "Context Menu";
var width = 20;

Expand Down Expand Up @@ -60,43 +75,16 @@ public override void Main ()
_tfBottomRight = new () { Id = "_tfBottomRight", X = Pos.AnchorEnd (width), Y = Pos.AnchorEnd (1), Width = width, Text = text };
appWindow.Add (_tfBottomRight);

appWindow.KeyDown += OnAppWindowOnKeyDown;
appWindow.MouseClick += OnAppWindowOnMouseClick;

CultureInfo originalCulture = Thread.CurrentThread.CurrentUICulture;
appWindow.Closed += (s, e) => { Thread.CurrentThread.CurrentUICulture = originalCulture; };

// Run - Start the application.
Application.Run (appWindow);
appWindow.Dispose ();
appWindow.KeyDown -= OnAppWindowOnKeyDown;
appWindow.MouseClick -= OnAppWindowOnMouseClick;
_winContextMenu?.Dispose ();

// Shutdown - Calling Application.Shutdown is required.
Application.Shutdown ();

return;

void OnAppWindowOnMouseClick (object s, MouseEventArgs e)
{
if (e.Flags == MouseFlags.Button3Clicked)
{
// ReSharper disable once AccessToDisposedClosure
_winContextMenu?.MakeVisible (e.ScreenPosition);
e.Handled = true;
}
}

void OnAppWindowOnKeyDown (object s, Key e)
{
if (e == _winContextMenuKey)
{
// ReSharper disable once AccessToDisposedClosure
_winContextMenu?.MakeVisible ();
e.Handled = true;
}
}
}

private void CreateWinContextMenu ()
Expand Down Expand Up @@ -182,7 +170,12 @@ private Menuv2 GetSupportedCultureMenu ()
{
MenuItemv2 culture = new ();

culture.CommandView = new CheckBox { CanFocus = false };
culture.CommandView = new CheckBox
{
// Best practice for CheckBoxes in menus is to disable focus and highlight states
CanFocus = false,
HighlightStates = MouseState.None
};

if (index == -1)
{
Expand All @@ -198,7 +191,12 @@ private Menuv2 GetSupportedCultureMenu ()

index++;
culture = new ();
culture.CommandView = new CheckBox { CanFocus = false };
culture.CommandView = new CheckBox
{
// Best practice for CheckBoxes in menus is to disable focus and highlight states
CanFocus = false,
HighlightStates = MouseState.None
};
}

culture.Id = $"_{c.Parent.EnglishName}";
Expand Down
2 changes: 1 addition & 1 deletion Examples/UICatalog/Scenarios/CsvEditor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,7 @@ private bool GetText (string title, string label, string initialText, out string
{
var okPressed = false;

var ok = new Button { Text = "Ok", IsDefault = true };
var ok = new Button { Text = "Ok", IsDefaultAcceptView = true };

ok.Accepting += (s, e) =>
{
Expand Down
24 changes: 11 additions & 13 deletions Examples/UICatalog/Scenarios/Dialogs.cs
Original file line number Diff line number Diff line change
Expand Up @@ -151,18 +151,16 @@ public override void Main ()
};
frame.Add (label);

// Add hotkeys
var labels = Enum.GetNames<Alignment> ().Select (n => n = "_" + n);
var alignmentGroup = new RadioGroup
List<string> labels = Enum.GetNames<Alignment> ().Select (n => n = "_" + n).ToList ();
OptionSelector alignmentGroup = new ()
{
X = Pos.Right (label) + 1,
Y = Pos.Top (label),
RadioLabels = labels.ToArray (),
Title = "Ali_gn",
BorderStyle = LineStyle.Dashed
Labels = labels,
};
frame.Add (alignmentGroup);
alignmentGroup.SelectedItem = labels.ToList ().IndexOf ("_" + Dialog.DefaultButtonAlignment.ToString ());
alignmentGroup.Value = labels.IndexOf ("_" + Dialog.DefaultButtonAlignment.ToString ());

frame.ValidatePosDim = true;

Expand All @@ -181,7 +179,7 @@ public override void Main ()

var showDialogButton = new Button
{
X = Pos.Center (), Y = Pos.Bottom (frame) + 2, IsDefault = true, Text = "_Show Dialog"
X = Pos.Center (), Y = Pos.Bottom (frame) + 2, IsDefaultAcceptView = true, Text = "_Show Dialog"
};

app.Accepting += (s, e) =>
Expand Down Expand Up @@ -216,7 +214,7 @@ private Dialog CreateDemoDialog (
TextField titleEdit,
TextField numButtonsEdit,
CheckBox glyphsNotWords,
RadioGroup alignmentRadioGroup,
OptionSelector alignmentGroup,
Label buttonPressedLabel
)
{
Expand Down Expand Up @@ -246,12 +244,12 @@ Label buttonPressedLabel
button = new ()
{
Text = "_" + NumberToWords.Convert (buttonId) + " " + char.ConvertFromUtf32 (buttonId + CODE_POINT),
IsDefault = buttonId == 0
IsDefaultAcceptView = buttonId == 0
};
}
else
{
button = new () { Text = "_" + NumberToWords.Convert (buttonId), IsDefault = buttonId == 0 };
button = new () { Text = "_" + NumberToWords.Convert (buttonId), IsDefaultAcceptView = buttonId == 0 };
}

button.Accepting += (s, e) =>
Expand All @@ -269,7 +267,7 @@ Label buttonPressedLabel
{
Title = titleEdit.Text,
Text = "Dialog Text",
ButtonAlignment = (Alignment)Enum.Parse (typeof (Alignment), alignmentRadioGroup.RadioLabels [alignmentRadioGroup.SelectedItem].Substring (1)),
ButtonAlignment = (Alignment)Enum.Parse (typeof (Alignment), alignmentGroup.Labels! [(int)alignmentGroup.Value!.Value] [1..]),

Buttons = buttons.ToArray ()
};
Expand Down Expand Up @@ -300,12 +298,12 @@ Label buttonPressedLabel
button = new ()
{
Text = "_" + NumberToWords.Convert (buttonId) + " " + char.ConvertFromUtf32 (buttonId + CODE_POINT),
IsDefault = buttonId == 0
IsDefaultAcceptView = buttonId == 0
};
}
else
{
button = new () { Text = "_" + NumberToWords.Convert (buttonId), IsDefault = buttonId == 0 };
button = new () { Text = "_" + NumberToWords.Convert (buttonId), IsDefaultAcceptView = buttonId == 0 };
}

button.Accepting += (s, e) =>
Expand Down
2 changes: 1 addition & 1 deletion Examples/UICatalog/Scenarios/DynamicMenuBar.cs
Original file line number Diff line number Diff line change
Expand Up @@ -391,7 +391,7 @@ public DynamicMenuItem EnterMenuItem ()
EditMenuBarItem (_menuItem);
}

var btnOk = new Button { IsDefault = true, Text = "Ok" };
var btnOk = new Button { IsDefaultAcceptView = true, Text = "Ok" };

btnOk.Accepting += (s, e) =>
{
Expand Down
2 changes: 1 addition & 1 deletion Examples/UICatalog/Scenarios/DynamicStatusBar.cs
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ public DynamicStatusItem EnterStatusItem ()
EditStatusItem (_statusItem);
}

var btnOk = new Button { IsDefault = true, Text = "OK" };
var btnOk = new Button { IsDefaultAcceptView = true, Text = "OK" };

btnOk.Accepting += (s, e) =>
{
Expand Down
4 changes: 2 additions & 2 deletions Examples/UICatalog/Scenarios/Editor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -894,7 +894,7 @@ private View CreateFindTab ()
X = Pos.Align (Alignment.Center),
Y = Pos.AnchorEnd (),
Enabled = !string.IsNullOrEmpty (txtToFind.Text),
IsDefault = true,
IsDefaultAcceptView = true,

Text = "Find _Next"
};
Expand Down Expand Up @@ -1122,7 +1122,7 @@ private View CreateReplaceTab ()
X = Pos.Align (Alignment.Center),
Y = Pos.AnchorEnd (),
Enabled = !string.IsNullOrEmpty (txtToFind.Text),
IsDefault = true,
IsDefaultAcceptView = true,
Text = "Replace _Next"
};
btnFindNext.Accepting += (s, e) => ReplaceNext ();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ public AllViewsView ()
KeyBindings.Add (Key.End, Command.End);
KeyBindings.Add (PopoverMenu.DefaultKey, Command.Context);

MouseBindings.Add (MouseFlags.Button1DoubleClicked, Command.Accept);
MouseBindings.ReplaceCommands (MouseFlags.Button3Clicked, Command.Context);
MouseBindings.ReplaceCommands (MouseFlags.Button1Clicked | MouseFlags.ButtonCtrl, Command.Context);
MouseBindings.Add (MouseFlags.WheeledDown, Command.ScrollDown);
Expand Down
Loading
Loading