Exemple #1
0
/*===========================================================================
 *
 * Class CSrContView Event - int OnDropRecords (DropItems);
 *
 *=========================================================================*/
int CSrContView::OnDropRecords (srrldroprecords_t& DropItems) 
{
	srlvllistinfo_t*	pInfo;
	CSrRecord*			pRecord;
	dword				Index;

	for (Index = 0; Index < DropItems.pRecords->GetSize(); ++Index) 
	{
		pRecord = DropItems.pRecords->GetAt(Index);
    
			/* Don't drag onto ourself */
		if (pRecord == m_EditInfo.pOldRecord) return (SRRL_DROPCHECK_ERROR);
		if (pRecord->GetFormID() == m_EditInfo.pOldRecord->GetFormID()) return (SRRL_DROPCHECK_ERROR);

			/* Ignore any invalid record types */
		if (!SrIsValidContainerRecord(pRecord->GetRecordType())) return (SRRL_DROPCHECK_ERROR);

			/* If we're just checking */
		if (DropItems.Notify.code == ID_SRRECORDLIST_CHECKDROP) continue;

		pInfo = m_LvlListInfo.AddNew();
		pInfo->InitializeNew(SR_NAME_CONT);
		pInfo->SetFormID(pRecord->GetFormID());
		AddItemList(pInfo);
	}

	return (SRRL_DROPCHECK_OK);
}
Exemple #2
0
/*===========================================================================
 *
 * Class CSrContView Event - int OnDropCustomData (DropItems);
 *
 *=========================================================================*/
int CSrContView::OnDropCustomData (srrldroprecords_t& DropItems) 
{
	CSrCntoSubrecord*  pItem;
	srlvllistinfo_t*   pInfo;
	srrlcustomdata_t*  pCustomData;
	dword			   Index;

	for (Index = 0; Index < DropItems.pCustomDatas->GetSize(); ++Index) 
	{
		pCustomData = DropItems.pCustomDatas->GetAt(Index);
		if (pCustomData == NULL) return (SRRL_DROPCHECK_ERROR);
		if (pCustomData->pRecord == NULL) return (SRRL_DROPCHECK_ERROR);

		if (!SrIsValidContainerRecord(pCustomData->pRecord->GetRecordType())) return (SRRL_DROPCHECK_ERROR);
		pItem = SrCastClassNull(CSrCntoSubrecord, pCustomData->Subrecords[0]);
		if (pItem == NULL) return (SRRL_DROPCHECK_ERROR);
    
			/* If we're just checking */
		if (DropItems.Notify.code == ID_SRRECORDLIST_CHECKDROP) continue;

		pInfo = m_LvlListInfo.AddNew();
		pInfo->CopyFrom(pCustomData->Subrecords);
		AddItemList(pInfo);
  }

  return (SRRL_DROPCHECK_OK);
}
Exemple #3
0
/*===========================================================================
 *
 * Class CSrContView Method - void FillItemList (void);
 *
 *=========================================================================*/
void CSrContView::FillItemList (void) 
{
	m_ItemList.DeleteAllItems();
  
	for (dword i = 0; i < m_LvlListInfo.GetSize(); ++i)
	{
		AddItemList(m_LvlListInfo[i]);
	}
}
Exemple #4
0
void sAddItem( void )// 1
{
	int itemno, x, y;

	itemno = GetInt();
	x =		 GetInt();
	y =		 GetInt();

	AddItemList(itemno, 0, 0, 0, x, y);
}
Exemple #5
0
/*===========================================================================
 *
 * Class CSrContView Event - void OnLvllistAdd ();
 *
 *=========================================================================*/
void CSrContView::OnLvllistAdd() 
{
	srlvllistinfo_t*  pNewInfo;
	int				  Result;

	pNewInfo = m_LvlListInfo.AddNew();
	pNewInfo->InitializeNew(SR_NAME_CONT);
	Result = SrEditContItemDlg(pNewInfo, m_pDlgHandler, GetInputRecord()->GetFormID());

	if (Result == SR_CONTITEMDLG_RESULT_CANCEL || Result == SR_CONTITEMDLG_RESULT_DELETE) 
	{
		m_LvlListInfo.Delete(pNewInfo);
		return;
	}

	AddItemList(pNewInfo);
}