home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!munnari.oz.au!metro!socs.uts.edu.au!kralizec.zeta.org.au!ixgate!peter.anderson
- From: peter.anderson@f914.n714.z3.fido.zeta.org.au (Peter Anderson)
- Message-ID: <b491090a@Kralizec.fido.zeta.org.au>
- Newsgroups: comp.sys.mac.hypercard
- Subject: RE-pop-up menus
- Organization: Fidonet. Gate admin is fido@socs.uts.edu.au
- Date: 31 Dec 92 10:02:27 GMT
- Lines: 71
-
- Original to: aaron.schrab
-
- The following uses a pure Hypercard method of providing popup menus. There
- is a '?' (Help) button adjacent to the field where you require the input
- from the pop-up menu. The 'RINALDI' collection of XCMDs (available on most
- Mac BBSs also contain some good menu XCMDs. I can send you a disk with the
- stack if you wish.
-
- Peter Anderson
- 31 Sheaffe Street
- HOLDER ACT 2611
- AUSTRALIA
-
- -----------------------------------
- The following script goes in the STACK script.
- The purpose of this script is to set-up the data for the pop-up menu.
- This technique has the advantage that it can be used in any card within
- the stack as it is available globally. Also as many menus as required
- can be set up. The contents of the menus are also available for
- modification in ONE place.
-
- on openStack
- global citiesMenu
- -- Field selection menu setup
- put "Adelaide,Brisbane,Canberra,Darwin,Hobart,Melbourne,"┬
- & "Perth,Sydney" into citiesMenu
- end openStack
-
- on closeStack
- stop using stack "Print The Scripts"
- end closeStack
-
- on openCard
- hide bg field "Valid cities"
- put the number of this card into bg field "Card number"
- put the number of cards into bg field "Number cards"
- end openCard
-
- -----------------------------------
- The following script goes with a '?' button adjacent to 'City' field.
- The purpose of this script is to display the list of valid choices as a
- pop-up menu.
-
- on mouseUp
- global citiesMenu
- put 1 into itemNumber
- repeat for number of items in citiesMenu
- put item itemNumber of citiesMenu into line itemNumber of ┬
- bg field "Valid cities"
- add 1 to itemNumber
- end repeat
- show field "Valid cities"
- end mouseUp
-
- -----------------------------------
- The following script goes with a background field called "Valid cities"
- The purpose of this script is to copy the selected item into the fore-
- ground field.
-
- on mouseUp
- get the value of the clickLine
- if it is empty then
- hide field "Valid cities"
- exit mouseUp
- end if
- put it into bg field "City"
- hide bg field "Valid cities"
- end mouseUp
-
- --- Tabby 3.0
- * Origin: *MacConnection* Sydney, Australia. 61-2-907-9198 (3:714/914)
-