|
@@ -135,60 +135,59 @@ namespace Terminal.Gui {
|
|
|
{
|
|
|
this.Title = title; // this.Title holds just the "Wizard Title"; base.Title holds "Wizard Title - Step Title"
|
|
|
this.Border.BorderStyle = BorderStyle.Rounded;
|
|
|
-
|
|
|
base.Add (contentView);
|
|
|
|
|
|
helpTextView.ReadOnly = true;
|
|
|
helpTextView.WordWrap = true;
|
|
|
base.Add (helpTextView);
|
|
|
|
|
|
+ // BUGBUG: v2 - Disabling scrolling for now
|
|
|
+ //var scrollBar = new ScrollBarView (helpTextView, true);
|
|
|
+
|
|
|
+ //scrollBar.ChangedPosition += (s,e) => {
|
|
|
+ // helpTextView.TopRow = scrollBar.Position;
|
|
|
+ // if (helpTextView.TopRow != scrollBar.Position) {
|
|
|
+ // scrollBar.Position = helpTextView.TopRow;
|
|
|
+ // }
|
|
|
+ // helpTextView.SetNeedsDisplay ();
|
|
|
+ //};
|
|
|
+
|
|
|
+ //scrollBar.OtherScrollBarView.ChangedPosition += (s,e) => {
|
|
|
+ // helpTextView.LeftColumn = scrollBar.OtherScrollBarView.Position;
|
|
|
+ // if (helpTextView.LeftColumn != scrollBar.OtherScrollBarView.Position) {
|
|
|
+ // scrollBar.OtherScrollBarView.Position = helpTextView.LeftColumn;
|
|
|
+ // }
|
|
|
+ // helpTextView.SetNeedsDisplay ();
|
|
|
+ //};
|
|
|
+
|
|
|
+ //scrollBar.VisibleChanged += (s,e) => {
|
|
|
+ // if (scrollBar.Visible && helpTextView.RightOffset == 0) {
|
|
|
+ // helpTextView.RightOffset = 1;
|
|
|
+ // } else if (!scrollBar.Visible && helpTextView.RightOffset == 1) {
|
|
|
+ // helpTextView.RightOffset = 0;
|
|
|
+ // }
|
|
|
+ //};
|
|
|
+
|
|
|
+ //scrollBar.OtherScrollBarView.VisibleChanged += (s,e) => {
|
|
|
+ // if (scrollBar.OtherScrollBarView.Visible && helpTextView.BottomOffset == 0) {
|
|
|
+ // helpTextView.BottomOffset = 1;
|
|
|
+ // } else if (!scrollBar.OtherScrollBarView.Visible && helpTextView.BottomOffset == 1) {
|
|
|
+ // helpTextView.BottomOffset = 0;
|
|
|
+ // }
|
|
|
+ //};
|
|
|
+
|
|
|
+ //helpTextView.DrawContent += (s,e) => {
|
|
|
+ // scrollBar.Size = helpTextView.Lines;
|
|
|
+ // scrollBar.Position = helpTextView.TopRow;
|
|
|
+ // if (scrollBar.OtherScrollBarView != null) {
|
|
|
+ // scrollBar.OtherScrollBarView.Size = helpTextView.Maxlength;
|
|
|
+ // scrollBar.OtherScrollBarView.Position = helpTextView.LeftColumn;
|
|
|
+ // }
|
|
|
+ // scrollBar.LayoutSubviews ();
|
|
|
+ // scrollBar.Refresh ();
|
|
|
+ //};
|
|
|
+ //base.Add (scrollBar);
|
|
|
ShowHide ();
|
|
|
-
|
|
|
- var scrollBar = new ScrollBarView (helpTextView, true);
|
|
|
-
|
|
|
- scrollBar.ChangedPosition += (s,e) => {
|
|
|
- helpTextView.TopRow = scrollBar.Position;
|
|
|
- if (helpTextView.TopRow != scrollBar.Position) {
|
|
|
- scrollBar.Position = helpTextView.TopRow;
|
|
|
- }
|
|
|
- helpTextView.SetNeedsDisplay ();
|
|
|
- };
|
|
|
-
|
|
|
- scrollBar.OtherScrollBarView.ChangedPosition += (s,e) => {
|
|
|
- helpTextView.LeftColumn = scrollBar.OtherScrollBarView.Position;
|
|
|
- if (helpTextView.LeftColumn != scrollBar.OtherScrollBarView.Position) {
|
|
|
- scrollBar.OtherScrollBarView.Position = helpTextView.LeftColumn;
|
|
|
- }
|
|
|
- helpTextView.SetNeedsDisplay ();
|
|
|
- };
|
|
|
-
|
|
|
- scrollBar.VisibleChanged += (s,e) => {
|
|
|
- if (scrollBar.Visible && helpTextView.RightOffset == 0) {
|
|
|
- helpTextView.RightOffset = 1;
|
|
|
- } else if (!scrollBar.Visible && helpTextView.RightOffset == 1) {
|
|
|
- helpTextView.RightOffset = 0;
|
|
|
- }
|
|
|
- };
|
|
|
-
|
|
|
- scrollBar.OtherScrollBarView.VisibleChanged += (s,e) => {
|
|
|
- if (scrollBar.OtherScrollBarView.Visible && helpTextView.BottomOffset == 0) {
|
|
|
- helpTextView.BottomOffset = 1;
|
|
|
- } else if (!scrollBar.OtherScrollBarView.Visible && helpTextView.BottomOffset == 1) {
|
|
|
- helpTextView.BottomOffset = 0;
|
|
|
- }
|
|
|
- };
|
|
|
-
|
|
|
- helpTextView.DrawContent += (s,e) => {
|
|
|
- scrollBar.Size = helpTextView.Lines;
|
|
|
- scrollBar.Position = helpTextView.TopRow;
|
|
|
- if (scrollBar.OtherScrollBarView != null) {
|
|
|
- scrollBar.OtherScrollBarView.Size = helpTextView.Maxlength;
|
|
|
- scrollBar.OtherScrollBarView.Position = helpTextView.LeftColumn;
|
|
|
- }
|
|
|
- scrollBar.LayoutSubviews ();
|
|
|
- scrollBar.Refresh ();
|
|
|
- };
|
|
|
- base.Add (scrollBar);
|
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
@@ -228,8 +227,9 @@ namespace Terminal.Gui {
|
|
|
public override void Add (View view)
|
|
|
{
|
|
|
contentView.Add (view);
|
|
|
- if (view.CanFocus)
|
|
|
+ if (view.CanFocus) {
|
|
|
CanFocus = true;
|
|
|
+ }
|
|
|
ShowHide ();
|
|
|
}
|
|
|
|
|
@@ -240,15 +240,17 @@ namespace Terminal.Gui {
|
|
|
/// </remarks>
|
|
|
public override void Remove (View view)
|
|
|
{
|
|
|
- if (view == null)
|
|
|
+ if (view == null) {
|
|
|
return;
|
|
|
+ }
|
|
|
|
|
|
SetNeedsDisplay ();
|
|
|
var touched = view.Frame;
|
|
|
contentView.Remove (view);
|
|
|
|
|
|
- if (contentView.InternalSubviews.Count < 1)
|
|
|
+ if (contentView.InternalSubviews.Count < 1) {
|
|
|
this.CanFocus = false;
|
|
|
+ }
|
|
|
ShowHide ();
|
|
|
}
|
|
|
|
|
@@ -317,6 +319,7 @@ namespace Terminal.Gui {
|
|
|
ClearKeybinding (Command.QuitToplevel);
|
|
|
AddKeyBinding (Key.Esc, Command.QuitToplevel);
|
|
|
}
|
|
|
+ SetNeedsLayout ();
|
|
|
|
|
|
}
|
|
|
|