[Demo] Shared StyleTemplates
Posted: Thu May 03, 2018 2:52 pm
1) This demo uses FireDAC and InterBase table:
http://www.trichview.com/support/files/ ... dac_ib.zip
2) This demo uses BDE:
http://www.trichview.com/support/files/ ... mo-bde.zip
TRichView 17.3 or newer is required.
These demos show how to use the rvfoSaveStyleTemplatesOnlyNames option.
Basically, these are ActionTest demos, but they use TDBRichViewEdit, so all file-related actions are deleted, and TDBNavigator is added.
rvfoSaveStyleTemplatesOnlyNames is included in DBRichViewEdit.RVFOptions.
In this demo, StyleTemplates are applied to all records in the table. If you change them (menu "Format | Styles"), these changes are applies to all documents in all records.
On start, the demo loads StyleTemplates:
On exit, the demo saves StyleTemplates:
This demo processes AfterScroll event to update the ruler:
To test styles, open the styles dialog (Format | Styles), click the Import button, and select one of RVST files placed in "styles" folder. Of course, you can change styles manually in this dialog, You will see that changes are applied to all documents in the database.
http://www.trichview.com/support/files/ ... dac_ib.zip
2) This demo uses BDE:
http://www.trichview.com/support/files/ ... mo-bde.zip
TRichView 17.3 or newer is required.
These demos show how to use the rvfoSaveStyleTemplatesOnlyNames option.
Basically, these are ActionTest demos, but they use TDBRichViewEdit, so all file-related actions are deleted, and TDBNavigator is added.
rvfoSaveStyleTemplatesOnlyNames is included in DBRichViewEdit.RVFOptions.
In this demo, StyleTemplates are applied to all records in the table. If you change them (menu "Format | Styles"), these changes are applies to all documents in all records.
On start, the demo loads StyleTemplates:
Code: Select all
RVStyle1.StyleTemplates.LoadFromRVST(ExtractFilePath(Application.ExeName)+'DBDemo.rvst',
RVStyle1.Units);
Code: Select all
RVStyle1.StyleTemplates.SaveToRVST(ExtractFilePath(Application.ExeName)+'DBDemo.rvst',
RVStyle1.Units);
Code: Select all
procedure TForm3.Table1AfterScroll(DataSet: TDataSet);
begin
RVRuler1.UpdateRulerMargins;
RichViewEdit1.CurTextStyleChange;
RichViewEdit1.CurParaStyleChange
end;