When you insert a TLabelItem at the end of a document with a style x, from then on you are using the style of the TLabelItem.
How can I keep the style of the paragraph? I want that when you enter some text after the insert action, you have the same paragraph style as before.
Thanks for your reaction,
Frank van den Bergh.
Keep the current paragraph style after an InsertItem
-
- Posts: 6
- Joined: Thu Oct 20, 2005 2:29 pm
- Location: The Netherlands
-
- Site Admin
- Posts: 17569
- Joined: Sat Aug 27, 2005 10:28 am
- Contact:
-
- Posts: 6
- Joined: Thu Oct 20, 2005 2:29 pm
- Location: The Netherlands
Hi Sergey,
I use InsertItem as AddItem does not work (no TLabelItem insertion in the document when the caret is at the end). I use the suggestion you gave me yesterday. This is the code:
li := TRVLabelItemInfo.CreateEx(RichViewEdit1.RVData, TEXTSTYLE_VARIABLE, '['+Variable.Description+']');
// RichViewEdit1.AddItem('', li);
If RichViewEdit1.InsertItem('', li)
then begin
rve := RichViewEdit1.TopLevelEditor;
ItemNo := rve.CurItemNo;
rve.SetSelectionBounds(ItemNo, rve.GetOffsBeforeItem(ItemNo), ItemNo, rve.GetOffsAfterItem(ItemNo));
rve.Invalidate;
end;
I'm only interested in text style (basically just another text color and style). I don't change the paragraph. I'm creating a kind of formula wizard. Sorry about the misunderstanding the paragraph.
I use InsertItem as AddItem does not work (no TLabelItem insertion in the document when the caret is at the end). I use the suggestion you gave me yesterday. This is the code:
li := TRVLabelItemInfo.CreateEx(RichViewEdit1.RVData, TEXTSTYLE_VARIABLE, '['+Variable.Description+']');
// RichViewEdit1.AddItem('', li);
If RichViewEdit1.InsertItem('', li)
then begin
rve := RichViewEdit1.TopLevelEditor;
ItemNo := rve.CurItemNo;
rve.SetSelectionBounds(ItemNo, rve.GetOffsBeforeItem(ItemNo), ItemNo, rve.GetOffsAfterItem(ItemNo));
rve.Invalidate;
end;
I'm only interested in text style (basically just another text color and style). I don't change the paragraph. I'm creating a kind of formula wizard. Sorry about the misunderstanding the paragraph.
-
- Site Admin
- Posts: 17569
- Joined: Sat Aug 27, 2005 10:28 am
- Contact:
(AddItem is used for document generation, not for inserting at the caret position; It requires call of Format before displaying)
As far as I understand, your question is about a current text style after the insertion of label item. Which text style do you want to make current:
- a text style used in the inserted label item?
- or may be a style of text before the label item?
As far as I understand, your question is about a current text style after the insertion of label item. Which text style do you want to make current:
- a text style used in the inserted label item?
- or may be a style of text before the label item?
-
- Posts: 6
- Joined: Thu Oct 20, 2005 2:29 pm
- Location: The Netherlands
-
- Site Admin
- Posts: 17569
- Joined: Sat Aug 27, 2005 10:28 am
- Contact:
-
- Posts: 6
- Joined: Thu Oct 20, 2005 2:29 pm
- Location: The Netherlands