[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: how to scroll in a TextEdit control?
In article <1992Nov17.175534.1057@tamsun.tamu.edu> j0p7771@tamuts.tamu.edu (Jason Perez) writes:
>[...]
>i'm not using TaskMaster to control the record because i am going to have
>multiple fonts/styles/sizes and i didn't think i could do this with
>TaskMaster. though i am using TaskMaster for everything else . what i need
>is way to know when i'm at the bottom of the window so i can scroll up. it
>looks like i'll have to keep a manual count of which line i'm on to figure
>it out.
Try using the "cachSelcVPos" and "cachSelHPos" fields in the Text Edit
record. They tell you the last vertical and horizontal position at
which TE drew your insertion point. -- If that position is outside your
window's portRect (at some point between StartDrawing and SetOrigin(0,0),
when your window's port's origin reflects the scroll bar settings), then
you need to scroll your stuff, using SetContentOrigin on your window
(not using TEScroll).
There is no conflict with using multiple fonts in your TE control and
also using TaskMaster.
--
David A. Lyons, Apple Computer, Inc. | DAL Systems
Apple II System Software Engineer | P.O. Box 875
Internet:dlyons@apple.com | Cupertino, CA 95015-0875
My opinions are my own, not Apple's.