#ifndef __GCOMBO_H
#define __GCOMBO_H

// Combo Box
class LgiClass LCombo :
#if defined BEOS
	public BMenuField,
#endif
	public ResObject,
	public LControl,
	public List<char>
{
	#if defined WIN32
	static LWindowsClass WndClass;
	char *Class() { return LGI_COMBO; }
	uint32 GetStyle() { return WS_VISIBLE | WS_VSCROLL | CBS_DISABLENOSCROLL | CBS_DROPDOWN | CBS_AUTOHSCROLL | WS_CHILD | WS_TABSTOP | ((SortItems) ? CBS_SORT : 0) | LView::GetStyle(); }
	int SysOnNotify(int Code);
	#elif defined BEOS
	BMenuItem *CurItem;
	void AttachedToWindow() { OnCreate(); }
	void MessageReceived(BMessage *message) { OnEvent(message); }
	#endif

	int InitIndex;
	bool SortItems;

public:
	LCombo(int id, int x, int y, int cx, int cy, char *name);
	~LCombo();

	bool Sort() { return SortItems; }
	void Sort(bool s) { SortItems = s; }
	void Value(int64 i);
	int64 Value();
	void Index(int i);
	int Index();
	#if defined BEOS
	char *Name();
	bool Name(const char *n);
	#endif

	LMessage::Result OnEvent(LMessage *Msg);
	bool Delete();
	bool Delete(int i);
	bool Delete(char *p);
	bool Insert(char *p, int Index = -1);
	#if defined BEOS
	void OnCreate();
	#endif
};

#endif
