trichview.com

trichview.support




Re: How can I select text by TextStyleNo


Return to index


Author

Message

Sergey Tkachenko

Posted: 03/31/2003 15:00:34


Some corrections with selection: you need to use item indices of RVData, not

of rve.

Besides, you need to initialize editing of RVData:



procedure TSelectForm.SelectTextByStyle(RVData: TCustomRVData; StyleIndex:

Integer);

var

  i, r, c: Integer;

  table: TRVTableItemInfo;

begin

  for i := 0 to RVData.Items.Count - 1 do

    if RVData.GetItemStyle(i) = StyleIndex then begin

      RVData := RVData.Edit;

      RVData.SetSelectionBounds(i, RVData.GetOffsBeforeItem(i), i,

RVData.GetOffsAfterItem(i));

      rve.ApplyTextStyle(3);

    end

    else if RVData.GetItemStyle(i) = rvsTable then

    begin

      table := TRVTableItemInfo(RVData.GetItem(i));

      for r := 0 to table.Rows.Count - 1 do

        for c := 0 to table.Rows[r].Count - 1 do

          if table.Cells[r, c] <> nil then

            SelectTextByStyle(table.Cells[r, c].GetRVData, StyleIndex);

    end;








Powered by ABC Amber Outlook Express Converter