28 #define popid_complete_00 (wxID_HIGHEST + 1000)
37 #ifndef AUTOCOMPLETEPOPUP_H
38 #define AUTOCOMPLETEPOPUP_H
44 #include <wx/listctrl.h>
46 #define AC_MENU_LENGTH 25
51 wxWindow *GetControl()
override {
return this; }
54 void SetStringValue(
const wxString& s)
override
56 int n = wxListView::FindItem(-1,s);
57 if (n >= 0 && n < wxListView::GetItemCount() )
58 wxListView::Select(n);
61 wxString GetStringValue()
const override
62 {
return (m_value >= 0) ? wxListView::GetItemText(m_value) : wxString(); }
65 struct DonePtr {
AutocompletePopup*& observer; ~DonePtr() { observer =
nullptr; } };
70 wxWindow *m_parent = {};
71 const DonePtr m_doneptr;
72 wxArrayString m_completions;
86 bool Create(wxWindow* parent)
override;
89 void OnChar(wxKeyEvent &event);
104 void UpdateResults();
106 void OnClick(wxMouseEvent &event);
109 #endif // AUTOCOMPLETEPOPUP_H