home *** CD-ROM | disk | FTP | other *** search
/ Otherware / Otherware_1_SB_Development.iso / mac / misc / biology / bioessst.cpt / Bio_ESS / background_2799.xml next >
Encoding:
Extensible Markup Language  |  1992-10-05  |  27.6 KB  |  679 lines

  1. <?xml version="1.0" encoding="utf-8" ?>
  2. <!DOCTYPE background PUBLIC "-//Apple, Inc.//DTD background V 2.0//EN" "" >
  3. <background>
  4.     <id>2799</id>
  5.     <filler1>0</filler1>
  6.     <bitmap>BMAP_3782.pbm</bitmap>
  7.     <cantDelete> <false /> </cantDelete>
  8.     <showPict> <true /> </showPict>
  9.     <dontSearch> <false /> </dontSearch>
  10.     <link rel="stylesheet" type="text/css" href="stylesheet_3080.css" />
  11.     <part>
  12.         <id>1</id>
  13.         <type>button</type>
  14.         <visible> <true /> </visible>
  15.         <reserved5> 0 </reserved5>
  16.         <reserved4> 0 </reserved4>
  17.         <reserved3> 0 </reserved3>
  18.         <reserved2> 0 </reserved2>
  19.         <reserved1> 0 </reserved1>
  20.         <enabled> <true /> </enabled>
  21.         <rect>
  22.             <left>435</left>
  23.             <top>99</top>
  24.             <right>503</right>
  25.             <bottom>157</bottom>
  26.         </rect>
  27.         <style>roundrect</style>
  28.         <showName> <true /> </showName>
  29.         <highlight> <false /> </highlight>
  30.         <autoHighlight> <true /> </autoHighlight>
  31.         <sharedHighlight> <true /> </sharedHighlight>
  32.         <family>0</family>
  33.         <titleWidth>0</titleWidth>
  34.         <icon>26665</icon>
  35.         <textAlign>center</textAlign>
  36.         <font>Chicago</font>
  37.         <textSize>12</textSize>
  38.         <textStyle>plain</textStyle>
  39.         <name>Calculate</name>
  40.         <script>on mouseUp
  41. global StartA,StartB,StartC,StartD,StartE
  42. global NoNumberField
  43.  
  44. if NoNumberField is not empty then
  45. send "openField" to NoNumberField
  46. exit mouseUp
  47. end if
  48.  
  49. set the numberFormat to "0.000"
  50. put field FreqField1+0 into StartA
  51. put field FreqField2+0 into StartB
  52. if visible of field FreqField3 is true
  53. then put field FreqField3+0 into StartC
  54. else put empty into StartC
  55.  
  56. put field ValueField into StartD
  57. put field DamageField into StartE
  58.  
  59. -- check first if frequencies add up to 1
  60. -- if <> 1: select button, 1st on left
  61. if (StartA+StartB+StartC)<>1 then
  62. answer "The frequencies don't sum up to 1 !!!" with "OK"
  63. send "openField" to bg field "FreqField1"
  64. exit mouseUp
  65. end if
  66.  
  67. -- if everything ok, then show "Graph" button
  68. show bg button "Graph"
  69.  
  70. -- clear text if it already exists, i. e. better always...
  71. put empty into field "ResultsList"
  72. -- calculation of frequencies
  73. -- ..by sending message to card, so each card represents..
  74. -- ..a new game, but background buttons have the same..
  75. -- ..script for all the games (i.e. cards)
  76. send "CalcNow" to this card
  77. show bg button "Graph"
  78. end mouseUp</script>
  79.     </part>
  80.     <part>
  81.         <id>2</id>
  82.         <type>button</type>
  83.         <visible> <true /> </visible>
  84.         <reserved5> 0 </reserved5>
  85.         <reserved4> 0 </reserved4>
  86.         <reserved3> 0 </reserved3>
  87.         <reserved2> 0 </reserved2>
  88.         <reserved1> 0 </reserved1>
  89.         <enabled> <true /> </enabled>
  90.         <rect>
  91.             <left>435</left>
  92.             <top>165</top>
  93.             <right>503</right>
  94.             <bottom>225</bottom>
  95.         </rect>
  96.         <style>roundrect</style>
  97.         <showName> <true /> </showName>
  98.         <highlight> <false /> </highlight>
  99.         <autoHighlight> <true /> </autoHighlight>
  100.         <sharedHighlight> <true /> </sharedHighlight>
  101.         <family>0</family>
  102.         <titleWidth>0</titleWidth>
  103.         <icon>21379</icon>
  104.         <textAlign>center</textAlign>
  105.         <font>Chicago</font>
  106.         <textSize>12</textSize>
  107.         <textStyle>plain</textStyle>
  108.         <name>Graph</name>
  109.         <script>on mouseUp
  110. global Results
  111. global Label1, Label2, Label3, Label4, Label5
  112. global StartA,StartB,StartC,StartD,StartE
  113. global NoNumberField
  114. global Title
  115.  
  116. if NoNumberField is not empty then
  117. send "openField" to NoNumberField
  118. exit mouseUp
  119. end if
  120.  
  121. -- test if result list has more than 2 lines
  122. put field "ResultsList" into Results
  123. if the number of lines of Results < 3 then
  124. play "scale"
  125. answer "More then two data lines are needed"┬¼
  126. & return & "to draw this graph ! " with "OK"
  127. exit mouseUp
  128. end if
  129.  
  130. put field FreqLabel1 into Label1
  131. put field FreqLabel2 into Label2
  132. put field FreqLabel3 into Label3
  133. put field ValueLabel into Label4
  134. put field DamageLabel into Label5
  135. put field TitleOfGame into Title
  136.  
  137. put field FreqField1+0 into StartA
  138. put field FreqField2+0 into StartB
  139. if visible of field FreqField3 is true
  140. then put field FreqField3+0 into StartC
  141. else put empty into StartC
  142.  
  143. put field ValueField into StartD
  144. put field DamageField into StartE
  145. visual zoom out
  146. push card
  147. go to cd DrawGraph
  148. end mouseUp</script>
  149.     </part>
  150.     <part>
  151.         <id>3</id>
  152.         <type>button</type>
  153.         <visible> <true /> </visible>
  154.         <reserved5> 0 </reserved5>
  155.         <reserved4> 0 </reserved4>
  156.         <reserved3> 0 </reserved3>
  157.         <reserved2> 0 </reserved2>
  158.         <reserved1> 0 </reserved1>
  159.         <enabled> <true /> </enabled>
  160.         <rect>
  161.             <left>434</left>
  162.             <top>274</top>
  163.             <right>505</right>
  164.             <bottom>331</bottom>
  165.         </rect>
  166.         <style>roundrect</style>
  167.         <showName> <true /> </showName>
  168.         <highlight> <false /> </highlight>
  169.         <autoHighlight> <true /> </autoHighlight>
  170.         <sharedHighlight> <true /> </sharedHighlight>
  171.         <family>0</family>
  172.         <titleWidth>0</titleWidth>
  173.         <icon>8964</icon>
  174.         <textAlign>center</textAlign>
  175.         <font>Chicago</font>
  176.         <textSize>12</textSize>
  177.         <textStyle>plain</textStyle>
  178.         <name>Quit</name>
  179.         <script>on mouseUp
  180. answer "Are you sure you want to quit?" with "Cancel" or "OK"
  181. if it is "Cancel" then exit mouseUp
  182. else
  183. doMenu Quit HyperCard
  184. end if
  185. end mouseUp</script>
  186.     </part>
  187.     <part>
  188.         <id>4</id>
  189.         <type>field</type>
  190.         <visible> <true /> </visible>
  191.         <dontWrap> <false /> </dontWrap>
  192.         <dontSearch> <false /> </dontSearch>
  193.         <sharedText> <false /> </sharedText>
  194.         <fixedLineHeight> <false /> </fixedLineHeight>
  195.         <autoTab> <false /> </autoTab>
  196.         <lockText> <true /> </lockText>
  197.         <rect>
  198.             <left>9</left>
  199.             <top>10</top>
  200.             <right>47</right>
  201.             <bottom>25</bottom>
  202.         </rect>
  203.         <style>rectangle</style>
  204.         <autoSelect> <false /> </autoSelect>
  205.         <showLines> <false /> </showLines>
  206.         <wideMargins> <false /> </wideMargins>
  207.         <multipleLines> <false /> </multipleLines>
  208.         <reservedFamily> 0 </reservedFamily>
  209.         <titleWidth>0</titleWidth>
  210.         <icon>0</icon>
  211.         <textAlign>left</textAlign>
  212.         <font>Geneva</font>
  213.         <textSize>9</textSize>
  214.         <textStyle>plain</textStyle>
  215.         <textHeight>12</textHeight>
  216.         <name>FreqLabel1</name>
  217.         <script>on mouseUp
  218. if the shiftKey is down then
  219. set lockText of me to false
  220. select text of me
  221. end if
  222. end mouseUp
  223.  
  224. on closeField
  225. set locktext of me to true
  226. end closeField
  227.  
  228. on exitField
  229. send closeField to me
  230. end exitField</script>
  231.     </part>
  232.     <part>
  233.         <id>5</id>
  234.         <type>field</type>
  235.         <visible> <true /> </visible>
  236.         <dontWrap> <false /> </dontWrap>
  237.         <dontSearch> <false /> </dontSearch>
  238.         <sharedText> <false /> </sharedText>
  239.         <fixedLineHeight> <false /> </fixedLineHeight>
  240.         <autoTab> <false /> </autoTab>
  241.         <lockText> <false /> </lockText>
  242.         <rect>
  243.             <left>51</left>
  244.             <top>9</top>
  245.             <right>96</right>
  246.             <bottom>27</bottom>
  247.         </rect>
  248.         <style>shadow</style>
  249.         <autoSelect> <false /> </autoSelect>
  250.         <showLines> <false /> </showLines>
  251.         <wideMargins> <false /> </wideMargins>
  252.         <multipleLines> <false /> </multipleLines>
  253.         <reservedFamily> 0 </reservedFamily>
  254.         <titleWidth>0</titleWidth>
  255.         <icon>0</icon>
  256.         <textAlign>right</textAlign>
  257.         <font>Geneva</font>
  258.         <textSize>12</textSize>
  259.         <textStyle>plain</textStyle>
  260.         <textHeight>16</textHeight>
  261.         <name>FreqField1</name>
  262.         <script>-- ****************************
  263. -- validation of field entries:
  264. -- ****************************
  265. -- check if positive number is entered
  266. -- otherwise do not allow to move to next field
  267.  
  268. on openField
  269. global NoNumberField
  270.  
  271. if (NoNumberField is empty) or (the target=NoNumberField) ┬¼
  272. then select text of me
  273. else send "openField" to NoNumberField
  274. end openField
  275.  
  276. on closeField
  277. global NoNumberField
  278. if (target is not a number)  or (target<=0) then
  279. put the target into NoNumberField
  280. play "scale"
  281. select text of the target
  282. else
  283. put empty into NoNumberField
  284. pass closeField
  285. end if
  286. end closeField
  287.  
  288. on exitField
  289. closeField
  290. end exitField
  291. </script>
  292.     </part>
  293.     <part>
  294.         <id>6</id>
  295.         <type>field</type>
  296.         <visible> <true /> </visible>
  297.         <dontWrap> <false /> </dontWrap>
  298.         <dontSearch> <false /> </dontSearch>
  299.         <sharedText> <false /> </sharedText>
  300.         <fixedLineHeight> <false /> </fixedLineHeight>
  301.         <autoTab> <false /> </autoTab>
  302.         <lockText> <true /> </lockText>
  303.         <rect>
  304.             <left>99</left>
  305.             <top>10</top>
  306.             <right>137</right>
  307.             <bottom>25</bottom>
  308.         </rect>
  309.         <style>rectangle</style>
  310.         <autoSelect> <false /> </autoSelect>
  311.         <showLines> <false /> </showLines>
  312.         <wideMargins> <false /> </wideMargins>
  313.         <multipleLines> <false /> </multipleLines>
  314.         <reservedFamily> 0 </reservedFamily>
  315.         <titleWidth>0</titleWidth>
  316.         <icon>0</icon>
  317.         <textAlign>left</textAlign>
  318.         <font>Geneva</font>
  319.         <textSize>9</textSize>
  320.         <textStyle>plain</textStyle>
  321.         <textHeight>12</textHeight>
  322.         <name>FreqLabel2</name>
  323.         <script>on mouseUp
  324. if the shiftKey is down then
  325. set lockText of me to false
  326. select text of me
  327. end if
  328. end mouseUp
  329.  
  330. on closeField
  331. set locktext of me to true
  332. end closeField
  333.  
  334. on exitField
  335. send closeField to me
  336. end exitField</script>
  337.     </part>
  338.     <part>
  339.         <id>7</id>
  340.         <type>field</type>
  341.         <visible> <true /> </visible>
  342.         <dontWrap> <false /> </dontWrap>
  343.         <dontSearch> <false /> </dontSearch>
  344.         <sharedText> <false /> </sharedText>
  345.         <fixedLineHeight> <false /> </fixedLineHeight>
  346.         <autoTab> <false /> </autoTab>
  347.         <lockText> <false /> </lockText>
  348.         <rect>
  349.             <left>141</left>
  350.             <top>8</top>
  351.             <right>186</right>
  352.             <bottom>26</bottom>
  353.         </rect>
  354.         <style>shadow</style>
  355.         <autoSelect> <false /> </autoSelect>
  356.         <showLines> <false /> </showLines>
  357.         <wideMargins> <false /> </wideMargins>
  358.         <multipleLines> <false /> </multipleLines>
  359.         <reservedFamily> 0 </reservedFamily>
  360.         <titleWidth>0</titleWidth>
  361.         <icon>0</icon>
  362.         <textAlign>right</textAlign>
  363.         <font>Geneva</font>
  364.         <textSize>12</textSize>
  365.         <textStyle>plain</textStyle>
  366.         <textHeight>16</textHeight>
  367.         <name>FreqField2</name>
  368.         <script>-- ****************************
  369. -- validation of field entries:
  370. -- ****************************
  371. -- check if positive number is entered
  372. -- otherwise do not allow to move to next field
  373.  
  374. on openField
  375. global NoNumberField
  376.  
  377. if (NoNumberField is empty) or (the target=NoNumberField) ┬¼
  378. then select text of me
  379. else send "openField" to NoNumberField
  380. end openField
  381.  
  382. on closeField
  383. global NoNumberField
  384. if (target is not a number)  or (target<=0) then
  385. put the target into NoNumberField
  386. play "scale"
  387. select text of the target
  388. else
  389. put empty into NoNumberField
  390. pass closeField
  391. end if
  392. end closeField
  393.  
  394. on exitField
  395. closeField
  396. end exitField
  397. </script>
  398.     </part>
  399.     <part>
  400.         <id>8</id>
  401.         <type>field</type>
  402.         <visible> <true /> </visible>
  403.         <dontWrap> <false /> </dontWrap>
  404.         <dontSearch> <false /> </dontSearch>
  405.         <sharedText> <false /> </sharedText>
  406.         <fixedLineHeight> <false /> </fixedLineHeight>
  407.         <autoTab> <false /> </autoTab>
  408.         <lockText> <true /> </lockText>
  409.         <rect>
  410.             <left>192</left>
  411.             <top>10</top>
  412.             <right>230</right>
  413.             <bottom>25</bottom>
  414.         </rect>
  415.         <style>rectangle</style>
  416.         <autoSelect> <false /> </autoSelect>
  417.         <showLines> <false /> </showLines>
  418.         <wideMargins> <false /> </wideMargins>
  419.         <multipleLines> <false /> </multipleLines>
  420.         <reservedFamily> 0 </reservedFamily>
  421.         <titleWidth>0</titleWidth>
  422.         <icon>0</icon>
  423.         <textAlign>left</textAlign>
  424.         <font>Geneva</font>
  425.         <textSize>9</textSize>
  426.         <textStyle>plain</textStyle>
  427.         <textHeight>12</textHeight>
  428.         <name>FreqLabel3</name>
  429.         <script>on mouseUp
  430. if the shiftKey is down then
  431. set lockText of me to false
  432. select text of me
  433. end if
  434. end mouseUp
  435.  
  436. on closeField
  437. set locktext of me to true
  438. end closeField
  439.  
  440. on exitField
  441. send closeField to me
  442. end exitField</script>
  443.     </part>
  444.     <part>
  445.         <id>9</id>
  446.         <type>field</type>
  447.         <visible> <true /> </visible>
  448.         <dontWrap> <false /> </dontWrap>
  449.         <dontSearch> <false /> </dontSearch>
  450.         <sharedText> <false /> </sharedText>
  451.         <fixedLineHeight> <false /> </fixedLineHeight>
  452.         <autoTab> <false /> </autoTab>
  453.         <lockText> <false /> </lockText>
  454.         <rect>
  455.             <left>233</left>
  456.             <top>8</top>
  457.             <right>278</right>
  458.             <bottom>26</bottom>
  459.         </rect>
  460.         <style>shadow</style>
  461.         <autoSelect> <false /> </autoSelect>
  462.         <showLines> <false /> </showLines>
  463.         <wideMargins> <false /> </wideMargins>
  464.         <multipleLines> <false /> </multipleLines>
  465.         <reservedFamily> 0 </reservedFamily>
  466.         <titleWidth>0</titleWidth>
  467.         <icon>0</icon>
  468.         <textAlign>right</textAlign>
  469.         <font>Geneva</font>
  470.         <textSize>12</textSize>
  471.         <textStyle>plain</textStyle>
  472.         <textHeight>16</textHeight>
  473.         <name>FreqField3</name>
  474.         <script>-- ****************************
  475. -- validation of field entries:
  476. -- ****************************
  477. -- check if positive number is entered
  478. -- otherwise do not allow to move to next field
  479.  
  480. on openField
  481. global NoNumberField
  482.  
  483. if (NoNumberField is empty) or (the target=NoNumberField) ┬¼
  484. then select text of me
  485. else send "openField" to NoNumberField
  486. end openField
  487.  
  488. on closeField
  489. global NoNumberField
  490. if (target is not a number)  or (target<=0) then
  491. put the target into NoNumberField
  492. play "scale"
  493. select text of the target
  494. else
  495. put empty into NoNumberField
  496. pass closeField
  497. end if
  498. end closeField
  499.  
  500. on exitField
  501. closeField
  502. end exitField
  503. </script>
  504.     </part>
  505.     <part>
  506.         <id>10</id>
  507.         <type>field</type>
  508.         <visible> <true /> </visible>
  509.         <dontWrap> <false /> </dontWrap>
  510.         <dontSearch> <false /> </dontSearch>
  511.         <sharedText> <false /> </sharedText>
  512.         <fixedLineHeight> <false /> </fixedLineHeight>
  513.         <autoTab> <false /> </autoTab>
  514.         <lockText> <true /> </lockText>
  515.         <rect>
  516.             <left>301</left>
  517.             <top>11</top>
  518.             <right>347</right>
  519.             <bottom>26</bottom>
  520.         </rect>
  521.         <style>rectangle</style>
  522.         <autoSelect> <false /> </autoSelect>
  523.         <showLines> <false /> </showLines>
  524.         <wideMargins> <false /> </wideMargins>
  525.         <multipleLines> <false /> </multipleLines>
  526.         <reservedFamily> 0 </reservedFamily>
  527.         <titleWidth>0</titleWidth>
  528.         <icon>0</icon>
  529.         <textAlign>left</textAlign>
  530.         <font>Geneva</font>
  531.         <textSize>10</textSize>
  532.         <textStyle>plain</textStyle>
  533.         <textHeight>13</textHeight>
  534.         <name>ValueLabel</name>
  535.         <script>on mouseUp
  536. if the shiftKey is down then
  537. set lockText of me to false
  538. select text of me
  539. end if
  540. end mouseUp
  541.  
  542. on closeField
  543. set locktext of me to true
  544. end closeField
  545.  
  546. on exitField
  547. send closeField to me
  548. end exitField</script>
  549.     </part>
  550.     <part>
  551.         <id>11</id>
  552.         <type>field</type>
  553.         <visible> <true /> </visible>
  554.         <dontWrap> <false /> </dontWrap>
  555.         <dontSearch> <false /> </dontSearch>
  556.         <sharedText> <false /> </sharedText>
  557.         <fixedLineHeight> <false /> </fixedLineHeight>
  558.         <autoTab> <false /> </autoTab>
  559.         <lockText> <false /> </lockText>
  560.         <rect>
  561.             <left>353</left>
  562.             <top>9</top>
  563.             <right>398</right>
  564.             <bottom>27</bottom>
  565.         </rect>
  566.         <style>shadow</style>
  567.         <autoSelect> <false /> </autoSelect>
  568.         <showLines> <false /> </showLines>
  569.         <wideMargins> <false /> </wideMargins>
  570.         <multipleLines> <false /> </multipleLines>
  571.         <reservedFamily> 0 </reservedFamily>
  572.         <titleWidth>0</titleWidth>
  573.         <icon>0</icon>
  574.         <textAlign>right</textAlign>
  575.         <font>Geneva</font>
  576.         <textSize>12</textSize>
  577.         <textStyle>plain</textStyle>
  578.         <textHeight>16</textHeight>
  579.         <name>ValueField</name>
  580.         <script>-- ****************************
  581. -- validation of field entries:
  582. -- ****************************
  583. -- check if positive number is entered
  584. -- otherwise do not allow to move to next field
  585.  
  586. on openField
  587. global NoNumberField
  588.  
  589. if (NoNumberField is empty) or (the target=NoNumberField) ┬¼
  590. then select text of me
  591. else send "openField" to NoNumberField
  592. end openField
  593.  
  594. on closeField
  595. global NoNumberField
  596. if (target is not a number)  or (target<=0) then
  597. put the target into NoNumberField
  598. play "scale"
  599. select text of the target
  600. else
  601. put empty into NoNumberField
  602. pass closeField
  603. end if
  604. end closeField
  605.  
  606. on exitField
  607. closeField
  608. end exitField
  609. </script>
  610.     </part>
  611.     <part>
  612.         <id>14</id>
  613.         <type>field</type>
  614.         <visible> <true /> </visible>
  615.         <dontWrap> <false /> </dontWrap>
  616.         <dontSearch> <false /> </dontSearch>
  617.         <sharedText> <false /> </sharedText>
  618.         <fixedLineHeight> <false /> </fixedLineHeight>
  619.         <autoTab> <false /> </autoTab>
  620.         <lockText> <true /> </lockText>
  621.         <rect>
  622.             <left>402</left>
  623.             <top>11</top>
  624.             <right>451</right>
  625.             <bottom>26</bottom>
  626.         </rect>
  627.         <style>rectangle</style>
  628.         <autoSelect> <false /> </autoSelect>
  629.         <showLines> <false /> </showLines>
  630.         <wideMargins> <false /> </wideMargins>
  631.         <multipleLines> <false /> </multipleLines>
  632.         <reservedFamily> 0 </reservedFamily>
  633.         <titleWidth>0</titleWidth>
  634.         <icon>0</icon>
  635.         <textAlign>left</textAlign>
  636.         <font>Geneva</font>
  637.         <textSize>10</textSize>
  638.         <textStyle>plain</textStyle>
  639.         <textHeight>13</textHeight>
  640.         <name>DamageLabel</name>
  641.         <script>on mouseUp
  642. if the shiftKey is down then
  643. set lockText of me to false
  644. select text of me
  645. end if
  646. end mouseUp
  647.  
  648. on closeField
  649. set locktext of me to true
  650. end closeField
  651.  
  652. on exitField
  653. send closeField to me
  654. end exitField</script>
  655.     </part>
  656.     <part>
  657.         <id>15</id>
  658.         <type>field</type>
  659.         <visible> <true /> </visible>
  660.         <dontWrap> <false /> </dontWrap>
  661.         <dontSearch> <false /> </dontSearch>
  662.         <sharedText> <false /> </sharedText>
  663.         <fixedLineHeight> <false /> </fixedLineHeight>
  664.         <autoTab> <false /> </autoTab>
  665.         <lockText> <false /> </lockText>
  666.         <rect>
  667.             <left>455</left>
  668.             <top>9</top>
  669.             <right>500</right>
  670.             <bottom>27</bottom>
  671.         </rect>
  672.         <style>shadow</style>
  673.         <autoSelect> <false /> </autoSelect>
  674.         <showLines> <false /> </showLines>
  675.         <wideMargins> <false /> </wideMargins>
  676.         <multipleLines> <false /> </multipleLines>
  677.         <reservedFamily> 0 </reservedFamily>
  678.         <titleWidth>0</titleWidth>
  679.         <icon>0</icon>
  680.         <textAlign>right</textAlign>
  681.         <font>Geneva</font>
  682.         <textSize>12</textSize>
  683.         <textStyle>plain</textStyle>
  684.         <textHeight>16</textHeight>
  685.         <name>DamageField</name>
  686.         <script>-- ****************************
  687. -- validation of field entries:
  688. -- ****************************
  689. -- check if positive number is entered
  690. -- otherwise do not allow to move to next field
  691.  
  692. on openField
  693. global NoNumberField
  694.  
  695. if (NoNumberField is empty) or (the target=NoNumberField) ┬¼
  696. then select text of me
  697. else send "openField" to NoNumberField
  698. end openField
  699.  
  700. on closeField
  701. global NoNumberField
  702. if (target is not a number)  or (target<=0) then
  703. put the target into NoNumberField
  704. play "scale"
  705. select text of the target
  706. else
  707. put empty into NoNumberField
  708. pass closeField
  709. end if
  710. end closeField
  711.  
  712. on exitField
  713. closeField
  714. end exitField
  715. </script>
  716.     </part>
  717.     <part>
  718.         <id>16</id>
  719.         <type>button</type>
  720.         <visible> <true /> </visible>
  721.         <reserved5> 0 </reserved5>
  722.         <reserved4> 0 </reserved4>
  723.         <reserved3> 0 </reserved3>
  724.         <reserved2> 0 </reserved2>
  725.         <reserved1> 0 </reserved1>
  726.         <enabled> <true /> </enabled>
  727.         <rect>
  728.             <left>437</left>
  729.             <top>236</top>
  730.             <right>466</right>
  731.             <bottom>263</bottom>
  732.         </rect>
  733.         <style>transparent</style>
  734.         <showName> <false /> </showName>
  735.         <highlight> <false /> </highlight>
  736.         <autoHighlight> <true /> </autoHighlight>
  737.         <sharedHighlight> <true /> </sharedHighlight>
  738.         <family>0</family>
  739.         <titleWidth>0</titleWidth>
  740.         <icon>1014</icon>
  741.         <textAlign>center</textAlign>
  742.         <font>Chicago</font>
  743.         <textSize>12</textSize>
  744.         <textStyle>plain</textStyle>
  745.         <name>GoPrevious</name>
  746.         <script>on mouseUp
  747. global NoNumberField
  748.  
  749. if NoNumberField is empty then
  750. visual scroll right
  751. go prev card
  752. else send "openField" to NoNumberField
  753. end mouseUp</script>
  754.     </part>
  755.     <part>
  756.         <id>17</id>
  757.         <type>button</type>
  758.         <visible> <true /> </visible>
  759.         <reserved5> 0 </reserved5>
  760.         <reserved4> 0 </reserved4>
  761.         <reserved3> 0 </reserved3>
  762.         <reserved2> 0 </reserved2>
  763.         <reserved1> 0 </reserved1>
  764.         <enabled> <true /> </enabled>
  765.         <rect>
  766.             <left>471</left>
  767.             <top>236</top>
  768.             <right>500</right>
  769.             <bottom>263</bottom>
  770.         </rect>
  771.         <style>transparent</style>
  772.         <showName> <false /> </showName>
  773.         <highlight> <false /> </highlight>
  774.         <autoHighlight> <true /> </autoHighlight>
  775.         <sharedHighlight> <true /> </sharedHighlight>
  776.         <family>0</family>
  777.         <titleWidth>0</titleWidth>
  778.         <icon>1013</icon>
  779.         <textAlign>center</textAlign>
  780.         <font>Chicago</font>
  781.         <textSize>12</textSize>
  782.         <textStyle>plain</textStyle>
  783.         <name>GoNext</name>
  784.         <script>on mouseUp
  785. global NoNumberField
  786.  
  787. if NoNumberField is empty then
  788. visual scroll left
  789. go next card
  790. else send "openField" to NoNumberField
  791. end mouseUp</script>
  792.     </part>
  793.     <part>
  794.         <id>13</id>
  795.         <type>field</type>
  796.         <visible> <true /> </visible>
  797.         <dontWrap> <false /> </dontWrap>
  798.         <dontSearch> <false /> </dontSearch>
  799.         <sharedText> <false /> </sharedText>
  800.         <fixedLineHeight> <false /> </fixedLineHeight>
  801.         <autoTab> <false /> </autoTab>
  802.         <lockText> <true /> </lockText>
  803.         <rect>
  804.             <left>15</left>
  805.             <top>45</top>
  806.             <right>384</right>
  807.             <bottom>65</bottom>
  808.         </rect>
  809.         <style>rectangle</style>
  810.         <autoSelect> <false /> </autoSelect>
  811.         <showLines> <false /> </showLines>
  812.         <wideMargins> <false /> </wideMargins>
  813.         <multipleLines> <false /> </multipleLines>
  814.         <reservedFamily> 0 </reservedFamily>
  815.         <titleWidth>0</titleWidth>
  816.         <icon>0</icon>
  817.         <textAlign>left</textAlign>
  818.         <font>Monaco</font>
  819.         <textSize>12</textSize>
  820.         <textStyle>plain</textStyle>
  821.         <textHeight>16</textHeight>
  822.         <name>TitleLine</name>
  823.         <script></script>
  824.     </part>
  825.     <part>
  826.         <id>12</id>
  827.         <type>field</type>
  828.         <visible> <true /> </visible>
  829.         <dontWrap> <false /> </dontWrap>
  830.         <dontSearch> <false /> </dontSearch>
  831.         <sharedText> <false /> </sharedText>
  832.         <fixedLineHeight> <false /> </fixedLineHeight>
  833.         <autoTab> <false /> </autoTab>
  834.         <lockText> <true /> </lockText>
  835.         <rect>
  836.             <left>15</left>
  837.             <top>64</top>
  838.             <right>384</right>
  839.             <bottom>284</bottom>
  840.         </rect>
  841.         <style>scrolling</style>
  842.         <autoSelect> <false /> </autoSelect>
  843.         <showLines> <false /> </showLines>
  844.         <wideMargins> <false /> </wideMargins>
  845.         <multipleLines> <false /> </multipleLines>
  846.         <reservedFamily> 0 </reservedFamily>
  847.         <titleWidth>0</titleWidth>
  848.         <icon>0</icon>
  849.         <textAlign>left</textAlign>
  850.         <font>Monaco</font>
  851.         <textSize>12</textSize>
  852.         <textStyle>plain</textStyle>
  853.         <textHeight>16</textHeight>
  854.         <name>ResultsList</name>
  855.         <script></script>
  856.     </part>
  857.     <part>
  858.         <id>18</id>
  859.         <type>button</type>
  860.         <visible> <true /> </visible>
  861.         <reserved5> 0 </reserved5>
  862.         <reserved4> 0 </reserved4>
  863.         <reserved3> 0 </reserved3>
  864.         <reserved2> 0 </reserved2>
  865.         <reserved1> 0 </reserved1>
  866.         <enabled> <true /> </enabled>
  867.         <rect>
  868.             <left>435</left>
  869.             <top>45</top>
  870.             <right>502</right>
  871.             <bottom>66</bottom>
  872.         </rect>
  873.         <style>rectangle</style>
  874.         <showName> <true /> </showName>
  875.         <highlight> <false /> </highlight>
  876.         <autoHighlight> <true /> </autoHighlight>
  877.         <sharedHighlight> <true /> </sharedHighlight>
  878.         <family>0</family>
  879.         <titleWidth>0</titleWidth>
  880.         <icon>0</icon>
  881.         <textAlign>center</textAlign>
  882.         <font>Geneva</font>
  883.         <textSize>9</textSize>
  884.         <textStyle>plain</textStyle>
  885.         <name>Edit Script</name>
  886.         <script>on mouseUp
  887. setUserLevelFive
  888. edit script of this card
  889. restoreUserLevel
  890. end mouseUp</script>
  891.     </part>
  892.     <part>
  893.         <id>22</id>
  894.         <type>button</type>
  895.         <visible> <true /> </visible>
  896.         <reserved5> 0 </reserved5>
  897.         <reserved4> 0 </reserved4>
  898.         <reserved3> 0 </reserved3>
  899.         <reserved2> 0 </reserved2>
  900.         <reserved1> 0 </reserved1>
  901.         <enabled> <true /> </enabled>
  902.         <rect>
  903.             <left>435</left>
  904.             <top>71</top>
  905.             <right>502</right>
  906.             <bottom>91</bottom>
  907.         </rect>
  908.         <style>rectangle</style>
  909.         <showName> <true /> </showName>
  910.         <highlight> <false /> </highlight>
  911.         <autoHighlight> <true /> </autoHighlight>
  912.         <sharedHighlight> <true /> </sharedHighlight>
  913.         <family>0</family>
  914.         <titleWidth>0</titleWidth>
  915.         <icon>0</icon>
  916.         <textAlign>center</textAlign>
  917.         <font>Geneva</font>
  918.         <textSize>9</textSize>
  919.         <textStyle>plain</textStyle>
  920.         <name>Options</name>
  921.         <script>on mouseUp
  922. unlock screen
  923. visual effect stretch from top
  924. push card
  925. go to cd SetOptions
  926. end mouseUp</script>
  927.     </part>
  928.     <part>
  929.         <id>27</id>
  930.         <type>field</type>
  931.         <visible> <false /> </visible>
  932.         <dontWrap> <false /> </dontWrap>
  933.         <dontSearch> <false /> </dontSearch>
  934.         <sharedText> <false /> </sharedText>
  935.         <fixedLineHeight> <false /> </fixedLineHeight>
  936.         <autoTab> <false /> </autoTab>
  937.         <lockText> <true /> </lockText>
  938.         <rect>
  939.             <left>2</left>
  940.             <top>2</top>
  941.             <right>509</right>
  942.             <bottom>340</bottom>
  943.         </rect>
  944.         <style>scrolling</style>
  945.         <autoSelect> <false /> </autoSelect>
  946.         <showLines> <false /> </showLines>
  947.         <wideMargins> <true /> </wideMargins>
  948.         <multipleLines> <false /> </multipleLines>
  949.         <reservedFamily> 0 </reservedFamily>
  950.         <titleWidth>0</titleWidth>
  951.         <icon>0</icon>
  952.         <textAlign>left</textAlign>
  953.         <font>Geneva</font>
  954.         <textSize>10</textSize>
  955.         <textStyle>plain</textStyle>
  956.         <textHeight>13</textHeight>
  957.         <name>About Card</name>
  958.         <script>on mouseUp
  959. if the shiftKey is down then
  960. set lockText of me to false
  961. select text of me
  962. else send "showAll" to bg field "TitleOfGame"
  963. end mouseUp
  964.  
  965. on closeField
  966. set locktext of me to true
  967. end closeField
  968.  
  969. on exitField
  970. send closeField to me
  971. end exitField</script>
  972.     </part>
  973.     <part>
  974.         <id>23</id>
  975.         <type>field</type>
  976.         <visible> <true /> </visible>
  977.         <dontWrap> <false /> </dontWrap>
  978.         <dontSearch> <false /> </dontSearch>
  979.         <sharedText> <false /> </sharedText>
  980.         <fixedLineHeight> <false /> </fixedLineHeight>
  981.         <autoTab> <false /> </autoTab>
  982.         <lockText> <true /> </lockText>
  983.         <rect>
  984.             <left>15</left>
  985.             <top>321</top>
  986.             <right>386</right>
  987.             <bottom>337</bottom>
  988.         </rect>
  989.         <style>shadow</style>
  990.         <autoSelect> <false /> </autoSelect>
  991.         <showLines> <false /> </showLines>
  992.         <wideMargins> <false /> </wideMargins>
  993.         <multipleLines> <false /> </multipleLines>
  994.         <reservedFamily> 0 </reservedFamily>
  995.         <titleWidth>0</titleWidth>
  996.         <icon>0</icon>
  997.         <textAlign>left</textAlign>
  998.         <font>Geneva</font>
  999.         <textSize>10</textSize>
  1000.         <textStyle>bold</textStyle>
  1001.         <textHeight>13</textHeight>
  1002.         <name>TitleOfGame</name>
  1003.         <script>on mouseUp
  1004. global NumberOfFields
  1005. put the number of card fields into NumberOfFields
  1006. if the shiftKey is down then
  1007. set lockText of me to false
  1008. select text of me
  1009. else if visible of bg field "About Card" is false
  1010. then hideAll
  1011. else showAll
  1012. end mouseUp
  1013.  
  1014. on closeField
  1015. set locktext of me to true
  1016. end closeField
  1017.  
  1018. on exitField
  1019. send closeField to me
  1020. end exitField
  1021.  
  1022. on HideAll
  1023. global NumberOfFields
  1024. repeat with FieldNumber=1 to NumberOfFields
  1025. hide card field FieldNumber
  1026. end repeat
  1027. show bg field "About Card"
  1028. end HideAll
  1029.  
  1030. on showAll
  1031. global NumberOfFields
  1032. hide bg field "About Card"
  1033. repeat with FieldNumber=1 to NumberOfFields
  1034. show card field FieldNumber
  1035. end repeat
  1036. end showAll</script>
  1037.     </part>
  1038.     <name></name>
  1039.     <script>on openCard
  1040. global CardWasDeleted
  1041. set cursor to watch
  1042.  
  1043. -- if we come here because previous card was deleted:
  1044. -- go back to now previous card
  1045. if CardWasDeleted is true then
  1046. put false into CardWasDeleted
  1047. go to previous card
  1048. end if
  1049.  
  1050.  
  1051. lock screen
  1052. -- assemble title for scroll field
  1053. put "Generation" into Title
  1054. repeat for 13-length of field FreqLabel1 times
  1055. put space after Title
  1056. end repeat
  1057. put field FreqLabel1 after Title
  1058.  
  1059. repeat for 13-length of field FreqLabel2 times
  1060. put space after Title
  1061. end repeat
  1062. put field FreqLabel2 after Title
  1063.  
  1064. if visible of field FreqLabel3 is true then
  1065. repeat for 13-length of field FreqLabel3 times
  1066. put space after Title
  1067. end repeat
  1068. put field FreqLabel3 after Title
  1069. end if
  1070. put Title into field TitleLine
  1071.  
  1072. -- for all cards:
  1073. -- show/hide arrows to move forward/backwards
  1074. if ID of this card = "card id 2957" then hide bg button GoPrevious  -- 1st card
  1075. if ID of next card = "card id 3949" then hide bg button GoNext -- card before DrawGraph
  1076. if bg field "ResultsList" is empty
  1077. then hide bg button "Graph"
  1078. else show bg button "Graph"
  1079. unlock screen
  1080. pass openCard
  1081. end openCard
  1082.  
  1083.  
  1084. on closeCard
  1085. -- make all buttons visible
  1086. set cursor to watch
  1087. show field FreqLabel3
  1088. show field FreqField3
  1089. show bg button GoPrevious
  1090. show bg button GoNext
  1091. pass closeCard
  1092. end closeCard
  1093.  
  1094.  
  1095. -- function handler to put results (as calculated by each card)
  1096. -- 3 arguments; if last is empty, only two columns to print
  1097. -- put 1st arg into (new) line; get length of it
  1098. -- fill up with spaces
  1099. -- add 2nd arg; if 3rd arg<>empty, fill with spaces, add 3rd
  1100. -- add return
  1101.  
  1102. on PrintLine Generation,FreqA,FreqB,FreqC
  1103. global ScrollDownX, ScrollDownY
  1104. -- for debugging:
  1105. -- global NumberOfLoop
  1106. -- generate new line
  1107. put "        " into Spaces  -- 8 spaces, plus 5 from number=13 (column)
  1108. set the numberFormat to "0"
  1109. put 10-length of Generation into NumberOfLoop
  1110. repeat for NumberOfLoop
  1111. put space after NewLine
  1112. end repeat
  1113. put Generation after NewLine
  1114. put Spaces after NewLine
  1115. set the numberFormat to "0.000"
  1116. put FreqA after NewLine
  1117. put Spaces after NewLine
  1118. put FreqB after NewLine
  1119. if FreqC is not empty then
  1120. put Spaces after NewLine
  1121. put FreqC after NewLine
  1122. end if
  1123. put return after NewLine
  1124.  
  1125. -- add line to ResultsList
  1126. put NewLine after bg field "ResultsList"
  1127.  
  1128. -- click on Scroll Down arrow, make last line visible
  1129. click at ScrollDownX, ScrollDownY
  1130. end PrintLine
  1131.  
  1132. </script>
  1133. </background>
  1134.