//------------------------------------------------------------------------------------
// irr::gui::IGUIComboBox wrappers
// do not delete a pointer to this
//------------------------------------------------------------------------------------

extern "C" { 

	void IrrGUI_IGUIComboBox_clear(IGUIComboBox* cb)
	{
		if (cb)
			cb->clear();
	}

	u32 IrrGUI_IGUIComboBox_addItem(IGUIComboBox* cb,const c8* text, u32 data = 0)
	{
		if (cb) {
			core::stringw w_text = text;
			return cb->addItem(w_text.c_str(), data);
		} else return 0;
	}

	const c8* IrrGUI_IGUIComboBox_getItem(IGUIComboBox* cb,u32 idx)
	{
		if (cb) {
			stringc* item=new stringc(cb->getItem(idx));
			return item->c_str();
		} else return "";
	}

	u32 IrrGUI_IGUIComboBox_getItemCount(IGUIComboBox* cb)
	{
		if (cb)
			return cb->getItemCount();
		else return 0;
	}

	s32 IrrGUI_IGUIComboBox_getSelected(IGUIComboBox* cb)
	{
		if (cb)
			return cb->getSelected();
		else return -1;
	}

	void IrrGUI_IGUIComboBox_setSelected(IGUIComboBox* cb,s32 id=-1)
	{
		if (cb)
			cb->setSelected(id);
	}

	void IrrGUI_IGUIComboBox_removeItem(IGUIComboBox* cb,u32 id)
	{
		if (cb)
			cb->removeItem(id);
	}

	void IrrGUI_IGUIComboBox_setTextAlignment(IGUIComboBox* cb, EGUI_ALIGNMENT horizontal, EGUI_ALIGNMENT vertical)
	{
		if (cb)
			cb->setTextAlignment(horizontal, vertical);
	}

	u32 IrrGUI_IGUIComboBox_getItemData(IGUIComboBox* cb, u32 idx) {
		if (cb)
			return cb->getItemData(idx);
		else return 0;
	}

	s32 IrrGUI_IGUIComboBox_getIndexForItemData(IGUIComboBox* cb, u32 data ) {
		if (cb)
			return cb->getIndexForItemData(data);
		else return -1;
	}	
}
