Table of Contents

Class PopupAutocomplete

Namespace
Terminal.Gui
Assembly
Terminal.Gui.dll

Renders an overlay on another view at a given point that allows selecting from a range of 'autocomplete' options.

public abstract class PopupAutocomplete : AutocompleteBase, IAutocomplete
Inheritance
PopupAutocomplete
Implements
Derived
Inherited Members

Constructors

PopupAutocomplete()

Creates a new instance of the PopupAutocomplete class.

Properties

ColorScheme

The colors to use to render the overlay. Accessing this property before the Application has been initialized will cause an error

HostControl

The host control to handle.

ScrollOffset

When more suggestions are available than can be rendered the user can scroll down the dropdown list. This indicates how far down they have gone

Methods

Close()

Closes the Autocomplete context menu if it is showing and ClearSuggestions()

DeleteTextBackwards()

Deletes the text backwards before insert the selected text in the HostControl.

EnsureSelectedIdxIsValid()

Updates SelectedIdx to be a valid index within Suggestions

InsertSelection(Suggestion)

Called when the user confirms a selection at the current cursor location in the HostControl. The accepted string is the full autocomplete word to be inserted. Typically a host will have to remove some characters such that the accepted string completes the word instead of simply being appended.

InsertText(string)

Insert the selected text in the HostControl.

MoveDown()

Moves the selection in the Autocomplete context menu down one

MoveUp()

Moves the selection in the Autocomplete context menu up one

OnMouseEvent(MouseEvent, bool)

Handle mouse events before HostControl e.g. to make mouse events like report/click apply to the autocomplete control instead of changing the cursor position in the underlying text view.

ProcessKey(Key)

Handle key events before HostControl e.g. to make key events like up/down apply to the autocomplete control instead of changing the cursor position in the underlying text view.

RenderOverlay(Point)

Renders the autocomplete dialog inside or outside the given HostControl at the given point.

RenderSelectedIdxByMouse(MouseEvent)

Render the current selection in the Autocomplete context menu by the mouse reporting.

ReopenSuggestions()

Reopen the popup after it has been closed.

Select()

Completes the autocomplete selection process. Called when user hits the SelectionKey.

SetCursorPosition(int)

Set the cursor position in the HostControl.