Items with Style
Posted: Mon Oct 14, 2013 12:24 pm
How search for all items in RichViewEdit with Style 'myStyle'?
Josip
Josip
Support forums for TRichView, ScaleRichView, Report Workshop and RVMedia components
https://writeally.com/forums/
Code: Select all
for (int i = 0; i < ActiveEditor->RichViewEdit->RVData->ItemCount ; i++)
{
TFontInfo *fi = ...
}
Code: Select all
void TForm1::EnumItems(TCustomRVData* RVData, int StyleNo)
{
for (int i = 0; i< RVData->ItemCount; i++)
if (RVData->GetItemStyle(i)==StyleNo)
ListBox1->Items->Add(RVData->GetItemText(i));
else if (RVData->GetItemStyle(i)==rvsTable)
{
TRVTableItemInfo* Table = (TRVTableItemInfo*)(RVData->GetItem(i));
for (int r = 0; r < Table->RowCount; r++)
for (int c = 0; c < Table->ColCount; c++)
if (Table->Cells[r][c])
EnumItems(Table->Cells[r][c]->GetRVData(), StyleNo);
}
}
Code: Select all
EnumItems(SRV->RichViewEdit->RVData, StyleNo);