Page 1 of 2
I have an question about TRichViewEdit
Posted: Wed Nov 07, 2007 12:27 pm
by mariana
Can I draw circles, ellipses, lines or arrows in RichViewEdit?
I mean like in Word or Paint.
Can you help me please?
Posted: Wed Nov 07, 2007 3:32 pm
by Sergey Tkachenko
No, you can only insert pictures (TBitmap, TMetafile or other, inherited from TGraphic) or Delphi controls in text.
Posted: Fri Nov 23, 2007 10:19 am
by mariana
I have an project were in RichViewEdit I need to insert another RichViewEdit and write something in it. It's ok, it works, but when I save file the text writed in inserted control(RichViewEdit) don't save.What can I do to save text? Or can I save text from inserted controls?
And another question..
If I want to save file without text, only controls inserted how can I do that?
10x.
Posted: Fri Nov 23, 2007 3:52 pm
by Sergey Tkachenko
1) In order to load RVF file containing controls, you need to register them with RegisterClasses. For example, if you use TButton and TEdit in document, call:
RegisterClasses([TButton, TEdit]);
Do it one time before the first loading.
2) Sorry, I do not understand the second question. Do you want to remove all text from document?
Posted: Sun Nov 25, 2007 7:35 am
by mariana
Yes, I want to remove all text from document but my inserted controls to remain in initial position.
What you know, can I do that?
thankyou very much
Posted: Mon Nov 26, 2007 6:00 pm
by Sergey Tkachenko
This procedure deletes all text items from document:
Code: Select all
uses CRVData, RVTable, RVNormalize;
procedure DeleteText(RVData: TCustomRVData);
var i,r,c: Integer;
table: TRVTableItemInfo;
begin
for i := RVData.ItemCount-1 downto 0 do
if (RVData.GetItemStyle(i)>=0) or (RVData.GetItemStyle(i)=rvsTab) then // text or tabulation
RVData.DeleteItem(i)
else if RVData.GetItemStyle(i)=rvsTable then begin
table := TRVTableItemInfo(RVData.GetItem(i));
for r := 0 to table.RowCount-1 do
for c := 0 to table.ColCount-1 do
if table.Cells[r,c]<>nil then
DeleteText(table.Cells[r,c].GetRVData);
end;
end;
Call:
Code: Select all
RichViewEdit1.ClearUndo;
DeleteText(RichViewEdit1.RVData);
NormalizeRichView(RichViewEdit1.RVData);
RichViewEdit1.Format;
RVNormalize is unit from RichViewActions (it can be used even if you do not use RichViewActions)
Posted: Thu Nov 29, 2007 7:32 am
by mariana
Thankyou very much for helping me..
It worked, but I have a little problem, I don't know how to save coordinates of inserted controls to remain where I introduced them, when deleting text the controls moves at the begin of line and I want to remain where I introduced them.
Have you an idea what can I do?
10x
Posted: Thu Nov 29, 2007 8:57 am
by Sergey Tkachenko
In TRichView, controls are positioned in text, and if you remove text, controls will be moved.
Can you explain what do you want to implement, may be I will be able to suggest a solution.
Posted: Thu Nov 29, 2007 9:23 am
by mariana
I want to create a mask for create pages for printing, and save that page without text so that next time I want to create an page to insert the mask and write text into control.
I use inserted RichViewEdit to write text near an image introduced(to have near image more lines )
Like in next pothos:
Here is when I create the page..
Here is how i want to look after saveing.
Have you understand what I want to do?
Posted: Thu Nov 29, 2007 10:11 am
by Sergey Tkachenko
Sorry, I am afraid it's not possible. It requires positioning items at the specified coordinates (unsupported by TRichView)
Posted: Thu Nov 29, 2007 10:28 am
by mariana
Ok.
Thankyou very much, again.
Posted: Mon Dec 03, 2007 9:22 am
by mariana
I tried to introduce an PaintBox in RichViewEdit, but at preview time I couldn't see it and neither what is drawn in it.
Know you what can I do to view them, or it is impossible to do that?
Posted: Mon Dec 10, 2007 1:50 pm
by Sergey Tkachenko
If some components are not printed, you can help TRichView to print them.
Process TRVPrint.OnPrintComponent event. In this event, if the component is TPaintBox, create a bitmap (having the same size as the paint box) and draw the paint box on it.
If you need further help, let me know.
Posted: Wed Dec 12, 2007 9:46 am
by mariana
Hi.. thanks for your help
I have another question..
I introduced an RichViewEdit into another RichViewEdit and save the file with extension rvf, but when I load into aplication the text writed inti the inserted RichViewEdit isn't loaded.. I think that wasn't saved.
What can I do to save text in inserted RichViewEdit?
I registered class in constructor whit function RegisterClasses..
Thank you..
Posted: Thu Dec 13, 2007 4:27 pm
by Sergey Tkachenko
It's not so simple to insert RichViewEdit in RichViewEdit, because:
- it has link to TRVStyle, and links are not saved in RVF;
- it does not save its document together with its properties.
This demo shows how to solve these problems:
http://www.trichview.com/forums/viewtopic.php?t=2199