trichview.com

trichview.support




Re: TDBRichViewEdit


Return to index


Author

Message

Sergey Tkachenko

Posted: 12/31/2003 14:18:17


> Hi All,

> I have a coulple of ?'s.

> After saving formated data from the TDBRichView and then reading it back

out

> the control displays the RVF code eg.

> -8 1 3

>

> 6 1 0 0 0 0

>

> This is a test.

>

> The field is of the type Blob. I did not see anything else in the help to

> explain this behaviour. So, either I missing something (happens all the

> time) or it is something that is not documented.


How to solve: Right-click TDBRichViewEdit, choose "Settings" in the context

menu, set the option "Allow adding styles dynamically".

Why it happens: You add new styles in the collection

TextStyles/ParaStyles/ListStyles, but they are not saved with the document.

So document contains references to unknown styles. RVF reading procedure

reports error when reading it, and the document is loaded as a plain text.

"Allow adding styles dynamically" will set option to save collections of

styles together with the document.

Also, set DBRichViewEdit.AutoDeleteUnusedStyles = True, otherwise many

unnecessary styles may be saved.


>

> Second, how can you set up the actions to automatically detect the char

> formating of the selected text or at the cursor location? Can this be done

> or do you have do mannually in code much like a TRichEdit control?


You can use RichViewActions (http://www.trichview.com/resources/actions/; of

course, New/Open/Save/SaveAs actions cannot be used with DB editor, but you

can use the rest of them).

Or create your code based on Demos\Delphi\Editors\Editor 2\


>

> Finally is the next release going to make the HTML exporting W3C

compliant?


In the last updated (already available for registered users) the method

SaveHTMLEx was modified to procuce W3C compliant code ("HTML 4.01

Transitional" ).

There are only two issues:

1) Currently TRichView saves encoding id in HTML basing on

RVStyle.TextStyles[0].Charset. If it is a DEFAULT_CHARSET, encoding is not

written in HTML.

Actually, I am still not sure that explicit encoding is required by W3C. At

least, here http://validator.w3.org/file-upload.html you can specify

encoding for the tested HTML doc in a form, and it will be recognized as a

vaild HTML document.

For DBRichViewEdit, the best place to define a default set of styles for new

document is OnNewDocument event (for non-DB with RichViewActions -

TrvActionNew.OnNew). You can define a charset of TextStyles[0] here. But if

you hardcode some charset (such as ANSI_CHARSET) here, it will make more

inconvenient to use your application for non-Western users, so it is not

recommended.

2) TRichView saves <table bordercolor> attribute. This attribute is not a

standard HTML attribute (it is recognized by Internet Explorer), so W3C

validator reports error here. I do not think that this is a serious

violation.





Powered by ABC Amber Outlook Express Converter