Esempio n. 1
0
int CDomainContainer::AddDomainReplace( CDomainContainer & newdomains )
{
	int nCount = 0;
	for( int i=0; i<newdomains.GetSize(); i++ )
	{
		if( AddDomainReplace( newdomains.ElementAt(i) ) >= 0 )
			nCount ++;
	}
	return nCount;
}
Esempio n. 2
0
int CDomainComboBox::InitStrings( BOOL bHasClass, BOOL bHasDomain, CDomainContainer & groups )
{
	ResetContent( );

	CDomainContainer & domains = AfxGetDomainContainer( );
	CStockContainer & container = AfxGetStockContainer();

	int	nItemCount	=	groups.GetSize();
	if( bHasClass )		nItemCount	+=	8;
	if( bHasDomain )	nItemCount	+=	domains.GetSize();
	
	// Init Storage
	InitStorage( nItemCount, 32 );
	CString	strGroup;

	if( bHasClass )
	{
		strGroup.LoadString( IDS_DOMAIN_ALL );
		int nItem = AddString( strGroup );
		SetItemData( nItem, CStockContainer::typeAll );

		strGroup.LoadString( IDS_DOMAIN_INDEX );
		nItem = AddString( strGroup );
		SetItemData( nItem, CStockContainer::typeIndex );
		
		strGroup.LoadString( IDS_DOMAIN_CLASSSHAA );
		nItem = AddString( strGroup );
		SetItemData( nItem, CStockContainer::typeClassShaa );

		strGroup.LoadString( IDS_DOMAIN_CLASSSHAB );
		nItem = AddString( strGroup );
		SetItemData( nItem, CStockContainer::typeClassShab );

		strGroup.LoadString( IDS_DOMAIN_CLASSSZNA );
		nItem = AddString( strGroup );
		SetItemData( nItem, CStockContainer::typeClassSzna );

		strGroup.LoadString( IDS_DOMAIN_CLASSSZNB );
		nItem = AddString( strGroup );
		SetItemData( nItem, CStockContainer::typeClassSznb );

		strGroup.LoadString( IDS_DOMAIN_CLASSSHABOND );
		nItem = AddString( strGroup );
		SetItemData( nItem, CStockContainer::typeClassShabond );

		strGroup.LoadString( IDS_DOMAIN_CLASSSZNBOND );
		nItem = AddString( strGroup );
		SetItemData( nItem, CStockContainer::typeClassSznbond );
	}

	// Domains
	if( bHasDomain )
	{
		for( int i=0; i<domains.GetSize(); i++ )
		{
			CDomain	& domain = domains.ElementAt(i);
			int nItem = AddString( domain.m_strName );
			SetItemData( nItem, CStockContainer::typeDomain );
		}
	}

	// Groups
	for( int i=0; i<groups.GetSize(); i++ )
	{
		CDomain	& domain = groups.ElementAt(i);
		int nItem = AddString( domain.m_strName );
		SetItemData( nItem, CStockContainer::typeGroup );
	}

	return nItemCount;
}