-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathListBox.h
33 lines (29 loc) · 932 Bytes
/
ListBox.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
#ifndef _LIST_BOX_H_
#define _LIST_BOX_H_
#include <vector>
#include <windows.h>
#include "callback.h"
class ListBox {
private:
std::vector<int> _Data;
bool _DeleteHandle;
HWND _Handle;
CallbackFunc _OnDoubleClick;
void OnDoubleClick();
public:
ListBox(HWND pFather, HINSTANCE phInstance, int pX, int pY, int pWidth, int pHeight);
ListBox(HWND pHandle);
~ListBox();
int GetSelection();
inline int GetData(int pIndex) const {return _Data[pIndex];}
std::wstring GetText(int pIndex);
void SetText(int pIndex, const wchar_t *pText);
void AppendEntry(const wchar_t *pEntry, int pData);
void InsertEntry(int pIndex, const wchar_t *pEntry, int pData);
bool RemoveEntry(int pIndex);
void RemoveAllEntries();
void SetFont(HFONT pFont);
int GetNumEntries();
inline void SetOnDoubleClick(CallbackFunc pFunc){_OnDoubleClick = pFunc;}
};
#endif // _LIST_BOX_H_