trichview.com

trichview.support




Re: Understanding Styles


Return to index


Author

Message

Sergey Tkachenko

Posted: 01/23/2003 0:42:42


> Hi, I'm new to RichView, so please bear with me. I've added a

DBRichViewEdit,

> assigned a TRVStyle to it, all ok. Then while editing I change the font of

> a single word and it appears fine. Then I move to a different record in

the

> database, and move back. Now the word has lost it's font and has a

background

> color. So I guess I am using styles incorrectly somehow. I have "Allow

adding

> Styles dynamically" turned on.


Probably, changed document was not saved in database.

Which code do you use for changing font of word?

One note - delete rvfoUseStyleNames option. It is not compatible with "Allow

adding styles dynamically" option.


>

> What I would like to achieve is:-

> 1. I can type whatever I like in each DBRichViewEdit, format using any

fonts,

> colors etc. Then save it and when I reload it, I'd like it to look as I

had

> it.


This should not happen in mode "Allow adding styles dynamically"

Please give me a code that you use for changing fonts, and I'll see what's

wrong.


> 2. To use styles in a similar way to MS Word. So that I can present a

predefined

> list of styles with all the attributes like font, color etc. These would

> only be changed by code, i.e. through a form that I could adjust settings.

> I would like to be able to apply these styles to paragraphs, in the same

> way as using "Normal", "Heading1" etc. So if I change the "Normal" style

> from font size 10 to size 12, that that change would be appplied to my

text

> as soon as I load it again.

>

> Is this how RichView works? I haven't been able to achieve this yet. But

> I like what I see so far.


Currently, the recommended way is the following:

all styles in collections represents formatting of documents; but some of

them can be designated as "real" styles. These styles have Standard property

= True.

If you want to add new "real" style, add it. If you want to delete a "real"

style - do not delete it from collection, just set its Standard property to

False.


>

> I've read the help file and it explains a lot very well. But some options

> which I'd like to understand are not explained. For example, the

RVFOptions,

> what effect have the options:-

>  rvfoConvUnknownStylesToZero

>  rvfoUseStyleNames


rvfoConvUnknownStylesToZero affects loading erroneous documents (saved in

mode "Use predefined set of styles", i.e. document does not contain

collection of styles inside, and collection of styles of application is

incompatible (has not enough styles) with document. If this option is not

set, document will not be loaded (error will be reported). If set, document

will be loaded, but with losing some formatting.

rvfoUseStyleNames is almost obsolete. Do not use it.


>

> Also, is there an example of using Styles, as used by MS Word? I saw a

screenshot

> of an editor demo on the site that looked like it did, but none of the

demos

> I have downloaded show this. Has anyone written a Styles editor like one

> of the Action add-ins?


The demo in Demos\Delphi\Editors\Editor 1\ has comboboxes of text and

paragraph styles.

It fills them with first Standard styles (until the first non-standard

style) and allows to apply them.


In future, RichViewActions will include support for MSWord-like styles





Powered by ABC Amber Outlook Express Converter