Append many RichView files in an other RichView file

General TRichView support forum. Please post your questions here
Sergey Tkachenko
Site Admin
Posts: 17554
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Re: Append many RichView files in an other RichView file

Post by Sergey Tkachenko »

Can you send me your project 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 cannot send you the whole project. You cannot do anything without database. but i can send you the .pas of the RichViewEditor. Is it that what you want?
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 remembered now, that in my RichViewEditor is no style template. In your sample i can click NEW or load a file and i have a template. Where does it coming from? Perhaps there is missing in my source code. Which line in my source code opens this style template? I thought it is cmbStyles.Localize.
I controlled the whole source code, but i cannot find anything missing. Do you have an idea what that can be?
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 am testing the RichViewEditor. i think there is the connection between the buttons above to the RichViewEdit missing. If i select a text and click on bold, not reaction at the text. The same with font and font size. If i close there is no question to save. If i start the RichViewEditor again, the buttons are all clicked but the text has no format.
Where is the connection between these components? In RVAControlPanel and RVStyle and ActionList there are all needed connections.
Do you have some ideas?
Sergey Tkachenko
Site Admin
Posts: 17554
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Re: Append many RichView files in an other RichView file

Post by Sergey Tkachenko »

I think the actions are applied to an editor on another form.

How many instances of this form do you create?
Do you have other forms containing TRVAControlPanel component?

On this form, RVAControlPanel1 is linked to RichViewEdit1 explicitly (because RVAControlPanel1.DefaultControl = RichViewEdit1).
But actions are not linked to RVAControlPanel1: ControlPanel property of actions is not assigned (like it is in the original demo).
It is ok if you have a single form with RVAControlPanel1, but not ok if you have multiple forms like this.
All actions (on all forms) that have unassigned ControlPanel properties work with the active TRVAControlPanel component.
The first created RVAControlPanel1 becomes active.

You can make another RVAControlPanel active (using Activate method).
However, the best solution is to link actions to TRVAControlPanel on the form explicitly.
Just assign ControlPanel property of all actions on this form equal to RVAControlPanel1. Also, assign cmbStyles.ControlPanel = RVAControlPanel1.
Sergey Tkachenko
Site Admin
Posts: 17554
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Re: Append many RichView files in an other RichView file

Post by Sergey Tkachenko »

As for named styles (StyleTemplates).
The actions use StyleTemplates if the target editor has UseStyleTemplates property = True.
The default set of StyleTemplates (applied by "New" command) is in rvActionNew1.StyleTemplates property.
sorega2022
Posts: 23
Joined: Tue May 07, 2024 4:30 am

Re: Append many RichView files in an other RichView file

Post by sorega2022 »

Oh. Thank you. Your tool is very sensible. I put only RVAControlPanel1.Activate in the first line of the Form.Create and all was ok. That was the missing connection. I can change to justify and i can change the format. The saving is ok und on printing i have all these changes.

Now i have still the problem with the margins, i told some messages before. I cannot change it. The TSRichViewEdit takes always its defaults.

I can imagine that there is another trick to fix the problem. But i am not so firm till now to remember the right work-flow.
Sergey Tkachenko
Site Admin
Posts: 17554
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Re: Append many RichView files in an other RichView file

Post by Sergey Tkachenko »

I need a code sample reproducing the problem.
Normally, when you assign a new value, like this:

Code: Select all

  SRV.PageProperty.LeftMargin := 4;
changes are applied immediately, and you can see the result.

(so, if you need to change multiple margins, it's better to disable reformatting temporarily:

Code: Select all

  ActiveEditor.CanUpdate := False;
  SRV.PageProperty.LeftMargin := 4;
  SRV.PageProperty.RightMargin := 4;
  SRV.CanUpdate := True;
)
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 very much. The CanUpdate := true was that what i needed.

The next problem is to set the table. do you have some special samples for generating a table? to work with bestwidth and so on
Sergey Tkachenko
Site Admin
Posts: 17554
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Re: Append many RichView files in an other RichView file

Post by Sergey Tkachenko »

Check the demo in TRichView\Demos\DelphiUnicode\Editors\Edito 1\
It can insert several sample tables generated in code.
sorega2022
Posts: 23
Joined: Tue May 07, 2024 4:30 am

Re: Append many RichView files in an other RichView file

Post by sorega2022 »

At creation of a table i have to fix how many rows and cols i will have. I know the cols, but i dont know the rows. is it possible to change this while filling the table? can i change the count of rows while doing?
Post Reply