// ***************************************************************************
void addMacroLine (CGroupList *pParent, uint macNb, const CMacroCmd &macro)
{
	CInterfaceManager	*pIM = CInterfaceManager::getInstance();

	vector< pair<string, string> > vParams;
	vParams.push_back(pair<string,string>("id", "m"+toString(macNb)));
	CInterfaceGroup *pNewMacro = CWidgetManager::getInstance()->getParser()->createGroupInstance(TEMPLATE_MACRO_ELT, pParent->getId(), vParams);
	if (pNewMacro == NULL) return;

	CViewText *pVT = dynamic_cast<CViewText*>(pNewMacro->getView(TEMPLATE_MACRO_ELT_TEXT));
	if (pVT != NULL) pVT->setText(macro.Name);

	CDBCtrlSheet *pCS = dynamic_cast<CDBCtrlSheet*>(pNewMacro->getCtrl(TEMPLATE_MACRO_ELT_ICON));
	if (pCS != NULL) pCS->readFromMacro(macro);

	pVT = dynamic_cast<CViewText*>(pNewMacro->getView(TEMPLATE_MACRO_ELT_KEYTEXT));
	if (pVT != NULL)
	{
		if (macro.Combo.Key != KeyCount)
			pVT->setText(macro.Combo.toUCString());
		else
			pVT->setText(CI18N::get(VIEW_EDITCMD_TEXT_KEY_DEFAULT));
	}

	pNewMacro->setParent (pParent);
	pParent->addChild (pNewMacro);
}