-
Notifications
You must be signed in to change notification settings - Fork 2
/
IntellisenseListBox.h
43 lines (33 loc) · 1023 Bytes
/
IntellisenseListBox.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#pragma once
class IAutoCompleteClient;
// CIntellisenseListBox
class CIntellisenseListBox : public CListBox
{
DECLARE_DYNAMIC(CIntellisenseListBox)
public:
CIntellisenseListBox();
virtual ~CIntellisenseListBox();
BOOL GetSelectedText(CString &strText);
void Show(CPoint pt);
void Hide();
void SetClient(IAutoCompleteClient *pClient) { _pClient = pClient; }
void Highlight(PCTSTR pszText);
private:
virtual int OnCreate(LPCREATESTRUCT lpCreateStruct);
virtual void OnDestroy();
void OnDrawItem(LPDRAWITEMSTRUCT lpDrawItemStruct);
void DrawItem(LPDRAWITEMSTRUCT lpDrawItemStruct);
int CompareItem(LPCOMPAREITEMSTRUCT lpCompareItemStruct);
void MeasureItem(LPMEASUREITEMSTRUCT lpMeasureItemStruct);
void OnDblClick();
DECLARE_MESSAGE_MAP()
CFont m_font;
CImageList _imageList;
IAutoCompleteClient *_pClient;
};
class IAutoCompleteClient
{
public:
// Returns TRUE if there was an entry selected in the AC
virtual BOOL OnACDoubleClick() = 0;
};