Re: Extending TextViews?

Clemens Szyperski (szypersk@fit.qut.edu.au)
Fri, 3 Jan 1997 11:43:43 +1000 (EST)

Hi Gordon,

> Here's what I'd like to do: have text boxes in a form that can display any
> typeface at any size.

Just display? Then you can use text views as they are and embed them right
into a form view. Even if you wanted to edit the contents of a text view in a
form, you could do just this. (In fact, Oberon/F forms are general container
views, so any view can be embedded into them, not just controls.) The only
thing that text views cannot do, and where they are different from text
fields, is calling a notifier or having a guard.

> I could modify ObxButtons, but that would necessitate writing text editing
> code. Is it possible to extend TextViews.View to give it control properties?
> Is this what Controls.Field is?

It would be possible to write a wrapper view that contains a text view and
adds the functionality needed to make it behave like a text field control.
This is not a trivial exercise. Let me know what exactly you want from an
extended text view that the existing text views cannot already do.

(Oberon/F does not encourage or support extension via inheritence--for many
good reasons - see the online documentation--, but relies on object
composition instead. Thus writing a wrapper view that forwards to the view to
be extended is the standard way to go.)

> Apologies if I'm missing something basic here; I'm just getting the hang
> of the framework.

No worries! Hope my comments helped,

- Clemens

http://www.fit.qut.edu.au/~szypersk