|
@@ -44,21 +44,21 @@ public class Buttons : Scenario
|
|
Width = 45,
|
|
Width = 45,
|
|
Height = 3,
|
|
Height = 3,
|
|
Text = "S_wap Default (Size = 45, 3)",
|
|
Text = "S_wap Default (Size = 45, 3)",
|
|
- ColorScheme = Colors.ColorSchemes ["Error"]
|
|
|
|
|
|
+ SchemeName = "Error"
|
|
};
|
|
};
|
|
|
|
|
|
swapButton.Accepting += (s, e) =>
|
|
swapButton.Accepting += (s, e) =>
|
|
{
|
|
{
|
|
- e.Cancel = !swapButton.IsDefault;
|
|
|
|
|
|
+ e.Handled = !swapButton.IsDefault;
|
|
defaultButton.IsDefault = !defaultButton.IsDefault;
|
|
defaultButton.IsDefault = !defaultButton.IsDefault;
|
|
swapButton.IsDefault = !swapButton.IsDefault;
|
|
swapButton.IsDefault = !swapButton.IsDefault;
|
|
};
|
|
};
|
|
|
|
|
|
defaultButton.Accepting += (s, e) =>
|
|
defaultButton.Accepting += (s, e) =>
|
|
{
|
|
{
|
|
- e.Cancel = !defaultButton.IsDefault;
|
|
|
|
|
|
+ e.Handled = !defaultButton.IsDefault;
|
|
|
|
|
|
- if (e.Cancel)
|
|
|
|
|
|
+ if (e.Handled)
|
|
{
|
|
{
|
|
MessageBox.ErrorQuery ("Error", "This button is no longer the Quit button; the Swap Default button is.", "_Ok");
|
|
MessageBox.ErrorQuery ("Error", "This button is no longer the Quit button; the Swap Default button is.", "_Ok");
|
|
}
|
|
}
|
|
@@ -71,7 +71,7 @@ public class Buttons : Scenario
|
|
{
|
|
{
|
|
string btnText = button.Text;
|
|
string btnText = button.Text;
|
|
MessageBox.Query ("Message", $"Did you click {txt}?", "Yes", "No");
|
|
MessageBox.Query ("Message", $"Did you click {txt}?", "Yes", "No");
|
|
- e.Cancel = true;
|
|
|
|
|
|
+ e.Handled = true;
|
|
};
|
|
};
|
|
}
|
|
}
|
|
|
|
|
|
@@ -80,14 +80,14 @@ public class Buttons : Scenario
|
|
|
|
|
|
View prev = colorButtonsLabel;
|
|
View prev = colorButtonsLabel;
|
|
|
|
|
|
- foreach (KeyValuePair<string, ColorScheme> colorScheme in Colors.ColorSchemes)
|
|
|
|
|
|
+ foreach (KeyValuePair<string, Scheme> scheme in SchemeManager.GetSchemesForCurrentTheme ())
|
|
{
|
|
{
|
|
var colorButton = new Button
|
|
var colorButton = new Button
|
|
{
|
|
{
|
|
X = Pos.Right (prev),
|
|
X = Pos.Right (prev),
|
|
Y = Pos.Y (colorButtonsLabel),
|
|
Y = Pos.Y (colorButtonsLabel),
|
|
- Text = $"_{colorScheme.Key}",
|
|
|
|
- ColorScheme = colorScheme.Value,
|
|
|
|
|
|
+ Text = $"_{scheme.Key}",
|
|
|
|
+ SchemeName = scheme.Key,
|
|
};
|
|
};
|
|
DoMessage (colorButton, colorButton.Text);
|
|
DoMessage (colorButton, colorButton.Text);
|
|
main.Add (colorButton);
|
|
main.Add (colorButton);
|
|
@@ -114,7 +114,7 @@ public class Buttons : Scenario
|
|
button.Accepting += (s, e) =>
|
|
button.Accepting += (s, e) =>
|
|
{
|
|
{
|
|
MessageBox.Query ("Message", "Question?", "Yes", "No");
|
|
MessageBox.Query ("Message", "Question?", "Yes", "No");
|
|
- e.Cancel = true;
|
|
|
|
|
|
+ e.Handled = true;
|
|
};
|
|
};
|
|
|
|
|
|
var textChanger = new Button { X = 2, Y = Pos.Bottom (button) + 1, Text = "Te_xt Changer" };
|
|
var textChanger = new Button { X = 2, Y = Pos.Bottom (button) + 1, Text = "Te_xt Changer" };
|
|
@@ -122,7 +122,7 @@ public class Buttons : Scenario
|
|
textChanger.Accepting += (s, e) =>
|
|
textChanger.Accepting += (s, e) =>
|
|
{
|
|
{
|
|
textChanger.Text += "!";
|
|
textChanger.Text += "!";
|
|
- e.Cancel = true;
|
|
|
|
|
|
+ e.Handled = true;
|
|
};
|
|
};
|
|
|
|
|
|
main.Add (
|
|
main.Add (
|
|
@@ -133,12 +133,13 @@ public class Buttons : Scenario
|
|
Text = "Lets see if this will move as \"Text Changer\" grows"
|
|
Text = "Lets see if this will move as \"Text Changer\" grows"
|
|
}
|
|
}
|
|
);
|
|
);
|
|
- button.Accepting += (sender, args) => { args.Cancel = true; };
|
|
|
|
|
|
+ button.Accepting += (sender, args) => { args.Handled = true; };
|
|
|
|
|
|
var removeButton = new Button
|
|
var removeButton = new Button
|
|
{
|
|
{
|
|
X = 2, Y = Pos.Bottom (button) + 1,
|
|
X = 2, Y = Pos.Bottom (button) + 1,
|
|
- ColorScheme = Colors.ColorSchemes ["Error"], Text = "Remove this button"
|
|
|
|
|
|
+ SchemeName = SchemeManager.SchemesToSchemeName (Schemes.Error),
|
|
|
|
+ Text = "Remove this button"
|
|
};
|
|
};
|
|
main.Add (removeButton);
|
|
main.Add (removeButton);
|
|
|
|
|
|
@@ -146,7 +147,7 @@ public class Buttons : Scenario
|
|
removeButton.Accepting += (s, e) =>
|
|
removeButton.Accepting += (s, e) =>
|
|
{
|
|
{
|
|
removeButton.Visible = false;
|
|
removeButton.Visible = false;
|
|
- e.Cancel = true;
|
|
|
|
|
|
+ e.Handled = true;
|
|
};
|
|
};
|
|
|
|
|
|
var computedFrame = new FrameView
|
|
var computedFrame = new FrameView
|
|
@@ -165,14 +166,14 @@ public class Buttons : Scenario
|
|
X = 0,
|
|
X = 0,
|
|
Y = Pos.Center () - 1,
|
|
Y = Pos.Center () - 1,
|
|
Width = 30,
|
|
Width = 30,
|
|
- ColorScheme = Colors.ColorSchemes ["Error"],
|
|
|
|
|
|
+ SchemeName = "Error",
|
|
Text = "Move This \u263b Button v_ia Pos"
|
|
Text = "Move This \u263b Button v_ia Pos"
|
|
};
|
|
};
|
|
|
|
|
|
moveBtn.Accepting += (s, e) =>
|
|
moveBtn.Accepting += (s, e) =>
|
|
{
|
|
{
|
|
moveBtn.X = moveBtn.Frame.X + 5;
|
|
moveBtn.X = moveBtn.Frame.X + 5;
|
|
- e.Cancel = true;
|
|
|
|
|
|
+ e.Handled = true;
|
|
};
|
|
};
|
|
computedFrame.Add (moveBtn);
|
|
computedFrame.Add (moveBtn);
|
|
|
|
|
|
@@ -183,13 +184,13 @@ public class Buttons : Scenario
|
|
X = 0,
|
|
X = 0,
|
|
Width = 30,
|
|
Width = 30,
|
|
Text = "Grow This \u263a Button _via Pos",
|
|
Text = "Grow This \u263a Button _via Pos",
|
|
- ColorScheme = Colors.ColorSchemes ["Error"],
|
|
|
|
|
|
+ SchemeName = "Error",
|
|
};
|
|
};
|
|
|
|
|
|
sizeBtn.Accepting += (s, e) =>
|
|
sizeBtn.Accepting += (s, e) =>
|
|
{
|
|
{
|
|
sizeBtn.Width = sizeBtn.Frame.Width + 5;
|
|
sizeBtn.Width = sizeBtn.Frame.Width + 5;
|
|
- e.Cancel = true;
|
|
|
|
|
|
+ e.Handled = true;
|
|
};
|
|
};
|
|
computedFrame.Add (sizeBtn);
|
|
computedFrame.Add (sizeBtn);
|
|
|
|
|
|
@@ -204,7 +205,7 @@ public class Buttons : Scenario
|
|
main.Add (absoluteFrame);
|
|
main.Add (absoluteFrame);
|
|
|
|
|
|
// Demonstrates how changing the View.Frame property can move Views
|
|
// Demonstrates how changing the View.Frame property can move Views
|
|
- var moveBtnA = new Button { ColorScheme = Colors.ColorSchemes ["Error"], Text = "Move This Button via Frame" };
|
|
|
|
|
|
+ var moveBtnA = new Button { SchemeName = "Error", Text = "Move This Button via Frame" };
|
|
|
|
|
|
moveBtnA.Accepting += (s, e) =>
|
|
moveBtnA.Accepting += (s, e) =>
|
|
{
|
|
{
|
|
@@ -214,14 +215,14 @@ public class Buttons : Scenario
|
|
moveBtnA.Frame.Width,
|
|
moveBtnA.Frame.Width,
|
|
moveBtnA.Frame.Height
|
|
moveBtnA.Frame.Height
|
|
);
|
|
);
|
|
- e.Cancel = true;
|
|
|
|
|
|
+ e.Handled = true;
|
|
};
|
|
};
|
|
absoluteFrame.Add (moveBtnA);
|
|
absoluteFrame.Add (moveBtnA);
|
|
|
|
|
|
// Demonstrates how changing the View.Frame property can SIZE Views (#583)
|
|
// Demonstrates how changing the View.Frame property can SIZE Views (#583)
|
|
var sizeBtnA = new Button
|
|
var sizeBtnA = new Button
|
|
{
|
|
{
|
|
- Y = 2, ColorScheme = Colors.ColorSchemes ["Error"], Text = " ~ s gui.cs master ↑_10 = Сохранить"
|
|
|
|
|
|
+ Y = 2, SchemeName = "Error", Text = " ~ s gui.cs master ↑_10 = Сохранить"
|
|
};
|
|
};
|
|
|
|
|
|
sizeBtnA.Accepting += (s, e) =>
|
|
sizeBtnA.Accepting += (s, e) =>
|
|
@@ -232,7 +233,7 @@ public class Buttons : Scenario
|
|
sizeBtnA.Frame.Width + 5,
|
|
sizeBtnA.Frame.Width + 5,
|
|
sizeBtnA.Frame.Height
|
|
sizeBtnA.Frame.Height
|
|
);
|
|
);
|
|
- e.Cancel = true;
|
|
|
|
|
|
+ e.Handled = true;
|
|
};
|
|
};
|
|
absoluteFrame.Add (sizeBtnA);
|
|
absoluteFrame.Add (sizeBtnA);
|
|
|
|
|
|
@@ -294,13 +295,13 @@ public class Buttons : Scenario
|
|
X = 2,
|
|
X = 2,
|
|
Y = Pos.Bottom (radioGroup) + 1,
|
|
Y = Pos.Bottom (radioGroup) + 1,
|
|
Width = Dim.Width (computedFrame) - 2,
|
|
Width = Dim.Width (computedFrame) - 2,
|
|
- ColorScheme = Colors.ColorSchemes ["TopLevel"],
|
|
|
|
|
|
+ SchemeName = "TopLevel",
|
|
Text = mhkb
|
|
Text = mhkb
|
|
};
|
|
};
|
|
moveHotKeyBtn.Accepting += (s, e) =>
|
|
moveHotKeyBtn.Accepting += (s, e) =>
|
|
{
|
|
{
|
|
moveHotKeyBtn.Text = MoveHotkey (moveHotKeyBtn.Text);
|
|
moveHotKeyBtn.Text = MoveHotkey (moveHotKeyBtn.Text);
|
|
- e.Cancel = true;
|
|
|
|
|
|
+ e.Handled = true;
|
|
};
|
|
};
|
|
main.Add (moveHotKeyBtn);
|
|
main.Add (moveHotKeyBtn);
|
|
|
|
|
|
@@ -311,13 +312,13 @@ public class Buttons : Scenario
|
|
X = Pos.Left (absoluteFrame) + 1,
|
|
X = Pos.Left (absoluteFrame) + 1,
|
|
Y = Pos.Bottom (radioGroup) + 1,
|
|
Y = Pos.Bottom (radioGroup) + 1,
|
|
Width = Dim.Width (absoluteFrame) - 2,
|
|
Width = Dim.Width (absoluteFrame) - 2,
|
|
- ColorScheme = Colors.ColorSchemes ["TopLevel"],
|
|
|
|
|
|
+ SchemeName = "TopLevel",
|
|
Text = muhkb
|
|
Text = muhkb
|
|
};
|
|
};
|
|
moveUnicodeHotKeyBtn.Accepting += (s, e) =>
|
|
moveUnicodeHotKeyBtn.Accepting += (s, e) =>
|
|
{
|
|
{
|
|
moveUnicodeHotKeyBtn.Text = MoveHotkey (moveUnicodeHotKeyBtn.Text);
|
|
moveUnicodeHotKeyBtn.Text = MoveHotkey (moveUnicodeHotKeyBtn.Text);
|
|
- e.Cancel = true;
|
|
|
|
|
|
+ e.Handled = true;
|
|
};
|
|
};
|
|
main.Add (moveUnicodeHotKeyBtn);
|
|
main.Add (moveUnicodeHotKeyBtn);
|
|
|
|
|
|
@@ -401,7 +402,7 @@ public class Buttons : Scenario
|
|
noRepeatButton.Accepting += (s, e) =>
|
|
noRepeatButton.Accepting += (s, e) =>
|
|
{
|
|
{
|
|
noRepeatButton.Title = $"Accept Cou_nt: {++noRepeatAcceptCount}";
|
|
noRepeatButton.Title = $"Accept Cou_nt: {++noRepeatAcceptCount}";
|
|
- e.Cancel = true;
|
|
|
|
|
|
+ e.Handled = true;
|
|
};
|
|
};
|
|
main.Add (label, noRepeatButton);
|
|
main.Add (label, noRepeatButton);
|
|
|
|
|
|
@@ -423,7 +424,7 @@ public class Buttons : Scenario
|
|
repeatButton.Accepting += (s, e) =>
|
|
repeatButton.Accepting += (s, e) =>
|
|
{
|
|
{
|
|
repeatButton.Title = $"Accept Co_unt: {++acceptCount}";
|
|
repeatButton.Title = $"Accept Co_unt: {++acceptCount}";
|
|
- e.Cancel = true;
|
|
|
|
|
|
+ e.Handled = true;
|
|
};
|
|
};
|
|
|
|
|
|
var enableCB = new CheckBox
|
|
var enableCB = new CheckBox
|