Example #1
0
int	CN3UIList::AddString(const std::string& szString)
{
	CN3UIString* pString = new CN3UIString();
	pString->Init(this);
	pString->SetFont(m_szFontName, m_dwFontHeight, m_bFontBold, m_bFontItalic);
	pString->SetColor(m_crFont);
	pString->SetString(szString);

	m_ListString.push_back(pString);
	this->UpdateChildRegions();

	return m_ListString.size() - 1;
}
Example #2
0
int CN3UIList::AddStrings(const std::string* pszStrings, int iStringCount)
{
	for(int i = 0; i < iStringCount; i++)
	{
		CN3UIString* pString = new CN3UIString();
		pString->Init(this);
		pString->SetFont(m_szFontName, m_dwFontHeight, m_bFontBold, m_bFontItalic);
		pString->SetColor(m_crFont);
		pString->SetString(pszStrings[i]);

		m_ListString.push_back(pString);
	}
		
	this->UpdateChildRegions();

	return m_ListString.size() - 1;
}
Example #3
0
bool CN3UIList::InsertString(int iIndex, const std::string& szString)
{
	if(iIndex < 0 || iIndex >= m_ListString.size()) return false;

	CN3UIString* pString = new CN3UIString();
	pString->Init(this);
	pString->SetFont(m_szFontName, m_dwFontHeight, m_bFontBold, m_bFontItalic);
	pString->SetColor(m_crFont);
	pString->SetString(szString);

	it_pString it = m_ListString.begin();
	for(int i = 0; i < iIndex; it++);

	m_ListString.insert(it, pString);
	return true;

	this->UpdateChildRegions();
}