trichview.com

trichview.support




Re: Apply Textstyle to paragraph


Return to index


Author

Message

Yernar

Posted: 01/13/2003 16:26:09


Smth like this:


procedure TParaForm.ChangeButtonClick(Sender: TObject);

var

  CurNo: Integer;

  StartNo, EndNo: Integer;

  Offs, Offs2: Integer;

  function StartPara(No: Integer): Integer;

  var

    I: Integer;

  begin

    for I:=No downto 0 do

      if rve.IsParaStart(I) then Break;

    Result:=I;

  end;

  function EndPara(No: Integer): Integer;

  var

    I: Integer;

  begin

    for I:=No to rve.ItemCount-1 do

      if rve.IsParaStart(I) then Break;

    Result:=I;

  end;

begin

  CurNo:=rve.CurItemNo;

  StartNo:=StartPara(CurNo);

  Offs:=rve.GetOffsAfterItem(StartNo);

  EndNo:=EndPara(CurNo);

  Offs2:=rve.GetOffsBeforeItem(EndNo);

  rve.SetSelectionBounds(StartNo, Offs, EndNo, Offs2);

  rve.ApplyTextStyle(1);

end;





Powered by ABC Amber Outlook Express Converter