//..............................................................................
//
// Ninja GUI - tool bar
//

import "gui_Action.jnc"
import "gui_ComboBox.jnc"

namespace gui {

//..............................................................................

// toolbar

opaque class ToolBar
{
	destruct ();

	addAction (Action* action);
	addLabel (char const* pText);

	ComboBox* addComboBox (uint_t width = 0);  // 0 = default, -1 = stretch

	ComboBox* addComboBox (
		const char* labelText,
		gui.EnumPropertyOption const* optionTable,
		size_t optionCount
		);  // 0 = default, -1 = stretch

	addSeparator ();
}

// . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

ComboBox* ToolBar.addComboBox (
	const char* labelText,
	gui.EnumPropertyOption const* optionTable,
	size_t optionCount
	)
{
	addLabel (labelText);
	gui.ComboBox* comboBox = addComboBox ();

	for (size_t i = 0; i < optionCount; i++)
		comboBox.addItem (optionTable [i].m_text, optionTable [i].m_value);

	comboBox.adjustSizeToContents ();
	return comboBox;
}

//..............................................................................

} // namespace gui {
