How search for all items in RichViewEdit with Style 'myStyle'?
Josip
Items with Style
-
- Site Admin
- Posts: 17566
- Joined: Sat Aug 27, 2005 10:28 am
- Contact:
Items with Style
Something like keywords in Help, maybe TStringList or ListBox
Code: Select all
for (int i = 0; i < ActiveEditor->RichViewEdit->RVData->ItemCount ; i++)
{
TFontInfo *fi = ...
}
-
- Site Admin
- Posts: 17566
- Joined: Sat Aug 27, 2005 10:28 am
- Contact:
What do you mean by "with Style 'myStyle'"?
Below is the example how to add all text formatted with SRV->RichViewEdit->Style->TextStyles->Items[StyleNo] in ListBox1:
Call:
PS: I replied to your email, but it seems that your gmail account redirects to non-existent email address.
Below is the example how to add all text formatted with SRV->RichViewEdit->Style->TextStyles->Items[StyleNo] in ListBox1:
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);