Append many RichView files in an other RichView file

General TRichView support forum. Please post your questions here
sorega2022
Posts: 23
Joined: Tue May 07, 2024 4:30 am

Append many RichView files in an other RichView file

Post by sorega2022 »

hi,
i want append many RichText files in one RichText file. I am using following routine

verz := reihe[ind].Dateiname;
if verz <> '' then
begin
rv.Clear;
ok := rv.LoadRVF(verz);
if ok then
begin
TextErsetzen(nil,rv);
rv.Format;
rve.AppendFrom(rv);
end;
end;

I is working very fine. But it loose the styles in the original file. The text is in the new file but it is not bold if it is bold in orignal file. If i use justified in the original file it is not in the new one.
i tried 1 style component and for each richview and a seperate style component. Both does not work.
Please tell me how i can solve this.
sorega2022
Posts: 23
Joined: Tue May 07, 2024 4:30 am

Re: Append many RichView files in an other RichView file

Post by sorega2022 »

Thank you. That works. The parts of the text are bold like in Editor.
But if i mark the text as justified, it marks the button in editor, but on printing it is not justified. Is there anything else to do?
An other problem is, that i need to change the margins. I am using your sample MakeSRVDoc. I show the produced RichView text als Main in SRichViewEdit there. That works but without justified and with wrong margins. I tried many settins to get the right margins but it seems the program uses the original margins of SRichViewEdit form. I can change it, but it use always the original.
Sergey Tkachenko
Site Admin
Posts: 17602
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Re: Append many RichView files in an other RichView file

Post by Sergey Tkachenko »

InsertRVFFromStream does not read margins (like other insertion methods).
You can load the first document using LoadRVF or LoadRVFFromStream, these methods load margins.
Or you can assign margin properties of SRichViewEdit.PageProperty.

Can you send me documents where the justify problem occurs? But I will be able to check them only when I return from vacation.
sorega2022
Posts: 23
Joined: Tue May 07, 2024 4:30 am

Re: Append many RichView files in an other RichView file

Post by sorega2022 »

srveView.UnitsProgram := rvuCentimeters;
srveView.PageProperty.LeftMargin := 2; (default: 3)
srveView.PageProperty.RightMargin := 1; (default: 3)
srveView.PageProperty.TopMargin := 1; (default: 2.5)
srveView.PageProperty.BottomMargin := 1; (default: 2.5)

i make this. but it does not work. i changed the margins in SRichViewEdit too. but i got always the default margins. From where it takes it?

Is it possible to switch on justify in SRichViewEdit for the whole document?
Sergey Tkachenko
Site Admin
Posts: 17602
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Re: Append many RichView files in an other RichView file

Post by Sergey Tkachenko »

To apply changes in margins, call SRichViewEdit.Format (not SRichViewEdit.RichViewEdit.Format).
To make all paragraphs justified (aligned both to left and right sides), you need to change Alignment property of styles of all paragraphs.
sorega2022
Posts: 23
Joined: Tue May 07, 2024 4:30 am

Re: Append many RichView files in an other RichView file

Post by sorega2022 »

i use SRichViewEdit.Format
i have many RichView files. Some include only titles, this war centered. but all other include text, which should be shown as justified.
i take all single RichView files and put it into 1 RichView file together. That works very fine. This RichView file will be loaded in SRichViewEdit in Main. And here i need the text justified and the titles centered.
How can i do this. i see the loaded RichView file, but without justify and the margins are not like i set it.
Sergey Tkachenko
Site Admin
Posts: 17602
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Re: Append many RichView files in an other RichView file

Post by Sergey Tkachenko »

I can create a code sample for you (when I return from vacation), but I need to see the original documents. Do they already have the formatting that you need? How headings are defined?
Can you send sample files to email richviewgmailcom?
sorega2022
Posts: 23
Joined: Tue May 07, 2024 4:30 am

Re: Append many RichView files in an other RichView file

Post by sorega2022 »

i think, that will be the problem. I am using your sample for editing RichView. But there is no heading. i can select the text and click on Justify. but the text will not move to Justify. Is that ok? Or should i see it in the editor too? if i close the editor it should save the text with formatings. But it does not ask to save. It seems that the editor does not register there formating of the text. but if i open again the Justify button is pressed, but i see no justify.

Perhaps that is the main problem. The editor does like the text is justified, but it is not. And i have no headings in the combobox. but you have not some in your sample too. Your tool is so mighty and i have not recognized what to do that it does what i want. I read you help but mostly i cannot find what i am looking for.
Sergey Tkachenko
Site Admin
Posts: 17602
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Re: Append many RichView files in an other RichView file

Post by Sergey Tkachenko »

What demo do you use as a sample?
All ActionTest demos (i.e., all demos based on RichViewActions) display a save request on exit.
Also, "Editors\Editor 2" demo does it.
Other demos may not ask to save modified files.
The editor component does not display a save request itself. It's an application responsibility to check if the editor was modified and ask the user to save the document. See FormCloseQuery in these demos.

Of course, when you change the paragraph alignment (to justify or to another option), it must be immediately displayed in the editor
(please note that by default the last paragraph line is not justified).
How do you apply justify alignment?
sorega2022
Posts: 23
Joined: Tue May 07, 2024 4:30 am

Re: Append many RichView files in an other RichView file

Post by sorega2022 »

I used ...\TRichView\RichViewActions\Demos\DelphiUnicode\ActionTest
Yes. I saw the FormCloseQuery and it works correct if i change a letter or something else. But it does not work if i mark the text and press justify. Justify is status on but no reaction an the text
Sergey Tkachenko
Site Admin
Posts: 17602
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Re: Append many RichView files in an other RichView file

Post by Sergey Tkachenko »

I cannot reproduce this problem.
I just ran this demo, clicked "Justify" on the toolbar, closed the form. The application shows "Save changes to readme.rvf?" messagebox.
Do you use unmodified demo?
sorega2022
Posts: 23
Joined: Tue May 07, 2024 4:30 am

Re: Append many RichView files in an other RichView file

Post by sorega2022 »

i imported the whole form. My changes at FormShow

if TransDateiname = '' then
begin
Toolbutton11.Enabled := true; // Neu
Toolbutton1.Enabled := true; // Öffnen
rvActionNew1.ExecuteTarget(RichViewEdit1);
end
else
begin
Toolbutton11.Enabled := false; // Neu
Toolbutton1.Enabled := false; // Öffnen
if TransDateiname = '' then
begin
rvActionNew1.ExecuteTarget(RichViewEdit1);
end
else
begin
if pos('.rtf',lowercase(TransDateiname)) <> 0 then
begin
rvActionOpen1.LoadFile(RichViewEdit1, TransDateiname, ffiRTF);
end;
if pos('.rvf',lowercase(TransDateiname)) <> 0 then
begin
rvActionOpen1.LoadFile(RichViewEdit1, TransDateiname, ffiRVF);
end;
end;
end;
Sergey Tkachenko
Site Admin
Posts: 17602
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Re: Append many RichView files in an other RichView file

Post by Sergey Tkachenko »

Maybe a link between the action and the button is lost somehow?
Please check that this button's Action = rvActionAlignJustify1.
sorega2022
Posts: 23
Joined: Tue May 07, 2024 4:30 am

Re: Append many RichView files in an other RichView file

Post by sorega2022 »

The action of the button is like you wrote
Post Reply