home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!psinntp!vaxsar.vassar.edu!deslade
- From: deslade@vaxsar.vassar.edu
- Newsgroups: comp.sys.mac.hypercard
- Subject: Re: Scrolling field problem.... (my solution)
- Message-ID: <1993Jan8.203321.547@vaxsar.vassar.edu>
- Date: 8 Jan 93 20:33:21 +1000
- References: <1993Jan7.183928.25218@utkux1.utk.edu>
- Organization: Vassar College
- Lines: 66
-
- In article <1993Jan7.183928.25218@utkux1.utk.edu>, danny@martha.utcc.utk.edu
- (Danny William McCampbell) writes:
-
- > Hi all. I have two scrolling fields side by side. Each contain text.
- > I have enabled an option to have the fields to scroll together or
- > seperately. The problem is when the fields are set to scroll together
- > one field has more text than the other and the last few lines of the
- > other field are not visible. I cannot have this. Is there any way
- > to find out what the very last scroll number is in the field with
- > the longest text as well as the other field so when one gets to the
- > end I can set the other one to the end? Please help me........
- >
- > Any suggestions on maybe a different way to go about this would be
- > greatly appreciated.
-
- ----- Put this handler in your background or higher script and enjoy! -dennis
-
- function CalculateScroll whichFld, saveSelection
-
- -- Calculates the maximum scroll of the scrolling field pointed to by
- -- whichFld. It assumes that the field it is been told to work with
- -- is a scrolling field; it does not matter if the field is locked.
- --
- -- whichFld is passed in as a string, as in:
- -- CalculateScroll "bg fld 1", true
- -- or
- -- CalculateScroll (the target), false
- --
- -- saveSelection is a boolean: true means remember what text was
- -- selected and select it after we are done, false means don't
- -- bother. There is a bug which causes the selection to flicker
- -- if saveSelection is true: can anyone fix this?
-
- lock screen
- -- save the current selection
- put the selectedChunk into Holder
- -- save whichFld's soon-to-be-altered properties
- put the lockText of whichFld into locked
- put the scroll of whichFld into scrolled
- set the lockText of whichFld to false
-
- -- the following lines force HyperCard to reveal how far a field must
- -- scroll to get to show the last line of its text.
- select text of whichFld
- type numToChar(29)
- put the scroll of whichFld into result
-
- set the lockText of whichFld to locked
- set the scroll of whichFld to scrolled
- unlock screen
-
- if saveSelection is true
- then select Holder
-
- return result
- end CalculateScroll
-
- +----------------------------------------+----------------------------------+
- | | Standard disclaimer for rent. |
- | Dennis Slade Jr. | +++++++++++++++ |
- | 2217 Mckean Street | Inquire within. |
- | Philadelphia, PA 19145 +----------------------------------+
- | internet: deslade@vaxsar.vassar.edu | Develop the world... |
- | voice: 01.215.468.4472 | Develop yourself... |
- | | AIESEC: in a country near you! |
- +----------------------------------------+----------------------------------+
-