|
@@ -167,7 +167,6 @@ namespace UICatalog {
|
|
|
}),
|
|
|
new MenuBarItem ("_Color Scheme", CreateColorSchemeMenuItems()),
|
|
|
new MenuBarItem ("Diag_nostics", CreateDiagnosticMenuItems()),
|
|
|
- new MenuBarItem ("_Size Style", CreateSizeStyle()),
|
|
|
new MenuBarItem ("_Help", new MenuItem [] {
|
|
|
new MenuItem ("_gui.cs API Overview", "", () => OpenUrl ("https://migueldeicaza.github.io/gui.cs/articles/overview.html"), null, null, Key.F1),
|
|
|
new MenuItem ("gui.cs _README", "", () => OpenUrl ("https://github.com/migueldeicaza/gui.cs"), null, null, Key.F2),
|
|
@@ -275,28 +274,33 @@ namespace UICatalog {
|
|
|
return _runningScenario;
|
|
|
}
|
|
|
|
|
|
+ static List<MenuItem []> CreateDiagnosticMenuItems ()
|
|
|
+ {
|
|
|
+ List<MenuItem []> menuItems = new List<MenuItem []> ();
|
|
|
+ menuItems.Add (CreateDiagnosticFlagsMenuItems ());
|
|
|
+ menuItems.Add (new MenuItem [] { null });
|
|
|
+ menuItems.Add (CreateSizeStyle ());
|
|
|
+ return menuItems;
|
|
|
+ }
|
|
|
+
|
|
|
static MenuItem [] CreateSizeStyle ()
|
|
|
{
|
|
|
List<MenuItem> menuItems = new List<MenuItem> ();
|
|
|
- for (int i = 0; i < 2; i++) {
|
|
|
- var item = new MenuItem ();
|
|
|
- item.Title = i == 0 ? "_Normal" : "_As Buffer";
|
|
|
- item.Shortcut = Key.CtrlMask | Key.AltMask | (Key)item.Title.ToString ().Substring (1, 1) [0];
|
|
|
- item.CheckType |= MenuItemCheckStyle.Radio;
|
|
|
- item.Checked = i == 0 && !Application.HeightAsBuffer ? true : false;
|
|
|
- item.Action += () => {
|
|
|
- item.Checked = !item.Checked;
|
|
|
- Application.HeightAsBuffer = item.Title == "_Normal" ? false : true;
|
|
|
- foreach (var menuItem in menuItems) {
|
|
|
- menuItem.Checked = menuItem.Title.Equals (item.Title);
|
|
|
- }
|
|
|
- };
|
|
|
- menuItems.Add (item);
|
|
|
- }
|
|
|
+ var item = new MenuItem ();
|
|
|
+ item.Title = "_Height As Buffer";
|
|
|
+ item.Shortcut = Key.CtrlMask | Key.AltMask | (Key)item.Title.ToString ().Substring (1, 1) [0];
|
|
|
+ item.CheckType |= MenuItemCheckStyle.Checked;
|
|
|
+ item.Checked = Application.HeightAsBuffer;
|
|
|
+ item.Action += () => {
|
|
|
+ item.Checked = !item.Checked;
|
|
|
+ Application.HeightAsBuffer = item.Checked;
|
|
|
+ };
|
|
|
+ menuItems.Add (item);
|
|
|
+
|
|
|
return menuItems.ToArray ();
|
|
|
}
|
|
|
|
|
|
- static MenuItem [] CreateDiagnosticMenuItems ()
|
|
|
+ static MenuItem [] CreateDiagnosticFlagsMenuItems ()
|
|
|
{
|
|
|
const string OFF = "Diagnostics: _Off";
|
|
|
const string FRAME_RULER = "Diagnostics: Frame _Ruler";
|
|
@@ -310,7 +314,12 @@ namespace UICatalog {
|
|
|
item.Shortcut = Key.AltMask + index.ToString () [0];
|
|
|
index++;
|
|
|
item.CheckType |= MenuItemCheckStyle.Checked;
|
|
|
- item.Checked = _diagnosticFlags.HasFlag (diag);
|
|
|
+ if (GetDiagnosticsTitle (ConsoleDriver.DiagnosticFlags.Off) == item.Title) {
|
|
|
+ item.Checked = (_diagnosticFlags & (ConsoleDriver.DiagnosticFlags.FramePadding
|
|
|
+ | ConsoleDriver.DiagnosticFlags.FrameRuler)) == 0;
|
|
|
+ } else {
|
|
|
+ item.Checked = _diagnosticFlags.HasFlag (diag);
|
|
|
+ }
|
|
|
item.Action += () => {
|
|
|
var t = GetDiagnosticsTitle (ConsoleDriver.DiagnosticFlags.Off);
|
|
|
if (item.Title == t && !item.Checked) {
|