home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #31 / NN_1992_31.iso / spool / comp / sys / mac / hypercar / 4662 < prev    next >
Encoding:
Text File  |  1992-12-25  |  1.4 KB  |  45 lines

  1. Newsgroups: comp.sys.mac.hypercard
  2. Path: sparky!uunet!well!well.sf.ca.us!edandavi
  3. From: edandavi@well.sf.ca.us (Ed Allen and Avi Rappoport)
  4. Subject: Re: Progress ribbon in dialog box
  5. Message-ID: <edandavi.725335110@well.sf.ca.us>
  6. Sender: news@well.sf.ca.us
  7. Organization: Whole Earth 'Lectronic Link
  8. References: <1992Dec22.150429.5190@murdoch.acc.Virginia.EDU>
  9. Date: Sat, 26 Dec 1992 01:58:30 GMT
  10. Lines: 33
  11.  
  12.  
  13. If you want to do a progress ribbon in HyperCard itself, you basically
  14. need two parts, a passive rectangle which is paint or a button or a field,
  15. and overlaying that, a hilited button which you resize to represent the
  16. progress.  You'll change the rect of the indicator button each time you
  17. update, keeping the left, top, and bottom coordinates, and adjusting the
  18. right one.
  19.  
  20. the line at the core of the routine is:
  21.  
  22. set the rect of button <whatever> to myLeft,myTop,myRight,myBottom
  23.  
  24. Before that line you will have to fill those in, with only the right one
  25. changing.
  26.  
  27. For a simple case ( a one hundred pixel progress bar, so as not to deal with
  28. rounding from percents to pixels)
  29.  
  30. on updateProgress percentDone
  31.   put the rect of btn "backButton" into buttonRect
  32.   put item 1 of buttonRect + percentDone into item 3 of buttonRect
  33.   set the rect of btn "indicator" to buttonRect
  34. end updateProgress
  35.  
  36.  
  37.  
  38. There are also XCMDs that give you progress bar dialogs with or without
  39. cancel buttons, etc.
  40.  
  41.  
  42. Ed Allen
  43. edandavi@well.sf.ca.us
  44. BMUG HyperCard SIG Leader    Scripter for Hire
  45.