TileViewExperiment.cs 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132
  1. using System;
  2. using Terminal.Gui;
  3. using Terminal.Gui.Graphs;
  4. using System.Linq;
  5. namespace UICatalog.Scenarios {
  6. [ScenarioMetadata (Name: "Tile View Experiments", Description: "Experiments with Tile View")]
  7. [ScenarioCategory ("Controls")]
  8. [ScenarioCategory ("LineView")]
  9. public class TileViewExperiment : Scenario {
  10. public override void Init ()
  11. {
  12. Application.Init ();
  13. }
  14. /// <summary>
  15. /// Setup the scenario.
  16. /// </summary>
  17. public override void Setup ()
  18. {
  19. //var menu = new MenuBar (new MenuBarItem [] {
  20. //new MenuBarItem ("_File", new MenuItem [] {
  21. // new MenuItem ("_Quit", "", () => Application.RequestStop()),
  22. //}) });
  23. //Application.Top.Add (menu);
  24. var frame1 = new FrameView () {
  25. Title = "frame1",
  26. X = 0,
  27. Y = 0,
  28. Width = 70, //Dim.Fill (),
  29. Height = 15, //Dim.Fill (),
  30. //IgnoreBorderPropertyOnRedraw = true
  31. };
  32. frame1.Border.BorderStyle = BorderStyle.Double;
  33. //var frame2 = new FrameView () {
  34. // Title = "frame2",
  35. // X = 0,
  36. // Y = Pos.Bottom (frame1) + 1,
  37. // Width = 20, //Dim.Fill (),
  38. // Height = 15, //Dim.Fill (),
  39. // //IgnoreBorderPropertyOnRedraw = true
  40. //};
  41. //frame2.Border.BorderStyle = BorderStyle.Single;
  42. //ConsoleDriver.Diagnostics ^= ConsoleDriver.DiagnosticFlags.FrameRuler;
  43. Application.Top.Add (frame1);
  44. //Application.Top.Add (frame2);
  45. var view1 = new View () {
  46. AutoSize = false,
  47. Title = "view1",
  48. Text = "View1 30%/50% Single",
  49. X = 0,
  50. Y = 0,
  51. Width = 30, //Dim.Percent (30) - 5,
  52. Height = 10, //Dim.Percent (50) - 5,
  53. ColorScheme = Colors.ColorSchemes ["Dialog"],
  54. Border = new Border () {
  55. BorderStyle = BorderStyle.Single,
  56. BorderThickness = new Thickness (1),
  57. DrawMarginFrame = true,
  58. PaddingThickness = new Thickness(1),
  59. ForgroundColor = Color.BrightMagenta,
  60. }
  61. };
  62. frame1.Add (view1);
  63. //var view12splitter = new SplitterEventArgs
  64. var view2 = new FrameView () {
  65. Title = "view2",
  66. Text = "View2 right of view1, 30%/70% Single.",
  67. X = Pos.Right (view1) - 1,
  68. Y = 0,
  69. Width = Dim.Percent (30),
  70. Height = Dim.Percent (70),
  71. ColorScheme = Colors.ColorSchemes ["Error"],
  72. Border = new Border () { BorderStyle = BorderStyle.Single }
  73. };
  74. frame1.Add (view2);
  75. //var view3 = new FrameView () {
  76. // Title = "View 3",
  77. // Text = "View3 right of View2 Fill/Fill Single",
  78. // X = Pos.Right (view2) - 1,
  79. // Y = -1,
  80. // Width = Dim.Fill (-1),
  81. // Height = Dim.Fill (-1),
  82. // ColorScheme = Colors.ColorSchemes ["Menu"],
  83. // Border = new Border () { BorderStyle = BorderStyle.Single }
  84. //};
  85. //frame.Add (view3);
  86. //var view4 = new FrameView () {
  87. // Title = "View 4",
  88. // Text = "View4 below View2 view2.Width/5 Single",
  89. // X = Pos.Left (view2),
  90. // Y = Pos.Bottom (view2) - 1,
  91. // Width = view2.Width,
  92. // Height = 5,
  93. // ColorScheme = Colors.ColorSchemes ["TopLevel"],
  94. // Border = new Border () { BorderStyle = BorderStyle.Single }
  95. //};
  96. //frame.Add (view4);
  97. //var view5 = new FrameView () {
  98. // Title = "View 5",
  99. // Text = "View5 below View4 view4.Width/5 Double",
  100. // X = Pos.Left (view2),
  101. // Y = Pos.Bottom (view4) - 1,
  102. // Width = view4.Width,
  103. // Height = 5,
  104. // ColorScheme = Colors.ColorSchemes ["TopLevel"],
  105. // Border = new Border () { BorderStyle = BorderStyle.Double }
  106. //};
  107. //frame.Add (view5);
  108. }
  109. }
  110. }