Subject Re: Fw: [IBO] TIB_RichEdit feature
Author Helen Borrie
At 10:59 PM 14/01/2004 +0100, you wrote:
>Helen,
>
>Part of Helen's answer:
> > If you have written a function that can convert a richtext stream to html,
> > then you can call it in the OnSetText of the column. I don't know why you
> > think these methods are not available. Perhaps you have not hooked the
> > control to the column object? Consult the help for tib_column,
> > tib_columnblob and tib_columnmemo.
>
>Firstly, thanks for your quick answer. In my opinion you aren't right.
>I use BLOB SUB_TYPE 1 column for containing HTML stream.

Of course, correct. Blobs can't have OnSetText and OnGetText because they
are not text.

Because I'm not totally clear about what you really need to do here, I've
guessed a little and made a very small, rough demo. It's here:
You can access the file at the URL

http://groups.yahoo.com/group/IBObjects/files/TIB_RichEdit.zip

In this demo, in the BeforePost for an insert (but it could be somewhere
else) a procedure MassageText is called. It takes the ib_columnBlob and
the ib_richedit as arguments. The procedure itself is really simple and is
just for demo purposes - it takes the rich text, adds some html commands
top and bottom and then writes the modified text back to the blob column,
warts, RTF tags and all. As you said you have written a procedure to
convert the richtext to HTML, I assume you can just call that from this
"MassageText" procedure instead of this demo code.

Presumably if you want your users to see RTF instead of HTML on the return
journey, you can add another parameter to MassageText to do that in the
AfterOpen event and wherever else you need to do this massaging.

Helen