Пример #1
0
/// Tells if there is an item for string s
bool BasicSearchTree::HasItem(const wxString& s)
{
    size_t itemno = GetItemNo(s);
    if (!itemno && !s.empty())
        return false;
    return true;
}
Пример #2
0
void CFoulerDoc::AddDataFromText(DWORD dwSize, char *pHeader)
{
	char seps[] = "abcdfghijklmnopqrstuvwxyzABCDFGHIJKLMNOPQRSTUVWXYZ= ,\t\n:()";
	char *token, *cpTextData;
	int i, iOrg, iData, itemno, iIndex;
	double dData;
	BeginWaitCursor();
	for (DWORD dw = 0; dw < dwSize; dw++)
	{
		if (pHeader[dw] == NULL) pHeader[dw] = ' ';
	}
	cpTextData = new char[dwSize];
	memcpy( cpTextData, pHeader, dwSize );
	itemno = GetItemNo( cpTextData );
	delete[] cpTextData;
	if( itemno < 1 ) return;
	CProgressBar* pBar = new CProgressBar();
	iData = m_iNo;
	iOrg = m_iOriginNo;
	InsertData( itemno );
	iIndex = 0;
	token = strtok( pHeader, seps );
	while( token!= NULL )
	{
		dData = atof(token);
		if( dData != 0 )
		{
			m_pOrgData[iOrg]->SetItem( dData );
			m_iSubGroupIndex++;
			if( m_iSubGroupIndex >= m_iSubGroupSize )
			{
				m_iSubGroupIndex = 0;
				dData = 0;
				for( i=iOrg+1-m_iSubGroupSize ; i<iOrg+1 ; i++ )
				{
					dData += m_pOrgData[i]->GetItem();
				}
				m_pData[iData]->SetItem(dData/m_iSubGroupSize);
				iData++;
				AnalysisData();
			}
			iOrg++;
			iIndex++;
			pBar->SetPos((iIndex<<8)/itemno);
		}
		token = strtok( NULL, seps );
	}
	delete pBar;
	EndWaitCursor();
}
Пример #3
0
void ListedTextItems::SetText( const Text &prev_text, const Text &new_text )
{
    SetText( GetItemNo(prev_text), new_text );
}
Пример #4
0
void ListedTextItems::Remove(const Text& text)
{
    Remove( GetItemNo(text) );
}