home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #30 / NN_1992_30.iso / spool / comp / sys / mac / programm / 20097 < prev    next >
Encoding:
Text File  |  1992-12-21  |  1.1 KB  |  36 lines

  1. Newsgroups: comp.sys.mac.programmer
  2. Path: sparky!uunet!spool.mu.edu!agate!apple!mumbo.apple.com!gallant.apple.com!kip2-42.apple.com!user
  3. From: jpugh@apple.com (Jon Pugh)
  4. Subject: Re: Scrollbars with more than 32000 lines?
  5. Sender: news@gallant.apple.com
  6. Message-ID: <jpugh-191292130340@kip2-42.apple.com>
  7. Date: Sat, 19 Dec 1992 21:06:55 GMT
  8. References: <5854@krafla.rhi.hi.is>
  9. Organization: Apple Computer, Inc.
  10. Followup-To: comp.sys.mac.programmer
  11. Lines: 23
  12.  
  13. In article <5854@krafla.rhi.hi.is>, rson@rhi.hi.is (Mimir Reynisson) wrote:
  14. > How do I map the scrollbars which are limited to
  15. > short values only onto a long value? MPW seems to do this
  16. > since it has no seperate scrollbar definition procedure.
  17. > Anybody know the magic formula?
  18.  
  19. This is a simple ratio.  Scale your large size into the small size.
  20.  
  21. large val      small val
  22. ---------  =   ---------
  23. max large      max small
  24.  
  25. Or, for the algebretically impaired, scroll = large val / max large * max
  26. small
  27.  
  28. In the case of a transition from a full longInt to a short, use HiWord to
  29. get the top half.  If you are using the full range, this sounds like what
  30. you
  31. need, otherwise you'll need to do math.
  32.  
  33. Jon
  34.