Page 1 of 1

Want to make sure I am using RVAControlPanel correctly.

Posted: Mon Nov 09, 2015 11:03 pm
by dakota
Hi:

I just want to make sure I am using the RVAControlPanel correctly.

I have a database program with three different memo fields. Each memo field uses a TRichViewEdit to handle RTF. (I'm not using TDBRichViewEdit).

I have created a toolbar for each of the three memo's. (three toolbars, each identical)

My question is this.

- Can I create just one set of RichView Actions...
- Create one RVAControlPanel
- Set RVAControlPanel.DefaultControl := <focused TRichViewEdit>

Or do I have to create a duplicate set of actions for each TRichViewEdit?

Are there any issues that I need to watch out for?

Thanks,

Dale

Posted: Mon Nov 09, 2015 11:08 pm
by dakota
Or better yet!!!!

Can I just create one toolbar, and then it will work with whatever TRichViewEdit that is set in the RVAControlPanel.DefaultControl?

That would be idea.

Thanks,

Dale

Posted: Tue Nov 10, 2015 7:53 am
by Sergey Tkachenko
If you have a single toolbar, you can have a single set of actions and a single TRVAControlPanel. Change the control panel's DefaultControl property when a different editor becomes active.
In addition to DefaultControl, you should assign the current TRichViewEdit control to Editor property of font combo boxes and to Control property of TrvActionStyleInspector.

If you have a toolbar for each editor, you cannot use a single set of actions.
The reason is obvious: actions are enabled and checked depending on the state of the target editor, so, for example, "copy" button must be enabled on some toolbars, and disabled on other toolbars. It is impossible with a single set of actions. As for TRVAControlPanel, multiple toolbars can have a common or different control panels. If you have several control panels, assign the proper one to ControlPanel properties of all actions and TRVStyleTemplateComboBox.
Actions can be associated with an editor using one of two ways:
- assign the editor to Control properties of all actions on the same form
- assign ControlPanel to all actions on this form, and assign the editor to DefaultControl property of ControlPanel (you still need to assign Editor property of font combo boxes and Control property of TrvActionStyleInspector explicitly).
Multiple control panels make sense only if you want to define different properties for different sets of actions (different language, different default file name or format, etc.)

Posted: Tue Nov 10, 2015 12:00 pm
by dakota
That is exactly what I was looking for. Thanks.

Dale