Bugs in D6 MultilineTextEdit and RichTextEdit

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Bugs in D6 MultilineTextEdit and RichTextEdit

Chris Uppal-3
A couple of apparently unrelated bugs in MultilineTextEdit and RichTextEdit
(and possibly other subclasses of TextEdfit too, although I didn't test them).

Set up a new view resource for RichTextPresenter which is a clone of the
existing default except that the #backcolor and #forecolor are set to real
colours.  Similarly set up a clone of TextPresenter.'Multiline text' with real
colours.

First problem: in neither case does the view use the chosen colours when edited
in the VC or as seen in its "thumbnail".

Second problem: show the new coloured RichTextEdit view resource in the normal
way.  Neither of the two configured colours are honoured, although you can set
the desired colours programmatically after the view is open.

The reason the #backcolor doesn't work seems to be because the line in
RichTextEdit>>onViewCreated

     self backcolor ifNotNil: [:color | self backcolor: color].

has no effect.  There is an equality test in #backcolor which makes this into a
no-op.  Adding:

    self backcolorChanged.

to #onViewCreated fixes this problem (but I'm not certain its the correct fix).

I don't know why the similar line setting the forecolor doesn't work either
(there is no equality check like the one in #backcolor:).  It may just be a
Windows thing, because it doesn't work in D5 either.   Using #postToInputQueue
to defer setting the #forecolor /appears/ to fix this, but is a very ugly hack
at best.

Fixing the initialisation problems with RTE does not cause the colours to work
correctly in the VC or for thumbnails, only for "real" views.

    -- chris