|
@@ -35,7 +35,7 @@ public class Bars : Scenario
|
|
{
|
|
{
|
|
Title = "Event Log",
|
|
Title = "Event Log",
|
|
X = Pos.AnchorEnd (),
|
|
X = Pos.AnchorEnd (),
|
|
- Width = Dim.Auto(),
|
|
|
|
|
|
+ Width = Dim.Auto (),
|
|
Height = Dim.Fill (), // Make room for some wide things
|
|
Height = Dim.Fill (), // Make room for some wide things
|
|
ColorScheme = Colors.ColorSchemes ["Toplevel"],
|
|
ColorScheme = Colors.ColorSchemes ["Toplevel"],
|
|
Source = new ListWrapper<string> (eventSource)
|
|
Source = new ListWrapper<string> (eventSource)
|
|
@@ -49,7 +49,7 @@ public class Bars : Scenario
|
|
X = 0,
|
|
X = 0,
|
|
Y = 0,
|
|
Y = 0,
|
|
Width = Dim.Fill () - Dim.Width (eventLog),
|
|
Width = Dim.Fill () - Dim.Width (eventLog),
|
|
- Height = 10,
|
|
|
|
|
|
+ Height = Dim.Percent(33),
|
|
};
|
|
};
|
|
Application.Top.Add (menuBarLikeExamples);
|
|
Application.Top.Add (menuBarLikeExamples);
|
|
|
|
|
|
@@ -57,7 +57,7 @@ public class Bars : Scenario
|
|
{
|
|
{
|
|
Title = " Bar:",
|
|
Title = " Bar:",
|
|
X = 0,
|
|
X = 0,
|
|
- Y = Pos.AnchorEnd () - 6
|
|
|
|
|
|
+ Y = 0,
|
|
};
|
|
};
|
|
menuBarLikeExamples.Add (label);
|
|
menuBarLikeExamples.Add (label);
|
|
|
|
|
|
@@ -67,8 +67,6 @@ public class Bars : Scenario
|
|
X = Pos.Right (label),
|
|
X = Pos.Right (label),
|
|
Y = Pos.Top (label),
|
|
Y = Pos.Top (label),
|
|
Width = Dim.Fill (),
|
|
Width = Dim.Fill (),
|
|
- Height = 1,//Dim.Auto (DimAutoStyle.Content),
|
|
|
|
- Orientation = Orientation.Horizontal,
|
|
|
|
};
|
|
};
|
|
|
|
|
|
ConfigMenuBar (bar);
|
|
ConfigMenuBar (bar);
|
|
@@ -78,61 +76,68 @@ public class Bars : Scenario
|
|
{
|
|
{
|
|
Title = " MenuBar:",
|
|
Title = " MenuBar:",
|
|
X = 0,
|
|
X = 0,
|
|
- Y = Pos.Bottom(bar)
|
|
|
|
|
|
+ Y = Pos.Bottom (bar) + 1
|
|
};
|
|
};
|
|
menuBarLikeExamples.Add (label);
|
|
menuBarLikeExamples.Add (label);
|
|
|
|
|
|
- //bar = new MenuBarv2
|
|
|
|
- //{
|
|
|
|
- // Id = "menuBar",
|
|
|
|
- // Width = Dim.Fill (),
|
|
|
|
- // Height = 1,//Dim.Auto (DimAutoStyle.Content),
|
|
|
|
- // Orientation = Orientation.Horizontal,
|
|
|
|
- //};
|
|
|
|
|
|
+ bar = new MenuBarv2
|
|
|
|
+ {
|
|
|
|
+ Id = "menuBar",
|
|
|
|
+ X = Pos.Right (label),
|
|
|
|
+ Y = Pos.Top (label),
|
|
|
|
+ };
|
|
|
|
|
|
- //ConfigMenuBar (bar);
|
|
|
|
- //menuBarLikeExamples.Add (bar);
|
|
|
|
|
|
+ ConfigMenuBar (bar);
|
|
|
|
+ menuBarLikeExamples.Add (bar);
|
|
|
|
|
|
FrameView menuLikeExamples = new ()
|
|
FrameView menuLikeExamples = new ()
|
|
{
|
|
{
|
|
Title = "Menu-Like Examples",
|
|
Title = "Menu-Like Examples",
|
|
X = 0,
|
|
X = 0,
|
|
- Y = Pos.Bottom (menuBarLikeExamples),
|
|
|
|
|
|
+ Y = Pos.Center (),
|
|
Width = Dim.Fill () - Dim.Width (eventLog),
|
|
Width = Dim.Fill () - Dim.Width (eventLog),
|
|
- Height = 10,
|
|
|
|
|
|
+ Height = Dim.Percent (33),
|
|
};
|
|
};
|
|
Application.Top.Add (menuLikeExamples);
|
|
Application.Top.Add (menuLikeExamples);
|
|
|
|
|
|
- var shortcut1 = new Shortcut
|
|
|
|
|
|
+ label = new Label ()
|
|
{
|
|
{
|
|
- Title = "_Zigzag",
|
|
|
|
- Key = Key.G.WithCtrl,
|
|
|
|
- Text = "Gonna zig zag",
|
|
|
|
|
|
+ Title = "Bar:",
|
|
|
|
+ X = 0,
|
|
|
|
+ Y = 0,
|
|
};
|
|
};
|
|
|
|
+ menuLikeExamples.Add (label);
|
|
|
|
|
|
- var shortcut2 = new Shortcut
|
|
|
|
|
|
+ bar = new Bar
|
|
{
|
|
{
|
|
- Title = "Za_G",
|
|
|
|
- Text = "Gonna zag",
|
|
|
|
- Key = Key.G.WithAlt,
|
|
|
|
|
|
+ Id = "menu-like",
|
|
|
|
+ X = 0,
|
|
|
|
+ Y = Pos.Bottom(label),
|
|
|
|
+ //Width = Dim.Percent (40),
|
|
|
|
+ Orientation = Orientation.Vertical,
|
|
};
|
|
};
|
|
|
|
+ bar.Border.Thickness = new (1);
|
|
|
|
+ ConfigureMenu (bar);
|
|
|
|
+
|
|
|
|
+ menuLikeExamples.Add (bar);
|
|
|
|
|
|
- var vBar = new Bar
|
|
|
|
|
|
+ label = new Label ()
|
|
{
|
|
{
|
|
- X = 2,
|
|
|
|
- Y = 2,
|
|
|
|
- Orientation = Orientation.Vertical,
|
|
|
|
- BorderStyle = LineStyle.Rounded
|
|
|
|
|
|
+ Title = "Menu:",
|
|
|
|
+ X = Pos.Right(bar) + 1,
|
|
|
|
+ Y = Pos.Top (label),
|
|
};
|
|
};
|
|
- vBar.Add (shortcut1, shortcut2);
|
|
|
|
-
|
|
|
|
- menuLikeExamples.Add (vBar);
|
|
|
|
|
|
+ menuLikeExamples.Add (label);
|
|
|
|
|
|
- // BUGBUG: This should not be needed
|
|
|
|
- menuLikeExamples.LayoutSubviews ();
|
|
|
|
|
|
+ bar = new Menuv2
|
|
|
|
+ {
|
|
|
|
+ Id = "menu",
|
|
|
|
+ X = Pos.Left (label),
|
|
|
|
+ Y = Pos.Bottom (label),
|
|
|
|
+ };
|
|
|
|
+ ConfigureMenu (bar);
|
|
|
|
|
|
- // SetupMenuBar ();
|
|
|
|
- //SetupContentMenu ();
|
|
|
|
|
|
+ menuLikeExamples.Add (bar);
|
|
|
|
|
|
FrameView statusBarLikeExamples = new ()
|
|
FrameView statusBarLikeExamples = new ()
|
|
{
|
|
{
|
|
@@ -140,7 +145,7 @@ public class Bars : Scenario
|
|
X = 0,
|
|
X = 0,
|
|
Y = Pos.AnchorEnd (),
|
|
Y = Pos.AnchorEnd (),
|
|
Width = Dim.Width (menuLikeExamples),
|
|
Width = Dim.Width (menuLikeExamples),
|
|
- Height = 10,
|
|
|
|
|
|
+ Height = Dim.Percent (33),
|
|
};
|
|
};
|
|
Application.Top.Add (statusBarLikeExamples);
|
|
Application.Top.Add (statusBarLikeExamples);
|
|
|
|
|
|
@@ -148,7 +153,7 @@ public class Bars : Scenario
|
|
{
|
|
{
|
|
Title = " Bar:",
|
|
Title = " Bar:",
|
|
X = 0,
|
|
X = 0,
|
|
- Y = Pos.AnchorEnd () - 6
|
|
|
|
|
|
+ Y = 0,
|
|
};
|
|
};
|
|
statusBarLikeExamples.Add (label);
|
|
statusBarLikeExamples.Add (label);
|
|
bar = new Bar
|
|
bar = new Bar
|
|
@@ -166,7 +171,7 @@ public class Bars : Scenario
|
|
{
|
|
{
|
|
Title = "StatusBar:",
|
|
Title = "StatusBar:",
|
|
X = 0,
|
|
X = 0,
|
|
- Y = Pos.AnchorEnd () - 3
|
|
|
|
|
|
+ Y = Pos.Bottom (bar) + 1,
|
|
};
|
|
};
|
|
statusBarLikeExamples.Add (label);
|
|
statusBarLikeExamples.Add (label);
|
|
bar = new StatusBar ()
|
|
bar = new StatusBar ()
|
|
@@ -348,22 +353,58 @@ public class Bars : Scenario
|
|
var fileMenuBarItem = new Shortcut
|
|
var fileMenuBarItem = new Shortcut
|
|
{
|
|
{
|
|
Title = "_File",
|
|
Title = "_File",
|
|
|
|
+ HelpText = "File Menu",
|
|
|
|
+ Key = Key.D0.WithAlt,
|
|
};
|
|
};
|
|
- fileMenuBarItem.KeyView.Visible = false;
|
|
|
|
|
|
|
|
var editMenuBarItem = new Shortcut
|
|
var editMenuBarItem = new Shortcut
|
|
{
|
|
{
|
|
Title = "_Edit",
|
|
Title = "_Edit",
|
|
|
|
+ HelpText = "Edit Menu",
|
|
|
|
+ Key = Key.D1.WithAlt
|
|
|
|
+ };
|
|
|
|
+
|
|
|
|
+ var helpMenuBarItem = new Shortcut
|
|
|
|
+ {
|
|
|
|
+ Title = "_Help",
|
|
|
|
+ HelpText = "Halp Menu",
|
|
|
|
+ Key = Key.D2.WithAlt
|
|
|
|
+ };
|
|
|
|
+
|
|
|
|
+ bar.Add (fileMenuBarItem, editMenuBarItem, helpMenuBarItem);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ private void ConfigureMenu (Bar bar)
|
|
|
|
+ {
|
|
|
|
+
|
|
|
|
+ var shortcut1 = new Shortcut
|
|
|
|
+ {
|
|
|
|
+ Title = "Z_igzag",
|
|
|
|
+ Key = Key.I.WithCtrl,
|
|
|
|
+ Text = "Gonna zig zag",
|
|
|
|
+ };
|
|
|
|
+
|
|
|
|
+ var shortcut2 = new Shortcut
|
|
|
|
+ {
|
|
|
|
+ Title = "Za_G",
|
|
|
|
+ Text = "Gonna zag",
|
|
|
|
+ Key = Key.G.WithAlt,
|
|
|
|
+ };
|
|
|
|
+
|
|
|
|
+ var shortcut3 = new Shortcut
|
|
|
|
+ {
|
|
|
|
+ Title = "_Three",
|
|
|
|
+ Text = "The 3rd item",
|
|
|
|
+ Key = Key.D3.WithAlt,
|
|
};
|
|
};
|
|
|
|
|
|
- bar.Add (fileMenuBarItem, editMenuBarItem);
|
|
|
|
|
|
+ bar.Add (shortcut1, shortcut2, shortcut3);
|
|
}
|
|
}
|
|
|
|
|
|
private void ConfigStatusBar (Bar bar)
|
|
private void ConfigStatusBar (Bar bar)
|
|
{
|
|
{
|
|
var shortcut = new Shortcut
|
|
var shortcut = new Shortcut
|
|
{
|
|
{
|
|
- Height = Dim.Auto (DimAutoStyle.Content, 3),
|
|
|
|
Text = "Quit",
|
|
Text = "Quit",
|
|
Title = "Q_uit",
|
|
Title = "Q_uit",
|
|
Key = Key.Z.WithCtrl,
|
|
Key = Key.Z.WithCtrl,
|