Path: utzoo!mnetor!uunet!husc6!cmcl2!nrl-cmf!ames!pasteur!ucbvax!dewey.soe.berkeley.edu!oster From: oster@dewey.soe.berkeley.edu (David Phillip Oster) Newsgroups: comp.sys.mac.programmer Subject: Re: Variable-sized elevators Message-ID: <23825@ucbvax.BERKELEY.EDU> Date: 30 Apr 88 16:43:36 GMT References: <242@uvabick.UUCP> <8700@apple.Apple.Com> <2956@saturn.ucsc.edu> <3006@saturn.ucsc.edu> Sender: usenet@ucbvax.BERKELEY.EDU Reply-To: oster@dewey.soe.berkeley.edu.UUCP (David Phillip Oster) Organization: School of Education, UC-Berkeley Lines: 29 Variable sized elevators can be built into any program you write, but they will not work in general if you just make a new CDEF and paste it into an arbitrary program. Certainly, you can't expect it to work if you paste it into one of my text editors: 1.) the scrollbar counts lines. 2.) because of multiple font sizes, the lines are variable widths here is an example: suppose that I have a file consisting of 1 line of 72 point font followed by 20 lines of 6 point font if I scroll off the first line, then all the remaining lines fit in the window, so my CtlMax is 1. But, that one line may keep 5 lines from showing. The part of the document that is visible if it is showing is (72+15*6) / (72+20*6) = 0.8.. of the whole document so I expect the elevator to show me that. The CDEF has no idea that I am scrolling a collection of variable sized objects, so it certainly can't know about my 0.8 unless I tell it. In my own program, I can easily extend my controls to have more data, and add a SetCtlThumbWidth() and GetCtlThumbWidth(), but in general, anyone pasting into my programs is in for a surprise. --- David Phillip Oster --When you asked me to live in sin with you Arpa: oster@dewey.soe.berkeley.edu --I didn't know you meant sloth. Uucp: {uwvax,decvax,ihnp4}!ucbvax!oster%dewey.soe.berkeley.edu