-- background: 16897 from stack: in -- bmap block id: 14845 -- flags: 0000 -- background id: 0 -- name: Item Map -- part 1 (field) -- low flags: 01 -- high flags: 0000 -- rect: left=44 top=43 right=65 bottom=331 -- title width / last selected line: 0 -- icon id / first selected line: 0 / 0 -- text alignment: 0 -- font id: 3 -- text size: 14 -- style flags: 256 -- line height: 18 -- part name: theTitle -- part 2 (button) -- low flags: 00 -- high flags: 0000 -- rect: left=482 top=184 right=230 bottom=507 -- title width / last selected line: 0 -- icon id / first selected line: 0 / 0 -- text alignment: 1 -- font id: 0 -- text size: 12 -- style flags: 0 -- line height: 16 -- part name: Right ----- HyperTalk script ----- on mouseUp doItemRightButton end mouseUp -- part 3 (button) -- low flags: 00 -- high flags: 0000 -- rect: left=463 top=232 right=275 bottom=488 -- title width / last selected line: 0 -- icon id / first selected line: 0 / 0 -- text alignment: 1 -- font id: 0 -- text size: 12 -- style flags: 0 -- line height: 16 -- part name: Left ----- HyperTalk script ----- on mouseUp doItemLeftButton end mouseUp -- part 4 (button) -- low flags: 00 -- high flags: 0000 -- rect: left=463 top=88 right=130 bottom=507 -- title width / last selected line: 0 -- icon id / first selected line: 0 / 0 -- text alignment: 1 -- font id: 0 -- text size: 12 -- style flags: 0 -- line height: 16 -- part name: Earth ----- HyperTalk script ----- on mouseUp goWholeEarth end mouseUp -- part 5 (button) -- low flags: 00 -- high flags: 0000 -- rect: left=463 top=139 right=173 bottom=508 -- title width / last selected line: 0 -- icon id / first selected line: 0 / 0 -- text alignment: 1 -- font id: 0 -- text size: 12 -- style flags: 0 -- line height: 16 -- part name: Map ----- HyperTalk script ----- on mouseUp doItemMapButton end mouseUp -- part 6 (field) -- low flags: 81 -- high flags: 0002 -- rect: left=255 top=0 right=18 bottom=396 -- title width / last selected line: 0 -- icon id / first selected line: 0 / 0 -- text alignment: 0 -- font id: 3 -- text size: 12 -- style flags: 0 -- line height: 16 -- part name: theIdent -- part 7 (field) -- low flags: 81 -- high flags: 0002 -- rect: left=0 top=0 right=18 bottom=86 -- title width / last selected line: 0 -- icon id / first selected line: 0 / 0 -- text alignment: 0 -- font id: 3 -- text size: 12 -- style flags: 0 -- line height: 16 -- part name: Accession -- part 9 (field) -- low flags: 81 -- high flags: 0004 -- rect: left=46 top=268 right=324 bottom=249 -- title width / last selected line: 0 -- icon id / first selected line: 0 / 0 -- text alignment: 0 -- font id: 3 -- text size: 9 -- style flags: 0 -- line height: 12 -- part name: xrefs ----- HyperTalk script ----- on mouseup -- go to xref card depending which line was clicked on -- calculate which line -- doesn't work if word-wrap occurred put 1 + (the clickV - the top of target) div the textHeight of target into clickedLine if line clickedLine of target is not empty then put line clickedLine of field "xrefAccs" into targAcc if targAcc is not empty then set cursor to busy -- go there lookup targAcc, "zoom open" end if end if end mouseup -- part 10 (field) -- low flags: 81 -- high flags: 0002 -- rect: left=0 top=268 right=324 bottom=57 -- title width / last selected line: 0 -- icon id / first selected line: 0 / 0 -- text alignment: 0 -- font id: 3 -- text size: 9 -- style flags: 0 -- line height: 12 -- part name: xrefAccs -- part 11 (field) -- low flags: 01 -- high flags: 0002 -- rect: left=345 top=22 right=41 bottom=463 -- title width / last selected line: 0 -- icon id / first selected line: 0 / 0 -- text alignment: 1 -- font id: 0 -- text size: 12 -- style flags: 0 -- line height: 16 -- part name: theHeading ----- HyperTalk script ----- on mouseDown popMenuIMap end mouseDown -- part 12 (field) -- low flags: 81 -- high flags: 0002 -- rect: left=0 top=172 right=232 bottom=165 -- 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: popup -- part 13 (field) -- low flags: 81 -- high flags: 0004 -- rect: left=246 top=268 right=324 bottom=447 -- title width / last selected line: 0 -- icon id / first selected line: 0 / 0 -- text alignment: 0 -- font id: 3 -- text size: 9 -- style flags: 0 -- line height: 12 -- part name: xrefs2 ----- HyperTalk script ----- on mouseup -- go to xref card depending which line was clicked on -- calculaate which line -- doesn't work if word-wrap occurred put 1 + (the clickV - the top of target) div the textHeight of target into clickedLine if line clickedLine of target is not empty then put line clickedLine of field "xrefAccs2" into targAcc if targAcc is not empty then set cursor to busy -- go there lookup targAcc, "zoom open" end if end if end mouseup -- part 14 (field) -- low flags: 81 -- high flags: 0002 -- rect: left=446 top=268 right=324 bottom=502 -- title width / last selected line: 0 -- icon id / first selected line: 0 / 0 -- text alignment: 0 -- font id: 3 -- text size: 9 -- style flags: 0 -- line height: 12 -- part name: xrefAccs2 -- part 15 (field) -- low flags: 81 -- high flags: 0002 -- rect: left=159 top=260 right=277 bottom=333 -- title width / last selected line: 0 -- icon id / first selected line: 0 / 0 -- text alignment: 0 -- font id: 3 -- text size: 12 -- style flags: 256 -- line height: 16 -- part name: xrefHeading -- part 18 (field) -- low flags: 81 -- high flags: 0002 -- rect: left=410 top=128 right=143 bottom=512 -- title width / last selected line: 0 -- icon id / first selected line: 0 / 0 -- text alignment: 0 -- font id: 4 -- text size: 9 -- style flags: 0 -- line height: 12 -- part name: MapDest -- part 19 (field) -- low flags: 81 -- high flags: 0002 -- rect: left=410 top=272 right=287 bottom=512 -- title width / last selected line: 0 -- icon id / first selected line: 0 / 0 -- text alignment: 0 -- font id: 4 -- text size: 9 -- style flags: 0 -- line height: 12 -- part name: LeftDest -- part 20 (field) -- low flags: 81 -- high flags: 0002 -- rect: left=410 top=225 right=240 bottom=512 -- title width / last selected line: 0 -- icon id / first selected line: 0 / 0 -- text alignment: 0 -- font id: 4 -- text size: 9 -- style flags: 0 -- line height: 12 -- part name: RightDest -- part 21 (field) -- low flags: 81 -- high flags: 0002 -- rect: left=163 top=172 right=232 bottom=277 -- 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: PopupDest -- part 24 (field) -- low flags: 81 -- high flags: 0002 -- rect: left=46 top=236 right=274 bottom=247 -- title width / last selected line: 0 -- icon id / first selected line: 0 / 0 -- text alignment: 0 -- font id: 4 -- text size: 9 -- style flags: 0 -- line height: 12 -- part name: xrefDest -- part 25 (field) -- low flags: 81 -- high flags: 0002 -- rect: left=247 top=236 right=274 bottom=447 -- title width / last selected line: 0 -- icon id / first selected line: 0 / 0 -- text alignment: 0 -- font id: 4 -- text size: 9 -- style flags: 0 -- line height: 12 -- part name: xrefDest2 -- part 27 (button) -- low flags: 80 -- high flags: 8002 -- rect: left=0 top=323 right=342 bottom=114 -- title width / last selected line: 0 -- icon id / first selected line: 0 / 0 -- text alignment: 1 -- font id: 0 -- text size: 12 -- style flags: 0 -- line height: 16 -- part name: Xref ----- HyperTalk script ----- -- xref button for Cluster card on mouseUp makeNewXref end mouseUp on hideXrefCdFields hide cd fld "xrefs" hide cd fld "xrefs2" hide cd fld "xrefHeading" end hideXrefCdFields on showXrefCdFields show cd fld "xrefs" show cd fld "xrefs2" show cd fld "xrefHeading" end showXrefCdFields on deleteXref whichXref if whichXref >= 2 and whichXref <= 4 then put empty into line whichXref of fld "xrefDest" put empty into line whichXref of fld "xrefAccs" put empty into line whichXref of fld "xrefs" put empty into line whichXref of cd fld "xrefs" else if whichXref >= 6 and whichXref <= 8 then subtract 4 from whichXref put empty into line whichXref of fld "xrefDest2" put empty into line whichXref of fld "xrefAccs2" put empty into line whichXref of fld "xrefs2" put empty into line whichXref of cd fld "xrefs2" end if end deleteXref function isXrefOccupied whichXref if whichXref >= 2 and whichXref <= 4 then if line whichXref of fld "xrefAccs" is empty then put false into occupied else put true into occupied end if else if whichXref >= 6 and whichXref <= 8 then if line (whichXref - 4) of fld "xrefAccs2" is empty then put false into occupied else put true into occupied end if end if return occupied end isXrefOccupied function getXrefClick put the rect of cd fld "xrefs" into xrefsR put the rect of cd fld "xrefs2" into xrefs2R put the textHeight of cd fld "xrefs" into xrefTxHt put item 2 of xrefsR into xrefTop wait until the mouseClick if the clickLoc is within xrefsR then put 1 + ((the clickV - xrefTop) div xrefTxHt) into whichXref if whichXref = 5 then -- a little of line 5 shows at bottom of field put 4 into whichXref end if else if the clickLoc is within xrefs2R then put 5 + ((the clickV - xrefTop) div xrefTxHt) into whichXref if whichXref = 9 then put 8 into whichXref end if else put 0 into whichXref end if -- top lines of xrefs field not used if whichXref = 1 or whichXref = 5 then put 0 into whichXref end if return whichXref end getXrefClick on installNewXref linkTitle, linkAcc, linkID global currentXref showXrefCdFields put currentXref into whichXref if linkAcc is not empty then if whichXref >= 2 and whichXref <= 4 then put linkID into line whichXref of fld "xrefDest" put linkAcc into line whichXref of fld "xrefAccs" put linkTitle into line whichXref of fld "xrefs" put linkTitle into line whichXref of cd fld "xrefs" else if whichXref >= 6 and whichXref <= 8 then subtract 4 from whichXref put linkID into line whichXref of fld "xrefDest2" put linkAcc into line whichXref of fld "xrefAccs2" put linkTitle into line whichXref of fld "xrefs2" put linkTitle into line whichXref of cd fld "xrefs2" end if end if end installNewXref ----------------------- makeNewXref -------------------------------- on makeNewXref global currentXref set hilite of target to true showXrefCdFields put getXrefClick() into currentXref set hilite of target to false if currentXref <> 0 then if isXrefOccupied(currentXref) is true then answer "What do you want to do with this xref?" with "Replace" or "Delete" or "Cancel" if it is "Cancel" then exit makeNewXref -- EXIT else if it is "Delete" then deleteXref currentXref -- delete old entry exit makeNewXref else if it is "Replace" then deleteXref currentXref -- delete old entry makeNewXrefAction -- get new entry end if else makeNewXrefAction end if end if end makeNewXref on makeNewXrefAction global xrefStack, xrefLooking, xrefReturn push card put short name of this stack into theDomain if xrefStack is empty then go to stack "Xref Tools" end if go to card theDomain of xrefStack pop card into xrefReturn put true into xrefLooking end makeNewXrefAction