Ejemplo n.º 1
0
void CWListView::OnEditInsertEntry()
{
	//CListCtrl & clc = GetListCtrl( );
	int iAtItem = getFirstSelectedRow();
	if(iAtItem == -1)	// if no selection
		iAtItem = -1; // stick it at the end

#ifndef mr270
	BOOL bIsAmple=TRUE;
	if( m_pTopic->m_label == "Synthesis Tests" )
	{bIsAmple=FALSE;}
	m_pList->setTypeOfTest(bIsAmple);
#endif //270

#ifndef mr270
	CLangModelsDoc *pdoc = (CLangModelsDoc*) GetDocument();
	pdoc->getLang();
	CCarlaLanguage *pLang = pdoc->m_pLang;
	char cCommentChar = pLang->getCommentChar();
	m_pList->setCommentChar(cCommentChar);
	m_pList->setTestEditModel(pLang->m_pTestEditModel);
#endif // mr270

	int iRow = m_pList->insertNewItem(m_listCtrl, iAtItem, 0);
	if (iRow==-1)
		return;
	if(! (m_pList->m_dwFlags & CWList::ITEMS_HAVE_DIALOG))
		m_listCtrl.EditSubLabel(iRow, 0); // do in-place edit

	m_listCtrl.RedrawItems(iAtItem, m_listCtrl.GetItemCount());

	GetDocument()->SetModifiedFlag(); //((CTabbedTreeDoc*)GetDocument())->SetModifiedFlag(TRUE);
}
Ejemplo n.º 2
0
void CWListView::OnEditProperties()
{
	int iRow = getFirstSelectedRow();
	if(iRow<0)
		return;

	// could be a subclass of CWListEntry, an evironment row, or a comment row (<-- really? i don't think we allow comment rows)
	CWListRowItem *pRowItem = getRowItem(iRow);
	if(pRowItem )
	{
		if(!pRowItem->IsKindOf(RUNTIME_CLASS(CWListEntry)))
			pRowItem =	pRowItem->owningEntry();	// open the dialog on the full entry

		BOOL bChanged = TRUE;
#ifndef hab214
		if(m_pList->m_dwFlags & CWList::ITEMS_HAVE_DIALOG ||
		   (pRowItem->IsKindOf(RUNTIME_CLASS(CListEntryComment))) ||
		   (pRowItem->IsKindOf(RUNTIME_CLASS(CListEntryTestData))))
#else //hab214
		if(m_pList->m_dwFlags & CWList::ITEMS_HAVE_DIALOG)
#endif //hab214

		{
#ifndef mr270
			BOOL bIsAmple=TRUE;
			if( m_pTopic->m_label == "Synthesis Tests" )
			{
				bIsAmple=FALSE;
			}

			CLangModelsDoc *pdoc = (CLangModelsDoc*) GetDocument();
			pdoc->getLang();
			CCarlaLanguage *pLang = pdoc->m_pLang;
			char cCommentChar = pLang->getCommentChar();
			pRowItem->setCommentChar(cCommentChar);

			pRowItem->setTypeOfTest(bIsAmple);
			pRowItem->setTestEditModel(pLang->m_pTestEditModel);
#endif // mr270
			bChanged = pRowItem->doEditDialog(m_listCtrl);
		}
		else
			m_listCtrl.EditSubLabel(iRow, 0); // do in-place edit

		//m_listCtrl.Update(iRow);
		// update all the way to the end in case the number of rows this takes
		//	up has changed, as when environments are added or removed
		if(bChanged)
		{
			m_listCtrl.RedrawItems(iRow, 1+m_listCtrl.GetItemCount());
			GetDocument()->SetModifiedFlag();//((CTabbedTreeDoc*)GetDocument())->setModified(TRUE);
		}
	}
}