home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.sys.mac.programmer
- Path: sparky!uunet!spool.mu.edu!agate!apple!mumbo.apple.com!gallant.apple.com!kip2-42.apple.com!user
- From: jpugh@apple.com (Jon Pugh)
- Subject: Re: Scrollbars with more than 32000 lines?
- Sender: news@gallant.apple.com
- Message-ID: <jpugh-191292130340@kip2-42.apple.com>
- Date: Sat, 19 Dec 1992 21:06:55 GMT
- References: <5854@krafla.rhi.hi.is>
- Organization: Apple Computer, Inc.
- Followup-To: comp.sys.mac.programmer
- Lines: 23
-
- In article <5854@krafla.rhi.hi.is>, rson@rhi.hi.is (Mimir Reynisson) wrote:
- >
- > How do I map the scrollbars which are limited to
- > short values only onto a long value? MPW seems to do this
- > since it has no seperate scrollbar definition procedure.
- >
- > Anybody know the magic formula?
-
- This is a simple ratio. Scale your large size into the small size.
-
- large val small val
- --------- = ---------
- max large max small
-
- Or, for the algebretically impaired, scroll = large val / max large * max
- small
-
- In the case of a transition from a full longInt to a short, use HiWord to
- get the top half. If you are using the full range, this sounds like what
- you
- need, otherwise you'll need to do math.
-
- Jon
-