how remove paragraph
how remove paragraph
how i can remove lines or paragraph and shift up other line or paragraph
example :
Line1
Line2
Line3
Line4
after Delete Line2 show me:
Line1
Line3
Line4
example :
Line1
Line2
Line3
Line4
after Delete Line2 show me:
Line1
Line3
Line4
-
- Site Admin
- Posts: 17566
- Joined: Sat Aug 27, 2005 10:28 am
- Contact:
-
- Site Admin
- Posts: 17566
- Joined: Sat Aug 27, 2005 10:28 am
- Contact:
If the user cannot edit this document, I understand you need a non-editing procedure.
Also, I assume that you need to delete a paragraph.
The most simple way is using DeleteParas method.
This method assumes that the document is formatted. It also leaves the document formatted (so it is unique among non-editing method).
In the parameters of this method, you need to specify the index of any item belonging to the paragraph to delete.
For example, to delete the paragraph N (counted from 1):
Also, I assume that you need to delete a paragraph.
The most simple way is using DeleteParas method.
This method assumes that the document is formatted. It also leaves the document formatted (so it is unique among non-editing method).
In the parameters of this method, you need to specify the index of any item belonging to the paragraph to delete.
For example, to delete the paragraph N (counted from 1):
Code: Select all
procedure DeleteParagraph(rv: TCustomRichView; N: Integer);
var i: Integer;
begin
for i := 0 to rv.ItemCount-1 do
if rv.IsFromNewLine(i) then begin
dec(N);
if N=0 then begin
rv.DeleteParas(i, i);
exit;
end;
end;
end;
-
- Site Admin
- Posts: 17566
- Joined: Sat Aug 27, 2005 10:28 am
- Contact:
user can not edit or add text manually , richveiw is read only
but my program can add message or event or question and answer ( such as "Are you sur? Yes i want , No thanks") to richveiw
and i want when user clicked on answer , program delete question and answer or replace with new Text (example : "You chose NO").
but my program can add message or event or question and answer ( such as "Are you sur? Yes i want , No thanks") to richveiw
and i want when user clicked on answer , program delete question and answer or replace with new Text (example : "You chose NO").
-
- Site Admin
- Posts: 17566
- Joined: Sat Aug 27, 2005 10:28 am
- Contact:
-
- Site Admin
- Posts: 17566
- Joined: Sat Aug 27, 2005 10:28 am
- Contact:
Deleting lines - rv.DeleteItems.
Inserting lines in middle - no documented methods for this. I can give you a code for this, but probably it is possible to avoid inserting lines, and modify text of existing lines instead.
Please send me two "screenshots" - what you want to see before and after.
I'll give you a code how to implement it.
Inserting lines in middle - no documented methods for this. I can give you a code for this, but probably it is possible to avoid inserting lines, and modify text of existing lines instead.
Please send me two "screenshots" - what you want to see before and after.
I'll give you a code how to implement it.
-
- Site Admin
- Posts: 17566
- Joined: Sat Aug 27, 2005 10:28 am
- Contact:
i upload here http://rapidshare.com/files/409611616/chat.pngSergey Tkachenko wrote:Sorry, the link to your image does not work.
and i see image on previous post
-
- Site Admin
- Posts: 17566
- Joined: Sat Aug 27, 2005 10:28 am
- Contact:
I understand the following:
You have 2 hyperlinks in the same paragraph.
If the user clicks on the first hyperlink, you need to remove the first item in this paragraph. The rest of the paragraph remains unchanged.
If the user clicks on the second link, you want to change text in the first item of this paragraph. The rest of the paragraph remains unchanged.
But what if the user clicks on the first item in this paragraph again? The first item is already removed...
You have 2 hyperlinks in the same paragraph.
If the user clicks on the first hyperlink, you need to remove the first item in this paragraph. The rest of the paragraph remains unchanged.
If the user clicks on the second link, you want to change text in the first item of this paragraph. The rest of the paragraph remains unchanged.
But what if the user clicks on the first item in this paragraph again? The first item is already removed...
hi
item 1 is 2 line (or 3 line)
and i add line 1 to item 1 :
ReciveText.AddNLWTag(uname+'......',0,0,0); <----- text in line 1
and i add line 2 to item 1 :
ReciveText.AddNLWTag('.....',0,0,0); <---- text before item 2
ReciveText.AddNLWTag('......',3,-1,100); <---- this is item 2
ReciveText.AddNLWTag('.......',0,-1,0); <---- text after item 2 and before item 3
ReciveText.AddNLWTag('......',3,-1,101); <---- item 3
ReciveText.AddNLWTag('......',0,-1,0); <---- text after item 3
ReciveText.Format;
now i want when user click on item 2 ,application clear 2 lines in item 1 and item 2 and item 3
when click on item 3 ,application replase 2 lines in item 1 and item 2 and item 3 by other text and lines
item 1 is 2 line (or 3 line)
and i add line 1 to item 1 :
ReciveText.AddNLWTag(uname+'......',0,0,0); <----- text in line 1
and i add line 2 to item 1 :
ReciveText.AddNLWTag('.....',0,0,0); <---- text before item 2
ReciveText.AddNLWTag('......',3,-1,100); <---- this is item 2
ReciveText.AddNLWTag('.......',0,-1,0); <---- text after item 2 and before item 3
ReciveText.AddNLWTag('......',3,-1,101); <---- item 3
ReciveText.AddNLWTag('......',0,-1,0); <---- text after item 3
ReciveText.Format;
now i want when user click on item 2 ,application clear 2 lines in item 1 and item 2 and item 3
when click on item 3 ,application replase 2 lines in item 1 and item 2 and item 3 by other text and lines