From e0551f4e4dcb3dda3baf9db4c00c31048bb430c6 Mon Sep 17 00:00:00 2001 From: Tig Date: Sun, 27 Oct 2024 19:54:50 -0700 Subject: [PATCH] NeedsDisplay -> NeedsDraw --- Terminal.Gui/Application/Application.Run.cs | 10 +- Terminal.Gui/Application/MainLoop.cs | 1 - .../Text/Autocomplete/AppendAutocomplete.cs | 4 +- .../Text/Autocomplete/PopupAutocomplete.cs | 14 +- Terminal.Gui/View/Adornment/Adornment.cs | 2 +- Terminal.Gui/View/Adornment/Border.cs | 10 +- Terminal.Gui/View/Adornment/Margin.cs | 2 +- Terminal.Gui/View/Adornment/Padding.cs | 4 +- Terminal.Gui/View/View.Attribute.cs | 2 +- Terminal.Gui/View/View.Content.cs | 2 +- Terminal.Gui/View/View.Diagnostics.cs | 2 +- Terminal.Gui/View/View.Drawing.cs | 108 +++++------ Terminal.Gui/View/View.Hierarchy.cs | 10 +- Terminal.Gui/View/View.Layout.cs | 14 +- Terminal.Gui/View/View.Navigation.cs | 4 +- Terminal.Gui/View/View.Text.cs | 4 +- Terminal.Gui/View/View.cs | 12 +- Terminal.Gui/Views/Bar.cs | 6 +- Terminal.Gui/Views/ColorBar.cs | 4 +- Terminal.Gui/Views/ColorPicker.16.cs | 2 +- Terminal.Gui/Views/ComboBox.cs | 12 +- Terminal.Gui/Views/FileDialog.cs | 12 +- Terminal.Gui/Views/GraphView/GraphView.cs | 4 +- Terminal.Gui/Views/HexView.cs | 30 ++-- Terminal.Gui/Views/ListView.cs | 38 ++-- Terminal.Gui/Views/Menu/Menu.cs | 16 +- Terminal.Gui/Views/Menu/MenuBar.cs | 26 +-- Terminal.Gui/Views/ProgressBar.cs | 6 +- Terminal.Gui/Views/RadioGroup.cs | 6 +- Terminal.Gui/Views/ScrollBarView.cs | 6 +- Terminal.Gui/Views/ScrollView.cs | 14 +- Terminal.Gui/Views/Shortcut.cs | 4 +- Terminal.Gui/Views/Slider.cs | 10 +- .../Views/SpinnerView/SpinnerStyle.cs | 2 +- Terminal.Gui/Views/SpinnerView/SpinnerView.cs | 10 +- Terminal.Gui/Views/Tab.cs | 2 +- Terminal.Gui/Views/TabView.cs | 6 +- .../TableView/CheckBoxTableSourceWrapper.cs | 6 +- Terminal.Gui/Views/TableView/TableView.cs | 28 +-- .../Views/TableView/TreeTableSource.cs | 4 +- Terminal.Gui/Views/TextField.cs | 20 +-- Terminal.Gui/Views/TextValidateField.cs | 16 +- Terminal.Gui/Views/TextView.cs | 152 ++++++++-------- Terminal.Gui/Views/TileView.cs | 10 +- Terminal.Gui/Views/TimeField.cs | 2 +- Terminal.Gui/Views/TreeView/TreeView.cs | 70 ++++---- Terminal.Gui/Views/TreeViewTextFilter.cs | 2 +- Terminal.Gui/Views/Wizard/WizardStep.cs | 10 +- UICatalog/KeyBindingsDialog.cs | 2 +- .../AnimationScenario/AnimationScenario.cs | 4 +- UICatalog/Scenarios/Arrangement.cs | 2 +- UICatalog/Scenarios/CharacterMap.cs | 6 +- UICatalog/Scenarios/ClassExplorer.cs | 4 +- UICatalog/Scenarios/ConfigurationEditor.cs | 2 +- UICatalog/Scenarios/CsvEditor.cs | 8 +- UICatalog/Scenarios/DynamicMenuBar.cs | 16 +- UICatalog/Scenarios/DynamicStatusBar.cs | 6 +- UICatalog/Scenarios/Editor.cs | 4 +- UICatalog/Scenarios/Editors/BorderEditor.cs | 2 +- UICatalog/Scenarios/GraphViewExample.cs | 20 +-- UICatalog/Scenarios/Images.cs | 2 +- UICatalog/Scenarios/InvertColors.cs | 2 +- UICatalog/Scenarios/LineDrawing.cs | 12 +- UICatalog/Scenarios/ListColumns.cs | 16 +- UICatalog/Scenarios/ListViewWithSelection.cs | 10 +- UICatalog/Scenarios/ListsAndCombos.cs | 8 +- UICatalog/Scenarios/Navigation.cs | 2 +- UICatalog/Scenarios/Notepad.cs | 2 +- UICatalog/Scenarios/Shortcuts.cs | 2 +- UICatalog/Scenarios/SingleBackgroundWorker.cs | 12 +- UICatalog/Scenarios/Snake.cs | 2 +- UICatalog/Scenarios/TableEditor.cs | 8 +- UICatalog/Scenarios/TextEffectsScenario.cs | 2 +- UICatalog/Scenarios/Threading.cs | 2 +- UICatalog/Scenarios/TreeViewFileSystem.cs | 20 +-- UICatalog/Scenarios/VkeyPacketSimulator.cs | 2 +- UICatalog/Scenarios/Wizards.cs | 2 +- UICatalog/UICatalog.cs | 2 +- UnitTests/Application/ApplicationTests.cs | 10 +- UnitTests/Application/MainLoopTests.cs | 6 +- UnitTests/Dialogs/DialogTests.cs | 4 +- UnitTests/Drawing/RulerTests.cs | 16 +- UnitTests/Drawing/ThicknessTests.cs | 6 +- UnitTests/Text/AutocompleteTests.cs | 20 +-- UnitTests/UICatalog/ScenarioTests.cs | 2 +- UnitTests/View/Adornment/MarginTests.cs | 2 +- UnitTests/View/Draw/AllViewsDrawTests.cs | 2 +- UnitTests/View/Draw/DrawTests.cs | 10 +- UnitTests/View/Draw/NeedsDisplayTests.cs | 168 +++++++++--------- UnitTests/View/Layout/LayoutTests.cs | 2 +- UnitTests/View/TextTests.cs | 6 +- UnitTests/View/ViewTests.cs | 26 +-- UnitTests/Views/GraphViewTests.cs | 30 ++-- UnitTests/Views/LabelTests.cs | 8 +- UnitTests/Views/MenuBarTests.cs | 4 +- UnitTests/Views/ScrollBarViewTests.cs | 24 +-- UnitTests/Views/TableViewTests.cs | 22 +-- UnitTests/Views/TextViewTests.cs | 14 +- UnitTests/Views/TileViewTests.cs | 24 +-- UnitTests/Views/ToplevelTests.cs | 8 +- UnitTests/Views/TreeViewTests.cs | 2 +- docfx/docs/drawing.md | 4 +- 102 files changed, 674 insertions(+), 671 deletions(-) diff --git a/Terminal.Gui/Application/Application.Run.cs b/Terminal.Gui/Application/Application.Run.cs index dccbc4794..adb9b63c0 100644 --- a/Terminal.Gui/Application/Application.Run.cs +++ b/Terminal.Gui/Application/Application.Run.cs @@ -495,9 +495,10 @@ public static partial class Application // Run (Begin, Run, End, Stop) /// Wakes up the running application that might be waiting on input. public static void Wakeup () { MainLoop?.Wakeup (); } + // TODO: Rename this to LayoutAndDrawRunnables in https://github.com/gui-cs/Terminal.Gui/issues/2491 /// /// Causes any Toplevels that need layout to be laid out. Then draws any Toplevels that need dispplay. Only Views that need to be laid out (see ) will be laid out. - /// Only Views that need to be drawn (see ) will be drawn. + /// Only Views that need to be drawn (see ) will be drawn. /// /// If the entire View hierarchy will be redrawn. The default is and should only be overriden for testing. public static void LayoutAndDrawToplevels (bool forceDraw = false) @@ -515,6 +516,8 @@ public static partial class Application // Run (Begin, Run, End, Stop) Driver?.Refresh (); } + // TODO: Rename this to LayoutRunnables in https://github.com/gui-cs/Terminal.Gui/issues/2491 + private static bool LayoutToplevels () { bool neededLayout = false; @@ -531,13 +534,14 @@ public static partial class Application // Run (Begin, Run, End, Stop) return neededLayout; } + // TODO: Rename this to DrawRunnables in https://github.com/gui-cs/Terminal.Gui/issues/2491 private static void DrawToplevels (bool forceDraw) { foreach (Toplevel tl in TopLevels.Reverse ()) { if (forceDraw) { - tl.SetNeedsDisplay (); + tl.SetNeedsDraw (); } tl.Draw (); @@ -698,7 +702,7 @@ public static partial class Application // Run (Begin, Run, End, Stop) if (TopLevels.Count > 0) { Top = TopLevels.Peek (); - Top.SetNeedsDisplay (); + Top.SetNeedsDraw (); } if (runState.Toplevel is { HasFocus: true }) diff --git a/Terminal.Gui/Application/MainLoop.cs b/Terminal.Gui/Application/MainLoop.cs index 401b37c52..ee4bba220 100644 --- a/Terminal.Gui/Application/MainLoop.cs +++ b/Terminal.Gui/Application/MainLoop.cs @@ -247,7 +247,6 @@ internal class MainLoop : IDisposable while (Running) { EventsPending (); - object ctx = null; RunIteration (); } diff --git a/Terminal.Gui/Text/Autocomplete/AppendAutocomplete.cs b/Terminal.Gui/Text/Autocomplete/AppendAutocomplete.cs index d9ee06053..b068b099a 100644 --- a/Terminal.Gui/Text/Autocomplete/AppendAutocomplete.cs +++ b/Terminal.Gui/Text/Autocomplete/AppendAutocomplete.cs @@ -42,7 +42,7 @@ public class AppendAutocomplete : AutocompleteBase public override void ClearSuggestions () { base.ClearSuggestions (); - textField.SetNeedsDisplay (); + textField.SetNeedsDraw (); } /// @@ -183,7 +183,7 @@ public class AppendAutocomplete : AutocompleteBase SelectedIdx = Suggestions.Count () - 1; } - textField.SetNeedsDisplay (); + textField.SetNeedsDraw (); return true; } diff --git a/Terminal.Gui/Text/Autocomplete/PopupAutocomplete.cs b/Terminal.Gui/Text/Autocomplete/PopupAutocomplete.cs index 9614edb52..34e058dab 100644 --- a/Terminal.Gui/Text/Autocomplete/PopupAutocomplete.cs +++ b/Terminal.Gui/Text/Autocomplete/PopupAutocomplete.cs @@ -120,7 +120,7 @@ public abstract partial class PopupAutocomplete : AutocompleteBase if (Visible && Suggestions.Count == 0) { Visible = false; - HostControl?.SetNeedsDisplay (); + HostControl?.SetNeedsDraw (); return true; } @@ -128,7 +128,7 @@ public abstract partial class PopupAutocomplete : AutocompleteBase if (!Visible && Suggestions.Count > 0) { Visible = true; - HostControl?.SetNeedsDisplay (); + HostControl?.SetNeedsDraw (); Application.UngrabMouse (); return false; @@ -141,7 +141,7 @@ public abstract partial class PopupAutocomplete : AutocompleteBase _closed = false; } - HostControl?.SetNeedsDisplay (); + HostControl?.SetNeedsDraw (); return false; } @@ -424,7 +424,7 @@ public abstract partial class PopupAutocomplete : AutocompleteBase ClearSuggestions (); Visible = false; _closed = true; - HostControl?.SetNeedsDisplay (); + HostControl?.SetNeedsDraw (); //RemovePopupFromTop (); } @@ -469,7 +469,7 @@ public abstract partial class PopupAutocomplete : AutocompleteBase } EnsureSelectedIdxIsValid (); - HostControl?.SetNeedsDisplay (); + HostControl?.SetNeedsDraw (); } /// Moves the selection in the Autocomplete context menu up one @@ -483,7 +483,7 @@ public abstract partial class PopupAutocomplete : AutocompleteBase } EnsureSelectedIdxIsValid (); - HostControl?.SetNeedsDisplay (); + HostControl?.SetNeedsDraw (); } /// Render the current selection in the Autocomplete context menu by the mouse reporting. @@ -512,7 +512,7 @@ public abstract partial class PopupAutocomplete : AutocompleteBase { Visible = true; _closed = false; - HostControl?.SetNeedsDisplay (); + HostControl?.SetNeedsDraw (); return true; } diff --git a/Terminal.Gui/View/Adornment/Adornment.cs b/Terminal.Gui/View/Adornment/Adornment.cs index 6414ec9b6..ec79986a1 100644 --- a/Terminal.Gui/View/Adornment/Adornment.cs +++ b/Terminal.Gui/View/Adornment/Adornment.cs @@ -66,7 +66,7 @@ public class Adornment : View, IDesignable { Parent?.SetAdornmentFrames (); SetNeedsLayout (); - SetNeedsDisplay (); + SetNeedsDraw (); OnThicknessChanged (); } diff --git a/Terminal.Gui/View/Adornment/Border.cs b/Terminal.Gui/View/Adornment/Border.cs index a619190d8..af38114d6 100644 --- a/Terminal.Gui/View/Adornment/Border.cs +++ b/Terminal.Gui/View/Adornment/Border.cs @@ -152,7 +152,7 @@ public class Border : Adornment set { base.ColorScheme = value; - Parent?.SetNeedsDisplay (); + Parent?.SetNeedsDraw (); } } @@ -223,7 +223,7 @@ public class Border : Adornment _settings = value; - Parent?.SetNeedsDisplay (); + Parent?.SetNeedsDraw (); } } @@ -264,7 +264,7 @@ public class Border : Adornment ColorScheme = cs; } - Parent?.SetNeedsDisplay (); + Parent?.SetNeedsDraw (); e.Cancel = true; } @@ -447,11 +447,11 @@ public class Border : Adornment if (Parent!.SuperView is null) { // Redraw the entire app window. - Application.Top!.SetNeedsDisplay (); + Application.Top!.SetNeedsDraw (); } else { - Parent.SuperView.SetNeedsDisplay (); + Parent.SuperView.SetNeedsDraw (); } _dragPosition = mouseEvent.Position; diff --git a/Terminal.Gui/View/Adornment/Margin.cs b/Terminal.Gui/View/Adornment/Margin.cs index 87393598a..053f555b7 100644 --- a/Terminal.Gui/View/Adornment/Margin.cs +++ b/Terminal.Gui/View/Adornment/Margin.cs @@ -63,7 +63,7 @@ public class Margin : Adornment set { base.ColorScheme = value; - Parent?.SetNeedsDisplay (); + Parent?.SetNeedsDraw (); } } diff --git a/Terminal.Gui/View/Adornment/Padding.cs b/Terminal.Gui/View/Adornment/Padding.cs index 7dbc1cd70..99de08dda 100644 --- a/Terminal.Gui/View/Adornment/Padding.cs +++ b/Terminal.Gui/View/Adornment/Padding.cs @@ -35,7 +35,7 @@ public class Padding : Adornment set { base.ColorScheme = value; - Parent?.SetNeedsDisplay (); + Parent?.SetNeedsDraw (); } } @@ -62,7 +62,7 @@ public class Padding : Adornment if (Parent.CanFocus && !Parent.HasFocus) { Parent.SetFocus (); - Parent.SetNeedsDisplay (); + Parent.SetNeedsDraw (); return mouseEvent.Handled = true; } } diff --git a/Terminal.Gui/View/View.Attribute.cs b/Terminal.Gui/View/View.Attribute.cs index 67c3b3b35..d6e42a01b 100644 --- a/Terminal.Gui/View/View.Attribute.cs +++ b/Terminal.Gui/View/View.Attribute.cs @@ -34,7 +34,7 @@ public partial class View Border.ColorScheme = _colorScheme; } - SetNeedsDisplay (); + SetNeedsDraw (); } } } diff --git a/Terminal.Gui/View/View.Content.cs b/Terminal.Gui/View/View.Content.cs index c7d3ccdc5..c09bf4950 100644 --- a/Terminal.Gui/View/View.Content.cs +++ b/Terminal.Gui/View/View.Content.cs @@ -265,7 +265,7 @@ public partial class View /// /// /// Altering the Viewport Size will eventually (when the view is next laid out) cause the - /// and methods to be called. + /// and methods to be called. /// /// public virtual Rectangle Viewport diff --git a/Terminal.Gui/View/View.Diagnostics.cs b/Terminal.Gui/View/View.Diagnostics.cs index 6e3e63471..6cf51985f 100644 --- a/Terminal.Gui/View/View.Diagnostics.cs +++ b/Terminal.Gui/View/View.Diagnostics.cs @@ -25,7 +25,7 @@ public enum ViewDiagnosticFlags : uint Hover = 0b_0000_00100, /// - /// When enabled a draw indicator will be shown; the indicator will change each time the View's Draw method is called with NeedsDisplay set to true. + /// When enabled a draw indicator will be shown; the indicator will change each time the View's Draw method is called with NeedsDraw set to true. /// DrawIndicator = 0b_0000_01000, } diff --git a/Terminal.Gui/View/View.Drawing.cs b/Terminal.Gui/View/View.Drawing.cs index 006a59879..e9b7232e2 100644 --- a/Terminal.Gui/View/View.Drawing.cs +++ b/Terminal.Gui/View/View.Drawing.cs @@ -12,8 +12,8 @@ public partial class View // Drawing APIs /// /// /// - /// The view will only be drawn if it is visible, and has any of , - /// , + /// The view will only be drawn if it is visible, and has any of , + /// , /// or set. /// /// @@ -22,7 +22,7 @@ public partial class View // Drawing APIs /// public void Draw () { - if (!CanBeVisible (this) || (!NeedsDisplay && !SubViewNeedsDisplay)) + if (!CanBeVisible (this) || (!NeedsDraw && !SubViewNeedsDraw)) { return; } @@ -50,7 +50,7 @@ public partial class View // Drawing APIs DoRenderLineCanvas (); DoDrawAdornmentSubViews (); - ClearNeedsDisplay (); + ClearNeedsDraw (); // We're done DoDrawComplete (); @@ -66,7 +66,7 @@ public partial class View // Drawing APIs { foreach (View subview in Margin.Subviews) { - subview.SetNeedsDisplay (); + subview.SetNeedsDraw (); } Margin?.DoDrawSubviews (Margin.Viewport); @@ -76,7 +76,7 @@ public partial class View // Drawing APIs { foreach (View subview in Border.Subviews) { - subview.SetNeedsDisplay (); + subview.SetNeedsDraw (); } Border?.DoDrawSubviews (Border.Viewport); @@ -86,7 +86,7 @@ public partial class View // Drawing APIs { foreach (View subview in Padding.Subviews) { - subview.SetNeedsDisplay (); + subview.SetNeedsDraw (); } Padding?.DoDrawSubviews (Padding.Viewport); @@ -103,7 +103,7 @@ public partial class View // Drawing APIs // TODO: add event. // Subviews of Adornments count as subviews - if (!NeedsDisplay && !SubViewNeedsDisplay) + if (!NeedsDraw && !SubViewNeedsDraw) { return; } @@ -151,7 +151,7 @@ public partial class View // Drawing APIs return; } - if (!NeedsDisplay && !SubViewNeedsDisplay) + if (!NeedsDraw && !SubViewNeedsDraw) { return; } @@ -204,7 +204,7 @@ public partial class View // Drawing APIs return; } - if (!NeedsDisplay) + if (!NeedsDraw) { return; } @@ -264,7 +264,7 @@ public partial class View // Drawing APIs SetAttribute (prev); Driver.Clip = prevClip; - SetNeedsDisplay (); + SetNeedsDraw (); } #endregion ClearViewport @@ -288,7 +288,7 @@ public partial class View // Drawing APIs return; } - if (!NeedsDisplay) + if (!NeedsDraw) { return; } @@ -332,7 +332,7 @@ public partial class View // Drawing APIs ); // We assume that the text has been drawn over the entire area; ensure that the subviews are redrawn. - SetSubViewNeedsDisplay (); + SetSubViewNeedsDraw (); } #endregion DrawText @@ -396,7 +396,7 @@ public partial class View // Drawing APIs return; } - if (!SubViewNeedsDisplay) + if (!SubViewNeedsDraw) { return; } @@ -425,19 +425,19 @@ public partial class View // Drawing APIs /// public void DrawSubviews () { - if (_subviews is null || !SubViewNeedsDisplay) + if (_subviews is null || !SubViewNeedsDraw) { return; } - IEnumerable subviewsNeedingDraw = _subviews.Where (view => (view.Visible && (view.NeedsDisplay || view.SubViewNeedsDisplay)) + IEnumerable subviewsNeedingDraw = _subviews.Where (view => (view.Visible && (view.NeedsDraw || view.SubViewNeedsDraw)) );//|| view.Arrangement.HasFlag (ViewArrangement.Overlapped)); foreach (View view in subviewsNeedingDraw) { if (view.Arrangement.HasFlag (ViewArrangement.Overlapped)) { - //view.SetNeedsDisplay (); + //view.SetNeedsDraw (); } view.Draw (); } @@ -567,14 +567,14 @@ public partial class View // Drawing APIs #endregion DrawComplete - #region NeedsDisplay + #region NeedsDraw - // TODO: Make _needsDisplayRect nullable instead of relying on Empty + // TODO: Make _needsDrawRect nullable instead of relying on Empty // TODO: If null, it means ? // TODO: If Empty, it means no need to redraw // TODO: If not Empty, it means the region that needs to be redrawn // The viewport-relative region that needs to be redrawn. Marked internal for unit tests. - internal Rectangle _needsDisplayRect = Rectangle.Empty; + internal Rectangle _needsDrawRect = Rectangle.Empty; /// Gets or sets whether the view needs to be redrawn. /// @@ -586,42 +586,42 @@ public partial class View // Drawing APIs /// Setting has no effect on . /// /// - public bool NeedsDisplay + public bool NeedsDraw { - // TODO: Figure out if we can decouple NeedsDisplay from NeedsLayout. This is a temporary fix. - get => _needsDisplayRect != Rectangle.Empty || NeedsLayout; + // TODO: Figure out if we can decouple NeedsDraw from NeedsLayout. This is a temporary fix. + get => _needsDrawRect != Rectangle.Empty || NeedsLayout; set { if (value) { - SetNeedsDisplay (); + SetNeedsDraw (); } else { - ClearNeedsDisplay (); + ClearNeedsDraw (); } } } /// Gets whether any Subviews need to be redrawn. - public bool SubViewNeedsDisplay { get; private set; } + public bool SubViewNeedsDraw { get; private set; } /// Sets that the of this View needs to be redrawn. /// /// If the view has not been initialized ( is ), this method /// does nothing. /// - public void SetNeedsDisplay () + public void SetNeedsDraw () { Rectangle viewport = Viewport; - if (_needsDisplayRect != Rectangle.Empty && viewport.IsEmpty) + if (_needsDrawRect != Rectangle.Empty && viewport.IsEmpty) { // This handles the case where the view has not been initialized yet return; } - SetNeedsDisplay (viewport); + SetNeedsDraw (viewport); } /// Expands the area of this view needing to be redrawn to include . @@ -635,11 +635,11 @@ public partial class View // Drawing APIs /// /// /// The relative region that needs to be redrawn. - public void SetNeedsDisplay (Rectangle viewPortRelativeRegion) + public void SetNeedsDraw (Rectangle viewPortRelativeRegion) { - if (_needsDisplayRect.IsEmpty) + if (_needsDrawRect.IsEmpty) { - _needsDisplayRect = viewPortRelativeRegion; + _needsDrawRect = viewPortRelativeRegion; } else { @@ -647,18 +647,18 @@ public partial class View // Drawing APIs int y = Math.Min (Viewport.Y, viewPortRelativeRegion.Y); int w = Math.Max (Viewport.Width, viewPortRelativeRegion.Width); int h = Math.Max (Viewport.Height, viewPortRelativeRegion.Height); - _needsDisplayRect = new (x, y, w, h); + _needsDrawRect = new (x, y, w, h); } - Margin?.SetNeedsDisplay (); - Border?.SetNeedsDisplay (); - Padding?.SetNeedsDisplay (); + Margin?.SetNeedsDraw (); + Border?.SetNeedsDraw (); + Padding?.SetNeedsDraw (); - SuperView?.SetSubViewNeedsDisplay (); + SuperView?.SetSubViewNeedsDraw (); if (this is Adornment adornment) { - adornment.Parent?.SetSubViewNeedsDisplay (); + adornment.Parent?.SetSubViewNeedsDraw (); } foreach (View subview in Subviews) @@ -668,42 +668,42 @@ public partial class View // Drawing APIs Rectangle subviewRegion = Rectangle.Intersect (subview.Frame, viewPortRelativeRegion); subviewRegion.X -= subview.Frame.X; subviewRegion.Y -= subview.Frame.Y; - subview.SetNeedsDisplay (subviewRegion); + subview.SetNeedsDraw (subviewRegion); } } } - /// Sets to for this View and all Superviews. - public void SetSubViewNeedsDisplay () + /// Sets to for this View and all Superviews. + public void SetSubViewNeedsDraw () { - SubViewNeedsDisplay = true; + SubViewNeedsDraw = true; if (this is Adornment adornment) { - adornment.Parent?.SetSubViewNeedsDisplay (); + adornment.Parent?.SetSubViewNeedsDraw (); } - if (SuperView is { SubViewNeedsDisplay: false }) + if (SuperView is { SubViewNeedsDraw: false }) { - SuperView.SetSubViewNeedsDisplay (); + SuperView.SetSubViewNeedsDraw (); } } - /// Clears and . - protected void ClearNeedsDisplay () + /// Clears and . + protected void ClearNeedsDraw () { - _needsDisplayRect = Rectangle.Empty; - SubViewNeedsDisplay = false; + _needsDrawRect = Rectangle.Empty; + SubViewNeedsDraw = false; - Margin?.ClearNeedsDisplay (); - Border?.ClearNeedsDisplay (); - Padding?.ClearNeedsDisplay (); + Margin?.ClearNeedsDraw (); + Border?.ClearNeedsDraw (); + Padding?.ClearNeedsDraw (); foreach (View subview in Subviews) { - subview.ClearNeedsDisplay (); + subview.ClearNeedsDraw (); } } - #endregion NeedsDisplay + #endregion NeedsDraw } diff --git a/Terminal.Gui/View/View.Hierarchy.cs b/Terminal.Gui/View/View.Hierarchy.cs index 1767a7a32..8bd58a185 100644 --- a/Terminal.Gui/View/View.Hierarchy.cs +++ b/Terminal.Gui/View/View.Hierarchy.cs @@ -89,7 +89,7 @@ public partial class View // SuperView/SubView hierarchy management (SuperView, view.EndInit (); } - SetNeedsDisplay (); + SetNeedsDraw (); SetNeedsLayout (); return view; @@ -186,13 +186,13 @@ public partial class View // SuperView/SubView hierarchy management (SuperView, view._superView = null; SetNeedsLayout (); - SetNeedsDisplay (); + SetNeedsDraw (); foreach (View v in _subviews) { if (v.Frame.IntersectsWith (touched)) { - view.SetNeedsDisplay (); + view.SetNeedsDraw (); } } @@ -346,8 +346,8 @@ public partial class View // SuperView/SubView hierarchy management (SuperView, } // BUGBUG: this is odd. Why is this needed? - SetNeedsDisplay (); - subview.SetNeedsDisplay (); + SetNeedsDraw (); + subview.SetNeedsDraw (); } #endregion SubViewOrdering diff --git a/Terminal.Gui/View/View.Layout.cs b/Terminal.Gui/View/View.Layout.cs index da65c51c4..0f5cb0239 100644 --- a/Terminal.Gui/View/View.Layout.cs +++ b/Terminal.Gui/View/View.Layout.cs @@ -35,7 +35,7 @@ public partial class View // Layout APIs /// Setting Frame will set , , , and to absoulte values. /// /// - /// Changing this property will result in and to be set, resulting in the + /// Changing this property will result in and to be set, resulting in the /// view being laid out and redrawn as appropriate in the next iteration of the . /// /// @@ -90,7 +90,7 @@ public partial class View // Layout APIs SetAdornmentFrames (); - SetNeedsDisplay (); + SetNeedsDraw (); SetNeedsLayout (); // BUGBUG: When SetFrame is called from Frame_set, this event gets raised BEFORE OnResizeNeeded. Is that OK? @@ -192,7 +192,7 @@ public partial class View // Layout APIs /// laid out (e.g. has been called). /// /// - /// Changing this property will result in and to be set, resulting in the + /// Changing this property will result in and to be set, resulting in the /// view being laid out and redrawn as appropriate in the next iteration of the . /// /// @@ -235,7 +235,7 @@ public partial class View // Layout APIs /// laid out (e.g. has been called). /// /// - /// Changing this property will result in and to be set, resulting in the + /// Changing this property will result in and to be set, resulting in the /// view being laid out and redrawn as appropriate in the next iteration of the . /// /// @@ -276,7 +276,7 @@ public partial class View // Layout APIs /// laid out (e.g. has been called). /// /// - /// Changing this property will result in and to be set, resulting in the + /// Changing this property will result in and to be set, resulting in the /// view being laid out and redrawn as appropriate in the next iteration of the . /// /// @@ -322,7 +322,7 @@ public partial class View // Layout APIs /// laid out (e.g. has been called). /// /// - /// Changing this property will result in and to be set, resulting in the + /// Changing this property will result in and to be set, resulting in the /// view being laid out and redrawn as appropriate in the next iteration of the . /// /// @@ -512,7 +512,7 @@ public partial class View // Layout APIs SetTitleTextFormatterSize (); } - SuperView?.SetNeedsDisplay (); + SuperView?.SetNeedsDraw (); } if (TextFormatter.ConstrainToWidth is null) diff --git a/Terminal.Gui/View/View.Navigation.cs b/Terminal.Gui/View/View.Navigation.cs index 094ed5a01..cbd2963c4 100644 --- a/Terminal.Gui/View/View.Navigation.cs +++ b/Terminal.Gui/View/View.Navigation.cs @@ -594,7 +594,7 @@ public partial class View // Focus and cross-view navigation management (TabStop // Focus work is done. Notify. RaiseFocusChanged (HasFocus, currentFocusedView, this); - SetNeedsDisplay (); + SetNeedsDraw (); // Post-conditions - prove correctness if (HasFocus == previousValue) @@ -847,7 +847,7 @@ public partial class View // Focus and cross-view navigation management (TabStop throw new InvalidOperationException ("SetHasFocusFalse and the HasFocus value did not change."); } - SetNeedsDisplay (); + SetNeedsDraw (); } private void RaiseFocusChanged (bool newHasFocus, View? previousFocusedView, View? focusedView) diff --git a/Terminal.Gui/View/View.Text.cs b/Terminal.Gui/View/View.Text.cs index 762c05384..971a8ac83 100644 --- a/Terminal.Gui/View/View.Text.cs +++ b/Terminal.Gui/View/View.Text.cs @@ -148,7 +148,7 @@ public partial class View // Text Property APIs set { TextFormatter.VerticalAlignment = value; - SetNeedsDisplay (); + SetNeedsDraw (); } } @@ -237,6 +237,6 @@ public partial class View // Text Property APIs SetNeedsLayout (); } - SetNeedsDisplay (); + SetNeedsDraw (); } } diff --git a/Terminal.Gui/View/View.cs b/Terminal.Gui/View/View.cs index d89abce75..9c4b687f5 100644 --- a/Terminal.Gui/View/View.cs +++ b/Terminal.Gui/View/View.cs @@ -69,9 +69,9 @@ namespace Terminal.Gui; /// /// /// To flag a region of the View's to be redrawn call -/// +/// /// . -/// To flag the entire view for redraw call . +/// To flag the entire view for redraw call . /// /// /// The method is called when the size or layout of a view has changed. The will @@ -286,7 +286,7 @@ public partial class View : Responder, ISupportInitializeNotification } OnEnabledChanged (); - SetNeedsDisplay (); + SetNeedsDraw (); if (Border is { }) { @@ -363,8 +363,8 @@ public partial class View : Responder, ISupportInitializeNotification SetNeedsLayout (); SuperView?.SetNeedsLayout(); - SetNeedsDisplay (); - SuperView?.SetNeedsDisplay(); + SetNeedsDraw (); + SuperView?.SetNeedsDraw(); } } @@ -470,7 +470,7 @@ public partial class View : Responder, ISupportInitializeNotification SetTitleTextFormatterSize (); SetHotKeyFromTitle (); - SetNeedsDisplay (); + SetNeedsDraw (); #if DEBUG if (string.IsNullOrEmpty (Id)) { diff --git a/Terminal.Gui/Views/Bar.cs b/Terminal.Gui/Views/Bar.cs index e977b537c..516bbbee4 100644 --- a/Terminal.Gui/Views/Bar.cs +++ b/Terminal.Gui/Views/Bar.cs @@ -137,7 +137,7 @@ public class Bar : View, IOrientation, IDesignable set { _alignmentModes = value; - SetNeedsDisplay (); + SetNeedsDraw (); SetNeedsLayout (); } } @@ -165,7 +165,7 @@ public class Bar : View, IOrientation, IDesignable } } - SetNeedsDisplay (); + SetNeedsDraw (); SetNeedsLayout (); } @@ -189,7 +189,7 @@ public class Bar : View, IOrientation, IDesignable if (toRemove is { }) { Remove (toRemove); - SetNeedsDisplay (); + SetNeedsDraw (); SetNeedsLayout (); } diff --git a/Terminal.Gui/Views/ColorBar.cs b/Terminal.Gui/Views/ColorBar.cs index 8fd121e0d..14d8b25b3 100644 --- a/Terminal.Gui/Views/ColorBar.cs +++ b/Terminal.Gui/Views/ColorBar.cs @@ -78,7 +78,7 @@ internal abstract class ColorBar : View, IColorBar void IColorBar.SetValueWithoutRaisingEvent (int v) { _value = v; - SetNeedsDisplay (); + SetNeedsDraw (); } /// @@ -215,7 +215,7 @@ internal abstract class ColorBar : View, IColorBar private void OnValueChanged () { ValueChanged?.Invoke (this, new (in _value)); - SetNeedsDisplay (); + SetNeedsDraw (); } private bool? SetMax () diff --git a/Terminal.Gui/Views/ColorPicker.16.cs b/Terminal.Gui/Views/ColorPicker.16.cs index 8fe69a6dc..91d447578 100644 --- a/Terminal.Gui/Views/ColorPicker.16.cs +++ b/Terminal.Gui/Views/ColorPicker.16.cs @@ -176,7 +176,7 @@ public class ColorPicker16 : View this, new (value) ); - SetNeedsDisplay (); + SetNeedsDraw (); } } diff --git a/Terminal.Gui/Views/ComboBox.cs b/Terminal.Gui/Views/ComboBox.cs index 9005a7ecd..f0a6bfcc7 100644 --- a/Terminal.Gui/Views/ComboBox.cs +++ b/Terminal.Gui/Views/ComboBox.cs @@ -73,7 +73,7 @@ public class ComboBox : View, IDesignable } SetNeedsLayout (); - SetNeedsDisplay (); + SetNeedsDraw (); ShowHideList (Text); }; @@ -118,7 +118,7 @@ public class ComboBox : View, IDesignable { _listview.ColorScheme = value; base.ColorScheme = value; - SetNeedsDisplay (); + SetNeedsDraw (); } } @@ -198,7 +198,7 @@ public class ComboBox : View, IDesignable if (SuperView is { } && SuperView.Subviews.Contains (this)) { Text = string.Empty; - SetNeedsDisplay (); + SetNeedsDraw (); } } } @@ -512,9 +512,9 @@ public class ComboBox : View, IDesignable _listview.TabStop = TabBehavior.NoStop; SuperView?.MoveSubviewToStart (this); - // BUGBUG: SetNeedsDisplay takes Viewport relative coordinates, not Screen + // BUGBUG: SetNeedsDraw takes Viewport relative coordinates, not Screen Rectangle rect = _listview.ViewportToScreen (_listview.IsInitialized ? _listview.Viewport : Rectangle.Empty); - SuperView?.SetNeedsDisplay (rect); + SuperView?.SetNeedsDraw (rect); OnCollapsed (); } @@ -878,7 +878,7 @@ public class ComboBox : View, IDesignable if (isMousePositionValid) { _highlighted = Math.Min (TopItem + me.Position.Y, Source.Count); - SetNeedsDisplay (); + SetNeedsDraw (); } _isFocusing = false; diff --git a/Terminal.Gui/Views/FileDialog.cs b/Terminal.Gui/Views/FileDialog.cs index b309c088b..ca69d53cb 100644 --- a/Terminal.Gui/Views/FileDialog.cs +++ b/Terminal.Gui/Views/FileDialog.cs @@ -494,7 +494,7 @@ public class FileDialog : Dialog MoveSubviewTowardsStart (_btnCancel); } - SetNeedsDisplay(); + SetNeedsDraw(); SetNeedsLayout(); } @@ -636,7 +636,7 @@ public class FileDialog : Dialog if (!IsCompatibleWithOpenMode (f.FullName, out string reason)) { _feedback = reason; - SetNeedsDisplay (); + SetNeedsDraw (); return; } @@ -663,7 +663,7 @@ public class FileDialog : Dialog if (reason is { }) { _feedback = reason; - SetNeedsDisplay (); + SetNeedsDraw (); } return; @@ -1117,7 +1117,7 @@ public class FileDialog : Dialog _tableView.RowOffset = 0; _tableView.SelectedRow = 0; - SetNeedsDisplay (); + SetNeedsDraw (); UpdateNavigationVisibility (); } finally @@ -1402,7 +1402,7 @@ public class FileDialog : Dialog if (reason is { }) { _feedback = reason; - SetNeedsDisplay (); + SetNeedsDraw (); } return false; @@ -1590,7 +1590,7 @@ public class FileDialog : Dialog Parent.WriteStateToTableView (); Parent._spinnerView.Visible = true; - Parent._spinnerView.SetNeedsDisplay (); + Parent._spinnerView.SetNeedsDraw (); } ); } diff --git a/Terminal.Gui/Views/GraphView/GraphView.cs b/Terminal.Gui/Views/GraphView/GraphView.cs index 3654f3a19..0254d8e86 100644 --- a/Terminal.Gui/Views/GraphView/GraphView.cs +++ b/Terminal.Gui/Views/GraphView/GraphView.cs @@ -297,7 +297,7 @@ public class GraphView : View, IDesignable Series.Clear (); Annotations.Clear (); GraphColor = null; - SetNeedsDisplay (); + SetNeedsDraw (); } /// Returns the section of the graph that is represented by the given screen position. @@ -338,7 +338,7 @@ public class GraphView : View, IDesignable ScrollOffset.Y + offsetY ); - SetNeedsDisplay (); + SetNeedsDraw (); } /// diff --git a/Terminal.Gui/Views/HexView.cs b/Terminal.Gui/Views/HexView.cs index babbc9d15..c2fa42186 100644 --- a/Terminal.Gui/Views/HexView.cs +++ b/Terminal.Gui/Views/HexView.cs @@ -199,7 +199,7 @@ public class HexView : View, IDesignable } SetNeedsLayout (); - SetNeedsDisplay (); + SetNeedsDraw (); } } @@ -271,7 +271,7 @@ public class HexView : View, IDesignable } _addressWidth = value; - SetNeedsDisplay (); + SetNeedsDraw (); SetNeedsLayout (); } } @@ -293,7 +293,7 @@ public class HexView : View, IDesignable _displayStart = value; } - SetNeedsDisplay (); + SetNeedsDraw (); } /// @@ -319,7 +319,7 @@ public class HexView : View, IDesignable } _edits = new (); - SetNeedsDisplay (); + SetNeedsDraw (); } /// @@ -415,7 +415,7 @@ public class HexView : View, IDesignable } } - SetNeedsDisplay (); + SetNeedsDraw (); return true; } @@ -581,7 +581,7 @@ public class HexView : View, IDesignable /// protected void RaisePositionChanged () { - SetNeedsDisplay (); + SetNeedsDraw (); HexViewEventArgs args = new (Address, Position, BytesPerLine); OnPositionChanged (args); @@ -786,7 +786,7 @@ public class HexView : View, IDesignable if (Address >= DisplayStart + BytesPerLine * Viewport.Height) { SetDisplayStart (DisplayStart + bytes); - SetNeedsDisplay (); + SetNeedsDraw (); } else { @@ -804,7 +804,7 @@ public class HexView : View, IDesignable if (Address >= DisplayStart + BytesPerLine * Viewport.Height) { SetDisplayStart (Address); - SetNeedsDisplay (); + SetNeedsDraw (); } else { @@ -818,7 +818,7 @@ public class HexView : View, IDesignable { // This lets address go past the end of the stream one, enabling adding to the stream. Address = Math.Min (Address / BytesPerLine * BytesPerLine + BytesPerLine - 1, GetEditedSize ()); - SetNeedsDisplay (); + SetNeedsDraw (); return true; } @@ -826,7 +826,7 @@ public class HexView : View, IDesignable private bool MoveHome () { DisplayStart = 0; - SetNeedsDisplay (); + SetNeedsDraw (); return true; } @@ -855,7 +855,7 @@ public class HexView : View, IDesignable if (Address - 1 < DisplayStart) { SetDisplayStart (_displayStart - BytesPerLine); - SetNeedsDisplay (); + SetNeedsDraw (); } else { @@ -892,7 +892,7 @@ public class HexView : View, IDesignable if (Address >= DisplayStart + BytesPerLine * Viewport.Height) { SetDisplayStart (DisplayStart + BytesPerLine); - SetNeedsDisplay (); + SetNeedsDraw (); } else { @@ -917,7 +917,7 @@ public class HexView : View, IDesignable private bool MoveLeftStart () { Address = Address / BytesPerLine * BytesPerLine; - SetNeedsDisplay (); + SetNeedsDraw (); return true; } @@ -934,7 +934,7 @@ public class HexView : View, IDesignable if (Address < DisplayStart) { SetDisplayStart (DisplayStart - bytes); - SetNeedsDisplay (); + SetNeedsDraw (); } else { @@ -954,7 +954,7 @@ public class HexView : View, IDesignable var delta = (int)(pos - DisplayStart); int line = delta / BytesPerLine; - SetNeedsDisplay (new (0, line, Viewport.Width, 1)); + SetNeedsDraw (new (0, line, Viewport.Width, 1)); } /// diff --git a/Terminal.Gui/Views/ListView.cs b/Terminal.Gui/Views/ListView.cs index 0f07ffb48..ab4e98115 100644 --- a/Terminal.Gui/Views/ListView.cs +++ b/Terminal.Gui/Views/ListView.cs @@ -247,7 +247,7 @@ public class ListView : View, IDesignable set { _allowsMarking = value; - SetNeedsDisplay (); + SetNeedsDraw (); } } @@ -274,7 +274,7 @@ public class ListView : View, IDesignable } } - SetNeedsDisplay (); + SetNeedsDraw (); } } @@ -302,7 +302,7 @@ public class ListView : View, IDesignable } Viewport = Viewport with { X = value }; - SetNeedsDisplay (); + SetNeedsDraw (); } } @@ -361,7 +361,7 @@ public class ListView : View, IDesignable KeystrokeNavigator.Collection = _source?.ToList (); _selected = -1; _lastSelectedItem = -1; - SetNeedsDisplay (); + SetNeedsDraw (); } } @@ -375,7 +375,7 @@ public class ListView : View, IDesignable SelectedItem = Source.Count - 1; } - SetNeedsDisplay (); + SetNeedsDraw (); OnCollectionChanged (e); } @@ -482,7 +482,7 @@ public class ListView : View, IDesignable if (UnmarkAllButSelected ()) { Source.SetMark (SelectedItem, !Source.IsMarked (SelectedItem)); - SetNeedsDisplay (); + SetNeedsDraw (); return Source.IsMarked (SelectedItem); } @@ -558,7 +558,7 @@ public class ListView : View, IDesignable } OnSelectedChanged (); - SetNeedsDisplay (); + SetNeedsDraw (); if (me.Flags == MouseFlags.Button1DoubleClicked) { @@ -585,7 +585,7 @@ public class ListView : View, IDesignable // This can occur if the backing data source changes. _selected = _source.Count - 1; OnSelectedChanged (); - SetNeedsDisplay (); + SetNeedsDraw (); } else if (_selected + 1 < _source.Count) { @@ -602,17 +602,17 @@ public class ListView : View, IDesignable } OnSelectedChanged (); - SetNeedsDisplay (); + SetNeedsDraw (); } else if (_selected == 0) { OnSelectedChanged (); - SetNeedsDisplay (); + SetNeedsDraw (); } else if (_selected >= Viewport.Y + Viewport.Height) { Viewport = Viewport with { Y = _source.Count - Viewport.Height }; - SetNeedsDisplay (); + SetNeedsDraw (); } return true; @@ -637,7 +637,7 @@ public class ListView : View, IDesignable } OnSelectedChanged (); - SetNeedsDisplay (); + SetNeedsDraw (); } return true; @@ -652,7 +652,7 @@ public class ListView : View, IDesignable _selected = 0; Viewport = Viewport with { Y = _selected }; OnSelectedChanged (); - SetNeedsDisplay (); + SetNeedsDraw (); } return true; @@ -691,7 +691,7 @@ public class ListView : View, IDesignable } OnSelectedChanged (); - SetNeedsDisplay (); + SetNeedsDraw (); } return true; @@ -713,7 +713,7 @@ public class ListView : View, IDesignable _selected = n; Viewport = Viewport with { Y = _selected }; OnSelectedChanged (); - SetNeedsDisplay (); + SetNeedsDraw (); } return true; @@ -736,7 +736,7 @@ public class ListView : View, IDesignable // This can occur if the backing data source changes. _selected = _source.Count - 1; OnSelectedChanged (); - SetNeedsDisplay (); + SetNeedsDraw (); } else if (_selected > 0) { @@ -757,12 +757,12 @@ public class ListView : View, IDesignable } OnSelectedChanged (); - SetNeedsDisplay (); + SetNeedsDraw (); } else if (_selected < Viewport.Y) { Viewport = Viewport with { Y = _selected }; - SetNeedsDisplay (); + SetNeedsDraw (); } return true; @@ -886,7 +886,7 @@ public class ListView : View, IDesignable { SelectedItem = (int)newItem; EnsureSelectedItemVisible (); - SetNeedsDisplay (); + SetNeedsDraw (); return true; } diff --git a/Terminal.Gui/Views/Menu/Menu.cs b/Terminal.Gui/Views/Menu/Menu.cs index 54f29a6fe..de9b47de0 100644 --- a/Terminal.Gui/Views/Menu/Menu.cs +++ b/Terminal.Gui/Views/Menu/Menu.cs @@ -290,7 +290,7 @@ internal sealed class Menu : View if (!disabled && (_host.UseSubMenusSingleFrame || !CheckSubMenu ())) { - SetNeedsDisplay (); + SetNeedsDraw (); SetParentSetNeedsDisplay (); return true; @@ -709,7 +709,7 @@ internal sealed class Menu : View } while (_barItems?.Children? [_currentChild] is null || disabled); - SetNeedsDisplay (); + SetNeedsDraw (); SetParentSetNeedsDisplay (); if (!_host.UseSubMenusSingleFrame) @@ -790,7 +790,7 @@ internal sealed class Menu : View } while (_barItems.Children [_currentChild] is null || disabled); - SetNeedsDisplay (); + SetNeedsDraw (); SetParentSetNeedsDisplay (); if (!_host.UseSubMenusSingleFrame) @@ -807,12 +807,12 @@ internal sealed class Menu : View { foreach (Menu menu in _host._openSubMenu) { - menu.SetNeedsDisplay (); + menu.SetNeedsDraw (); } } - _host._openMenu?.SetNeedsDisplay (); - _host.SetNeedsDisplay (); + _host._openMenu?.SetNeedsDraw (); + _host.SetNeedsDraw (); } protected override bool OnMouseEvent (MouseEventArgs me) @@ -895,7 +895,7 @@ internal sealed class Menu : View if (_host.UseSubMenusSingleFrame || !CheckSubMenu ()) { - SetNeedsDisplay (); + SetNeedsDraw (); SetParentSetNeedsDisplay (); return me.Handled = true; @@ -942,7 +942,7 @@ internal sealed class Menu : View } else { - SetNeedsDisplay (); + SetNeedsDraw (); SetParentSetNeedsDisplay (); } diff --git a/Terminal.Gui/Views/Menu/MenuBar.cs b/Terminal.Gui/Views/Menu/MenuBar.cs index af3667b46..269f2a18a 100644 --- a/Terminal.Gui/Views/Menu/MenuBar.cs +++ b/Terminal.Gui/Views/Menu/MenuBar.cs @@ -244,7 +244,7 @@ public class MenuBar : View, IDesignable if (value && UseKeysUpDownAsKeysLeftRight) { _useKeysUpDownAsKeysLeftRight = false; - SetNeedsDisplay (); + SetNeedsDraw (); } } } @@ -408,7 +408,7 @@ public class MenuBar : View, IDesignable } _selected = 0; - SetNeedsDisplay (); + SetNeedsDraw (); _previousFocused = (SuperView is null ? Application.Top?.Focused : SuperView.Focused)!; OpenMenu (_selected); @@ -475,7 +475,7 @@ public class MenuBar : View, IDesignable } OpenMenu (idx, sIdx, subMenu); - SetNeedsDisplay (); + SetNeedsDraw (); } internal void CleanUp () @@ -497,7 +497,7 @@ public class MenuBar : View, IDesignable _lastFocused.SetFocus (); } - SetNeedsDisplay (); + SetNeedsDraw (); if (Application.MouseGrabView is { } && Application.MouseGrabView is MenuBar && Application.MouseGrabView != this) { @@ -590,7 +590,7 @@ public class MenuBar : View, IDesignable Application.Top?.Remove (_openMenu); } - SetNeedsDisplay (); + SetNeedsDraw (); if (_previousFocused is Menu && _openMenu is { } && _previousFocused.ToString () != OpenCurrentMenu!.ToString ()) { @@ -652,7 +652,7 @@ public class MenuBar : View, IDesignable case true: _selectedSub = -1; - SetNeedsDisplay (); + SetNeedsDraw (); RemoveAllOpensSubMenus (); OpenCurrentMenu!._previousSubFocused!.SetFocus (); _openSubMenu = null; @@ -770,7 +770,7 @@ public class MenuBar : View, IDesignable return; } - SetNeedsDisplay (); + SetNeedsDraw (); if (UseKeysUpDownAsKeysLeftRight) { @@ -989,7 +989,7 @@ public class MenuBar : View, IDesignable { _selectedSub--; RemoveSubMenu (_selectedSub, ignoreUseSubMenusSingleFrame); - SetNeedsDisplay (); + SetNeedsDraw (); } else { @@ -1136,7 +1136,7 @@ public class MenuBar : View, IDesignable LastFocused?.SetFocus (); } - SetNeedsDisplay (); + SetNeedsDraw (); } private Point GetLocationOffset () @@ -1165,14 +1165,14 @@ public class MenuBar : View, IDesignable } OpenMenu (_selected); - SetNeedsDisplay (); + SetNeedsDraw (); } private void MoveRight () { _selected = (_selected + 1) % Menus.Length; OpenMenu (_selected); - SetNeedsDisplay (); + SetNeedsDraw (); } private bool ProcessMenu (int i, MenuBarItem mi) @@ -1215,7 +1215,7 @@ public class MenuBar : View, IDesignable } } - SetNeedsDisplay (); + SetNeedsDraw (); return true; } @@ -1322,7 +1322,7 @@ public class MenuBar : View, IDesignable if (value && UseSubMenusSingleFrame) { UseSubMenusSingleFrame = false; - SetNeedsDisplay (); + SetNeedsDraw (); } } } diff --git a/Terminal.Gui/Views/ProgressBar.cs b/Terminal.Gui/Views/ProgressBar.cs index de8ae3cfa..9abb55478 100644 --- a/Terminal.Gui/Views/ProgressBar.cs +++ b/Terminal.Gui/Views/ProgressBar.cs @@ -71,7 +71,7 @@ public class ProgressBar : View, IDesignable { _fraction = Math.Min (value, 1); _isActivity = false; - SetNeedsDisplay (); + SetNeedsDraw (); } } @@ -109,7 +109,7 @@ public class ProgressBar : View, IDesignable break; } - SetNeedsDisplay (); + SetNeedsDraw (); } } @@ -252,7 +252,7 @@ public class ProgressBar : View, IDesignable } } - SetNeedsDisplay (); + SetNeedsDraw (); } private void PopulateActivityPos () diff --git a/Terminal.Gui/Views/RadioGroup.cs b/Terminal.Gui/Views/RadioGroup.cs index 45c3517ee..a110a7d54 100644 --- a/Terminal.Gui/Views/RadioGroup.cs +++ b/Terminal.Gui/Views/RadioGroup.cs @@ -354,7 +354,7 @@ public class RadioGroup : View, IDesignable, IOrientation OnSelectedItemChanged (value, SelectedItem); SelectedItemChanged?.Invoke (this, new (SelectedItem, savedSelected)); - SetNeedsDisplay (); + SetNeedsDraw (); return true; } @@ -523,7 +523,7 @@ public class RadioGroup : View, IDesignable, IOrientation if (Cursor + 1 < _radioLabels.Count) { Cursor++; - SetNeedsDisplay (); + SetNeedsDraw (); return true; } @@ -551,7 +551,7 @@ public class RadioGroup : View, IDesignable, IOrientation if (Cursor > 0) { Cursor--; - SetNeedsDisplay (); + SetNeedsDraw (); return true; } diff --git a/Terminal.Gui/Views/ScrollBarView.cs b/Terminal.Gui/Views/ScrollBarView.cs index 22a229c1b..12e53e2bf 100644 --- a/Terminal.Gui/Views/ScrollBarView.cs +++ b/Terminal.Gui/Views/ScrollBarView.cs @@ -115,7 +115,7 @@ public class ScrollBarView : View if (_autoHideScrollBars != value) { _autoHideScrollBars = value; - SetNeedsDisplay (); + SetNeedsDraw (); } } } @@ -903,7 +903,7 @@ public class ScrollBarView : View if (newPosition < 0) { _position = 0; - SetNeedsDisplay (); + SetNeedsDraw (); return; } @@ -928,7 +928,7 @@ public class ScrollBarView : View } OnChangedPosition (); - SetNeedsDisplay (); + SetNeedsDraw (); } // BUGBUG: v2 - rationalize this with View.SetMinWidthHeight diff --git a/Terminal.Gui/Views/ScrollView.cs b/Terminal.Gui/Views/ScrollView.cs index e19fab1a3..5e34fce5f 100644 --- a/Terminal.Gui/Views/ScrollView.cs +++ b/Terminal.Gui/Views/ScrollView.cs @@ -191,7 +191,7 @@ public class ScrollView : View _horizontal.AutoHideScrollBars = value; } - SetNeedsDisplay (); + SetNeedsDraw (); } } } @@ -228,7 +228,7 @@ public class ScrollView : View // _contentView.Frame = new Rectangle (_contentOffset, value); // _vertical.Size = GetContentSize ().Height; // _horizontal.Size = GetContentSize ().Width; - // SetNeedsDisplay (); + // SetNeedsDraw (); // } // } //} @@ -374,7 +374,7 @@ public class ScrollView : View /// protected override bool OnDrawingContent (Rectangle viewport) { - SetViewsNeedsDisplay (); + SetViewsNeedsDraw (); // TODO: It's bad practice for views to always clear a view. It negates clipping. ClearViewport (); @@ -469,7 +469,7 @@ public class ScrollView : View return view; } - SetNeedsDisplay (); + SetNeedsDraw (); View container = view?.SuperView; if (container == this) @@ -628,14 +628,14 @@ public class ScrollView : View { _horizontal.Position = Math.Max (0, -_contentOffset.X); } - SetNeedsDisplay (); + SetNeedsDraw (); } - private void SetViewsNeedsDisplay () + private void SetViewsNeedsDraw () { foreach (View view in _contentView.Subviews) { - view.SetNeedsDisplay (); + view.SetNeedsDraw (); } } diff --git a/Terminal.Gui/Views/Shortcut.cs b/Terminal.Gui/Views/Shortcut.cs index a3107d4a7..eadb3d73d 100644 --- a/Terminal.Gui/Views/Shortcut.cs +++ b/Terminal.Gui/Views/Shortcut.cs @@ -136,7 +136,7 @@ public class Shortcut : View, IOrientation, IDesignable } // Helper to set Width consistently - public Dim GetWidthDimAuto () + internal Dim GetWidthDimAuto () { return Dim.Auto ( DimAutoStyle.Content, @@ -647,7 +647,7 @@ public class Shortcut : View, IOrientation, IDesignable CommandView.SetNeedsLayout (); HelpView.SetNeedsLayout (); KeyView.SetNeedsLayout (); - SetSubViewNeedsDisplay (); + SetSubViewNeedsDraw (); } } diff --git a/Terminal.Gui/Views/Slider.cs b/Terminal.Gui/Views/Slider.cs index 6caf925c8..daba5466c 100644 --- a/Terminal.Gui/Views/Slider.cs +++ b/Terminal.Gui/Views/Slider.cs @@ -222,7 +222,7 @@ public class Slider : View, IOrientation // Todo: Custom logic to preserve options. _setOptions.Clear (); - SetNeedsDisplay (); + SetNeedsDraw (); } } @@ -353,7 +353,7 @@ public class Slider : View, IOrientation public virtual void OnOptionsChanged () { OptionsChanged?.Invoke (this, new (GetSetOptionDictionary ())); - SetNeedsDisplay (); + SetNeedsDraw (); } /// Event raised When the option is hovered with the keys or the mouse. @@ -1311,7 +1311,7 @@ public class Slider : View, IOrientation Application.GrabMouse (this); } - SetNeedsDisplay (); + SetNeedsDraw (); return true; } @@ -1345,7 +1345,7 @@ public class Slider : View, IOrientation } } - SetNeedsDisplay (); + SetNeedsDraw (); return true; } @@ -1379,7 +1379,7 @@ public class Slider : View, IOrientation } } - SetNeedsDisplay (); + SetNeedsDraw (); mouseEvent.Handled = true; diff --git a/Terminal.Gui/Views/SpinnerView/SpinnerStyle.cs b/Terminal.Gui/Views/SpinnerView/SpinnerStyle.cs index 09d435893..c4b5f8415 100644 --- a/Terminal.Gui/Views/SpinnerView/SpinnerStyle.cs +++ b/Terminal.Gui/Views/SpinnerView/SpinnerStyle.cs @@ -54,7 +54,7 @@ public abstract class SpinnerStyle /// /// /// This is the maximum speed the spinner will rotate at. You still need to call - /// or to advance/start animation. + /// or to advance/start animation. /// public abstract int SpinDelay { get; } diff --git a/Terminal.Gui/Views/SpinnerView/SpinnerView.cs b/Terminal.Gui/Views/SpinnerView/SpinnerView.cs index 9c9e28fae..1122fb8a6 100644 --- a/Terminal.Gui/Views/SpinnerView/SpinnerView.cs +++ b/Terminal.Gui/Views/SpinnerView/SpinnerView.cs @@ -10,8 +10,8 @@ namespace Terminal.Gui; /// A which displays (by default) a spinning line character. /// -/// By default animation only occurs when you call . Use -/// to make the automate calls to . +/// By default animation only occurs when you call . Use +/// to make the automate calls to . /// public class SpinnerView : View, IDesignable { @@ -115,7 +115,7 @@ public class SpinnerView : View, IDesignable /// ignored based on . /// /// Ensure this method is called on the main UI thread e.g. via - public void AdvanceAnimation (bool setNeedsDisplay = true) + public void AdvanceAnimation (bool setNeedsDraw = true) { if (DateTime.Now - _lastRender > TimeSpan.FromMilliseconds (SpinDelay)) { @@ -176,9 +176,9 @@ public class SpinnerView : View, IDesignable _lastRender = DateTime.Now; } - if (setNeedsDisplay) + if (setNeedsDraw) { - SetNeedsDisplay (); + SetNeedsDraw (); } } diff --git a/Terminal.Gui/Views/Tab.cs b/Terminal.Gui/Views/Tab.cs index be493ecf0..b683b04b6 100644 --- a/Terminal.Gui/Views/Tab.cs +++ b/Terminal.Gui/Views/Tab.cs @@ -22,7 +22,7 @@ public class Tab : View set { _displayText = value; - SetNeedsDisplay (); + SetNeedsDraw (); } } diff --git a/Terminal.Gui/Views/TabView.cs b/Terminal.Gui/Views/TabView.cs index 82231d918..bf22e4ece 100644 --- a/Terminal.Gui/Views/TabView.cs +++ b/Terminal.Gui/Views/TabView.cs @@ -216,7 +216,7 @@ public class TabView : View /// /// Updates the control to use the latest state settings in . This can change the size of the /// client area of the tab (for rendering the selected tab's content). This method includes a call to - /// . + /// . /// public void ApplyStyleChanges () { @@ -288,7 +288,7 @@ public class TabView : View /// Updates to be a valid index of . /// The value to validate. - /// Changes will not be immediately visible in the display until you call . + /// Changes will not be immediately visible in the display until you call . /// The valid for the given value. public int EnsureValidScrollOffsets (int value) { return Math.Max (Math.Min (value, Tabs.Count - 1), 0); } @@ -312,7 +312,7 @@ public class TabView : View { Rectangle savedClip = SetClip (); _tabsBar.Draw (); - _contentView.SetNeedsDisplay (); + _contentView.SetNeedsDraw (); _contentView.Draw (); if (Driver is { }) diff --git a/Terminal.Gui/Views/TableView/CheckBoxTableSourceWrapper.cs b/Terminal.Gui/Views/TableView/CheckBoxTableSourceWrapper.cs index abbb2c704..c3c47a64c 100644 --- a/Terminal.Gui/Views/TableView/CheckBoxTableSourceWrapper.cs +++ b/Terminal.Gui/Views/TableView/CheckBoxTableSourceWrapper.cs @@ -147,7 +147,7 @@ public abstract class CheckBoxTableSourceWrapperBase : ITableSource } e.Cancel = true; - tableView.SetNeedsDisplay (); + tableView.SetNeedsDraw (); } private void TableView_MouseClick (object sender, MouseEventArgs e) @@ -171,7 +171,7 @@ public abstract class CheckBoxTableSourceWrapperBase : ITableSource // otherwise it ticks all rows ToggleAllRows (); e.Handled = true; - tableView.SetNeedsDisplay (); + tableView.SetNeedsDraw (); } else if (hit.HasValue && hit.Value.X == 0) { @@ -186,7 +186,7 @@ public abstract class CheckBoxTableSourceWrapperBase : ITableSource } e.Handled = true; - tableView.SetNeedsDisplay (); + tableView.SetNeedsDraw (); } } } diff --git a/Terminal.Gui/Views/TableView/TableView.cs b/Terminal.Gui/Views/TableView/TableView.cs index c25ff1f76..c31ebe738 100644 --- a/Terminal.Gui/Views/TableView/TableView.cs +++ b/Terminal.Gui/Views/TableView/TableView.cs @@ -321,7 +321,7 @@ public class TableView : View, IDesignable set { columnOffset = TableIsNullOrInvisible () ? 0 : Math.Max (0, Math.Min (Table.Columns - 1, value)); - SetNeedsDisplay (); + SetNeedsDraw (); } } @@ -583,7 +583,7 @@ public class TableView : View, IDesignable /// not been set. /// /// - /// Changes will not be immediately visible in the display until you call + /// Changes will not be immediately visible in the display until you call /// public void EnsureSelectedCellIsVisible () { @@ -644,7 +644,7 @@ public class TableView : View, IDesignable /// (by adjusting them to the nearest existing cell). Has no effect if has not been set. /// /// - /// Changes will not be immediately visible in the display until you call + /// Changes will not be immediately visible in the display until you call /// public void EnsureValidScrollOffsets () { @@ -663,7 +663,7 @@ public class TableView : View, IDesignable /// has not been set. /// /// - /// Changes will not be immediately visible in the display until you call + /// Changes will not be immediately visible in the display until you call /// public void EnsureValidSelection () { @@ -830,28 +830,28 @@ public class TableView : View, IDesignable case MouseFlags.WheeledDown: RowOffset++; EnsureValidScrollOffsets (); - SetNeedsDisplay (); + SetNeedsDraw (); return true; case MouseFlags.WheeledUp: RowOffset--; EnsureValidScrollOffsets (); - SetNeedsDisplay (); + SetNeedsDraw (); return true; case MouseFlags.WheeledRight: ColumnOffset++; EnsureValidScrollOffsets (); - SetNeedsDisplay (); + SetNeedsDraw (); return true; case MouseFlags.WheeledLeft: ColumnOffset--; EnsureValidScrollOffsets (); - SetNeedsDisplay (); + SetNeedsDraw (); return true; } @@ -867,7 +867,7 @@ public class TableView : View, IDesignable { ColumnOffset--; EnsureValidScrollOffsets (); - SetNeedsDisplay (); + SetNeedsDraw (); } if (scrollRightPoint != null @@ -876,7 +876,7 @@ public class TableView : View, IDesignable { ColumnOffset++; EnsureValidScrollOffsets (); - SetNeedsDisplay (); + SetNeedsDraw (); } Point? hit = ScreenToCell (boundsX, boundsY); @@ -1227,12 +1227,12 @@ public class TableView : View, IDesignable /// Updates the view to reflect changes to and to ( / /// ) etc /// - /// This always calls + /// This always calls public void Update () { if (!IsInitialized || TableIsNullOrInvisible ()) { - SetNeedsDisplay (); + SetNeedsDraw (); return; } @@ -1242,7 +1242,7 @@ public class TableView : View, IDesignable EnsureSelectedCellIsVisible (); - SetNeedsDisplay (); + SetNeedsDraw (); } /// Invokes the event @@ -1585,7 +1585,7 @@ public class TableView : View, IDesignable SelectedRow = match; EnsureValidSelection (); EnsureSelectedCellIsVisible (); - SetNeedsDisplay (); + SetNeedsDraw (); return true; } diff --git a/Terminal.Gui/Views/TableView/TreeTableSource.cs b/Terminal.Gui/Views/TableView/TreeTableSource.cs index c3458b32d..9125c0c95 100644 --- a/Terminal.Gui/Views/TableView/TreeTableSource.cs +++ b/Terminal.Gui/Views/TableView/TreeTableSource.cs @@ -162,7 +162,7 @@ public class TreeTableSource : IEnumerableTableSource, IDisposable where T if (e.Handled) { _tree.InvalidateLineMap (); - _tableView.SetNeedsDisplay (); + _tableView.SetNeedsDraw (); } } @@ -197,7 +197,7 @@ public class TreeTableSource : IEnumerableTableSource, IDisposable where T if (e.Handled) { _tree.InvalidateLineMap (); - _tableView.SetNeedsDisplay (); + _tableView.SetNeedsDraw (); } } } diff --git a/Terminal.Gui/Views/TextField.cs b/Terminal.Gui/Views/TextField.cs index e903b1540..d3082d449 100644 --- a/Terminal.Gui/Views/TextField.cs +++ b/Terminal.Gui/Views/TextField.cs @@ -562,7 +562,7 @@ public class TextField : View } Adjust (); - SetNeedsDisplay (); + SetNeedsDraw (); } } @@ -585,7 +585,7 @@ public class TextField : View _selectedText = null; _start = 0; SelectedLength = 0; - SetNeedsDisplay (); + SetNeedsDraw (); } /// Allows clearing the items updating the original text. @@ -627,7 +627,7 @@ public class TextField : View _selectedStart = 0; MoveEndExtend (); DeleteCharLeft (false); - SetNeedsDisplay (); + SetNeedsDraw (); } /// Deletes the character to the left. @@ -909,7 +909,7 @@ public class TextField : View ShowContextMenu (); } - //SetNeedsDisplay (); + //SetNeedsDraw (); return true; @@ -1095,7 +1095,7 @@ public class TextField : View _cursorPosition = Math.Min (selStart + cbTxt.GetRuneCount (), _text.Count); ClearAllSelection (); - SetNeedsDisplay (); + SetNeedsDraw (); Adjust (); } @@ -1144,7 +1144,7 @@ public class TextField : View _selectedStart = 0; MoveEndExtend (); - SetNeedsDisplay (); + SetNeedsDraw (); } ///// @@ -1193,7 +1193,7 @@ public class TextField : View //SetContentSize(new (TextModel.DisplaySize (_text).size, 1)); int offB = OffSetBackground (); - bool need = NeedsDisplay || !Used; + bool need = NeedsDraw || !Used; if (_cursorPosition < ScrollOffset) { @@ -1218,7 +1218,7 @@ public class TextField : View if (need) { - SetNeedsDisplay (); + SetNeedsDraw (); } else { @@ -1713,7 +1713,7 @@ public class TextField : View _selectedText = null; } - SetNeedsDisplay (); + SetNeedsDraw (); } else if (SelectedLength > 0 || _selectedText is { }) { @@ -1793,7 +1793,7 @@ public class TextField : View private void SetOverwrite (bool overwrite) { Used = overwrite; - SetNeedsDisplay (); + SetNeedsDraw (); } private void SetSelectedStartSelectedLength () diff --git a/Terminal.Gui/Views/TextValidateField.cs b/Terminal.Gui/Views/TextValidateField.cs index 1515edd4d..c561197ab 100644 --- a/Terminal.Gui/Views/TextValidateField.cs +++ b/Terminal.Gui/Views/TextValidateField.cs @@ -526,7 +526,7 @@ namespace Terminal.Gui _provider.Text = value; - SetNeedsDisplay (); + SetNeedsDraw (); } } @@ -544,7 +544,7 @@ namespace Terminal.Gui _cursorPosition = c; SetFocus (); - SetNeedsDisplay (); + SetNeedsDraw (); return true; } @@ -657,7 +657,7 @@ namespace Terminal.Gui _cursorPosition = _provider.CursorLeft (_cursorPosition); _provider.Delete (_cursorPosition); - SetNeedsDisplay (); + SetNeedsDraw (); return true; } @@ -673,7 +673,7 @@ namespace Terminal.Gui int current = _cursorPosition; _cursorPosition = _provider.CursorLeft (_cursorPosition); - SetNeedsDisplay (); + SetNeedsDraw (); return current != _cursorPosition; } @@ -689,7 +689,7 @@ namespace Terminal.Gui int current = _cursorPosition; _cursorPosition = _provider.CursorRight (_cursorPosition); - SetNeedsDisplay (); + SetNeedsDraw (); return current != _cursorPosition; } @@ -704,7 +704,7 @@ namespace Terminal.Gui } _provider.Delete (_cursorPosition); - SetNeedsDisplay (); + SetNeedsDraw (); return true; } @@ -714,7 +714,7 @@ namespace Terminal.Gui private bool EndKeyHandler () { _cursorPosition = _provider.CursorEnd (); - SetNeedsDisplay (); + SetNeedsDraw (); return true; } @@ -745,7 +745,7 @@ namespace Terminal.Gui private bool HomeKeyHandler () { _cursorPosition = _provider.CursorStart (); - SetNeedsDisplay (); + SetNeedsDraw (); return true; } diff --git a/Terminal.Gui/Views/TextView.cs b/Terminal.Gui/Views/TextView.cs index fd0414fe9..7e409b439 100644 --- a/Terminal.Gui/Views/TextView.cs +++ b/Terminal.Gui/Views/TextView.cs @@ -2457,7 +2457,7 @@ public class TextView : View AllowsTab = false; } - SetNeedsDisplay (); + SetNeedsDraw (); } } @@ -2489,7 +2489,7 @@ public class TextView : View _tabWidth = 0; } - SetNeedsDisplay (); + SetNeedsDraw (); } } @@ -2522,7 +2522,7 @@ public class TextView : View CurrentRow = value.Y < 0 ? 0 : value.Y > _model.Count - 1 ? Math.Max (_model.Count - 1, 0) : value.Y; - SetNeedsDisplay (); + SetNeedsDraw (); Adjust (); } } @@ -2605,12 +2605,12 @@ public class TextView : View _model.LoadString (Text); } - SetNeedsDisplay (); + SetNeedsDraw (); } else if (_multiline && _savedHeight is { }) { Height = _savedHeight; - SetNeedsDisplay (); + SetNeedsDraw (); } KeyBindings.Remove (Key.Enter); @@ -2629,7 +2629,7 @@ public class TextView : View { _isReadOnly = value; - SetNeedsDisplay (); + SetNeedsDraw (); WrapTextModel (); Adjust (); } @@ -2683,7 +2683,7 @@ public class TextView : View _selectionStartColumn = value < 0 ? 0 : value > line.Count ? line.Count : value; IsSelecting = true; - SetNeedsDisplay (); + SetNeedsDraw (); Adjust (); } } @@ -2697,7 +2697,7 @@ public class TextView : View _selectionStartRow = value < 0 ? 0 : value > _model.Count - 1 ? Math.Max (_model.Count - 1, 0) : value; IsSelecting = true; - SetNeedsDisplay (); + SetNeedsDraw (); Adjust (); } } @@ -2715,7 +2715,7 @@ public class TextView : View AllowsTab = true; } - SetNeedsDisplay (); + SetNeedsDraw (); } } @@ -2747,7 +2747,7 @@ public class TextView : View } OnTextChanged (); - SetNeedsDisplay (); + SetNeedsDraw (); _historyText.Clear (_model.GetAllLines ()); } @@ -2795,7 +2795,7 @@ public class TextView : View _model = _wrapManager.Model; } - SetNeedsDisplay (); + SetNeedsDraw (); } } @@ -2809,7 +2809,7 @@ public class TextView : View SetWrapModel (); bool res = _model.CloseFile (); ResetPosition (); - SetNeedsDisplay (); + SetNeedsDraw (); UpdateWrapModel (); return res; @@ -2978,7 +2978,7 @@ public class TextView : View _selectionStartRow = 0; MoveBottomEndExtend (); DeleteCharLeft (); - SetNeedsDisplay (); + SetNeedsDraw (); } /// Deletes all the selected or a single character at left from the position of the cursor. @@ -3196,7 +3196,7 @@ public class TextView : View InsertText (key); - if (NeedsDisplay) + if (NeedsDraw) { Adjust (); } @@ -3225,7 +3225,7 @@ public class TextView : View finally { UpdateWrapModel (); - SetNeedsDisplay (); + SetNeedsDraw (); Adjust (); } @@ -3243,7 +3243,7 @@ public class TextView : View _model.LoadStream (stream); _historyText.Clear (_model.GetAllLines ()); ResetPosition (); - SetNeedsDisplay (); + SetNeedsDraw (); UpdateWrapModel (); } @@ -3255,7 +3255,7 @@ public class TextView : View _model.LoadCells (cells, ColorScheme?.Focus); _historyText.Clear (_model.GetAllLines ()); ResetPosition (); - SetNeedsDisplay (); + SetNeedsDraw (); UpdateWrapModel (); InheritsPreviousAttribute = true; } @@ -3269,7 +3269,7 @@ public class TextView : View _model.LoadListCells (cellsList, ColorScheme?.Focus); _historyText.Clear (_model.GetAllLines ()); ResetPosition (); - SetNeedsDisplay (); + SetNeedsDraw (); UpdateWrapModel (); } @@ -3325,7 +3325,7 @@ public class TextView : View } else { - SetNeedsDisplay (); + SetNeedsDraw (); } _lastWasKill = false; @@ -3534,7 +3534,7 @@ public class TextView : View _leftColumn = 0; TrackColumn (); PositionCursor (); - SetNeedsDisplay (); + SetNeedsDraw (); } /// @@ -3758,7 +3758,7 @@ public class TextView : View HistoryText.LineStatus.Replaced ); - SetNeedsDisplay (); + SetNeedsDraw (); OnContentsChanged (); } else @@ -3780,7 +3780,7 @@ public class TextView : View ); } - SetNeedsDisplay (); + SetNeedsDraw (); } UpdateWrapModel (); @@ -3803,8 +3803,8 @@ public class TextView : View // BUGBUG: customized rect aren't supported now because the Redraw isn't using the Intersect method. //var minRow = Math.Min (Math.Max (Math.Min (selectionStartRow, currentRow) - topRow, 0), Viewport.Height); //var maxRow = Math.Min (Math.Max (Math.Max (selectionStartRow, currentRow) - topRow, 0), Viewport.Height); - //SetNeedsDisplay (new (0, minRow, Viewport.Width, maxRow)); - SetNeedsDisplay (); + //SetNeedsDraw (new (0, minRow, Viewport.Width, maxRow)); + SetNeedsDraw (); } List line = _model.GetLine (CurrentRow); @@ -3919,7 +3919,7 @@ public class TextView : View _leftColumn = Math.Max (!_wordWrap && idx > maxlength - 1 ? maxlength - 1 : idx, 0); } - SetNeedsDisplay (); + SetNeedsDraw (); } /// Select all text. @@ -3935,7 +3935,7 @@ public class TextView : View _selectionStartRow = 0; CurrentColumn = _model.GetLine (_model.Count - 1).Count; CurrentRow = _model.Count - 1; - SetNeedsDisplay (); + SetNeedsDraw (); } ///// Raised when the property of the changes. @@ -3962,7 +3962,7 @@ public class TextView : View /// /// Sets the to an appropriate color for rendering the given /// of the current . Override to provide custom coloring by calling - /// Defaults to . + /// Defaults to . /// /// The line. /// The col index. @@ -3987,7 +3987,7 @@ public class TextView : View /// /// Sets the to an appropriate color for rendering the given /// of the current . Override to provide custom coloring by calling - /// Defaults to . + /// Defaults to . /// /// The line. /// The col index. @@ -4017,7 +4017,7 @@ public class TextView : View /// /// Sets the to an appropriate color for rendering the given /// of the current . Override to provide custom coloring by calling - /// Defaults to . + /// Defaults to . /// /// The line. /// The col index. @@ -4051,7 +4051,7 @@ public class TextView : View /// /// Sets the to an appropriate color for rendering the given /// of the current . Override to provide custom coloring by calling - /// Defaults to . + /// Defaults to . /// /// The line. /// The col index. @@ -4084,7 +4084,7 @@ public class TextView : View { (int width, int height) offB = OffSetBackground (); List line = GetCurrentLine (); - bool need = NeedsDisplay || _wrapNeeded || !Used; + bool need = NeedsDraw || _wrapNeeded || !Used; (int size, int length) tSize = TextModel.DisplaySize (line, -1, -1, false, TabWidth); (int size, int length) dSize = TextModel.DisplaySize (line, _leftColumn, CurrentColumn, true, TabWidth); @@ -4138,7 +4138,7 @@ public class TextView : View _wrapNeeded = false; } - SetNeedsDisplay (); + SetNeedsDraw (); } else { @@ -4268,14 +4268,14 @@ public class TextView : View if (_wordWrap) { - SetNeedsDisplay (); + SetNeedsDraw (); } else { //QUESTION: Is the below comment still relevant? // BUGBUG: customized rect aren't supported now because the Redraw isn't using the Intersect method. - //SetNeedsDisplay (new (0, startRow - topRow, Viewport.Width, startRow - topRow + 1)); - SetNeedsDisplay (); + //SetNeedsDraw (new (0, startRow - topRow, Viewport.Width, startRow - topRow + 1)); + SetNeedsDraw (); } _historyText.Add ( @@ -4317,7 +4317,7 @@ public class TextView : View UpdateWrapModel (); - SetNeedsDisplay (); + SetNeedsDraw (); } private void ClearSelectedRegion () @@ -4365,13 +4365,13 @@ public class TextView : View if (CurrentColumn < _leftColumn) { _leftColumn--; - SetNeedsDisplay (); + SetNeedsDraw (); } else { // BUGBUG: customized rect aren't supported now because the Redraw isn't using the Intersect method. - //SetNeedsDisplay (new (0, currentRow - topRow, 1, Viewport.Width)); - SetNeedsDisplay (); + //SetNeedsDraw (new (0, currentRow - topRow, 1, Viewport.Width)); + SetNeedsDraw (); } } else @@ -4415,7 +4415,7 @@ public class TextView : View ); CurrentColumn = prevCount; - SetNeedsDisplay (); + SetNeedsDraw (); } UpdateWrapModel (); @@ -4462,7 +4462,7 @@ public class TextView : View _wrapNeeded = true; } - DoSetNeedsDisplay (new (0, CurrentRow - _topRow, Viewport.Width, CurrentRow - _topRow + 1)); + DoSetNeedsDraw (new (0, CurrentRow - _topRow, Viewport.Width, CurrentRow - _topRow + 1)); } else { @@ -4481,7 +4481,7 @@ public class TextView : View _wrapNeeded = true; } - DoSetNeedsDisplay ( + DoSetNeedsDraw ( new ( CurrentColumn - _leftColumn, CurrentRow - _topRow, @@ -4498,7 +4498,7 @@ public class TextView : View private void DoNeededAction () { - if (NeedsDisplay) + if (NeedsDraw) { Adjust (); } @@ -4508,17 +4508,17 @@ public class TextView : View } } - private void DoSetNeedsDisplay (Rectangle rect) + private void DoSetNeedsDraw (Rectangle rect) { if (_wrapNeeded) { - SetNeedsDisplay (); + SetNeedsDraw (); } else { // BUGBUG: customized rect aren't supported now because the Redraw isn't using the Intersect method. - //SetNeedsDisplay (rect); - SetNeedsDisplay (); + //SetNeedsDraw (rect); + SetNeedsDraw (); } } @@ -4791,8 +4791,8 @@ public class TextView : View if (!_wrapNeeded) { // BUGBUG: customized rect aren't supported now because the Redraw isn't using the Intersect method. - //SetNeedsDisplay (new (0, prow, Math.Max (Viewport.Width, 0), Math.Max (prow + 1, 0))); - SetNeedsDisplay (); + //SetNeedsDraw (new (0, prow, Math.Max (Viewport.Width, 0), Math.Max (prow + 1, 0))); + SetNeedsDraw (); } } @@ -4846,13 +4846,13 @@ public class TextView : View if (_wordWrap) { - SetNeedsDisplay (); + SetNeedsDraw (); } else { // BUGBUG: customized rect aren't supported now because the Redraw isn't using the Intersect method. - //SetNeedsDisplay (new (0, currentRow - topRow, Viewport.Width, Math.Max (currentRow - topRow + 1, 0))); - SetNeedsDisplay (); + //SetNeedsDraw (new (0, currentRow - topRow, Viewport.Width, Math.Max (currentRow - topRow + 1, 0))); + SetNeedsDraw (); } UpdateWrapModel (); @@ -4950,7 +4950,7 @@ public class TextView : View if (CurrentColumn >= _leftColumn + Viewport.Width) { _leftColumn++; - SetNeedsDisplay (); + SetNeedsDraw (); } } else @@ -5065,7 +5065,7 @@ public class TextView : View UpdateWrapModel (); - DoSetNeedsDisplay (new (0, CurrentRow - _topRow, Viewport.Width, Viewport.Height)); + DoSetNeedsDraw (new (0, CurrentRow - _topRow, Viewport.Width, Viewport.Height)); _lastWasKill = setLastWasKill; DoNeededAction (); @@ -5172,7 +5172,7 @@ public class TextView : View UpdateWrapModel (); - DoSetNeedsDisplay (new (0, CurrentRow - _topRow, Viewport.Width, Viewport.Height)); + DoSetNeedsDraw (new (0, CurrentRow - _topRow, Viewport.Width, Viewport.Height)); _lastWasKill = setLastWasKill; DoNeededAction (); @@ -5242,7 +5242,7 @@ public class TextView : View UpdateWrapModel (); - DoSetNeedsDisplay (new (0, CurrentRow - _topRow, Viewport.Width, Viewport.Height)); + DoSetNeedsDraw (new (0, CurrentRow - _topRow, Viewport.Width, Viewport.Height)); DoNeededAction (); } @@ -5301,7 +5301,7 @@ public class TextView : View UpdateWrapModel (); - DoSetNeedsDisplay (new (0, CurrentRow - _topRow, Viewport.Width, Viewport.Height)); + DoSetNeedsDraw (new (0, CurrentRow - _topRow, Viewport.Width, Viewport.Height)); DoNeededAction (); } @@ -5354,7 +5354,7 @@ public class TextView : View if (CurrentRow >= _topRow + Viewport.Height) { _topRow++; - SetNeedsDisplay (); + SetNeedsDraw (); } TrackColumn (); @@ -5397,7 +5397,7 @@ public class TextView : View if (CurrentRow < _topRow) { _topRow--; - SetNeedsDisplay (); + SetNeedsDraw (); } List currentLine = GetCurrentLine (); @@ -5435,7 +5435,7 @@ public class TextView : View _topRow = CurrentRow >= _model.Count ? CurrentRow - nPageDnShift : _topRow + nPageDnShift; - SetNeedsDisplay (); + SetNeedsDraw (); } TrackColumn (); @@ -5461,7 +5461,7 @@ public class TextView : View if (CurrentRow < _topRow) { _topRow = _topRow - nPageUpShift < 0 ? 0 : _topRow - nPageUpShift; - SetNeedsDisplay (); + SetNeedsDraw (); } TrackColumn (); @@ -5489,7 +5489,7 @@ public class TextView : View if (CurrentRow >= _topRow + Viewport.Height) { _topRow++; - SetNeedsDisplay (); + SetNeedsDraw (); } else { @@ -5512,7 +5512,7 @@ public class TextView : View { if (_leftColumn > 0) { - SetNeedsDisplay (); + SetNeedsDraw (); } CurrentColumn = 0; @@ -5554,7 +5554,7 @@ public class TextView : View if (CurrentRow < _topRow) { _topRow--; - SetNeedsDisplay (); + SetNeedsDraw (); } TrackColumn (); @@ -5686,7 +5686,7 @@ public class TextView : View ); } - SetNeedsDisplay (); + SetNeedsDraw (); UpdateWrapModel (); } @@ -6186,12 +6186,12 @@ public class TextView : View CurrentRow++; - var fullNeedsDisplay = false; + var fullNeedsDraw = false; if (CurrentRow >= _topRow + Viewport.Height) { _topRow++; - fullNeedsDisplay = true; + fullNeedsDraw = true; } CurrentColumn = 0; @@ -6204,19 +6204,19 @@ public class TextView : View if (!_wordWrap && CurrentColumn < _leftColumn) { - fullNeedsDisplay = true; + fullNeedsDraw = true; _leftColumn = 0; } - if (fullNeedsDisplay) + if (fullNeedsDraw) { - SetNeedsDisplay (); + SetNeedsDraw (); } else { // BUGBUG: customized rect aren't supported now because the Redraw isn't using the Intersect method. - //SetNeedsDisplay (new (0, currentRow - topRow, 2, Viewport.Height)); - SetNeedsDisplay (); + //SetNeedsDraw (new (0, currentRow - topRow, 2, Viewport.Height)); + SetNeedsDraw (); } UpdateWrapModel (); @@ -6339,7 +6339,7 @@ public class TextView : View else { UpdateWrapModel (); - SetNeedsDisplay (); + SetNeedsDraw (); Adjust (); } @@ -6357,7 +6357,7 @@ public class TextView : View private void SetOverwrite (bool overwrite) { Used = overwrite; - SetNeedsDisplay (); + SetNeedsDraw (); DoNeededAction (); } @@ -6529,7 +6529,7 @@ public class TextView : View _selectionStartColumn = nStartCol; _wrapNeeded = true; - SetNeedsDisplay (); + SetNeedsDraw (); } if (_currentCaller is { }) @@ -6560,7 +6560,7 @@ public class TextView : View CurrentColumn = nCol; _selectionStartRow = nStartRow; _selectionStartColumn = nStartCol; - SetNeedsDisplay (); + SetNeedsDraw (); } } } diff --git a/Terminal.Gui/Views/TileView.cs b/Terminal.Gui/Views/TileView.cs index 3a7d64730..f7179a586 100644 --- a/Terminal.Gui/Views/TileView.cs +++ b/Terminal.Gui/Views/TileView.cs @@ -57,7 +57,7 @@ public class TileView : View _orientation = value; - SetNeedsDisplay (); + SetNeedsDraw (); SetNeedsLayout (); } @@ -151,7 +151,7 @@ public class TileView : View } } - SetNeedsDisplay (); + SetNeedsDraw (); SetNeedsLayout (); return toReturn; @@ -440,7 +440,7 @@ public class TileView : View } OnSplitterMoved (idx); - SetNeedsDisplay (); + SetNeedsDraw (); SetNeedsLayout (); return true; @@ -826,7 +826,7 @@ public class TileView : View } // BUGBUG: This should not be needed. If any of the pos/dim setters above actually changed values, NeedsDisplay should have already been set. - tile.ContentView.SetNeedsDisplay (); + tile.ContentView.SetNeedsDraw (); } } @@ -1041,7 +1041,7 @@ public class TileView : View /// private bool FinalisePosition (Pos oldValue, Pos newValue) { - SetNeedsDisplay (); + SetNeedsDraw (); SetNeedsLayout (); diff --git a/Terminal.Gui/Views/TimeField.cs b/Terminal.Gui/Views/TimeField.cs index ecc94a7be..932f67ddb 100644 --- a/Terminal.Gui/Views/TimeField.cs +++ b/Terminal.Gui/Views/TimeField.cs @@ -106,7 +106,7 @@ public class TimeField : TextField SetText (Text); ReadOnly = ro; - SetNeedsDisplay (); + SetNeedsDraw (); } } diff --git a/Terminal.Gui/Views/TreeView/TreeView.cs b/Terminal.Gui/Views/TreeView/TreeView.cs index 18ee95ac8..59351c27f 100644 --- a/Terminal.Gui/Views/TreeView/TreeView.cs +++ b/Terminal.Gui/Views/TreeView/TreeView.cs @@ -19,8 +19,8 @@ public interface ITreeView /// Removes all objects from the tree and clears selection. void ClearObjects (); - /// Sets a flag indicating this view needs to be redisplayed because its state has changed. - void SetNeedsDisplay (); + /// Sets a flag indicating this view needs to be drawn because its state has changed. + void SetNeedsDraw (); } /// @@ -377,7 +377,7 @@ public class TreeView : View, ITreeView where T : class { KeyBindings.ReplaceKey (ObjectActivationKey, value); objectActivationKey = value; - SetNeedsDisplay (); + SetNeedsDraw (); } } } @@ -388,7 +388,7 @@ public class TreeView : View, ITreeView where T : class /// The amount of tree view that has been scrolled to the right (horizontally). /// /// Setting a value of less than 0 will result in a offset of 0. To see changes in the UI call - /// . + /// . /// public int ScrollOffsetHorizontal { @@ -396,14 +396,14 @@ public class TreeView : View, ITreeView where T : class set { scrollOffsetHorizontal = Math.Max (0, value); - SetNeedsDisplay (); + SetNeedsDraw (); } } /// The amount of tree view that has been scrolled off the top of the screen (by the user scrolling down). /// /// Setting a value of less than 0 will result in an offset of 0. To see changes in the UI call - /// . + /// . /// public int ScrollOffsetVertical { @@ -411,7 +411,7 @@ public class TreeView : View, ITreeView where T : class set { scrollOffsetVertical = Math.Max (0, value); - SetNeedsDisplay (); + SetNeedsDraw (); } } @@ -454,7 +454,7 @@ public class TreeView : View, ITreeView where T : class multiSelectedRegions.Clear (); roots = new Dictionary> (); InvalidateLineMap (); - SetNeedsDisplay (); + SetNeedsDraw (); } /// @@ -490,7 +490,7 @@ public class TreeView : View, ITreeView where T : class { roots.Add (o, new Branch (this, null, o)); InvalidateLineMap (); - SetNeedsDisplay (); + SetNeedsDraw (); } } @@ -513,7 +513,7 @@ public class TreeView : View, ITreeView where T : class if (objectsAdded) { InvalidateLineMap (); - SetNeedsDisplay (); + SetNeedsDraw (); } } @@ -581,7 +581,7 @@ public class TreeView : View, ITreeView where T : class } } - SetNeedsDisplay (); + SetNeedsDraw (); } /// Moves the selection to the last child in the currently selected level. @@ -613,7 +613,7 @@ public class TreeView : View, ITreeView where T : class { SelectedObject = currentBranch.Model; EnsureVisible (currentBranch.Model); - SetNeedsDisplay (); + SetNeedsDraw (); return; } @@ -655,7 +655,7 @@ public class TreeView : View, ITreeView where T : class { SelectedObject = currentBranch.Model; EnsureVisible (currentBranch.Model); - SetNeedsDisplay (); + SetNeedsDraw (); return; } @@ -716,7 +716,7 @@ public class TreeView : View, ITreeView where T : class } InvalidateLineMap (); - SetNeedsDisplay (); + SetNeedsDraw (); } /// @@ -772,7 +772,7 @@ public class TreeView : View, ITreeView where T : class ObjectToBranch (toExpand)?.Expand (); InvalidateLineMap (); - SetNeedsDisplay (); + SetNeedsDraw (); } /// Expands the supplied object and all child objects. @@ -786,7 +786,7 @@ public class TreeView : View, ITreeView where T : class ObjectToBranch (toExpand)?.ExpandAll (); InvalidateLineMap (); - SetNeedsDisplay (); + SetNeedsDraw (); } /// @@ -801,7 +801,7 @@ public class TreeView : View, ITreeView where T : class } InvalidateLineMap (); - SetNeedsDisplay (); + SetNeedsDraw (); } /// @@ -930,7 +930,7 @@ public class TreeView : View, ITreeView where T : class /// /// Returns the index of the object if it is currently exposed (it's parent(s) have been - /// expanded). This can be used with and to + /// expanded). This can be used with and to /// scroll to a specific object. /// /// Uses the Equals method and returns the first index at which the object is found or -1 if it is not found. @@ -966,7 +966,7 @@ public class TreeView : View, ITreeView where T : class SelectedObject = toSelect; EnsureVisible (toSelect); - SetNeedsDisplay (); + SetNeedsDraw (); } /// Changes the to the last object in the tree and scrolls so that it is visible. @@ -976,7 +976,7 @@ public class TreeView : View, ITreeView where T : class ScrollOffsetVertical = Math.Max (0, map.Count - Viewport.Height + 1); SelectedObject = map.LastOrDefault ()?.Model; - SetNeedsDisplay (); + SetNeedsDraw (); } /// @@ -988,7 +988,7 @@ public class TreeView : View, ITreeView where T : class ScrollOffsetVertical = 0; SelectedObject = roots.Keys.FirstOrDefault (); - SetNeedsDisplay (); + SetNeedsDraw (); } /// Clears any cached results of the tree state. @@ -1041,7 +1041,7 @@ public class TreeView : View, ITreeView where T : class if (me.Flags == MouseFlags.WheeledRight) { ScrollOffsetHorizontal++; - SetNeedsDisplay (); + SetNeedsDraw (); return true; } @@ -1049,7 +1049,7 @@ public class TreeView : View, ITreeView where T : class if (me.Flags == MouseFlags.WheeledLeft) { ScrollOffsetHorizontal--; - SetNeedsDisplay (); + SetNeedsDraw (); return true; } @@ -1098,7 +1098,7 @@ public class TreeView : View, ITreeView where T : class multiSelectedRegions.Clear (); } - SetNeedsDisplay (); + SetNeedsDraw (); return true; } @@ -1117,7 +1117,7 @@ public class TreeView : View, ITreeView where T : class // Double click changes the selection to the clicked node as well as triggering // activation otherwise it feels wierd SelectedObject = clickedBranch.Model; - SetNeedsDisplay (); + SetNeedsDraw (); // trigger activation event OnObjectActivated (new ObjectActivatedEventArgs (this, clickedBranch.Model)); @@ -1221,7 +1221,7 @@ public class TreeView : View, ITreeView where T : class { SelectedObject = map.ElementAt ((int)newIndex).Model; EnsureVisible (selectedObject); - SetNeedsDisplay (); + SetNeedsDraw (); return true; } @@ -1262,7 +1262,7 @@ public class TreeView : View, ITreeView where T : class } InvalidateLineMap (); - SetNeedsDisplay (); + SetNeedsDraw (); } /// @@ -1283,7 +1283,7 @@ public class TreeView : View, ITreeView where T : class { branch.Refresh (startAtTop); InvalidateLineMap (); - SetNeedsDisplay (); + SetNeedsDraw (); } } @@ -1297,7 +1297,7 @@ public class TreeView : View, ITreeView where T : class { roots.Remove (o); InvalidateLineMap (); - SetNeedsDisplay (); + SetNeedsDraw (); if (Equals (SelectedObject, o)) { @@ -1312,7 +1312,7 @@ public class TreeView : View, ITreeView where T : class if (ScrollOffsetVertical <= ContentHeight - 2) { ScrollOffsetVertical++; - SetNeedsDisplay (); + SetNeedsDraw (); } } @@ -1322,7 +1322,7 @@ public class TreeView : View, ITreeView where T : class if (scrollOffsetVertical > 0) { ScrollOffsetVertical--; - SetNeedsDisplay (); + SetNeedsDraw (); } } @@ -1344,7 +1344,7 @@ public class TreeView : View, ITreeView where T : class } multiSelectedRegions.Push (new TreeSelection (map.ElementAt (0), map.Count, map)); - SetNeedsDisplay (); + SetNeedsDraw (); OnSelectionChanged (new SelectionChangedEventArgs (this, SelectedObject, SelectedObject)); } @@ -1389,7 +1389,7 @@ public class TreeView : View, ITreeView where T : class } InvalidateLineMap (); - SetNeedsDisplay (); + SetNeedsDraw (); } /// @@ -1417,7 +1417,7 @@ public class TreeView : View, ITreeView where T : class { SelectedObject = parent; AdjustSelection (0); - SetNeedsDisplay (); + SetNeedsDraw (); } } } @@ -1550,7 +1550,7 @@ public class TreeView : View, ITreeView where T : class { SelectedObject = map.ElementAt (idxCur).Model; EnsureVisible (map.ElementAt (idxCur).Model); - SetNeedsDisplay (); + SetNeedsDraw (); return; } diff --git a/Terminal.Gui/Views/TreeViewTextFilter.cs b/Terminal.Gui/Views/TreeViewTextFilter.cs index ba9b19092..907c1b5dc 100644 --- a/Terminal.Gui/Views/TreeViewTextFilter.cs +++ b/Terminal.Gui/Views/TreeViewTextFilter.cs @@ -51,6 +51,6 @@ public class TreeViewTextFilter : ITreeViewFilter where T : class private void RefreshTreeView () { _forTree.InvalidateLineMap (); - _forTree.SetNeedsDisplay (); + _forTree.SetNeedsDraw (); } } diff --git a/Terminal.Gui/Views/Wizard/WizardStep.cs b/Terminal.Gui/Views/Wizard/WizardStep.cs index eacb7c9df..e3d94f6b3 100644 --- a/Terminal.Gui/Views/Wizard/WizardStep.cs +++ b/Terminal.Gui/Views/Wizard/WizardStep.cs @@ -29,7 +29,7 @@ public class WizardStep : View // OnTitleChanged (old, title); // } // base.Title = value; - // SetNeedsDisplay (); + // SetNeedsDraw (); // } //} @@ -73,7 +73,7 @@ public class WizardStep : View // if (helpTextView.TopRow != scrollBar.Position) { // scrollBar.Position = helpTextView.TopRow; // } - // helpTextView.SetNeedsDisplay (); + // helpTextView.SetNeedsDraw (); //}; //scrollBar.OtherScrollBarView.ChangedPosition += (s,e) => { @@ -81,7 +81,7 @@ public class WizardStep : View // if (helpTextView.LeftColumn != scrollBar.OtherScrollBarView.Position) { // scrollBar.OtherScrollBarView.Position = helpTextView.LeftColumn; // } - // helpTextView.SetNeedsDisplay (); + // helpTextView.SetNeedsDraw (); //}; //scrollBar.VisibleChanged += (s,e) => { @@ -130,7 +130,7 @@ public class WizardStep : View { _helpTextView.Text = value; ShowHide (); - SetNeedsDisplay (); + SetNeedsDraw (); } } @@ -158,7 +158,7 @@ public class WizardStep : View /// public override View Remove (View view) { - SetNeedsDisplay (); + SetNeedsDraw (); View container = view?.SuperView; if (container == this) diff --git a/UICatalog/KeyBindingsDialog.cs b/UICatalog/KeyBindingsDialog.cs index 94aa4f91a..54e8f521d 100644 --- a/UICatalog/KeyBindingsDialog.cs +++ b/UICatalog/KeyBindingsDialog.cs @@ -103,7 +103,7 @@ internal class KeyBindingsDialog : Dialog _keyLabel.Text = "Key: None"; } - SetNeedsDisplay (); + SetNeedsDraw (); } /// Tracks views as they are created in UICatalog so that their keybindings can be managed. diff --git a/UICatalog/Scenarios/AnimationScenario/AnimationScenario.cs b/UICatalog/Scenarios/AnimationScenario/AnimationScenario.cs index b1f63596a..00fcf9ffa 100644 --- a/UICatalog/Scenarios/AnimationScenario/AnimationScenario.cs +++ b/UICatalog/Scenarios/AnimationScenario/AnimationScenario.cs @@ -94,7 +94,7 @@ public class AnimationScenario : Scenario () => { _imageView.NextFrame (); - _imageView.SetNeedsDisplay (); + _imageView.SetNeedsDraw (); }); Task.Delay (100).Wait (); @@ -247,7 +247,7 @@ public class AnimationScenario : Scenario fullResImages [frameCount - 1] = image; - SetNeedsDisplay (); + SetNeedsDraw (); } private string GetBraille (Image img) diff --git a/UICatalog/Scenarios/Arrangement.cs b/UICatalog/Scenarios/Arrangement.cs index fb4c05f90..48ed9f225 100644 --- a/UICatalog/Scenarios/Arrangement.cs +++ b/UICatalog/Scenarios/Arrangement.cs @@ -99,7 +99,7 @@ public class Arrangement : Scenario Application.Wakeup (); - progressBar.SetNeedsDisplay (); + progressBar.SetNeedsDraw (); }; timer.Start (); diff --git a/UICatalog/Scenarios/CharacterMap.cs b/UICatalog/Scenarios/CharacterMap.cs index 52909ec27..55f6dac1f 100644 --- a/UICatalog/Scenarios/CharacterMap.cs +++ b/UICatalog/Scenarios/CharacterMap.cs @@ -646,7 +646,7 @@ internal class CharMap : View, IDesignable } } - SetNeedsDisplay (); + SetNeedsDraw (); SelectedCodePointChanged?.Invoke (this, new (SelectedCodePoint, null)); } } @@ -657,7 +657,7 @@ internal class CharMap : View, IDesignable set { _rowHeight = value ? 2 : 1; - SetNeedsDisplay (); + SetNeedsDraw (); } } @@ -673,7 +673,7 @@ internal class CharMap : View, IDesignable _start = value; SelectedCodePoint = value; Viewport = Viewport with { Y = SelectedCodePoint / 16 * _rowHeight }; - SetNeedsDisplay (); + SetNeedsDraw (); } } diff --git a/UICatalog/Scenarios/ClassExplorer.cs b/UICatalog/Scenarios/ClassExplorer.cs index 0bfd4e9fd..60e88e3e0 100644 --- a/UICatalog/Scenarios/ClassExplorer.cs +++ b/UICatalog/Scenarios/ClassExplorer.cs @@ -193,7 +193,7 @@ public class ClassExplorer : Scenario { _treeView.Style.HighlightModelTextOnly = !_treeView.Style.HighlightModelTextOnly; _highlightModelTextOnly.Checked = _treeView.Style.HighlightModelTextOnly; - _treeView.SetNeedsDisplay (); + _treeView.SetNeedsDraw (); } private void Quit () { Application.RequestStop (); } @@ -292,7 +292,7 @@ public class ClassExplorer : Scenario _textView.Text = ex.Message; } - _textView.SetNeedsDisplay (); + _textView.SetNeedsDraw (); } private enum Showable diff --git a/UICatalog/Scenarios/ConfigurationEditor.cs b/UICatalog/Scenarios/ConfigurationEditor.cs index 5f40f51dd..037acceec 100644 --- a/UICatalog/Scenarios/ConfigurationEditor.cs +++ b/UICatalog/Scenarios/ConfigurationEditor.cs @@ -94,7 +94,7 @@ public class ConfigurationEditor : Scenario foreach (Tile t in _tileView.Tiles) { t.ContentView.ColorScheme = EditorColorScheme; - t.ContentView.SetNeedsDisplay (); + t.ContentView.SetNeedsDraw (); } ; diff --git a/UICatalog/Scenarios/CsvEditor.cs b/UICatalog/Scenarios/CsvEditor.cs index 012b4afcc..b6fa4e9c7 100644 --- a/UICatalog/Scenarios/CsvEditor.cs +++ b/UICatalog/Scenarios/CsvEditor.cs @@ -357,7 +357,7 @@ public class CsvEditor : Scenario _tableView.SetSelection (newIdx, _tableView.SelectedRow, false); _tableView.EnsureSelectedCellIsVisible (); - _tableView.SetNeedsDisplay (); + _tableView.SetNeedsDraw (); } } catch (Exception ex) @@ -406,7 +406,7 @@ public class CsvEditor : Scenario _tableView.SetSelection (_tableView.SelectedColumn, newIdx, false); _tableView.EnsureSelectedCellIsVisible (); - _tableView.SetNeedsDisplay (); + _tableView.SetNeedsDraw (); } } catch (Exception ex) @@ -627,7 +627,7 @@ public class CsvEditor : Scenario scrollBar.Position = _tableView.RowOffset; } - _tableView.SetNeedsDisplay (); + _tableView.SetNeedsDraw (); }; /* scrollBar.OtherScrollBarView.ChangedPosition += (s,e) => { @@ -635,7 +635,7 @@ public class CsvEditor : Scenario if (tableView.LeftItem != scrollBar.OtherScrollBarView.Position) { scrollBar.OtherScrollBarView.Position = tableView.LeftItem; } - tableView.SetNeedsDisplay (); + tableView.SetNeedsDraw (); };*/ _tableView.DrawingContent += (s, e) => diff --git a/UICatalog/Scenarios/DynamicMenuBar.cs b/UICatalog/Scenarios/DynamicMenuBar.cs index ec93af65d..2a5171f30 100644 --- a/UICatalog/Scenarios/DynamicMenuBar.cs +++ b/UICatalog/Scenarios/DynamicMenuBar.cs @@ -224,7 +224,7 @@ public class DynamicMenuBar : Scenario if (e.NewValue == CheckState.Checked) { CkbSubMenu.CheckedState = CheckState.UnChecked; - CkbSubMenu.SetNeedsDisplay (); + CkbSubMenu.SetNeedsDraw (); TextHelp.Enabled = true; TextAction.Enabled = true; TextShortcutKey.Enabled = true; @@ -234,7 +234,7 @@ public class DynamicMenuBar : Scenario if ((_menuItem == null && !_hasParent) || _menuItem.Parent == null) { CkbSubMenu.CheckedState = CheckState.Checked; - CkbSubMenu.SetNeedsDisplay (); + CkbSubMenu.SetNeedsDraw (); TextShortcutKey.Enabled = false; } @@ -252,7 +252,7 @@ public class DynamicMenuBar : Scenario if (e.CurrentValue == CheckState.Checked) { CkbIsTopLevel.CheckedState = CheckState.UnChecked; - CkbIsTopLevel.SetNeedsDisplay (); + CkbIsTopLevel.SetNeedsDraw (); TextHelp.Text = ""; TextHelp.Enabled = false; TextAction.Text = ""; @@ -265,7 +265,7 @@ public class DynamicMenuBar : Scenario if (!_hasParent) { CkbIsTopLevel.CheckedState = CheckState.Checked; - CkbIsTopLevel.SetNeedsDisplay (); + CkbIsTopLevel.SetNeedsDraw (); TextShortcutKey.Enabled = true; } @@ -683,7 +683,7 @@ public class DynamicMenuBar : Scenario menus [i] = menus [i - 1]; menus [i - 1] = menuItem; _currentSelectedMenuBar = i - 1; - _menuBar.SetNeedsDisplay (); + _menuBar.SetNeedsDraw (); } } }; @@ -705,7 +705,7 @@ public class DynamicMenuBar : Scenario menus [i] = menus [i + 1]; menus [i + 1] = menuItem; _currentSelectedMenuBar = i + 1; - _menuBar.SetNeedsDisplay (); + _menuBar.SetNeedsDraw (); } } }; @@ -920,7 +920,7 @@ public class DynamicMenuBar : Scenario RemoveMenuBar (); } - _lstMenus.SetNeedsDisplay (); + _lstMenus.SetNeedsDraw (); SetFrameDetails (); } }; @@ -1012,7 +1012,7 @@ public class DynamicMenuBar : Scenario lblMenuBar.Text = newMenu.Title; SetListViewSource (_currentMenuBarItem, true); SetFrameDetails (_menuBar.Menus [_currentSelectedMenuBar]); - _menuBar.SetNeedsDisplay (); + _menuBar.SetNeedsDraw (); }; btnRemoveMenuBar.Accepting += (s, e) => diff --git a/UICatalog/Scenarios/DynamicStatusBar.cs b/UICatalog/Scenarios/DynamicStatusBar.cs index 0f06630ad..a30aa43eb 100644 --- a/UICatalog/Scenarios/DynamicStatusBar.cs +++ b/UICatalog/Scenarios/DynamicStatusBar.cs @@ -329,7 +329,7 @@ public class DynamicStatusBar : Scenario DataContext.Items [i - 1] = new DynamicStatusItemList (statusItem.Title, statusItem); _lstItems.SelectedItem = i - 1; - _statusBar.SetNeedsDisplay (); + _statusBar.SetNeedsDraw (); } } }; @@ -352,7 +352,7 @@ public class DynamicStatusBar : Scenario DataContext.Items [i + 1] = new DynamicStatusItemList (statusItem.Title, statusItem); _lstItems.SelectedItem = i + 1; - _statusBar.SetNeedsDisplay (); + _statusBar.SetNeedsDraw (); } } }; @@ -435,7 +435,7 @@ public class DynamicStatusBar : Scenario _lstItems.SelectedItem = _lstItems.Source.Count - 1; } - _lstItems.SetNeedsDisplay (); + _lstItems.SetNeedsDraw (); SetFrameDetails (); } }; diff --git a/UICatalog/Scenarios/Editor.cs b/UICatalog/Scenarios/Editor.cs index f2c732d5d..801201132 100644 --- a/UICatalog/Scenarios/Editor.cs +++ b/UICatalog/Scenarios/Editor.cs @@ -281,7 +281,7 @@ public class Editor : Scenario _scrollBar.Position = _textView.TopRow; } - _textView.SetNeedsDisplay (); + _textView.SetNeedsDraw (); }; _scrollBar.OtherScrollBarView.ChangedPosition += (s, e) => @@ -293,7 +293,7 @@ public class Editor : Scenario _scrollBar.OtherScrollBarView.Position = _textView.LeftColumn; } - _textView.SetNeedsDisplay (); + _textView.SetNeedsDraw (); }; _textView.DrawingContent += (s, e) => diff --git a/UICatalog/Scenarios/Editors/BorderEditor.cs b/UICatalog/Scenarios/Editors/BorderEditor.cs index ed3a0916e..79a6e6011 100644 --- a/UICatalog/Scenarios/Editors/BorderEditor.cs +++ b/UICatalog/Scenarios/Editors/BorderEditor.cs @@ -88,7 +88,7 @@ public class BorderEditor : AdornmentEditor ((Border)AdornmentToEdit).Thickness = new (1); } - ((Border)AdornmentToEdit).SetNeedsDisplay (); + ((Border)AdornmentToEdit).SetNeedsDraw (); SetNeedsLayout (); } diff --git a/UICatalog/Scenarios/GraphViewExample.cs b/UICatalog/Scenarios/GraphViewExample.cs index 3bb27a10e..cb60237db 100644 --- a/UICatalog/Scenarios/GraphViewExample.cs +++ b/UICatalog/Scenarios/GraphViewExample.cs @@ -228,7 +228,7 @@ public class GraphViewExample : Scenario _graphView.MarginBottom = (uint)Math.Max (0, _graphView.MarginBottom + (increase ? 1 : -1)); } - _graphView.SetNeedsDisplay (); + _graphView.SetNeedsDraw (); } private void MultiBarGraph () @@ -264,7 +264,7 @@ public class GraphViewExample : Scenario _graphView.CellSize = new (0.25f, 1000); _graphView.Series.Add (series); - _graphView.SetNeedsDisplay (); + _graphView.SetNeedsDraw (); _graphView.MarginLeft = 3; _graphView.MarginBottom = 1; @@ -330,7 +330,7 @@ public class GraphViewExample : Scenario ); } - _graphView.SetNeedsDisplay (); + _graphView.SetNeedsDraw (); // while the equaliser is showing return _graphView.Series.Contains (series); @@ -350,7 +350,7 @@ public class GraphViewExample : Scenario _graphView.AxisX.Visible = false; _graphView.AxisY.Visible = false; - _graphView.SetNeedsDisplay (); + _graphView.SetNeedsDraw (); } /* Country,Both,Male,Female @@ -522,7 +522,7 @@ public class GraphViewExample : Scenario _graphView.ScrollOffset = new (80, 0); } - _graphView.SetNeedsDisplay (); + _graphView.SetNeedsDraw (); } private void SetupLineGraph () @@ -605,7 +605,7 @@ public class GraphViewExample : Scenario } ); - _graphView.SetNeedsDisplay (); + _graphView.SetNeedsDraw (); } private void SetupPeriodicTableScatterPlot () @@ -760,7 +760,7 @@ public class GraphViewExample : Scenario _graphView.AxisY.ShowLabelsEvery = 1; _graphView.AxisY.Minimum = 0; - _graphView.SetNeedsDisplay (); + _graphView.SetNeedsDraw (); } private void SetupPopulationPyramid () @@ -899,7 +899,7 @@ public class GraphViewExample : Scenario new TextAnnotation { Text = "F", ScreenPosition = new Point (_graphView.Viewport.Width - 1, 10) } ); - _graphView.SetNeedsDisplay (); + _graphView.SetNeedsDraw (); } private void SetupSineWave () @@ -946,7 +946,7 @@ public class GraphViewExample : Scenario _graphView.ScrollOffset = new (-2.5f, -1); - _graphView.SetNeedsDisplay (); + _graphView.SetNeedsDraw (); } private void ShowBorder () @@ -978,7 +978,7 @@ public class GraphViewExample : Scenario _graphView.AxisX.Increment *= factor; _graphView.AxisY.Increment *= factor; - _graphView.SetNeedsDisplay (); + _graphView.SetNeedsDraw (); } private class DiscoBarSeries : BarSeries diff --git a/UICatalog/Scenarios/Images.cs b/UICatalog/Scenarios/Images.cs index b3afcd800..a6f745bbe 100644 --- a/UICatalog/Scenarios/Images.cs +++ b/UICatalog/Scenarios/Images.cs @@ -152,7 +152,7 @@ public class Images : Scenario internal void SetImage (Image image) { _fullResImage = image; - SetNeedsDisplay (); + SetNeedsDraw (); } } } diff --git a/UICatalog/Scenarios/InvertColors.cs b/UICatalog/Scenarios/InvertColors.cs index de093909d..2663cc7a3 100644 --- a/UICatalog/Scenarios/InvertColors.cs +++ b/UICatalog/Scenarios/InvertColors.cs @@ -45,7 +45,7 @@ public class InvertColors : Scenario label.ColorScheme = new ColorScheme (label.ColorScheme) { Normal = color }; label.Text = $"{color.Foreground} on {color.Background}"; - label.SetNeedsDisplay (); + label.SetNeedsDraw (); } }; win.Add (button); diff --git a/UICatalog/Scenarios/LineDrawing.cs b/UICatalog/Scenarios/LineDrawing.cs index f50d292cd..30259ef62 100644 --- a/UICatalog/Scenarios/LineDrawing.cs +++ b/UICatalog/Scenarios/LineDrawing.cs @@ -61,7 +61,7 @@ internal class DrawLineTool : ITool _currentLine.Length = length; _currentLine.Orientation = orientation; area.CurrentLayer.ClearCache (); - area.SetNeedsDisplay (); + area.SetNeedsDraw (); } } else @@ -93,7 +93,7 @@ internal class DrawLineTool : ITool _currentLine = null; area.ClearUndo (); - area.SetNeedsDisplay (); + area.SetNeedsDraw (); } } @@ -302,7 +302,7 @@ public class DrawingArea : View if (pop != null) { _undoHistory.Push (pop); - SetNeedsDisplay (); + SetNeedsDraw (); return true; } @@ -314,7 +314,7 @@ public class DrawingArea : View { StraightLine pop = _undoHistory.Pop (); CurrentLayer.AddLine (pop); - SetNeedsDisplay (); + SetNeedsDraw (); return true; } @@ -458,7 +458,7 @@ public class AttributeView : View if (LineDrawing.PromptForColor ("Background", Value.Background, out Color newColor)) { Value = new (Value.Foreground, newColor); - SetNeedsDisplay (); + SetNeedsDraw (); } } @@ -467,7 +467,7 @@ public class AttributeView : View if (LineDrawing.PromptForColor ("Foreground", Value.Foreground, out Color newColor)) { Value = new (newColor, Value.Background); - SetNeedsDisplay (); + SetNeedsDraw (); } } } diff --git a/UICatalog/Scenarios/ListColumns.cs b/UICatalog/Scenarios/ListColumns.cs index a5d2ce5e9..47664d010 100644 --- a/UICatalog/Scenarios/ListColumns.cs +++ b/UICatalog/Scenarios/ListColumns.cs @@ -305,13 +305,13 @@ public class ListColumns : Scenario private void SetListMaxWidth () { RunListWidthDialog ("MaxCellWidth", (s, v) => s.MaxCellWidth = v, s => s.MaxCellWidth); - _listColView.SetNeedsDisplay (); + _listColView.SetNeedsDraw (); } private void SetListMinWidth () { RunListWidthDialog ("MinCellWidth", (s, v) => s.MinCellWidth = v, s => s.MinCellWidth); - _listColView.SetNeedsDisplay (); + _listColView.SetNeedsDraw (); } private void SetTable (IList list) @@ -337,7 +337,7 @@ public class ListColumns : Scenario scrollBar.Position = _listColView.RowOffset; } - _listColView.SetNeedsDisplay (); + _listColView.SetNeedsDraw (); }; /* scrollBar.OtherScrollBarView.ChangedPosition += (s,e) => { @@ -345,7 +345,7 @@ public class ListColumns : Scenario if (listColView.ColumnOffset != scrollBar.OtherScrollBarView.Position) { scrollBar.OtherScrollBarView.Position = listColView.ColumnOffset; } - listColView.SetNeedsDisplay (); + listColView.SetNeedsDraw (); }; */ @@ -389,7 +389,7 @@ public class ListColumns : Scenario _listColView.Style.RowColorGetter = null; } - _listColView.SetNeedsDisplay (); + _listColView.SetNeedsDraw (); } private void ToggleAlwaysUseNormalColorForVerticalCellLines () @@ -430,7 +430,7 @@ public class ListColumns : Scenario //toggle menu item _miCursor.Checked = !_miCursor.Checked; _listColView.Style.InvertSelectedCellFirstCharacter = (bool)_miCursor.Checked; - _listColView.SetNeedsDisplay (); + _listColView.SetNeedsDraw (); } private void ToggleScrollParallel () @@ -440,7 +440,7 @@ public class ListColumns : Scenario if ((ListTableSource)_listColView.Table != null) { ((ListTableSource)_listColView.Table).Style.ScrollParallel = (bool)_miScrollParallel.Checked; - _listColView.SetNeedsDisplay (); + _listColView.SetNeedsDraw (); } } @@ -468,7 +468,7 @@ public class ListColumns : Scenario ((ListTableSource)_listColView.Table).Style.Orientation = (bool)_miOrientVertical.Checked ? Orientation.Vertical : Orientation.Horizontal; - _listColView.SetNeedsDisplay (); + _listColView.SetNeedsDraw (); } } } diff --git a/UICatalog/Scenarios/ListViewWithSelection.cs b/UICatalog/Scenarios/ListViewWithSelection.cs index bb05332a8..744ac04a5 100644 --- a/UICatalog/Scenarios/ListViewWithSelection.cs +++ b/UICatalog/Scenarios/ListViewWithSelection.cs @@ -84,7 +84,7 @@ public class ListViewWithSelection : Scenario scrollBar.Position = _listView.TopItem; } - _listView.SetNeedsDisplay (); + _listView.SetNeedsDraw (); }; scrollBar.OtherScrollBarView.ChangedPosition += (s, e) => @@ -96,7 +96,7 @@ public class ListViewWithSelection : Scenario scrollBar.OtherScrollBarView.Position = _listView.LeftItem; } - _listView.SetNeedsDisplay (); + _listView.SetNeedsDraw (); }; _listView.DrawingContent += (s, e) => @@ -166,20 +166,20 @@ public class ListViewWithSelection : Scenario _listView.Source = new ScenarioListDataSource (_scenarios); } - _appWindow.SetNeedsDisplay (); + _appWindow.SetNeedsDraw (); } private void AllowMarkingCB_Toggle (object sender, [NotNull] CancelEventArgs stateEventArgs) { _listView.AllowsMarking = stateEventArgs.NewValue == CheckState.Checked; _allowMultipleCB.Visible = _listView.AllowsMarking; - _appWindow.SetNeedsDisplay (); + _appWindow.SetNeedsDraw (); } private void AllowMultipleCB_Toggle (object sender, [NotNull] CancelEventArgs stateEventArgs) { _listView.AllowsMultipleSelection = stateEventArgs.NewValue == CheckState.Checked; - _appWindow.SetNeedsDisplay (); + _appWindow.SetNeedsDraw (); } private void ListView_RowRender (object sender, ListViewRowEventArgs obj) diff --git a/UICatalog/Scenarios/ListsAndCombos.cs b/UICatalog/Scenarios/ListsAndCombos.cs index 9b9362830..2b21500b2 100644 --- a/UICatalog/Scenarios/ListsAndCombos.cs +++ b/UICatalog/Scenarios/ListsAndCombos.cs @@ -65,7 +65,7 @@ public class ListsAndCombos : Scenario scrollBar.Position = listview.TopItem; } - listview.SetNeedsDisplay (); + listview.SetNeedsDraw (); }; scrollBar.OtherScrollBarView.ChangedPosition += (s, e) => @@ -77,7 +77,7 @@ public class ListsAndCombos : Scenario scrollBar.OtherScrollBarView.Position = listview.LeftItem; } - listview.SetNeedsDisplay (); + listview.SetNeedsDraw (); }; listview.DrawingContent += (s, e) => @@ -122,7 +122,7 @@ public class ListsAndCombos : Scenario scrollBarCbx.Position = ((ListView)comboBox.Subviews [1]).TopItem; } - comboBox.SetNeedsDisplay (); + comboBox.SetNeedsDraw (); }; scrollBarCbx.OtherScrollBarView.ChangedPosition += (s, e) => @@ -134,7 +134,7 @@ public class ListsAndCombos : Scenario scrollBarCbx.OtherScrollBarView.Position = ((ListView)comboBox.Subviews [1]).LeftItem; } - comboBox.SetNeedsDisplay (); + comboBox.SetNeedsDraw (); }; comboBox.DrawingContent += (s, e) => diff --git a/UICatalog/Scenarios/Navigation.cs b/UICatalog/Scenarios/Navigation.cs index 93f1d91cf..7352fc705 100644 --- a/UICatalog/Scenarios/Navigation.cs +++ b/UICatalog/Scenarios/Navigation.cs @@ -103,7 +103,7 @@ public class Navigation : Scenario // progressBar.Fraction += 0.01f; - // Application.Invoke (() => progressBar.SetNeedsDisplay ()); + // Application.Invoke (() => progressBar.SetNeedsDraw ()); // ; // }; //timer.Start (); diff --git a/UICatalog/Scenarios/Notepad.cs b/UICatalog/Scenarios/Notepad.cs index ac0e78c19..1a0871d55 100644 --- a/UICatalog/Scenarios/Notepad.cs +++ b/UICatalog/Scenarios/Notepad.cs @@ -115,7 +115,7 @@ public class Notepad : Scenario } tab.Save (); - tabViewToSave.SetNeedsDisplay (); + tabViewToSave.SetNeedsDraw (); } public bool SaveAs () diff --git a/UICatalog/Scenarios/Shortcuts.cs b/UICatalog/Scenarios/Shortcuts.cs index cdc7e2269..e1d1f171b 100644 --- a/UICatalog/Scenarios/Shortcuts.cs +++ b/UICatalog/Scenarios/Shortcuts.cs @@ -361,7 +361,7 @@ public class Shortcuts : Scenario Application.Wakeup (); - pb.SetNeedsDisplay (); + pb.SetNeedsDraw (); } }; timer.Start (); diff --git a/UICatalog/Scenarios/SingleBackgroundWorker.cs b/UICatalog/Scenarios/SingleBackgroundWorker.cs index d75e31535..faf7ca7f5 100644 --- a/UICatalog/Scenarios/SingleBackgroundWorker.cs +++ b/UICatalog/Scenarios/SingleBackgroundWorker.cs @@ -101,7 +101,7 @@ public class SingleBackgroundWorker : Scenario if (_worker == null) { _log.Add ($"Worker is not running at {DateTime.Now}!"); - _listLog.SetNeedsDisplay (); + _listLog.SetNeedsDraw (); return; } @@ -109,13 +109,13 @@ public class SingleBackgroundWorker : Scenario _log.Add ( $"Worker {_startStaging}.{_startStaging:fff} is canceling at {DateTime.Now}!" ); - _listLog.SetNeedsDisplay (); + _listLog.SetNeedsDraw (); _worker.CancelAsync (); }; _startStaging = DateTime.Now; _log.Add ($"Worker is started at {_startStaging}.{_startStaging:fff}"); - _listLog.SetNeedsDisplay (); + _listLog.SetNeedsDraw (); var md = new Dialog { @@ -159,7 +159,7 @@ public class SingleBackgroundWorker : Scenario _log.Add ( $"Exception occurred {e.Error.Message} on Worker {_startStaging}.{_startStaging:fff} at {DateTime.Now}" ); - _listLog.SetNeedsDisplay (); + _listLog.SetNeedsDraw (); } else if (e.Cancelled) { @@ -167,7 +167,7 @@ public class SingleBackgroundWorker : Scenario _log.Add ( $"Worker {_startStaging}.{_startStaging:fff} was canceled at {DateTime.Now}!" ); - _listLog.SetNeedsDisplay (); + _listLog.SetNeedsDraw (); } else { @@ -175,7 +175,7 @@ public class SingleBackgroundWorker : Scenario _log.Add ( $"Worker {_startStaging}.{_startStaging:fff} was completed at {DateTime.Now}." ); - _listLog.SetNeedsDisplay (); + _listLog.SetNeedsDraw (); Application.LayoutAndDrawToplevels (); var builderUI = diff --git a/UICatalog/Scenarios/Snake.cs b/UICatalog/Scenarios/Snake.cs index a6a847044..5bae51e11 100644 --- a/UICatalog/Scenarios/Snake.cs +++ b/UICatalog/Scenarios/Snake.cs @@ -40,7 +40,7 @@ public class Snake : Scenario if (state.AdvanceState ()) { // When updating from a Thread/Task always use Invoke - Application.Invoke (() => { snakeView.SetNeedsDisplay (); }); + Application.Invoke (() => { snakeView.SetNeedsDraw (); }); } long wait = state.SleepAfterAdvancingState - sw.ElapsedMilliseconds; diff --git a/UICatalog/Scenarios/TableEditor.cs b/UICatalog/Scenarios/TableEditor.cs index d324fedc3..9aaf64ad8 100644 --- a/UICatalog/Scenarios/TableEditor.cs +++ b/UICatalog/Scenarios/TableEditor.cs @@ -1170,7 +1170,7 @@ public class TableEditor : Scenario scrollBar.Position = _tableView.RowOffset; } - _tableView.SetNeedsDisplay (); + _tableView.SetNeedsDraw (); }; /* scrollBar.OtherScrollBarView.ChangedPosition += (s,e) => { @@ -1178,7 +1178,7 @@ public class TableEditor : Scenario if (tableView.LeftItem != scrollBar.OtherScrollBarView.Position) { scrollBar.OtherScrollBarView.Position = tableView.LeftItem; } - tableView.SetNeedsDisplay (); + tableView.SetNeedsDraw (); };*/ _tableView.DrawingContent += (s, e) => @@ -1350,7 +1350,7 @@ public class TableEditor : Scenario _tableView.Style.RowColorGetter = null; } - _tableView.SetNeedsDisplay (); + _tableView.SetNeedsDraw (); } private void ToggleAlwaysShowHeaders () @@ -1468,7 +1468,7 @@ public class TableEditor : Scenario //toggle menu item _miCursor.Checked = !_miCursor.Checked; _tableView.Style.InvertSelectedCellFirstCharacter = (bool)_miCursor.Checked; - _tableView.SetNeedsDisplay (); + _tableView.SetNeedsDraw (); } private void ToggleNoCellLines () diff --git a/UICatalog/Scenarios/TextEffectsScenario.cs b/UICatalog/Scenarios/TextEffectsScenario.cs index 8459d4ac9..a8482945e 100644 --- a/UICatalog/Scenarios/TextEffectsScenario.cs +++ b/UICatalog/Scenarios/TextEffectsScenario.cs @@ -74,7 +74,7 @@ public class TextEffectsScenario : Scenario { LoopingGradient = e.NewValue == CheckState.Checked; SetupGradientLineCanvas (w, w.Frame.Size); - _tabView.SetNeedsDisplay (); + _tabView.SetNeedsDraw (); }; gradientsView.Add (cbLooping); diff --git a/UICatalog/Scenarios/Threading.cs b/UICatalog/Scenarios/Threading.cs index e1b0653f9..69ddbb01c 100644 --- a/UICatalog/Scenarios/Threading.cs +++ b/UICatalog/Scenarios/Threading.cs @@ -241,6 +241,6 @@ public class Threading : Scenario await Task.Delay (3000); LogJob ("Returning from task method"); await _itemsList.SetSourceAsync (items); - _itemsList.SetNeedsDisplay (); + _itemsList.SetNeedsDraw (); } } diff --git a/UICatalog/Scenarios/TreeViewFileSystem.cs b/UICatalog/Scenarios/TreeViewFileSystem.cs index 6679d2bc7..91141bf8c 100644 --- a/UICatalog/Scenarios/TreeViewFileSystem.cs +++ b/UICatalog/Scenarios/TreeViewFileSystem.cs @@ -217,7 +217,7 @@ public class TreeViewFileSystem : Scenario _miInvertSymbols.Checked = !_miInvertSymbols.Checked; _treeViewFiles.Style.InvertExpandSymbolColors = (bool)_miInvertSymbols.Checked; - _treeViewFiles.SetNeedsDisplay (); + _treeViewFiles.SetNeedsDraw (); } private void Quit () { Application.RequestStop (); } @@ -226,7 +226,7 @@ public class TreeViewFileSystem : Scenario { _treeViewFiles.Style.HighlightModelTextOnly = !_treeViewFiles.Style.HighlightModelTextOnly; _miHighlightModelTextOnly.Checked = _treeViewFiles.Style.HighlightModelTextOnly; - _treeViewFiles.SetNeedsDisplay (); + _treeViewFiles.SetNeedsDraw (); } private void SetCursor () @@ -287,7 +287,7 @@ public class TreeViewFileSystem : Scenario _treeViewFiles.ColorGetter = null; } - _treeViewFiles.SetNeedsDisplay (); + _treeViewFiles.SetNeedsDraw (); } private void SetExpandableSymbols (Rune expand, Rune? collapse) @@ -298,7 +298,7 @@ public class TreeViewFileSystem : Scenario _treeViewFiles.Style.ExpandableSymbol = expand; _treeViewFiles.Style.CollapseableSymbol = collapse; - _treeViewFiles.SetNeedsDisplay (); + _treeViewFiles.SetNeedsDraw (); } private void SetFullName () @@ -314,7 +314,7 @@ public class TreeViewFileSystem : Scenario _treeViewFiles.AspectGetter = f => f.Name; } - _treeViewFiles.SetNeedsDisplay (); + _treeViewFiles.SetNeedsDraw (); } private void SetLeaveLastRow () @@ -380,7 +380,7 @@ public class TreeViewFileSystem : Scenario scrollBar.Position = _treeViewFiles.ScrollOffsetVertical; } - _treeViewFiles.SetNeedsDisplay (); + _treeViewFiles.SetNeedsDraw (); }; scrollBar.OtherScrollBarView.ChangedPosition += (s, e) => @@ -392,7 +392,7 @@ public class TreeViewFileSystem : Scenario scrollBar.OtherScrollBarView.Position = _treeViewFiles.ScrollOffsetHorizontal; } - _treeViewFiles.SetNeedsDisplay (); + _treeViewFiles.SetNeedsDraw (); }; _treeViewFiles.DrawingContent += (s, e) => @@ -410,7 +410,7 @@ public class TreeViewFileSystem : Scenario _miColoredSymbols.Checked = !_miColoredSymbols.Checked; _treeViewFiles.Style.ColorExpandSymbol = (bool)_miColoredSymbols.Checked; - _treeViewFiles.SetNeedsDisplay (); + _treeViewFiles.SetNeedsDraw (); } private void ShowContextMenu (Point screenPoint, IFileSystemInfo forObject) @@ -429,7 +429,7 @@ public class TreeViewFileSystem : Scenario _miShowLines.Checked = !_miShowLines.Checked; _treeViewFiles.Style.ShowBranchLines = (bool)_miShowLines.Checked!; - _treeViewFiles.SetNeedsDisplay (); + _treeViewFiles.SetNeedsDraw (); } private void ShowPropertiesOf (IFileSystemInfo fileSystemInfo) { _detailsFrame.FileInfo = fileSystemInfo; } @@ -514,7 +514,7 @@ public class TreeViewFileSystem : Scenario _miBasicIcons.Checked = !_iconProvider.UseNerdIcons && !_iconProvider.UseUnicodeCharacters; _miUnicodeIcons.Checked = _iconProvider.UseUnicodeCharacters; _miNerdIcons.Checked = _iconProvider.UseNerdIcons; - _treeViewFiles.SetNeedsDisplay (); + _treeViewFiles.SetNeedsDraw (); } private class DetailsFrame : FrameView diff --git a/UICatalog/Scenarios/VkeyPacketSimulator.cs b/UICatalog/Scenarios/VkeyPacketSimulator.cs index 20d2bcdc8..e8948c946 100644 --- a/UICatalog/Scenarios/VkeyPacketSimulator.cs +++ b/UICatalog/Scenarios/VkeyPacketSimulator.cs @@ -176,7 +176,7 @@ public class VkeyPacketSimulator : Scenario _outputStarted = true; tvOutput.ReadOnly = false; tvOutput.SetFocus (); - tvOutput.SetNeedsDisplay (); + tvOutput.SetNeedsDraw (); Task.Run ( () => diff --git a/UICatalog/Scenarios/Wizards.cs b/UICatalog/Scenarios/Wizards.cs index 73b256ae2..a1448993f 100644 --- a/UICatalog/Scenarios/Wizards.cs +++ b/UICatalog/Scenarios/Wizards.cs @@ -322,7 +322,7 @@ public class Wizards : Scenario scrollBar.Position = someText.TopRow; } - someText.SetNeedsDisplay (); + someText.SetNeedsDraw (); }; someText.DrawingContent += (s, e) => diff --git a/UICatalog/UICatalog.cs b/UICatalog/UICatalog.cs index ee69d8104..3df0ebf30 100644 --- a/UICatalog/UICatalog.cs +++ b/UICatalog/UICatalog.cs @@ -908,7 +908,7 @@ public class UICatalogApp ((CheckBox)ShForce16Colors!.CommandView!).CheckedState = Application.Force16Colors ? CheckState.Checked : CheckState.UnChecked; - Application.Top!.SetNeedsDisplay (); + Application.Top!.SetNeedsDraw (); } public MenuItem []? CreateThemeMenuItems () diff --git a/UnitTests/Application/ApplicationTests.cs b/UnitTests/Application/ApplicationTests.cs index 2e49d2b51..c0289893e 100644 --- a/UnitTests/Application/ApplicationTests.cs +++ b/UnitTests/Application/ApplicationTests.cs @@ -831,7 +831,7 @@ public class ApplicationTests } // TODO: All Toplevel layout tests should be moved to ToplevelTests.cs - [Fact (Skip = "#2491 - Changing focus should cause NeedsDisplay = true, so bogus test?")] + [Fact (Skip = "#2491 - Changing focus should cause NeedsDraw = true, so bogus test?")] public void Run_Toplevel_With_Modal_View_Does_Not_Refresh_If_Not_Dirty () { Init (); @@ -857,11 +857,11 @@ public class ApplicationTests else if (iteration < 3) { Application.RaiseMouseEvent (new () { Flags = MouseFlags.ReportMousePosition }); - Assert.False (top.NeedsDisplay); - Assert.False (top.SubViewNeedsDisplay); + Assert.False (top.NeedsDraw); + Assert.False (top.SubViewNeedsDraw); Assert.False (top.NeedsLayout); - Assert.False (d.NeedsDisplay); - Assert.False (d.SubViewNeedsDisplay); + Assert.False (d.NeedsDraw); + Assert.False (d.SubViewNeedsDraw); Assert.False (d.NeedsLayout); } else diff --git a/UnitTests/Application/MainLoopTests.cs b/UnitTests/Application/MainLoopTests.cs index d569b0d80..47812926d 100644 --- a/UnitTests/Application/MainLoopTests.cs +++ b/UnitTests/Application/MainLoopTests.cs @@ -810,7 +810,7 @@ public class MainLoopTests btn.Text = "Cancel"; Interlocked.Increment (ref total); - btn.SetNeedsDisplay (); + btn.SetNeedsDraw (); await Task.Run ( () => @@ -857,7 +857,7 @@ public class MainLoopTests { btn.Text = "Pew Pew"; Interlocked.Increment (ref total); - btn.SetNeedsDisplay (); + btn.SetNeedsDraw (); } ); } @@ -907,7 +907,7 @@ public class MainLoopTests { btn.Text = "Click Me"; Interlocked.Increment (ref total); - btn.SetNeedsDisplay (); + btn.SetNeedsDraw (); } ); } diff --git a/UnitTests/Dialogs/DialogTests.cs b/UnitTests/Dialogs/DialogTests.cs index 969fe2e66..08bbed7ea 100644 --- a/UnitTests/Dialogs/DialogTests.cs +++ b/UnitTests/Dialogs/DialogTests.cs @@ -1109,7 +1109,7 @@ public class DialogTests { case 0: Top.SetNeedsLayout(); - Top.SetNeedsDisplay(); + Top.SetNeedsDraw(); LayoutAndDrawToplevels (); break; @@ -1448,7 +1448,7 @@ public class DialogTests RunState runState = Begin (dlg); - dlg.SetNeedsDisplay(); + dlg.SetNeedsDraw(); dlg.SetNeedsLayout (); dlg.Layout (); dlg.Draw (); diff --git a/UnitTests/Drawing/RulerTests.cs b/UnitTests/Drawing/RulerTests.cs index d253edeba..1798b3cef 100644 --- a/UnitTests/Drawing/RulerTests.cs +++ b/UnitTests/Drawing/RulerTests.cs @@ -67,7 +67,7 @@ public class RulerTests ); // Postive offset - top.SetNeedsDisplay (); + top.SetNeedsDraw (); Application.LayoutAndDrawToplevels (); r.Draw (new (1, 1)); @@ -82,7 +82,7 @@ public class RulerTests ); // Negative offset - top.SetNeedsDisplay (); + top.SetNeedsDraw (); Application.LayoutAndDrawToplevels (); r.Draw (new (-1, 1)); @@ -97,7 +97,7 @@ public class RulerTests ); // Clip - top.SetNeedsDisplay (); + top.SetNeedsDraw (); Application.LayoutAndDrawToplevels (); r.Draw (new (10, 1)); @@ -143,7 +143,7 @@ public class RulerTests _output ); - f.SetNeedsDisplay(); + f.SetNeedsDraw(); Application.LayoutAndDrawToplevels (); r.Length = len; r.Draw (new (1, 0), 1); @@ -206,7 +206,7 @@ public class RulerTests ); // Postive offset - f.SetNeedsDisplay (); + f.SetNeedsDraw (); Application.LayoutAndDrawToplevels (true); r.Draw (new (1, 1)); @@ -236,7 +236,7 @@ public class RulerTests ); // Negative offset - f.SetNeedsDisplay (); + f.SetNeedsDraw (); Application.LayoutAndDrawToplevels (); r.Draw (new (1, -1)); @@ -266,7 +266,7 @@ public class RulerTests ); // Clip - f.SetNeedsDisplay (); + f.SetNeedsDraw (); Application.LayoutAndDrawToplevels (); r.Draw (new (1, 10)); @@ -342,7 +342,7 @@ public class RulerTests └───┘", _output ); - f.SetNeedsDisplay (); + f.SetNeedsDraw (); Application.LayoutAndDrawToplevels (true); r.Length = len; r.Draw (new (0, 1), 1); diff --git a/UnitTests/Drawing/ThicknessTests.cs b/UnitTests/Drawing/ThicknessTests.cs index 3a33d670a..c1a5cbae5 100644 --- a/UnitTests/Drawing/ThicknessTests.cs +++ b/UnitTests/Drawing/ThicknessTests.cs @@ -200,7 +200,7 @@ public class ThicknessTests (ITestOutputHelper output) t = new Thickness (1, 1, 1, 1); r = new Rectangle (1, 1, 40, 15); - top.SetNeedsDisplay (); + top.SetNeedsDraw (); Application.RunIteration (ref rs); t.Draw (r, ViewDiagnosticFlags.Ruler, "Test"); @@ -231,7 +231,7 @@ public class ThicknessTests (ITestOutputHelper output) t = new Thickness (1, 2, 3, 4); r = new Rectangle (2, 2, 40, 15); - top.SetNeedsDisplay (); + top.SetNeedsDraw (); Application.RunIteration (ref rs); t.Draw (r, ViewDiagnosticFlags.Ruler, "Test"); @@ -262,7 +262,7 @@ public class ThicknessTests (ITestOutputHelper output) t = new Thickness (-1, 1, 1, 1); r = new Rectangle (5, 5, 40, 15); - top.SetNeedsDisplay (); + top.SetNeedsDraw (); Application.RunIteration (ref rs); t.Draw (r, ViewDiagnosticFlags.Ruler, "Test"); diff --git a/UnitTests/Text/AutocompleteTests.cs b/UnitTests/Text/AutocompleteTests.cs index c0d00f99d..7be3f35e0 100644 --- a/UnitTests/Text/AutocompleteTests.cs +++ b/UnitTests/Text/AutocompleteTests.cs @@ -24,7 +24,7 @@ public class AutocompleteTests (ITestOutputHelper output) for (var i = 0; i < 7; i++) { Assert.True (tv.NewKeyDownEvent (Key.CursorRight)); - top.SetNeedsDisplay(); + top.SetNeedsDraw(); Application.RunIteration (ref rs); if (i < 4 || i > 5) @@ -52,7 +52,7 @@ This a long line and against TextView. new() { Position = new (6, 0), Flags = MouseFlags.Button1Pressed } ) ); - top.SetNeedsDisplay (); + top.SetNeedsDraw (); Application.RunIteration (ref rs); TestHelpers.AssertDriverContentsWithFrameAre ( @@ -64,7 +64,7 @@ This a long line and against TextView. ); Assert.True (tv.NewKeyDownEvent (Key.G)); - top.SetNeedsDisplay (); + top.SetNeedsDraw (); Application.RunIteration (ref rs); TestHelpers.AssertDriverContentsWithFrameAre ( @@ -75,7 +75,7 @@ This ag long line and against TextView. ); Assert.True (tv.NewKeyDownEvent (Key.CursorLeft)); - top.SetNeedsDisplay (); + top.SetNeedsDraw (); Application.RunIteration (ref rs); TestHelpers.AssertDriverContentsWithFrameAre ( @@ -86,7 +86,7 @@ This ag long line and against TextView. ); Assert.True (tv.NewKeyDownEvent (Key.CursorLeft)); - top.SetNeedsDisplay (); + top.SetNeedsDraw (); Application.RunIteration (ref rs); TestHelpers.AssertDriverContentsWithFrameAre ( @@ -97,7 +97,7 @@ This ag long line and against TextView. ); Assert.True (tv.NewKeyDownEvent (Key.CursorLeft)); - top.SetNeedsDisplay (); + top.SetNeedsDraw (); Application.RunIteration (ref rs); TestHelpers.AssertDriverContentsWithFrameAre ( @@ -109,7 +109,7 @@ This ag long line and against TextView.", for (var i = 0; i < 3; i++) { Assert.True (tv.NewKeyDownEvent (Key.CursorRight)); - top.SetNeedsDisplay (); + top.SetNeedsDraw (); Application.RunIteration (ref rs); TestHelpers.AssertDriverContentsWithFrameAre ( @@ -121,7 +121,7 @@ This ag long line and against TextView. } Assert.True (tv.NewKeyDownEvent (Key.Backspace)); - top.SetNeedsDisplay (); + top.SetNeedsDraw (); Application.RunIteration (ref rs); TestHelpers.AssertDriverContentsWithFrameAre ( @@ -133,7 +133,7 @@ This a long line and against TextView. ); Assert.True (tv.NewKeyDownEvent (Key.N)); - top.SetNeedsDisplay (); + top.SetNeedsDraw (); Application.RunIteration (ref rs); TestHelpers.AssertDriverContentsWithFrameAre ( @@ -144,7 +144,7 @@ This an long line and against TextView. ); Assert.True (tv.NewKeyDownEvent (Key.CursorRight)); - top.SetNeedsDisplay (); + top.SetNeedsDraw (); Application.RunIteration (ref rs); TestHelpers.AssertDriverContentsWithFrameAre ( diff --git a/UnitTests/UICatalog/ScenarioTests.cs b/UnitTests/UICatalog/ScenarioTests.cs index fbd33effa..efcfd6216 100644 --- a/UnitTests/UICatalog/ScenarioTests.cs +++ b/UnitTests/UICatalog/ScenarioTests.cs @@ -746,7 +746,7 @@ public class ScenarioTests : TestsAllViews //DimPosChanged (); _hostPane.LayoutSubviews (); _hostPane.ClearViewport (); - _hostPane.SetNeedsDisplay (); + _hostPane.SetNeedsDraw (); UpdateSettings (view); UpdateTitle (view); diff --git a/UnitTests/View/Adornment/MarginTests.cs b/UnitTests/View/Adornment/MarginTests.cs index 82c35656d..f3ed87769 100644 --- a/UnitTests/View/Adornment/MarginTests.cs +++ b/UnitTests/View/Adornment/MarginTests.cs @@ -29,7 +29,7 @@ public class MarginTests (ITestOutputHelper output) superView.BeginInit (); superView.EndInit (); - view.SetNeedsDisplay(); + view.SetNeedsDraw(); view.Draw (); View.Diagnostics = ViewDiagnosticFlags.Off; diff --git a/UnitTests/View/Draw/AllViewsDrawTests.cs b/UnitTests/View/Draw/AllViewsDrawTests.cs index 834354531..0be06a6f2 100644 --- a/UnitTests/View/Draw/AllViewsDrawTests.cs +++ b/UnitTests/View/Draw/AllViewsDrawTests.cs @@ -40,7 +40,7 @@ public class AllViewsDrawTests (ITestOutputHelper _output) : TestsAllViews Assert.Equal (1, layoutStartedCount); Assert.Equal (1, layoutCompleteCount); - view.SetNeedsDisplay (); + view.SetNeedsDraw (); view.Draw (); Assert.Equal (1, drawCompleteCount); diff --git a/UnitTests/View/Draw/DrawTests.cs b/UnitTests/View/Draw/DrawTests.cs index d21f9eafa..fa09c6ea5 100644 --- a/UnitTests/View/Draw/DrawTests.cs +++ b/UnitTests/View/Draw/DrawTests.cs @@ -102,7 +102,7 @@ public class DrawTests (ITestOutputHelper _output) _output); // Now try to clear beyond Viewport (invalid; clipping should prevent) - superView.SetNeedsDisplay (); + superView.SetNeedsDraw (); superView.Draw (); TestHelpers.AssertDriverContentsWithFrameAre ( @@ -122,7 +122,7 @@ public class DrawTests (ITestOutputHelper _output) _output); // Now try to clear beyond Viewport (valid) - superView.SetNeedsDisplay (); + superView.SetNeedsDraw (); superView.Draw (); TestHelpers.AssertDriverContentsWithFrameAre ( @@ -142,7 +142,7 @@ public class DrawTests (ITestOutputHelper _output) _output); // Now clear too much size - superView.SetNeedsDisplay (); + superView.SetNeedsDraw (); superView.Draw (); TestHelpers.AssertDriverContentsWithFrameAre ( @@ -404,13 +404,13 @@ public class DrawTests (ITestOutputHelper _output) { var view = new View { Width = 2, Height = 2, BorderStyle = LineStyle.Single }; Assert.True (view.NeedsLayout); - Assert.True (view.NeedsDisplay); + Assert.True (view.NeedsDraw); view.Layout (); Assert.Equal (new (0, 0, 2, 2), view.Frame); Assert.Equal (Rectangle.Empty, view.Viewport); - Assert.True (view.NeedsDisplay); + Assert.True (view.NeedsDraw); view.Draw (); TestHelpers.AssertDriverContentsWithFrameAre ( diff --git a/UnitTests/View/Draw/NeedsDisplayTests.cs b/UnitTests/View/Draw/NeedsDisplayTests.cs index 51574d338..7100e6a29 100644 --- a/UnitTests/View/Draw/NeedsDisplayTests.cs +++ b/UnitTests/View/Draw/NeedsDisplayTests.cs @@ -2,21 +2,21 @@ namespace Terminal.Gui.ViewTests; [Trait ("Category", "Output")] -public class NeedsDisplayTests () +public class NeedsDrawTests () { [Fact] - public void NeedsDisplay_False_If_Width_Height_Zero () + public void NeedsDraw_False_If_Width_Height_Zero () { View view = new () { Width = 0, Height = 0 }; view.BeginInit (); view.EndInit (); - Assert.True (view.NeedsDisplay); - //Assert.False (view.SubViewNeedsDisplay); + Assert.True (view.NeedsDraw); + //Assert.False (view.SubViewNeedsDraw); } [Fact] - public void NeedsDisplay_True_Initially_If_Width_Height_Not_Zero () + public void NeedsDraw_True_Initially_If_Width_Height_Not_Zero () { View superView = new () { Width = 1, Height = 1 }; View view1 = new () { Width = 1, Height = 1 }; @@ -26,122 +26,122 @@ public class NeedsDisplayTests () superView.BeginInit (); superView.EndInit (); - Assert.True (superView.NeedsDisplay); - Assert.True (superView.SubViewNeedsDisplay); - Assert.True (view1.NeedsDisplay); - Assert.True (view2.NeedsDisplay); + Assert.True (superView.NeedsDraw); + Assert.True (superView.SubViewNeedsDraw); + Assert.True (view1.NeedsDraw); + Assert.True (view2.NeedsDraw); - superView.Layout (); // NeedsDisplay is always false if Layout is needed + superView.Layout (); // NeedsDraw is always false if Layout is needed superView.Draw (); - Assert.False (superView.NeedsDisplay); - Assert.False (superView.SubViewNeedsDisplay); - Assert.False (view1.NeedsDisplay); - Assert.False (view2.NeedsDisplay); + Assert.False (superView.NeedsDraw); + Assert.False (superView.SubViewNeedsDraw); + Assert.False (view1.NeedsDraw); + Assert.False (view2.NeedsDraw); - superView.SetNeedsDisplay (); + superView.SetNeedsDraw (); - Assert.True (superView.NeedsDisplay); - Assert.True (superView.SubViewNeedsDisplay); - Assert.True (view1.NeedsDisplay); - Assert.True (view2.NeedsDisplay); + Assert.True (superView.NeedsDraw); + Assert.True (superView.SubViewNeedsDraw); + Assert.True (view1.NeedsDraw); + Assert.True (view2.NeedsDraw); } [Fact] - public void NeedsDisplay_True_After_Constructor () + public void NeedsDraw_True_After_Constructor () { var view = new View { Width = 2, Height = 2 }; - Assert.True (view.NeedsDisplay); + Assert.True (view.NeedsDraw); view = new View { Width = 2, Height = 2, BorderStyle = LineStyle.Single }; - Assert.True (view.NeedsDisplay); + Assert.True (view.NeedsDraw); } [Fact] - public void NeedsDisplay_True_After_BeginInit () + public void NeedsDraw_True_After_BeginInit () { var view = new View { Width = 2, Height = 2, BorderStyle = LineStyle.Single }; - Assert.True (view.NeedsDisplay); + Assert.True (view.NeedsDraw); view.BeginInit (); - Assert.True (view.NeedsDisplay); + Assert.True (view.NeedsDraw); - view.NeedsDisplay = false; + view.NeedsDraw = false; view.BeginInit (); - Assert.True (view.NeedsDisplay); // Because layout is still needed + Assert.True (view.NeedsDraw); // Because layout is still needed view.Layout (); - Assert.False (view.NeedsDisplay); + Assert.False (view.NeedsDraw); } [Fact] - public void NeedsDisplay_False_After_EndInit () + public void NeedsDraw_False_After_EndInit () { var view = new View { Width = 2, Height = 2, BorderStyle = LineStyle.Single }; - Assert.True (view.NeedsDisplay); + Assert.True (view.NeedsDraw); view.BeginInit (); - Assert.True (view.NeedsDisplay); + Assert.True (view.NeedsDraw); view.EndInit (); - Assert.True (view.NeedsDisplay); + Assert.True (view.NeedsDraw); view = new View { Width = 2, Height = 2, BorderStyle = LineStyle.Single }; view.BeginInit (); - view.NeedsDisplay = false; + view.NeedsDraw = false; view.EndInit (); - Assert.True (view.NeedsDisplay); + Assert.True (view.NeedsDraw); } [Fact] - public void NeedsDisplay_After_SetLayoutNeeded () + public void NeedsDraw_After_SetLayoutNeeded () { var view = new View { Width = 2, Height = 2 }; - Assert.True (view.NeedsDisplay); + Assert.True (view.NeedsDraw); Assert.False (view.NeedsLayout); view.Draw (); - Assert.False (view.NeedsDisplay); + Assert.False (view.NeedsDraw); Assert.False (view.NeedsLayout); view.SetNeedsLayout (); - Assert.True (view.NeedsDisplay); + Assert.True (view.NeedsDraw); Assert.True (view.NeedsLayout); } [Fact] - public void NeedsDisplay_False_After_SetRelativeLayout_Absolute_Dims () + public void NeedsDraw_False_After_SetRelativeLayout_Absolute_Dims () { var view = new View { Width = 2, Height = 2 }; - Assert.True (view.NeedsDisplay); + Assert.True (view.NeedsDraw); view.Draw (); - Assert.False (view.NeedsDisplay); + Assert.False (view.NeedsDraw); Assert.False (view.NeedsLayout); // SRL won't change anything since the view is Absolute view.SetRelativeLayout (Application.Screen.Size); - Assert.False (view.NeedsDisplay); + Assert.False (view.NeedsDraw); view.SetNeedsLayout (); // SRL won't change anything since the view is Absolute view.SetRelativeLayout (Application.Screen.Size); - Assert.True (view.NeedsDisplay); + Assert.True (view.NeedsDraw); - view.NeedsDisplay = false; + view.NeedsDraw = false; // SRL won't change anything since the view is Absolute. However, Layout has not been called view.SetRelativeLayout (new (10, 10)); - Assert.True (view.NeedsDisplay); + Assert.True (view.NeedsDraw); } [Fact] - public void NeedsDisplay_False_After_SetRelativeLayout_Relative_Dims () + public void NeedsDraw_False_After_SetRelativeLayout_Relative_Dims () { var view = new View { Width = Dim.Percent (50), Height = Dim.Percent (50) }; View superView = new () @@ -150,28 +150,28 @@ public class NeedsDisplayTests () Width = Dim.Fill (), Height = Dim.Fill () }; - Assert.True (superView.NeedsDisplay); + Assert.True (superView.NeedsDraw); superView.Add (view); - Assert.True (view.NeedsDisplay); - Assert.True (superView.NeedsDisplay); + Assert.True (view.NeedsDraw); + Assert.True (superView.NeedsDraw); superView.BeginInit (); - Assert.True (view.NeedsDisplay); - Assert.True (superView.NeedsDisplay); + Assert.True (view.NeedsDraw); + Assert.True (superView.NeedsDraw); superView.EndInit (); - Assert.True (view.NeedsDisplay); - Assert.True (superView.NeedsDisplay); + Assert.True (view.NeedsDraw); + Assert.True (superView.NeedsDraw); superView.SetRelativeLayout (Application.Screen.Size); - Assert.True (view.NeedsDisplay); - Assert.True (superView.NeedsDisplay); + Assert.True (view.NeedsDraw); + Assert.True (superView.NeedsDraw); } [Fact] - public void NeedsDisplay_False_After_SetRelativeLayout_10x10 () + public void NeedsDraw_False_After_SetRelativeLayout_10x10 () { View superView = new () { @@ -179,58 +179,58 @@ public class NeedsDisplayTests () Width = Dim.Fill (), Height = Dim.Fill () }; - Assert.True (superView.NeedsDisplay); + Assert.True (superView.NeedsDraw); superView.Layout (); - superView.NeedsDisplay = false; + superView.NeedsDraw = false; superView.SetRelativeLayout (new (10, 10)); - Assert.True (superView.NeedsDisplay); + Assert.True (superView.NeedsDraw); } [Fact] - public void NeedsDisplay_True_After_LayoutSubviews () + public void NeedsDraw_True_After_LayoutSubviews () { var view = new View { Width = 2, Height = 2, BorderStyle = LineStyle.Single }; - Assert.True (view.NeedsDisplay); + Assert.True (view.NeedsDraw); view.BeginInit (); - Assert.True (view.NeedsDisplay); + Assert.True (view.NeedsDraw); view.EndInit (); - Assert.True (view.NeedsDisplay); + Assert.True (view.NeedsDraw); view.SetRelativeLayout (Application.Screen.Size); - Assert.True (view.NeedsDisplay); + Assert.True (view.NeedsDraw); view.LayoutSubviews (); - Assert.True (view.NeedsDisplay); + Assert.True (view.NeedsDraw); } [Fact] - public void NeedsDisplay_False_After_Draw () + public void NeedsDraw_False_After_Draw () { var view = new View { Width = 2, Height = 2, BorderStyle = LineStyle.Single }; - Assert.True (view.NeedsDisplay); + Assert.True (view.NeedsDraw); view.BeginInit (); - Assert.True (view.NeedsDisplay); + Assert.True (view.NeedsDraw); view.EndInit (); - Assert.True (view.NeedsDisplay); + Assert.True (view.NeedsDraw); view.SetRelativeLayout (Application.Screen.Size); - Assert.True (view.NeedsDisplay); + Assert.True (view.NeedsDraw); view.LayoutSubviews (); - Assert.True (view.NeedsDisplay); + Assert.True (view.NeedsDraw); view.Draw (); - Assert.False (view.NeedsDisplay); + Assert.False (view.NeedsDraw); } [Fact] - public void NeedsDisplayRect_Is_Viewport_Relative () + public void NeedsDrawRect_Is_Viewport_Relative () { View superView = new () { @@ -240,7 +240,7 @@ public class NeedsDisplayTests () }; Assert.Equal (new (0, 0, 10, 10), superView.Frame); Assert.Equal (new (0, 0, 10, 10), superView.Viewport); - Assert.Equal (new (0, 0, 10, 10), superView._needsDisplayRect); + Assert.Equal (new (0, 0, 10, 10), superView._needsDrawRect); var view = new View { @@ -250,50 +250,50 @@ public class NeedsDisplayTests () view.Frame = new (0, 1, 2, 3); Assert.Equal (new (0, 1, 2, 3), view.Frame); Assert.Equal (new (0, 0, 2, 3), view.Viewport); - Assert.Equal (new (0, 0, 2, 3), view._needsDisplayRect); + Assert.Equal (new (0, 0, 2, 3), view._needsDrawRect); superView.Add (view); Assert.Equal (new (0, 0, 10, 10), superView.Frame); Assert.Equal (new (0, 0, 10, 10), superView.Viewport); - Assert.Equal (new (0, 0, 10, 10), superView._needsDisplayRect); + Assert.Equal (new (0, 0, 10, 10), superView._needsDrawRect); Assert.Equal (new (0, 1, 2, 3), view.Frame); Assert.Equal (new (0, 0, 2, 3), view.Viewport); - Assert.Equal (new (0, 0, 2, 3), view._needsDisplayRect); + Assert.Equal (new (0, 0, 2, 3), view._needsDrawRect); view.Frame = new (3, 3, 5, 5); Assert.Equal (new (3, 3, 5, 5), view.Frame); Assert.Equal (new (0, 0, 5, 5), view.Viewport); - Assert.Equal (new (0, 0, 5, 5), view._needsDisplayRect); + Assert.Equal (new (0, 0, 5, 5), view._needsDrawRect); view.Frame = new (3, 3, 6, 6); // Grow right/bottom 1 Assert.Equal (new (3, 3, 6, 6), view.Frame); Assert.Equal (new (0, 0, 6, 6), view.Viewport); - Assert.Equal (new (0, 0, 6, 6), view._needsDisplayRect); + Assert.Equal (new (0, 0, 6, 6), view._needsDrawRect); view.Frame = new (3, 3, 5, 5); // Shrink right/bottom 1 Assert.Equal (new (3, 3, 5, 5), view.Frame); Assert.Equal (new (0, 0, 5, 5), view.Viewport); - Assert.Equal (new (0, 0, 5, 5), view._needsDisplayRect); + Assert.Equal (new (0, 0, 5, 5), view._needsDrawRect); view.SetContentSize (new (10, 10)); Assert.Equal (new (3, 3, 5, 5), view.Frame); Assert.Equal (new (0, 0, 5, 5), view.Viewport); - Assert.Equal (new (0, 0, 5, 5), view._needsDisplayRect); + Assert.Equal (new (0, 0, 5, 5), view._needsDrawRect); view.Viewport = new (1, 1, 5, 5); // Scroll up/left 1 Assert.Equal (new (3, 3, 5, 5), view.Frame); Assert.Equal (new (1, 1, 5, 5), view.Viewport); - Assert.Equal (new (0, 0, 5, 5), view._needsDisplayRect); + Assert.Equal (new (0, 0, 5, 5), view._needsDrawRect); view.Frame = new (3, 3, 6, 6); // Grow right/bottom 1 Assert.Equal (new (3, 3, 6, 6), view.Frame); Assert.Equal (new (1, 1, 6, 6), view.Viewport); - Assert.Equal (new (1, 1, 6, 6), view._needsDisplayRect); + Assert.Equal (new (1, 1, 6, 6), view._needsDrawRect); view.Frame = new (3, 3, 5, 5); Assert.Equal (new (3, 3, 5, 5), view.Frame); Assert.Equal (new (1, 1, 5, 5), view.Viewport); - Assert.Equal (new (1, 1, 5, 5), view._needsDisplayRect); + Assert.Equal (new (1, 1, 5, 5), view._needsDrawRect); } } diff --git a/UnitTests/View/Layout/LayoutTests.cs b/UnitTests/View/Layout/LayoutTests.cs index da4d40e9e..d1cde695d 100644 --- a/UnitTests/View/Layout/LayoutTests.cs +++ b/UnitTests/View/Layout/LayoutTests.cs @@ -32,7 +32,7 @@ public class LayoutTests (ITestOutputHelper _output) : TestsAllViews view.SubviewsLaidOut += (s, e) => layoutCompleteCount++; view.SetNeedsLayout (); - view.SetNeedsDisplay(); + view.SetNeedsDraw(); view.Layout (); Assert.Equal (0, drawContentCount); diff --git a/UnitTests/View/TextTests.cs b/UnitTests/View/TextTests.cs index c2454d777..cb0af3206 100644 --- a/UnitTests/View/TextTests.cs +++ b/UnitTests/View/TextTests.cs @@ -279,7 +279,7 @@ Y Assert.Equal (new (0, 0, 12, 1), view.Frame); top.ClearViewport (); - view.SetNeedsDisplay (); + view.SetNeedsDraw (); view.Draw (); expected = @" HelloWorlds"; TestHelpers.AssertDriverContentsWithFrameAre (expected, output); @@ -715,8 +715,8 @@ w "; lbl.Layout (); Assert.Equal (new (0, 0, 2, 1), lbl.Frame); - Assert.Equal (new (0, 0, 2, 1), lbl._needsDisplayRect); - Assert.Equal (new (0, 0, 80, 25), lbl.SuperView._needsDisplayRect); + Assert.Equal (new (0, 0, 2, 1), lbl._needsDrawRect); + Assert.Equal (new (0, 0, 80, 25), lbl.SuperView._needsDrawRect); Assert.True (lbl.SuperView.NeedsLayout); Application.RunIteration (ref rs); diff --git a/UnitTests/View/ViewTests.cs b/UnitTests/View/ViewTests.cs index d53ff0209..b50aa3ca4 100644 --- a/UnitTests/View/ViewTests.cs +++ b/UnitTests/View/ViewTests.cs @@ -259,7 +259,7 @@ At 0,0 view.Frame = new (3, 3, 10, 1); Assert.Equal (new (3, 3, 10, 1), view.Frame); Assert.Equal (new (0, 0, 10, 1), view.Viewport); - Assert.Equal (new (0, 0, 10, 1), view._needsDisplayRect); + Assert.Equal (new (0, 0, 10, 1), view._needsDrawRect); //Application.Refresh(); top.Draw (); @@ -310,7 +310,7 @@ At 0,0 view.Height = 1; Assert.Equal (new (3, 3, 10, 1), view.Frame); Assert.Equal (new (0, 0, 10, 1), view.Viewport); - Assert.Equal (new (0, 0, 10, 1), view._needsDisplayRect); + Assert.Equal (new (0, 0, 10, 1), view._needsDrawRect); top.Draw (); TestHelpers.AssertDriverContentsWithFrameAre ( @@ -356,7 +356,7 @@ At 0,0 view.Frame = new (1, 1, 10, 1); Assert.Equal (new (1, 1, 10, 1), view.Frame); Assert.Equal (new (0, 0, 10, 1), view.Viewport); - Assert.Equal (new (0, 0, 10, 1), view._needsDisplayRect); + Assert.Equal (new (0, 0, 10, 1), view._needsDrawRect); top.Draw (); TestHelpers.AssertDriverContentsWithFrameAre ( @@ -404,7 +404,7 @@ At 0,0 view.Height = 1; Assert.Equal (new (1, 1, 10, 1), view.Frame); Assert.Equal (new (0, 0, 10, 1), view.Viewport); - Assert.Equal (new (0, 0, 10, 1), view._needsDisplayRect); + Assert.Equal (new (0, 0, 10, 1), view._needsDrawRect); top.Draw (); TestHelpers.AssertDriverContentsWithFrameAre ( @@ -491,13 +491,13 @@ At 0,0 RunState runState = Application.Begin (top); - top.SubviewsLaidOut += (s, e) => { Assert.Equal (new (0, 0, 80, 25), top._needsDisplayRect); }; + top.SubviewsLaidOut += (s, e) => { Assert.Equal (new (0, 0, 80, 25), top._needsDrawRect); }; - frame.SubviewsLaidOut += (s, e) => { Assert.Equal (new (0, 0, 40, 8), frame._needsDisplayRect); }; + frame.SubviewsLaidOut += (s, e) => { Assert.Equal (new (0, 0, 40, 8), frame._needsDrawRect); }; - label.SubviewsLaidOut += (s, e) => { Assert.Equal (new (0, 0, 38, 1), label._needsDisplayRect); }; + label.SubviewsLaidOut += (s, e) => { Assert.Equal (new (0, 0, 38, 1), label._needsDrawRect); }; - view.SubviewsLaidOut += (s, e) => { Assert.Equal (new (0, 0, 13, 1), view._needsDisplayRect); }; + view.SubviewsLaidOut += (s, e) => { Assert.Equal (new (0, 0, 13, 1), view._needsDrawRect); }; Assert.Equal (new (0, 0, 80, 25), top.Frame); Assert.Equal (new (20, 8, 40, 8), frame.Frame); @@ -571,7 +571,7 @@ At 0,0 view.Frame = new (3, 3, 10, 1); Assert.Equal (new (0, 0, 10, 1), view.Viewport); - Assert.Equal (new (0, 0, 10, 1), view._needsDisplayRect); + Assert.Equal (new (0, 0, 10, 1), view._needsDrawRect); view.Draw (); TestHelpers.AssertDriverContentsWithFrameAre ( @@ -620,7 +620,7 @@ At 0,0 view.Height = 1; Assert.Equal (new (3, 3, 10, 1), view.Frame); Assert.Equal (new (0, 0, 10, 1), view.Viewport); - Assert.Equal (new (0, 0, 10, 1), view._needsDisplayRect); + Assert.Equal (new (0, 0, 10, 1), view._needsDrawRect); view.Draw (); TestHelpers.AssertDriverContentsWithFrameAre ( @@ -666,7 +666,7 @@ At 0,0 view.Frame = new (1, 1, 10, 1); Assert.Equal (new (1, 1, 10, 1), view.Frame); Assert.Equal (new (0, 0, 10, 1), view.Viewport); - Assert.Equal (new (0, 0, 10, 1), view._needsDisplayRect); + Assert.Equal (new (0, 0, 10, 1), view._needsDrawRect); view.Draw (); TestHelpers.AssertDriverContentsWithFrameAre ( @@ -715,7 +715,7 @@ At 0,0 view.Height = 1; Assert.Equal (new (1, 1, 10, 1), view.Frame); Assert.Equal (new (0, 0, 10, 1), view.Viewport); - Assert.Equal (new (0, 0, 10, 1), view._needsDisplayRect); + Assert.Equal (new (0, 0, 10, 1), view._needsDrawRect); view.Draw (); TestHelpers.AssertDriverContentsWithFrameAre ( @@ -1130,7 +1130,7 @@ At 0,0 } } - ClearNeedsDisplay (); + ClearNeedsDraw (); return true; } diff --git a/UnitTests/Views/GraphViewTests.cs b/UnitTests/Views/GraphViewTests.cs index fe58bfc18..abad62814 100644 --- a/UnitTests/Views/GraphViewTests.cs +++ b/UnitTests/Views/GraphViewTests.cs @@ -477,7 +477,7 @@ public class SeriesTests // Even with a margin the graph should be drawn from // the origin, we just get less visible width/height gv.LayoutSubviews (); - gv.SetNeedsDisplay (); + gv.SetNeedsDraw (); gv.Draw (); Assert.Equal (new RectangleF (0, 0, 45, 28), fullGraphBounds); @@ -536,7 +536,7 @@ public class SeriesTests // Even with a margin the graph should be drawn from // the origin, we just get less visible width/height gv.LayoutSubviews (); - gv.SetNeedsDisplay (); + gv.SetNeedsDraw (); gv.Draw (); Assert.Equal (new RectangleF (0, 0, 90, 140), fullGraphBounds); @@ -674,7 +674,7 @@ public class MultiBarSeriesTests multibarSeries.AddBars ("hey", (Rune)'M', 0.5001f, 0.5001f); fakeXAxis.LabelPoints.Clear (); gv.LayoutSubviews (); - gv.SetNeedsDisplay (); + gv.SetNeedsDraw (); gv.Draw (); Assert.Equal (4, fakeXAxis.LabelPoints.Single ()); @@ -683,7 +683,7 @@ public class MultiBarSeriesTests multibarSeries.AddBars ("bob", (Rune)'M', 1, 2); fakeXAxis.LabelPoints.Clear (); gv.LayoutSubviews (); - gv.SetNeedsDisplay (); + gv.SetNeedsDraw (); gv.Draw (); Assert.Equal (3, fakeXAxis.LabelPoints.Count); @@ -745,7 +745,7 @@ public class BarSeriesTests ); // redraw graph - graph.SetNeedsDisplay (); + graph.SetNeedsDraw (); graph.Draw (); // since bars are horizontal all have the same X start cordinates @@ -809,7 +809,7 @@ public class BarSeriesTests barSeries.Orientation = Orientation.Vertical; // redraw graph - graph.SetNeedsDisplay (); + graph.SetNeedsDraw (); graph.Draw (); // bar should be drawn at BarEvery 1f + offset 0.5f = 3 screen units @@ -851,7 +851,7 @@ public class BarSeriesTests barSeries.Orientation = Orientation.Vertical; // redraw graph - graph.SetNeedsDisplay (); + graph.SetNeedsDraw (); graph.Draw (); // bar should not be drawn @@ -1151,7 +1151,7 @@ public class TextAnnotationTests // user scrolls up one unit of graph space gv.ScrollOffset = new PointF (0, 1f); - gv.SetNeedsDisplay (); + gv.SetNeedsDraw (); gv.Draw (); // we expect the text annotation to go down one line since @@ -1185,7 +1185,7 @@ public class TextAnnotationTests ); gv.LayoutSubviews (); - gv.SetNeedsDisplay (); + gv.SetNeedsDraw (); gv.Draw (); // long text should get truncated @@ -1259,7 +1259,7 @@ public class TextAnnotationTests // user scrolls up one unit of graph space gv.ScrollOffset = new PointF (0, 1f); - gv.SetNeedsDisplay (); + gv.SetNeedsDraw (); gv.Draw (); // we expect no change in the location of the annotation (only the axis label changes) @@ -1277,7 +1277,7 @@ public class TextAnnotationTests // user scrolls up one unit of graph space gv.ScrollOffset = new PointF (0, 1f); - gv.SetNeedsDisplay (); + gv.SetNeedsDraw (); gv.Draw (); // we expect no change in the location of the annotation (only the axis label changes) @@ -1537,7 +1537,7 @@ public class PathAnnotationTests // render view view.ColorScheme = new ColorScheme (); Assert.Equal (1, view.Height); - mount.SetNeedsDisplay (); + mount.SetNeedsDraw (); mount.Draw (); // should have the initial text @@ -1545,7 +1545,7 @@ public class PathAnnotationTests // change the text and redraw view.Text = "ff1234"; - mount.SetNeedsDisplay (); + mount.SetNeedsDraw (); mount.Draw (); // should have the new text rendered @@ -1577,7 +1577,7 @@ public class PathAnnotationTests gv.MarginBottom = 1; gv.LayoutSubviews (); - gv.SetNeedsDisplay (); + gv.SetNeedsDraw (); gv.Draw (); var expected = @@ -1616,7 +1616,7 @@ public class PathAnnotationTests gv.MarginLeft = 1; gv.LayoutSubviews (); - gv.SetNeedsDisplay (); + gv.SetNeedsDraw (); gv.Draw (); var expected = diff --git a/UnitTests/Views/LabelTests.cs b/UnitTests/Views/LabelTests.cs index 62419c43c..39391c21b 100644 --- a/UnitTests/Views/LabelTests.cs +++ b/UnitTests/Views/LabelTests.cs @@ -211,13 +211,13 @@ This TextFormatter (tf2) with fill will be cleared on rewritten. ", output ); - Assert.False (label.NeedsDisplay); + Assert.False (label.NeedsDraw); Assert.False (label.NeedsLayout); - Assert.False (label.SubViewNeedsDisplay); + Assert.False (label.SubViewNeedsDraw); label.Text = "This label is rewritten."; - Assert.True (label.NeedsDisplay); + Assert.True (label.NeedsDraw); Assert.True (label.NeedsLayout); - //Assert.False (label.SubViewNeedsDisplay); + //Assert.False (label.SubViewNeedsDraw); label.Draw (); tf1.Text = "This TextFormatter (tf1) is rewritten."; diff --git a/UnitTests/Views/MenuBarTests.cs b/UnitTests/Views/MenuBarTests.cs index c1a8599ec..47b234b61 100644 --- a/UnitTests/Views/MenuBarTests.cs +++ b/UnitTests/Views/MenuBarTests.cs @@ -566,7 +566,7 @@ public class MenuBarTests (ITestOutputHelper output) void ChangeMenuTitle (string title) { menu.Menus [0].Title = title; - menu.SetNeedsDisplay (); + menu.SetNeedsDraw (); } RunState rsDialog = Application.Begin (dialog); @@ -775,7 +775,7 @@ public class MenuBarTests (ITestOutputHelper output) void ChangeMenuTitle (string title) { menu.Menus [0].Title = title; - menu.SetNeedsDisplay (); + menu.SetNeedsDraw (); } RunState rs = Application.Begin (dialog); diff --git a/UnitTests/Views/ScrollBarViewTests.cs b/UnitTests/Views/ScrollBarViewTests.cs index 57be234e1..058cb0452 100644 --- a/UnitTests/Views/ScrollBarViewTests.cs +++ b/UnitTests/Views/ScrollBarViewTests.cs @@ -44,7 +44,7 @@ public class ScrollBarViewTests Assert.Equal (1, _scrollBar.OtherScrollBarView.Viewport.Height); _hostView.Lines = 10; - _hostView.SetNeedsDisplay (); + _hostView.SetNeedsDraw (); _hostView.Draw (); Assert.False (_scrollBar.ShowScrollIndicator); Assert.False (_scrollBar.Visible); @@ -68,7 +68,7 @@ public class ScrollBarViewTests Assert.Equal (1, _scrollBar.OtherScrollBarView.Viewport.Height); _hostView.Cols = 60; - _hostView.SetNeedsDisplay (); + _hostView.SetNeedsDraw (); _hostView.Draw (); Assert.False (_scrollBar.ShowScrollIndicator); Assert.False (_scrollBar.Visible); @@ -92,7 +92,7 @@ public class ScrollBarViewTests Assert.Equal (1, _scrollBar.OtherScrollBarView.Viewport.Height); _hostView.Lines = 40; - _hostView.SetNeedsDisplay (); + _hostView.SetNeedsDraw (); _hostView.Draw (); Assert.True (_scrollBar.ShowScrollIndicator); Assert.True (_scrollBar.Visible); @@ -116,7 +116,7 @@ public class ScrollBarViewTests Assert.Equal (1, _scrollBar.OtherScrollBarView.Viewport.Height); _hostView.Cols = 120; - _hostView.SetNeedsDisplay (); + _hostView.SetNeedsDraw (); _hostView.Draw (); Assert.True (_scrollBar.ShowScrollIndicator); Assert.True (_scrollBar.Visible); @@ -429,7 +429,7 @@ This is a test } Assert.Equal (newScrollBarView.Position, listView.LeftItem); - listView.SetNeedsDisplay (); + listView.SetNeedsDraw (); Application.LayoutAndDrawToplevels (); }; @@ -510,7 +510,7 @@ This is a test } Assert.Equal (newScrollBarView.Position, listView.TopItem); - listView.SetNeedsDisplay (); + listView.SetNeedsDraw (); Application.LayoutAndDrawToplevels (); }; @@ -696,12 +696,12 @@ This is a test AddHandlers (); _hostView.Top = 3; - _hostView.SetNeedsDisplay (); + _hostView.SetNeedsDraw (); _hostView.Draw (); Assert.Equal (_scrollBar.Position, _hostView.Top); _hostView.Left = 6; - _hostView.SetNeedsDisplay (); + _hostView.SetNeedsDraw (); _hostView.Draw (); Assert.Equal (_scrollBar.OtherScrollBarView.Position, _hostView.Left); _hostView.SuperView.Dispose (); @@ -813,7 +813,7 @@ This is a test scrollBar.Position = textView.TopRow; } - textView.SetNeedsDisplay (); + textView.SetNeedsDraw (); }; scrollBar.OtherScrollBarView.ChangedPosition += (s, e) => @@ -825,7 +825,7 @@ This is a test scrollBar.OtherScrollBarView.Position = textView.LeftColumn; } - textView.SetNeedsDisplay (); + textView.SetNeedsDraw (); }; textView.SubviewsLaidOut += (s, e) => @@ -1308,7 +1308,7 @@ This is a test ", _scrollBar.Position = _hostView.Top; } - _hostView.SetNeedsDisplay (); + _hostView.SetNeedsDraw (); } private void _scrollBar_OtherScrollBarView_ChangedPosition (object sender, EventArgs e) @@ -1320,7 +1320,7 @@ This is a test ", _scrollBar.OtherScrollBarView.Position = _hostView.Left; } - _hostView.SetNeedsDisplay (); + _hostView.SetNeedsDraw (); } private void AddHandlers () diff --git a/UnitTests/Views/TableViewTests.cs b/UnitTests/Views/TableViewTests.cs index 99723e90e..fcbc30085 100644 --- a/UnitTests/Views/TableViewTests.cs +++ b/UnitTests/Views/TableViewTests.cs @@ -105,7 +105,7 @@ public class TableViewTests (ITestOutputHelper output) style.ColorGetter = e => { return scheme; }; } - tv.SetNeedsDisplay (); + tv.SetNeedsDraw (); tv.Draw (); expected = @@ -462,7 +462,7 @@ public class TableViewTests (ITestOutputHelper output) style.MaxWidth = 10; tableView.LayoutSubviews (); - tableView.SetNeedsDisplay (); + tableView.SetNeedsDraw (); tableView.Draw (); expected = @@ -483,7 +483,7 @@ public class TableViewTests (ITestOutputHelper output) style.RepresentationGetter = s => { return s.ToString ().Length < 15 ? s.ToString () : s.ToString ().Substring (0, 13) + "..."; }; tableView.LayoutSubviews (); - tableView.SetNeedsDisplay (); + tableView.SetNeedsDraw (); tableView.Draw (); expected = @@ -511,7 +511,7 @@ public class TableViewTests (ITestOutputHelper output) style.MinAcceptableWidth = 5; tableView.LayoutSubviews (); - tableView.SetNeedsDisplay (); + tableView.SetNeedsDraw (); tableView.Draw (); expected = @@ -585,7 +585,7 @@ public class TableViewTests (ITestOutputHelper output) tableView.MinCellWidth = 10; tableView.LayoutSubviews (); - tableView.SetNeedsDisplay (); + tableView.SetNeedsDraw (); tableView.Draw (); expected = @@ -1107,7 +1107,7 @@ public class TableViewTests (ITestOutputHelper output) // the value 2) dt.Rows [0] [1] = 5; - tv.SetNeedsDisplay (); + tv.SetNeedsDraw (); tv.Draw (); expected = @" @@ -1202,7 +1202,7 @@ public class TableViewTests (ITestOutputHelper output) // the value 2) dt.Rows [0] [1] = 5; - tv.SetNeedsDisplay (); + tv.SetNeedsDraw (); tv.Draw (); expected = @" @@ -1985,7 +1985,7 @@ public class TableViewTests (ITestOutputHelper output) │B│C│D│ ◄─┼─┼─┤ │2│3│4│"; - tableView.SetNeedsDisplay (); + tableView.SetNeedsDraw (); tableView.Draw (); TestHelpers.AssertDriverContentsAre (expected, output); @@ -1998,7 +1998,7 @@ public class TableViewTests (ITestOutputHelper output) │B│C│D│ ├─┼─┼─┤ │2│3│4│"; - tableView.SetNeedsDisplay (); + tableView.SetNeedsDraw (); tableView.Draw (); TestHelpers.AssertDriverContentsAre (expected, output); @@ -2013,7 +2013,7 @@ public class TableViewTests (ITestOutputHelper output) tableView.Style.ShowHorizontalScrollIndicators = true; tableView.Style.ShowHorizontalHeaderUnderline = true; tableView.LayoutSubviews (); - tableView.SetNeedsDisplay (); + tableView.SetNeedsDraw (); tableView.Draw (); // normally we should have scroll indicators because DEF are of screen @@ -2035,7 +2035,7 @@ public class TableViewTests (ITestOutputHelper output) │A│B│C│ ├─┼─┼─┤ │1│2│3│"; - tableView.SetNeedsDisplay (); + tableView.SetNeedsDraw (); tableView.Draw (); TestHelpers.AssertDriverContentsAre (expected, output); } diff --git a/UnitTests/Views/TextViewTests.cs b/UnitTests/Views/TextViewTests.cs index b4cbaa7d1..3090be152 100644 --- a/UnitTests/Views/TextViewTests.cs +++ b/UnitTests/Views/TextViewTests.cs @@ -6757,7 +6757,7 @@ TAB to jump between text field", _textView.NewKeyDownEvent (Key.Tab.WithShift); Assert.Equal ("TAB to jump between text fields.", _textView.Text); - Assert.True (_textView.NeedsDisplay); + Assert.True (_textView.NeedsDraw); Application.LayoutAndDrawToplevels (); TestHelpers.AssertDriverContentsWithFrameAre ( @@ -8272,7 +8272,7 @@ Line 2.", TestHelpers.AssertDriverContentsWithFrameAre ("Line 2.", _output); Assert.True (_textView.NewKeyDownEvent (Key.H.WithShift)); - Assert.NotEqual (Rectangle.Empty, _textView._needsDisplayRect); + Assert.NotEqual (Rectangle.Empty, _textView._needsDrawRect); Application.LayoutAndDrawToplevels (); TestHelpers.AssertDriverContentsWithFrameAre ( @@ -8894,12 +8894,12 @@ line. ) ]; TextView tv = CreateTextView (); - tv.DrawNormalColor += _textView_DrawColor; - tv.DrawReadOnlyColor += _textView_DrawColor; - tv.DrawSelectionColor += _textView_DrawColor; - tv.DrawUsedColor += _textView_DrawColor; + tv.DrawNormalColor += textView_DrawColor; + tv.DrawReadOnlyColor += textView_DrawColor; + tv.DrawSelectionColor += textView_DrawColor; + tv.DrawUsedColor += textView_DrawColor; - void _textView_DrawColor (object sender, CellEventArgs e) + void textView_DrawColor (object sender, CellEventArgs e) { Assert.Equal (e.Line [e.Col], text [e.UnwrappedPosition.Row] [e.UnwrappedPosition.Col]); eventCount++; diff --git a/UnitTests/Views/TileViewTests.cs b/UnitTests/Views/TileViewTests.cs index e8a9a1052..513ebdcbd 100644 --- a/UnitTests/Views/TileViewTests.cs +++ b/UnitTests/Views/TileViewTests.cs @@ -1692,7 +1692,7 @@ public class TileViewTests // Keyboard movement on splitter should have no effect if it is not focused bool handled = tileView.NewKeyDownEvent (Key.CursorDown); Assert.False (handled); - tileView.SetNeedsDisplay (); + tileView.SetNeedsDraw (); tileView.Draw (); TestHelpers.AssertDriverContentsAre (looksLike, _output); } @@ -1789,7 +1789,7 @@ public class TileViewTests line.NewKeyDownEvent (Key.CursorUp); line.NewKeyDownEvent (Key.CursorUp); - tileView.SetNeedsDisplay (); + tileView.SetNeedsDraw (); tileView.Layout (); tileView.Draw (); @@ -1918,7 +1918,7 @@ public class TileViewTests // Keyboard movement on splitter should have no effect if it is not focused tileView.NewKeyDownEvent (Key.CursorRight); - tileView.SetNeedsDisplay (); + tileView.SetNeedsDraw (); tileView.Draw (); TestHelpers.AssertDriverContentsAre (looksLike, _output); } @@ -2088,7 +2088,7 @@ public class TileViewTests // Keyboard movement on splitter should have no effect because it // would take us below the minimum splitter size line.NewKeyDownEvent (Key.CursorLeft); - tileView.SetNeedsDisplay (); + tileView.SetNeedsDraw (); tileView.Layout (); tileView.Draw (); TestHelpers.AssertDriverContentsAre (looksLike, _output); @@ -2096,7 +2096,7 @@ public class TileViewTests // but we can continue to move the splitter right if we want line.NewKeyDownEvent (Key.CursorRight); tileView.Layout (); - tileView.SetNeedsDisplay (); + tileView.SetNeedsDraw (); tileView.Draw (); looksLike = @@ -2136,14 +2136,14 @@ public class TileViewTests // would take us below the minimum splitter size line.NewKeyDownEvent (Key.CursorLeft); tileView.Layout (); - tileView.SetNeedsDisplay (); + tileView.SetNeedsDraw (); tileView.Draw (); TestHelpers.AssertDriverContentsAre (looksLike, _output); // but we can continue to move the splitter right if we want line.NewKeyDownEvent (Key.CursorRight); tileView.Layout (); - tileView.SetNeedsDisplay (); + tileView.SetNeedsDraw (); tileView.Draw (); looksLike = @@ -2183,14 +2183,14 @@ public class TileViewTests // would take us below the minimum splitter size line.NewKeyDownEvent (Key.CursorRight); tileView.Layout (); - tileView.SetNeedsDisplay (); + tileView.SetNeedsDraw (); tileView.Draw (); TestHelpers.AssertDriverContentsAre (looksLike, _output); // but we can continue to move the splitter left if we want line.NewKeyDownEvent (Key.CursorLeft); tileView.Layout (); - tileView.SetNeedsDisplay (); + tileView.SetNeedsDraw (); tileView.Draw (); looksLike = @@ -2231,14 +2231,14 @@ public class TileViewTests // would take us below the minimum splitter size line.NewKeyDownEvent (Key.CursorRight); tileView.Layout (); - tileView.SetNeedsDisplay (); + tileView.SetNeedsDraw (); tileView.Draw (); TestHelpers.AssertDriverContentsAre (looksLike, _output); // but we can continue to move the splitter left if we want line.NewKeyDownEvent (Key.CursorLeft); tileView.Layout (); - tileView.SetNeedsDisplay (); + tileView.SetNeedsDraw (); tileView.Draw (); looksLike = @@ -2267,7 +2267,7 @@ public class TileViewTests // Keyboard movement on splitter should have no effect if it is not focused tileView.NewKeyDownEvent (Key.CursorRight); - tileView.SetNeedsDisplay (); + tileView.SetNeedsDraw (); tileView.Draw (); TestHelpers.AssertDriverContentsAre (looksLike, _output); } diff --git a/UnitTests/Views/ToplevelTests.cs b/UnitTests/Views/ToplevelTests.cs index b200b68f7..181309c1f 100644 --- a/UnitTests/Views/ToplevelTests.cs +++ b/UnitTests/Views/ToplevelTests.cs @@ -699,7 +699,7 @@ public partial class ToplevelTests (ITestOutputHelper output) void ViewLayoutStarted (object sender, LayoutEventArgs e) { - Assert.Equal (new (0, 0, 20, 10), view._needsDisplayRect); + Assert.Equal (new (0, 0, 20, 10), view._needsDrawRect); view.SubviewLayout -= ViewLayoutStarted; } @@ -711,12 +711,12 @@ public partial class ToplevelTests (ITestOutputHelper output) view.Frame = new (1, 3, 10, 5); Assert.Equal (new (1, 3, 10, 5), view.Frame); - Assert.Equal (new (0, 0, 10, 5), view._needsDisplayRect); + Assert.Equal (new (0, 0, 10, 5), view._needsDrawRect); view.Frame = new (1, 3, 10, 5); top.Layout (); Assert.Equal (new (1, 3, 10, 5), view.Frame); - Assert.Equal (new (0, 0, 10, 5), view._needsDisplayRect); + Assert.Equal (new (0, 0, 10, 5), view._needsDrawRect); top.Dispose (); } @@ -968,7 +968,7 @@ public partial class ToplevelTests (ITestOutputHelper output) { Assert.Equal (new (1, 3, 18, 16), viewAddedToTop.Frame); - viewAddedToTop.SetNeedsDisplay (); + viewAddedToTop.SetNeedsDraw (); viewAddedToTop.Draw (); top.Move (2, 15); View.Driver.AddStr ("One"); diff --git a/UnitTests/Views/TreeViewTests.cs b/UnitTests/Views/TreeViewTests.cs index b8d7fe48d..5be696982 100644 --- a/UnitTests/Views/TreeViewTests.cs +++ b/UnitTests/Views/TreeViewTests.cs @@ -1243,7 +1243,7 @@ oot two // redraw now that the custom color // delegate is registered - tv.SetNeedsDisplay (); + tv.SetNeedsDraw (); tv.Draw (); // Same text diff --git a/docfx/docs/drawing.md b/docfx/docs/drawing.md index 5385b7431..f7f3ab375 100644 --- a/docfx/docs/drawing.md +++ b/docfx/docs/drawing.md @@ -25,7 +25,7 @@ Line drawing is accomplished using the @Terminal.Gui.LineCanvas API: a) Add the lines via @Terminal.Gui.LineCanvas.Add. b) Either render the line canvas via @Terminal.Gui.LineCanvas.GetMap() or let the @Terminal.Gui.View do so automatically (which enables automatic line joining across Views). -The @Terminal.Gui.Application MainLoop will iterate over all Views in an application looking for views have their @Terminal.Gui.View.NeedsDisplay property set. The @Terminal.Gui.View.Draw method will be called which, in turn. +The @Terminal.Gui.Application MainLoop will iterate over all Views in an application looking for views have their @Terminal.Gui.View.NeedsDraw property set. The @Terminal.Gui.View.Draw method will be called which, in turn. 1) Draws the Adornments (e.g. @Terminal.Gui.View.Border). 2) Sets the Normal color scheme. @@ -39,7 +39,7 @@ Each of these steps can be overridden by developers using the standard [Terminal ### Declaring that drawing is needed -If a View need to redraw because something changed within it's Content Area it can call @Terminal.Gui.View.SetNeedsDisplay. If a View needs to be redrawn because something has changed the size of the Viewport, it can call @Terminal.Gui.View.SetNeedsLayout. +If a View need to redraw because something changed within it's Content Area it can call @Terminal.Gui.View.SetNeedsDraw. If a View needs to be redrawn because something has changed the size of the Viewport, it can call @Terminal.Gui.View.SetNeedsLayout. ## Coordinate System for Drawing