36#ifndef AUTOCOMPLETEPOPUP_H
37#define AUTOCOMPLETEPOPUP_H
43#include <wx/listctrl.h>
49 wxWindow *GetControl()
override {
return this; }
52 void SetStringValue(
const wxString& s)
override
54 int n = wxListView::FindItem(-1, s);
55 if (n >= 0 && n < wxListView::GetItemCount() )
56 wxListView::Select(n);
59 wxString GetStringValue()
const override
60 {
return (m_value >= 0) ? wxListView::GetItemText(m_value) : wxString(); }
63 struct DonePtr {
AutocompletePopup*& observer; ~DonePtr() { observer =
nullptr; } };
68 wxWindow *m_parent = {};
69 const DonePtr m_doneptr;
70 std::vector<wxString> m_completions;
83 wxString m_fileBaseDir;
93 static bool IsDirectoryCompletion(
const wxString &completion) {
94 return completion.EndsWith(wxS(
"/\""));
105 bool DescendIntoDirectory(
const wxString &completion);
111 bool Create(wxWindow* parent)
override;
114 void OnChar(wxKeyEvent &event);
130 const wxString &fileBaseDir = {});
142 void OnClick(wxMouseEvent &event);
This file declares the class AutoComplete.
This file contains the definition of the class EditorCell.
Definition: Autocomplete.h:61
static bool CompletesFiles(autoCompletionType type)
Is this completion type one that completes file names?
Definition: Autocomplete.h:114
autoCompletionType
All types of things we can autocomplete.
Definition: Autocomplete.h:68
A weak non-owning pointer that becomes null whenever the observed object is destroyed.
Definition: CellPtr.h:511
This class defines what the user sees as input cell.
Definition: EditorCell.h:60