Page 1 of 1

How many RVAControlPanels

Posted: Mon Dec 14, 2009 9:39 pm
by gdenny
I have two separate forms with separate RVAControlPanels, RVStyles, RVPrints, etc.
I noticed when I set the default controls of the RVAControlPanel on one form, it
changes it on the other form as well, which is the wrong richviewedit for that form. What is the best practice? Should I use common controls in a datamodule or
separate controls per form? Thanks.

Posted: Tue Dec 15, 2009 2:54 pm
by Sergey Tkachenko
Only one RVAControlPanel for project.
This component just provides access to global variables. So, when you change properties on one component in the project, these properties are changed in all components.
And do not open several forms containing RVAControlPanel in Delphi IDE at the same time, the same problem will occur.

Posted: Tue Dec 15, 2009 7:06 pm
by gdenny
Thanks for the quick reply. I now have one RVAControlPanel in a datamodule.
It's default control, RVAddictSpell3, and RVPrint properties are set in the OnShow
event of all forms that use richviewedits. Hopefully, this is the best practice. My
question now is, should I also do the same with my RVStyles, RVPrints, ActionLists,
ImageLists, etc or is it best practice to duplicate them in each form? Thanks

Posted: Wed Dec 16, 2009 5:05 pm
by Sergey Tkachenko
It is only TRVAControlPanel. All other components can be created in as many copies as you need.
But since they use some resources, using a single copy in a datamodule is a good idea. Except for TRVStyle. Connect each editor with its own TRVStyle.
A common RVStyle for several editors can be used only in special mode, when a set of styles is fixed and not changed.