home *** CD-ROM | disk | FTP | other *** search
- -- background: 3756 from stack: in
- -- bmap block id: 4019
- -- flags: 0000
- -- background id: 0
- -- name:
- ----- HyperTalk script -----
- on drawAxes
- global top, left, bottom, right, xMin, xMax, yMin, yMax, xScale, yScale
-
- put (right - left)/(xMax - xMin) into xScale
- put (top - bottom)/(yMax - yMin) into yScale
-
- put round( left + (0 - xMin) * xScale ) into scrnX0
- if scrnX0 > right then
- put right into scrnX0
- else
- if scrnX0 < left then
- put left into scrnX0
- end if
- end if
-
-
- put round( bottom + (0 - yMin) * yScale ) into scrnY0
- if scrnY0 < top then
- put top into scrnY0
- else
- if scrnY0 > bottom then
- put bottom into scrnY0
- end if
- end if
-
- set loc of card field "yMin" to scrnX0,bottom
- set loc of card field "yMax" to scrnX0,top
- set loc of card field "xMin" to left,scrnY0
- set loc of card field "xMax" to right,scrnY0
-
- if loc of card field "yMax" = loc of card field "xMin" then
- get loc of card field "yMax"
- put second item of it - 15 into second item of it
- set loc of card field "yMax" to first item of it, second item of it
- end if
- if loc of card field "yMin" = loc of card field "xMin" then
- get loc of card field "yMin"
- put second item of it + 15 into second item of it
- set loc of card field "yMin" to first item of it, second item of it
- end if
- if loc of card field "yMax" = loc of card field "xMax" then
- get loc of card field "yMax"
- put second item of it - 15 into second item of it
- set loc of card field "yMax" to first item of it, second item of it
- end if
- if loc of card field "yMin" = loc of card field "xMax" then
- get loc of card field "yMin"
- put second item of it + 15 into second item of it
- set loc of card field "yMin" to first item of it, second item of it
- end if
-
- choose line tool
- set dragspeed to 30000
- drag from left,scrnY0 to right,scrnY0
- drag from scrnX0,top to scrnX0,bottom
- end drawAxes
-
- on doErase
- choose eraser tool
- domenu select all
- domenu clear picture
- drawAxes
- choose browse tool
- end doErase
-
-
-
-
-
- -- part 23 (button)
- -- low flags: 00
- -- high flags: A002
- -- rect: left=3 top=26 right=75 bottom=45
- -- title width / last selected line: 0
- -- icon id / first selected line: 20960 / 20960
- -- text alignment: 1
- -- font id: 0
- -- text size: 12
- -- style flags: 0
- -- line height: 16
- -- part name: Plot
- ----- HyperTalk script -----
- on mouseUp
- global top, left, bottom, right, xMin, xMax, yMin, yMax, yScale, xScale
- global slope, intcpt
-
- put (right - left)/(xMax - xMin) into xScale
- put (top - bottom)/(yMax - yMin) into yScale
-
- hide field "lnP"
- hide field "recipT"
- set the lockScreen to true
- go to card "Tables"
- if field "lnP" is not empty and field "recipT" is not empty then
- put field "lnP" into field "lnP" of card "Graph"
- put field "recipT" into field "recipT" of card "Graph"
- go to card "Graph"
- set the lockScreen to false
- choose line tool
- repeat with i = 1 to number of lines in field "lnP"
- if line i of field "lnP" is not empty and line i of field "recipT" is not empty then
- put line i of field "lnP" into y
- put line i of field "recipT" into x
- put round(left + (x - xMin)*xScale) into scrnX
- put round(bottom + (y - yMin)*yScale) into scrnY
- drag from scrnX-2,scrnY to scrnX+2,scrnY
- drag from scrnX,scrnY-2 to scrnX,scrnY+2
- end if
- end repeat
- choose browse tool
- end if
-
- if slope >= 0 then -- cannot be for Clausius-Clapeyron
- exit mouseup -- so no straight line plot
- end if
- put round( bottom + (0 - yMin) * yScale ) into scrnY0
- put max(top,min(scrnY0,bottom)) into scrnY0
-
- put (slope*xMin + intcpt) into y1
- put round( left ) into scrnX1
-
- put round( bottom + (y1 - yMin) * yScale ) into scrnY1
- put max(top,min(scrnY1,bottom)) into scrnY1
-
- choose line tool
-
- put (slope*xMax + intcpt) into y2
- put round(left + (xMax - xMin)*xScale ) into scrnX2
-
- put round(bottom + (y2 - yMin)*yScale ) into scrnY2
- put max(top,min(scrnY2,bottom)) into scrnY2
- if abs(scrnY1 - scrnY2) <> abs(top - bottom) then
- drag from scrnX1,scrnY1 to scrnX2,scrnY2
- end if
-
- choose browse tool
- end mouseUp
-
-
-
- -- part 25 (button)
- -- low flags: 00
- -- high flags: A002
- -- rect: left=4 top=78 right=127 bottom=45
- -- title width / last selected line: 0
- -- icon id / first selected line: 32434 / 32434
- -- text alignment: 1
- -- font id: 0
- -- text size: 12
- -- style flags: 0
- -- line height: 16
- -- part name: Clear
- ----- HyperTalk script -----
- on mouseUp
- doErase
- end mouseUp
-
-
-
- -- part 43 (button)
- -- low flags: 00
- -- high flags: 2001
- -- rect: left=2 top=294 right=332 bottom=39
- -- title width / last selected line: 0
- -- icon id / first selected line: 1011 / 1011
- -- text alignment: 1
- -- font id: 0
- -- text size: 12
- -- style flags: 0
- -- line height: 16
- -- part name: Home
- ----- HyperTalk script -----
- on mouseUp
- go home
- end mouseUp
-
-
-
- -- part 47 (button)
- -- low flags: 00
- -- high flags: 2001
- -- rect: left=3 top=251 right=289 bottom=40
- -- title width / last selected line: 0
- -- icon id / first selected line: 32462 / 32462
- -- text alignment: 1
- -- font id: 0
- -- text size: 12
- -- style flags: 0
- -- line height: 16
- -- part name: Help
- ----- HyperTalk script -----
- on mouseUp
- go to card "moreInfo"
- end mouseUp
-
-
-
- -- part 48 (button)
- -- low flags: 00
- -- high flags: A002
- -- rect: left=4 top=131 right=179 bottom=45
- -- title width / last selected line: 0
- -- icon id / first selected line: 16129 / 16129
- -- text alignment: 1
- -- font id: 0
- -- text size: 12
- -- style flags: 0
- -- line height: 16
- -- part name: Data
- ----- HyperTalk script -----
- on mouseUp
- go to card Tables
- show menubar
- end mouseUp
-
-
-
- -- part 49 (field)
- -- low flags: 81
- -- high flags: 4000
- -- rect: left=159 top=98 right=308 bottom=225
- -- title width / last selected line: 0
- -- icon id / first selected line: 0 / 0
- -- text alignment: 0
- -- font id: 3
- -- text size: 10
- -- style flags: 0
- -- line height: 13
- -- part name: lnP
-
-
- -- part 50 (field)
- -- low flags: 81
- -- high flags: 4000
- -- rect: left=228 top=98 right=308 bottom=297
- -- title width / last selected line: 0
- -- icon id / first selected line: 0 / 0
- -- text alignment: 0
- -- font id: 3
- -- text size: 10
- -- style flags: 0
- -- line height: 13
- -- part name: recipT
-