#ifndef _listbox_h
#define _listbox_h

class _listbox
{
	_button up, down;
	short x, y, w, h;
	short listsize;
	short sel;
	short offset;
	short delay;
	int mouse_zval;
	char **list;
	void addline(const char *line);
	void addline(const string &text);
	
public:
	void init(int x, int y, int w, int h);
	void additem(const char *item, bool textwrapping);
	void additem(const string &item, bool textwrapping);
	void check(bool selectable = true);
	void unselect();
	void draw(float textopacity = 1.0, bool textonly = false, bool reverseorder = false);
	void clear();
	void sort();
	void scroll(int n);
	void scroll_to_end();
	void setsel(int i);
	char *selected() const;
	char *getitem(int i) const;
	int getsel() const;
	int size() const;
	
	int get_x() const;
	int get_y() const;
	int get_w() const;
	int get_h() const;

	_listbox();
	_listbox(const _listbox &l);
	_listbox &operator=(const _listbox &l);
	~_listbox();
};



#endif
