Hi,
There are SelectCurrentLine and SelectCurrentWord. Why not a SelectCurrentParagraph?. Or ... how can I do that?
Thank you.
Philip.
SelectCurrenParagraph?
Hi,
Ok I writted this and it works, but if the paragraph is in a table cell, then the whole table is selected, and I don't understand why.
Philip
Ok I writted this and it works, but if the paragraph is in a table cell, then the whole table is selected, and I don't understand why.
Code: Select all
procedure WPSelectParagraph(RV: TCustomRichViewEdit);
var
iFirst, iLast, i: integer;
begin
iFirst := RV.CurItemNo;
for i := iFirst to RV.ItemCount - 1 do
begin
if RV.IsParaStart(iFirst) then Break;
Dec(iFirst);
end;
iLast := RV.CurItemNo + 1;
for i := iLast to RV.ItemCount - 1 do
begin
if RV.IsParaStart(iLast) then Break;
Inc(iLast);
end;
Dec(iLast);
RV.SetSelectionBounds(iFirst, RV.GetOffsBeforeItem(iFirst),
iLast, RV.GetOffsAfterItem(iLast));
end;
-
- Site Admin
- Posts: 17559
- Joined: Sat Aug 27, 2005 10:28 am
- Contact:
Add the line:
at the beginning.
Code: Select all
RV := RV.TopLevelEditor;