TRVStyleTemplateComboBox is empty

General TRichView support forum. Please post your questions here
Post Reply
filo
Posts: 22
Joined: Wed Apr 12, 2017 12:28 pm

TRVStyleTemplateComboBox is empty

Post by filo » Thu May 11, 2017 7:39 pm

Hi Sergey,
I'm trying to use TRVStyleTemplateComboBox but it is empty - no styles.

from help:
The components require Editor.UseStyleTemplates=True, otherwise their Items are empty.
The components work automatically: place them on a form, assign Editor property;no additional code is required
I have done both conditions, but combo box is still empty. There are only a TRVStyleTemplateComboBox and TScalerichview components on the form.
I also have tried to copy TScaleRichView and combobox from ActionTestUni demo to the new project, but I have got the same result - empty combo.

I think problem is somewhere in RichViewEdit.Style.StyleTemplates, but I have been stuck inside of RVStyleFunc.ListFill method.

What I'm doing wrong?

Thank you for your advice.

Sergey Tkachenko
Site Admin
Posts: 13637
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Re: TRVStyleTemplateComboBox is empty

Post by Sergey Tkachenko » Thu May 11, 2017 7:52 pm

This combobox displays styletemplates contained in RichViewEdit.Style.StyleTemplates.
Initially, TRVStyle.StyleTemplates are empty.

TrvActionNew, when executed, fills RichViewEdit.Style.StyleTemplates with TrvActionNew.StyleTemplates. By default, TrvActionNew.StyleTemplates contains the most frequently used styles.
And when loading RVF or RTF files, RichViewEdit.Style.StyleTemplates are filled from these files

Notice that ActionTest demos starts either from executing TrvActionNew, or from loading file using TrvActionOpen.

filo
Posts: 22
Joined: Wed Apr 12, 2017 12:28 pm

Re: TRVStyleTemplateComboBox is empty

Post by filo » Thu May 11, 2017 8:17 pm

Understand, it works now.
I thought that if editor is showed as empty, it is already in "new" state. My fault.

Thank you.

Post Reply