//..............................................................................
//
// Ninja information grid
//

namespace gui {

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

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

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

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

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

	removeItem (InformationItem* item);
}

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

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
		);

	removeProperty (Property* prop);

	InformationGroup* createGroup (
		InformationGroup* group = 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 (
		InformationGroup* group = 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 (
	InformationGroup* group,
	InformationItem* beforeItem,
	char const* name,
	char const* toolTipText
	)
{
	InformationGroup* item = new InformationGroup (name);
	item.m_toolTipText = toolTipText;

	if (group)
		group.addItem (item, beforeItem);
	else
		addItem (item, beforeItem);

	return item;
}

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

	if (group)
		group.addItem (item, beforeItem);
	else
		addItem (item, beforeItem);

	return item;
}

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

} // namespace gui {
