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
Want to make sure I am using RVAControlPanel correctly.
-
- Site Admin
- Posts: 17566
- Joined: Sat Aug 27, 2005 10:28 am
- Contact:
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.)
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.)
Last edited by Sergey Tkachenko on Tue Nov 10, 2015 12:45 pm, edited 1 time in total.