Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Adding To/Using TEViews

0 views
Skip to first unread message

Peter Commons

unread,
Feb 13, 1993, 10:40:20 PM2/13/93
to
I have a TTEView in a window and have a couple questions about it:

1) How do I add a line of text to it? I'm using it as a status report window
and want the application to add comments to it. The TTEView object only has
SetText() and StuffText() which set the whole thing. I want to do the
equivalent of a TEInsert. That's currently what I'm doing (TEInsert( stuff
, fTTEVIew->fhTE)) but I wasn't sure if that was ok...

2) I'm getting some weird selection effects when I try to select a large area
of text and it does autoscrolling. Little pieces get updated incorrectly.

Thanks in advance.

Richard Gillam,GEIS

unread,
Feb 17, 1993, 11:27:00 AM2/17/93
to
Peter--


>1) How do I add a line of text to it? I'm using it as a status report window
>and want the application to add comments to it. The TTEView object only has
>SetText() and StuffText() which set the whole thing. I want to do the
>equivalent of a TEInsert. That's currently what I'm doing (TEInsert( stuff
>, fTTEVIew->fhTE)) but I wasn't sure if that was ok...

What you probably ought to do is create a subclass of TTEView that includes
methods for appending text to the end of the view. This'll give you a lot more
flexibility in implementation and it'll minimize the amount of knowledge other
objects have to have about the TE view (which is always a good thing in O-O
programming). If you're including the view in a view hierarchy, this'll still
work. Still use the TTEView object in your view editor, but change the class
name to the name of your subclass. [The methods you add, by the way, can
certainly do the algorithm you show; I'd just be wary of doing that from
outside the class.]


>2) I'm getting some weird selection effects when I try to select a large area
>of text and it does autoscrolling. Little pieces get updated incorrectly.

I've had this kind of problem before too, and I'm not sure I know what causes
it (it's been a while). One easy thing you might check is that you have a
selection adorner attached to your TE view. I can't remember for sure whether
you need one here, but I know that's screwed me up in a lot of other places.

Hope this helps,

Rich Gillam
GE Information Services

Gobel, Jeff

unread,
Feb 17, 1993, 5:51:00 PM2/17/93
to
Hi Peter,

Regarding: "2) I'm getting some weird selection effects when I try to select a

large area of text and it does autoscrolling. Little pieces get updated
incorrectly."

I have seen similar autoscroll selection problems when the TTEView is disabled.
Make sure it is enabled, and if you want to prevent the user from entering
text, just turn "Accepts changes" off in ViewEdit.

Hope this helps,

Jeff


0 new messages