[clean-list] Building an editor with CompoundControl

Roel de Jong rdjong@altavista.net
Wed, 15 Nov 2000 21:36:19 +0100


Hi Clean Users,

I'm planning to program a custom editor "component" which uses part of a
window for a scrollable view domain. In preparation for that I started
building a straight auto-wrapping ascii-editor with the CompoundControl
present in Object IO library 1.1.1 (currently the highest available for
Mac and Windows simultaneously). However a few observations on the Mac
so far make me wonder whether the features of object-IO 1.1.1 are
sufficient to build an editor based on CompoundControl, or if it is
better to wait till the 1.2 object IO library is also available for
Macintosh.

1 - There seems to be no way to change the size of the viewdomain of a
CompoundControl in runtime. Since the edited text can grow and shrink, I
think it would be best practise to adjust the CompoundControl's
viewdomain: then all text paragraphs and lines can occupy a logical
position in the viewdomain which is independent of scrolling, and
scrolling can be done as intented (library internally moves the
viewdomain when the sliders are operated).

2- If I interpret the Object IO tutorial correctly, it says that
keyboard and mouse events are delivered via the callback function of the
object (parent window or control) that has the "input focus". However,
in my experiments with a CompoundControl placed within a Window it turns
out that:
While the CompoundControl has the focus, it evaluates callbacks for
all keyboard events and all mouse events *except* the "MouseMove"
events. The MouseMove events are evaluated from the parent Window object
instead of the CompoundControl.
Ok, since MouseMove events are probably dispensable in a simple editor,
and since they can be ignored in the parent window, it should not
prohibit the construction of this editor. Nevertheless, I think this
"irregularity" would require an unwieldy event re-routing provision if a
next version of the editor happenend to require the MouseMove events for
special features.

Has anyone run into the same kind of problems? Any ideas and advice are
welcome.

Regards,
Roel de Jong.