home *** CD-ROM | disk | FTP | other *** search
/ Garbo / Garbo.cdr / mac / hypercrd / hc1_2_x / dvstckfx.sit / uni_redmdno / DevStackFix / card_3022.txt < prev    next >
Text File  |  1989-09-13  |  16KB  |  552 lines

  1. -- card: 3022 from stack: in
  2. -- bmap block id: 0
  3. -- flags: 0000
  4. -- background id: 2591
  5. -- name: 
  6.  
  7.  
  8. -- part 1 (button)
  9. -- low flags: 80
  10. -- high flags: 8003
  11. -- rect: left=401 top=145 right=167 bottom=501
  12. -- title width / last selected line: 0
  13. -- icon id / first selected line: 0 / 0
  14. -- text alignment: 1
  15. -- font id: 0
  16. -- text size: 12
  17. -- style flags: 0
  18. -- line height: 16
  19. -- part name: NewBG
  20. ----- HyperTalk script -----
  21. on opencard
  22.   hide menubar
  23.   set the name of button id 63 to "Menus On"
  24.   put the size of this stack into card field "StackSize"
  25.   put the freesize of this stack into card field "Wasted"
  26. end opencard
  27.  
  28.  
  29. on listButton ListName
  30.   if the short name of the target is "Show List" then
  31.     set name of target to "Hide List"
  32.     set visible of card field ListName to true
  33.   else
  34.     set name of target to "Show List"
  35.     set visible of card field ListName to false
  36.   end if
  37. end listButton
  38.  
  39. on controlbutton ref
  40.   if the commandkey is down then
  41.     visual dissolve to black
  42.     visual dissolve
  43.     go first card of background ref
  44.     exit controlbutton
  45.   end if
  46.   --the following lines facilitate repair to the Developer Stack
  47.   --repair stack by Dean Wette, XNetΓäó
  48.   set cursor to 4
  49.   put Order(card field ref,return) into theList
  50.   put stripReturn(theList) into theList
  51.   ShowDialog 7,1999,"",Chicago,12,theList,1
  52.   get the result
  53.   set lockMessages to true
  54.   go this cd
  55.   set lockmessages to false
  56.   if it is not empty then
  57.     push this card
  58.     visual scroll left to gray
  59.     visual scroll right
  60.     go card line it of theList
  61.   end if
  62. end controlbutton
  63.  
  64. --StripReturn function by Dean Wette, XNet
  65. function stripReturn container
  66. repeat while charToNum(last char of container) = 13
  67.   delete last char of container
  68. end repeat
  69. repeat while charToNum(first char of container) = 13
  70.   delete first char of container
  71. end repeat
  72. return container
  73. end stripReturn
  74.  
  75.  
  76. on domenu which
  77.   if which is "New Card" or which is "Cut card" or which is "Delete Card" then
  78.     beep 3
  79.     exit domenu
  80.   end if
  81.   if which is "Protect Stack..." then
  82.     beep 3
  83.     answer "You don't want to do that!"
  84.     exit domenu
  85.   end if
  86.   if which is "Delete Stack..." then
  87.     play boing
  88.     answer "You really don't want to do that!"
  89.     exit domenu
  90.   end if
  91.   pass domenu
  92. end domenu
  93.  
  94.  
  95.  
  96. -- part 2 (button)
  97. -- low flags: 80
  98. -- high flags: 8003
  99. -- rect: left=401 top=169 right=191 bottom=501
  100. -- title width / last selected line: 0
  101. -- icon id / first selected line: 0 / 0
  102. -- text alignment: 1
  103. -- font id: 0
  104. -- text size: 12
  105. -- style flags: 0
  106. -- line height: 16
  107. -- part name: NewStack
  108. ----- HyperTalk script -----
  109. on openStack
  110.   hide message box
  111.   set userlevel to 5
  112. end openStack
  113.  
  114.  
  115. on mouseup
  116.   if the optionkey is not down then exit mouseup
  117.   else
  118.     if the shiftkey is down then edit script of this background
  119.     else edit script of target
  120.   end if
  121. end mouseup
  122.  
  123.  
  124. --newCard handler modified by Dean Wette, XNetΓäó
  125. --modification required with repair to Developer Stack
  126. on newcard
  127.   ask "What do you want to name this card?"
  128.   set cursor to 4
  129.   put "Please wait while we fix things up for you..."
  130.   put it into newName
  131.   if newName is empty then
  132.     domenu delete card
  133.     hide message
  134.     exit newcard
  135.   end if
  136.   set the name of this card to newName
  137.   put newName into field name
  138.   set lockscreen to true
  139.   put the short name of this background into rememberThis
  140.   push this card
  141.   go first card
  142.   put newName & return before card field rememberThis
  143.   put newName & return before card field index
  144.   pop card
  145.   set lockscreen to false
  146.   hide message window
  147. end newcard
  148.  
  149.  
  150. --
  151. --this function will take a word passed to it by the calling script,
  152. --check if it is valid, and then go the card whose name is that wore.
  153. --
  154. function HyperText selectedWord
  155. --
  156. --
  157. --hypertext technique by Steve Drazga, ART Incorporated
  158. --if you use this in your scripts please include these 2 lines.
  159. --
  160. --
  161. if space is in SelectedWord then  --the user selected more than 1 word
  162.   click at loc of target       --so we will clear the selection
  163.   exit HyperText             --and exit to wait for another selection
  164. end if
  165. push this card
  166. visual dissolve to gray
  167. visual dissolve
  168. go card selectedWord
  169. if the result is not empty then
  170.   play oops
  171.   answer "Can't find that card"
  172. end if
  173. end HyperText
  174.  
  175.  
  176.  
  177. --
  178. --this function is used by the 'install' buttons in the
  179. --XFCN & XCMD cards.  It needs the resource type and resource name
  180. --passed to it.  It then attempts to install the resource into
  181. --a target stack & returns the result.
  182. --
  183. function installres type, resname
  184. --
  185. --Original script by Steve Drazga, AnalytX
  186. --XFCNs used: fileName,
  187. --XCMDs used: ResCopy,
  188. --HANDLERS used: none
  189. --FUNCTIONS used: none
  190. --
  191. put (long name of this stack) into sourceStack
  192. delete first word of sourceStack
  193. delete first character of sourceStack
  194. delete last character of sourceStack
  195. put "Select a stack to copy this "&type&" resource into."
  196. put filename("STAK") into fname
  197. if fname is empty then exit installres
  198. if sourcestack=fname then
  199.   play "oops"
  200.   return "Get real.  You can't install it in this stack"
  201.   exit installres
  202. end if
  203. --
  204. ResCopy sourceStack,fname,type,resname
  205. --
  206. if first char of the result is "E" then
  207.   play oops
  208.   answer "Attempt to install resource has failed."
  209. else
  210.   answer type&&"resource installation successful"
  211. end if
  212. hide message
  213. end installres
  214.  
  215.  
  216.  
  217. --
  218. -- LastPathComponent -- given a file pathname, returns the last
  219. -- component i.e. whatever comes after the last colon, if anything.
  220. -- From Dewi Williams
  221. --
  222. function LastPathComponent name
  223. -- scan backwards for the last colon.
  224. repeat with i = the length of name down to 1
  225.   if character i of name is ":" then exit repeat
  226. end repeat
  227.  
  228. if i is 1 then
  229.   -- Name was of the form ":thing" or "thing". Check for leading
  230.   -- colon, and adjust if necessary. Done for generality.
  231.   if first character of name is ":" then
  232.     put 2 into i
  233.   end if
  234. else
  235.   add 1 to i -- skip the colon
  236. end if
  237.  
  238. -- Name was of the form "Thing:otherthing". Return "otherThing".
  239. put empty into lastpath
  240. repeat with j = i to the length of name
  241.   put character j of name after lastpath
  242. end repeat
  243. return lastpath
  244. end LastPathComponent
  245.  
  246.  
  247. --
  248. -- OsErr: for displaying Operating system error codes returned by
  249. -- Sublaunch, RenameFile, MoveFile and DeleteFile XFCNs.
  250. -- From Dewi Williams
  251. --
  252. on OsErr err
  253.   -- Translate the most common ones
  254.   if err > 0 then -- XFCN convention
  255.     put "Parameter error with function" into errstr
  256.   else if err is -59 then
  257.     put "Problem during rename" into errstr
  258.   else if err is -54 then
  259.     put "Attempt to open locked file for writing" into errstr
  260.   else if err is -46 then
  261.     put "Volume locked by software" into errstr
  262.   else if err is -45 then
  263.     put "File locked" into errstr
  264.   else if err is -44 then
  265.     put "Volume locked by hardware" into errstr
  266.   else if err is -43 then
  267.     put "File not found" into errstr
  268.   else if err is -37 then
  269.     put "Bad volume or file name" into errstr
  270.   else if err is -36 then
  271.     put "I/O error" into errstr
  272.   else if err is -35 then
  273.     put "No such volume" into errstr
  274.   else if err is -34 then
  275.     put "Disk is full" into errstr
  276.   else if err is -49 then
  277.     put "File already open for writing" into errstr
  278.   else
  279.     put "Failed with error" && err into errstr
  280.   end if
  281.   answer errstr with "OK"
  282. end OsErr
  283.  
  284.  
  285.  
  286. -- part 5 (button)
  287. -- low flags: 00
  288. -- high flags: A003
  289. -- rect: left=153 top=99 right=121 bottom=350
  290. -- title width / last selected line: 0
  291. -- icon id / first selected line: 0 / 0
  292. -- text alignment: 1
  293. -- font id: 0
  294. -- text size: 12
  295. -- style flags: 0
  296. -- line height: 16
  297. -- part name: Repair Developer Stack...
  298. ----- HyperTalk script -----
  299. on mouseUp
  300.   put "Proceed with repair to Developer Stack?" into str1
  301.   put return &"The process will add some resources, and modify some" && "scripts in the Developer Stack." into str2
  302.   beep
  303.   ShowDialog 2,7502,str1,str2,"","",true,40,90
  304.   get the result
  305.   redraw
  306.   if it is empty then exit to HyperCard
  307.   put the value of word 2 of the long name of this stack into theSource
  308.   put stackPath() into theStack
  309.   doRepair theSource,theStack
  310. end mouseUp
  311.  
  312. function stackPath
  313. put "Select a COPY of the ΓÇ£Developer StackΓÇ¥ for repair." into prompt
  314. get FileName("STAK",prompt)
  315. if it is empty then exit to HyperCard
  316. redraw
  317. return it
  318. end stackPath
  319.  
  320. on doRepair source,dest
  321.   put the script of btn id 1 into bgScript
  322.   put the script of btn id 2 into stackScript
  323.   put cd fld id 6 into theList
  324.   showMessage return &"Repairing Developer Stack..."
  325.   setLocks true
  326.   push cd
  327.   go stack dest
  328.   if not (the name of this stack contains "Developer") then wrongStack
  329.   rescopy source, dest, "XFCN", "Order"
  330.   rescopy source, dest, "XCMD", "ShowDialog"
  331.   rescopy source, dest, "DITL", "XNet"
  332.   rescopy source, dest, "DLOG", "XNet"
  333.   rescopy source, dest, "XFCN", "Substitute"
  334.   if the result is not empty then
  335.     pop cd
  336.     setLocks false
  337.     put "Sorry, problems copying resources. Repair aborted." into str1
  338.     ShowDialog 2,7400,str1,"","","",70,105
  339.     hideMessage
  340.     exit to HyperCard
  341.   end if
  342.   set the script of this stack to stackScript
  343.   set the script of this bg to bgScript
  344.   repeat with i = 1 to the number of lines of theList
  345.     put cd fld (line i of thelist) into indexList
  346.     put substitute(",",return,indexList) into indexList
  347.     put order(indexList,return) into indexList
  348.     put stripReturn(indexList) into indexList
  349.     put indexList into cd fld (line i of theList)
  350.   end repeat
  351.   hide msg
  352.   pop cd
  353.   hideMessage
  354.   setLocks false
  355.   beep
  356.   ShowDialog 1,7671,"",true,55,110
  357. end doRepair
  358.  
  359. on wrongStack
  360.   pop cd
  361.   setLocks false
  362.   put "Error! You cannot work on the stack you selected." into str1
  363.   beep
  364.   ShowDialog 2,7400,str1,"","","",70,105
  365.   hideMessage
  366.   exit to HyperCard
  367. end wrongStack
  368.  
  369.  
  370.  
  371.  
  372. -- part 6 (field)
  373. -- low flags: 80
  374. -- high flags: 0001
  375. -- rect: left=156 top=120 right=205 bottom=356
  376. -- title width / last selected line: 0
  377. -- icon id / first selected line: 0 / 0
  378. -- text alignment: 0
  379. -- font id: 3
  380. -- text size: 9
  381. -- style flags: 0
  382. -- line height: 12
  383. -- part name: 
  384.  
  385.  
  386. -- part 7 (button)
  387. -- low flags: 00
  388. -- high flags: A003
  389. -- rect: left=153 top=73 right=95 bottom=350
  390. -- title width / last selected line: 0
  391. -- icon id / first selected line: 0 / 0
  392. -- text alignment: 1
  393. -- font id: 0
  394. -- text size: 12
  395. -- style flags: 0
  396. -- line height: 16
  397. -- part name: Please Read Me First...
  398. ----- HyperTalk script -----
  399. on mouseUp
  400.   set the visible of cd fld id 11 to not the visible of cd fld id 11
  401. end mouseUp
  402.  
  403.  
  404.  
  405. -- part 8 (field)
  406. -- low flags: 81
  407. -- high flags: 0002
  408. -- rect: left=145 top=67 right=148 bottom=358
  409. -- title width / last selected line: 0
  410. -- icon id / first selected line: 0 / 0
  411. -- text alignment: 1
  412. -- font id: 0
  413. -- text size: 12
  414. -- style flags: 0
  415. -- line height: 16
  416. -- part name: 
  417.  
  418.  
  419. -- part 9 (field)
  420. -- low flags: 81
  421. -- high flags: 0002
  422. -- rect: left=148 top=70 right=145 bottom=355
  423. -- title width / last selected line: 0
  424. -- icon id / first selected line: 0 / 0
  425. -- text alignment: 1
  426. -- font id: 0
  427. -- text size: 12
  428. -- style flags: 0
  429. -- line height: 16
  430. -- part name: 
  431.  
  432.  
  433. -- part 10 (field)
  434. -- low flags: 81
  435. -- high flags: 0002
  436. -- rect: left=149 top=71 right=144 bottom=354
  437. -- title width / last selected line: 0
  438. -- icon id / first selected line: 0 / 0
  439. -- text alignment: 1
  440. -- font id: 0
  441. -- text size: 12
  442. -- style flags: 0
  443. -- line height: 14
  444. -- part name: 
  445.  
  446.  
  447. -- part 11 (field)
  448. -- low flags: 81
  449. -- high flags: 2007
  450. -- rect: left=4 top=213 right=337 bottom=507
  451. -- title width / last selected line: 0
  452. -- icon id / first selected line: 0 / 0
  453. -- text alignment: 0
  454. -- font id: 3
  455. -- text size: 9
  456. -- style flags: 0
  457. -- line height: 12
  458. -- part name: 
  459. ----- HyperTalk script -----
  460. on mouseUp
  461.   hide me
  462.   set the scroll of me to 0
  463. end mouseUp
  464.  
  465.  
  466. -- part 12 (button)
  467. -- low flags: 00
  468. -- high flags: 2000
  469. -- rect: left=482 top=187 right=211 bottom=512
  470. -- title width / last selected line: 0
  471. -- icon id / first selected line: 19678 / 19678
  472. -- text alignment: 1
  473. -- font id: 0
  474. -- text size: 12
  475. -- style flags: 0
  476. -- line height: 16
  477. -- part name: About XNet...
  478. ----- HyperTalk script -----
  479. on mouseUp
  480.   set the visible of cd fld id 14 to not the visible of cd fld id 14
  481. end mouseUp
  482.  
  483.  
  484.  
  485. -- part 14 (field)
  486. -- low flags: 81
  487. -- high flags: 2002
  488. -- rect: left=7 top=212 right=338 bottom=504
  489. -- title width / last selected line: 0
  490. -- icon id / first selected line: 0 / 0
  491. -- text alignment: 0
  492. -- font id: 3
  493. -- text size: 9
  494. -- style flags: 0
  495. -- line height: 12
  496. -- part name: 
  497. ----- HyperTalk script -----
  498. on mouseUp
  499.   hide me
  500. end mouseUp
  501.  
  502.  
  503. -- part contents for card part 6
  504. ----- text -----
  505. XFCNs
  506. XCMDs
  507. Functions
  508. Scripts
  509. Buttons
  510. Quick Ref
  511. Index
  512.  
  513. -- part contents for card part 11
  514. ----- text -----
  515. DevStackFix 1.0 by Dean H. Wette, XNetΓäó, 24 February 1989
  516.  
  517. The Developer Stack version 1.2 has problems with HyperCard 1.2. It uses an external function XFCN 
  518. (Sortlines) that causes a system crash when the scrolling list dialog is invoked. This stack repairs Developer Stack by replacing those resources that cause the system error with newer, compatible ones. It also modifies some scripts to make Developer Stack work correctly with the new resources. 
  519.  
  520. This stack will modify both the resource and data component of Developer Stack--WORK ONLY ON A COPY!
  521.  
  522. The repair is not guaranteed to work on modified copies of Developer Stack, although, in most cases, it should work fine. If you have modified Developer Stack and/or added resources to it, you may contact me directly for instructions on performing the repair manually.  If you have added resources that share the same ID as the resources added by the repair, your original resources will be overwritten by the ones installed by the repair routine.
  523.  
  524. To invoke the repair, click the appropriate button above. A standard GetFile dialog will prompt you to select a copy of the Developer Stack to work on. The process itself takes only a few moments. An alert will inform you if error is encountered, or when the repair is completed successfully.  
  525.  
  526. Please Note Well: You will need to RESTART HyperCard before the repair is functional. This is due to the way some resources are copied--they don't become active until after HyperCard is restarted.
  527.  
  528. DevStackFix uses some resources that are copyrighted by other developers. They are:
  529.  
  530. FileName XFCN by Steve Maller, Apple Computer
  531. ShowDialog XCMD by Jay Hodgdon
  532. Substitute and Order XFCNs by Eric Celeste
  533.  
  534. My thanks to all of them for their excellent work providing freeware and shareware external resources. 
  535.  
  536. All other components of this stack, other than the non-modified parts of Developer Stack's scripts, are copyright ┬⌐1989 by Dean H. Wette.  DevStackFix is an XNetΓäó product and is free of charge.  It may be distributed freely only through non-profit channels, and  through online services that do not charge for specific downloaded files.  ShareWare/Freeware distributors, whose business is to distribute software, are forbidden from distributing DevStackFix or any other XNet product.
  537.  
  538. If you have any problems, or need to perform the repair manually you may contact me at the following:
  539.  
  540. MacNET: DWETTE
  541. CIS: 72317,2034
  542. GEnie: D.WETTE
  543.  
  544. Dean Wette
  545. 921 DeMun Ave.
  546. Clayton MO 63105
  547.  
  548. -- part contents for card part 14
  549. ----- text -----
  550. XNetΓäó is the HyperCard and Externals Developers Network, a coalition of developers in HyperTalk and of XCMD's and XFCN's.  The members of the group are available via various ID's and Addresses on all the major networks and information services (CONNECT/MacNET, CompuServe, GEnie and AppleLink).  Soon, the group as a whole, may be contacted through one central ID or Address on your service of preference.  For now, inquire with the System Operator or Forum Manager of your service's HyperCard areas for info regarding the contacting of XNetΓäó members.
  551.  
  552. The group members, made up of a growing and changing number of experienced HyperTalk and Externals Developers, produce various freeware products for public distribution under the XNetΓäó name, as well as provide responsive assistance and information at both novice and expert levels of HyperCard Development.