//..............................................................................
//
// Ninja GUI - information grid
//

namespace gui {

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

opaque class InformationItem
{
	char const* autoget property m_name;
	char const* autoget property m_toolTipText;
	bool autoget property m_isEnabled;

	addChildItem(
		InformationItem* item,
		InformationItem* beforeItem = null
		);

	removeChildItem(InformationItem* item);
}

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

opaque class InformationGroup: InformationItem
{
	construct(char const* name);
}

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

opaque class InformationValue: InformationItem
{
	construct(char const* name);

	char const* autoget property m_value;
	char const* autoget property m_disabledValue;
	char const* autoget property m_valueToolTipText;
	uint_t autoget property m_valueColor;
	bool autoget property m_isSelectionDependent;
}

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

opaque class InformationGrid
{
	addItem(
		InformationItem* item,
		InformationItem* beforeItem = null
		);

	removeItem(InformationItem* item);

	InformationGroup* createGroup(
		InformationItem* parentItem = null,
		InformationItem* beforeItem = null,
		char const* name,
		char const* toolTipText = null
		);

	InformationGroup* createGroup(
		char const* name,
		char const* toolTipText = null
		)
	{
		return createGroup(,, name, toolTipText);
	}

	InformationValue* createValue(
		InformationItem* parentItem = null,
		InformationItem* beforeItem = null,
		bool isSelectionDependent = false,
		char const* name,
		char const* toolTipText = null
		);

	 InformationValue* createValue(
		char const* name,
		char const* toolTipText = null
		)
	{
		return createValue(,,, name, toolTipText);
	}

	resizeNameColumnToContents();
}

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

InformationGroup* InformationGrid.createGroup(
	InformationItem* parentItem,
	InformationItem* beforeItem,
	char const* name,
	char const* toolTipText
	)
{
	InformationGroup* item = new InformationGroup(name);
	item.m_toolTipText = toolTipText;

	parentItem ?
		parentItem.addChildItem(item, beforeItem) :
		addItem(item, beforeItem);

	return item;
}

InformationValue* InformationGrid.createValue(
	InformationItem* parentItem,
	InformationItem* beforeItem,
	bool isSelectionDependent,
	char const* name,
	char const* toolTipText
	)
{
	InformationValue* item = new InformationValue(name);
	item.m_toolTipText = toolTipText;
	item.m_isSelectionDependent = isSelectionDependent;

	parentItem ?
		parentItem.addChildItem(item, beforeItem) :
		addItem(item, beforeItem);

	return item;
}

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

} // namespace gui {
