Page 1 of 1

Multi RV in a TForm

Posted: Thu Oct 31, 2013 3:26 pm
by retwas
Hi,

I have a TForm with my richview and preperty (bold, italic, ..)
Image

I use it in Frame on a other TForm.
I need to have 2 Richview on the same TForm.

Image

Here is my code

Code: Select all

FrameMessage : TfcRichDocument;
FrameMessage2 : TfcRichDocument;
//-----
// on create form
FrameMessage := TfcRichDocument.Create(nil);
FrameMessage2 := TfcRichDocument.Create(nil);
//-----
// on form show
FrameMessage.Parent       := pMessageBas;
FrameMessage.BorderStyle  := bsNone;
FrameMessage.Align        := alClient;

FrameMessage2.Parent       := Panel1;
FrameMessage2.BorderStyle  := bsNone;
FrameMessage2.Align        := alClient;
- Only the first create works.

- If I let "DefaultControl" of RVAControlPanel empty the 2 works but, when I write on RV1 and I click on bold button of RV2 it's change in RV1.

Can you help me ?

Thanks

Posted: Thu Oct 31, 2013 3:53 pm
by Sergey Tkachenko
As I can see, you use two toolbars for two editors.

In this case, you should use each own sets of actions for each toolbar (i.e. a separate TActionList or TActionBar for each frame). Otherwise, actions on all toolbars would work with a single editor (RVAControlPanel.DefaultControl or a focused editor) at the given time.
Of course, ImageLists with glyphs can be common for all actions.

Next, how to link actions with a specific editor.
There are several ways:

1. Assign the proper RichViewEdit to Control property of all actions in the given TActionList or TActionBar. You can use a single RVAControlPanel in your application.

2. Use a separate RVAControlPanel on each frame. Assign it to ControlPanel property of all actions in the given TActionList or TActionBar.
Assign the proper RichViewEdit to DefaultControl property of each RVAControlPanel.