|
@@ -142,6 +142,16 @@ namespace Terminal.Gui {
|
|
View focused = null;
|
|
View focused = null;
|
|
Direction focusDirection;
|
|
Direction focusDirection;
|
|
|
|
|
|
|
|
+ /// <summary>
|
|
|
|
+ /// Event fired when the view is added.
|
|
|
|
+ /// </summary>
|
|
|
|
+ public Action<View> AddedView;
|
|
|
|
+
|
|
|
|
+ /// <summary>
|
|
|
|
+ /// Event fired when the view is being removing.
|
|
|
|
+ /// </summary>
|
|
|
|
+ public Action<View> RemovingView;
|
|
|
|
+
|
|
/// <summary>
|
|
/// <summary>
|
|
/// Event fired when the view gets focus.
|
|
/// Event fired when the view gets focus.
|
|
/// </summary>
|
|
/// </summary>
|
|
@@ -488,6 +498,7 @@ namespace Terminal.Gui {
|
|
subviews = new List<View> ();
|
|
subviews = new List<View> ();
|
|
subviews.Add (view);
|
|
subviews.Add (view);
|
|
view.container = this;
|
|
view.container = this;
|
|
|
|
+ OnAddedView (view);
|
|
if (view.CanFocus)
|
|
if (view.CanFocus)
|
|
CanFocus = true;
|
|
CanFocus = true;
|
|
SetNeedsLayout ();
|
|
SetNeedsLayout ();
|
|
@@ -532,6 +543,7 @@ namespace Terminal.Gui {
|
|
if (view == null || subviews == null)
|
|
if (view == null || subviews == null)
|
|
return;
|
|
return;
|
|
|
|
|
|
|
|
+ OnRemovingView (view);
|
|
SetNeedsLayout ();
|
|
SetNeedsLayout ();
|
|
SetNeedsDisplay ();
|
|
SetNeedsDisplay ();
|
|
var touched = view.Frame;
|
|
var touched = view.Frame;
|
|
@@ -861,6 +873,20 @@ namespace Terminal.Gui {
|
|
public bool Handled { get; set; }
|
|
public bool Handled { get; set; }
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ /// <inheritdoc/>
|
|
|
|
+ public override void OnAddedView (View view)
|
|
|
|
+ {
|
|
|
|
+ AddedView?.Invoke (view);
|
|
|
|
+ base.OnAddedView (view);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /// <inheritdoc/>
|
|
|
|
+ public override void OnRemovingView (View view)
|
|
|
|
+ {
|
|
|
|
+ RemovingView?.Invoke (view);
|
|
|
|
+ base.OnRemovingView (view);
|
|
|
|
+ }
|
|
|
|
+
|
|
/// <inheritdoc/>
|
|
/// <inheritdoc/>
|
|
public override bool OnEnter ()
|
|
public override bool OnEnter ()
|
|
{
|
|
{
|