#!/bin/sh # MetaCard 2.4 stack # The following is not ASCII text, # so now would be a good time to q out of more exec mc $0 "$@"  altGroupMgr3+--> all handlers on stripAndShip put "" into fld "GroupList" put "" into fld "CurrentCard" put "" into fld "CurrentStack" end stripAndShip on doIt #answer "put your plugin script in the doIt handler of the stack script!" end doIt --> ALTLAYOUT SCRIPTS --> DO NOT TOUCH! global gAltChecking, gAltOldRect local lHasDividerBeenUsed function checkHasDividerBeenUsed return lHasDividerBeenUsed end checkHasDividerBeenUsed() on setHasDividerBeenUsed pFlag put pFlag into lHasDividerBeenUsed end setHasDividerBeenUsed on initAltLayoutLib switch the platform case "MacOS" altSetLayoutMode "Mac OSX" break case "Win32" altSetLayoutMode "Win XP" break default altSetLayoutMode "Other" break end switch put false into lHasDividerBeenUsed end initAltLayoutLib on altSetLayoutMode pMode put the short name of this stack into tTheStackName if tTheStackName is "LayoutManager" then answer "Can't edit the Layout Manager stack!" exit to top end if replace space with "" in pMode #set the defaultStack to tTheStackName if pMode is "WinXP" then if there is a btn "altDrag" then show btn "altDrag" end if else if there is a btn "altDrag" then hide btn "altDrag" end if end if --> RESIZE STACK put the rect of stack tTheStackName into tRect --> MINWIDTH put pMode & "altMinWidth" into tProp if "altMinWidth" is among the lines of the customKeys of stack tTheStackName then if tProp is among the lines of the customKeys of stack tTheStackName then put "put the " & tProp & " of stack " & quote & tTheStackName & quote & " into tPropValue" into tDo do tDo if isNumber(tPropValue) and tPropValue > 32 then set the altMinWidth of stack tTheStackName to tPropValue end if end if set the minWidth of stack tTheStackName to the altMinWidth of stack tTheStackName end if --> MINHEIGHT put pMode & "altMinHeight" into tProp if "altMinHeight" is among the lines of the customKeys of stack tTheStackName then if tProp is among the lines of the customKeys of stack tTheStackName then put "put the " & tProp & " of stack " & quote & tTheStackName & quote & " into tPropValue" into tDo do tDo if isNumber(tPropValue) and tPropValue > 32 then set the altMinHeight of stack tTheStackName to tPropValue end if end if set the minHeight of stack tTheStackName to the altMinHeight of stack tTheStackName #set the height of stack tTheStackName to the altMinHeight of stack tTheStackName end if --> MAXWIDTH put pMode & "altMaxWidth" into tProp if "altMaxWidth" is among the lines of the customKeys of stack tTheStackName then if tProp is among the lines of the customKeys of stack tTheStackName then put "put the " & tProp & " of stack " & quote & tTheStackName & quote & " into tPropValue" into tDo do tDo if isNumber(tPropValue) and tPropValue > 32 then set the altMaxWidth of stack tTheStackName to tPropValue end if end if set the maxWidth of stack tTheStackName to the altMaxWidth of stack tTheStackName #set the width of stack tTheStackName to the altMaxWidth of stack tTheStackName end if --> MAXHEIGHT put pMode & "altMaxHeight" into tProp if "altMaxHeight" is among the lines of the customKeys of stack tTheStackName then if tProp is among the lines of the customKeys of stack tTheStackName then put "put the " & tProp & " of stack " & quote & tTheStackName & quote & " into tPropValue" into tDo do tDo if isNumber(tPropValue) and tPropValue > 32 then set the altMaxHeight of stack tTheStackName to tPropValue end if end if set the maxHeight of stack tTheStackName to the altMaxHeight of stack tTheStackName #set the height of stack tTheStackName to the altMaxHeight of stack tTheStackName end if --> SET THE STACK RECT USING MIN NUMBERS set the rect of stack tTheStackName to \ item 1 of tRect, \ item 2 of tRect, \ item 1 of tRect + the minWidth of stack tTheStackName, \ item 2 of tRect + the minHeight of stack tTheStackName --> SET CONTROL RECTS AND BEHAVIOR put the environment into tEnvironment --> NEVER WALK THRU CONTROLS...JUST USE CONTROL LIST if tEnvironment is "development" then --> WALK THRU EACH CONTROL ON EACH CD (SLOWER BUT BETTER FOR EDITING) repeat with x = 1 to the number of cds in stack tTheStackName repeat with y = 1 to the number of controls in the current card of stack tTheStackName if "altLayoutManager" is among the lines of the customPropertySets of control y then set the customPropertySet of control y to "altLayoutManager" --> SET THE ALTVIS OF CONTROL PER PLATFORM put pMode & "altVis" into tProp put "put the " & tProp & " of control y into tPropValue" into tDo do tDo if tPropValue is false then hide control y if tPropValue is true then show control y --> SET THE ALTRECT OF CONTROL PER PLATFORM if "altRect" is among the lines of the customKeys of control y then put pMode & "altRect" into tProp put "put the " & tProp & " of control y into tPropValue" into tDo do tDo if tPropValue is "" then put the altRect of control y into tPropValue end if set the rect of control y to tPropValue end if if "altCmd" is among the lines of the customKeys of control y then put pMode & "altCmd" into tProp if tProp is among the lines of the customKeys of control y then put "put the " & tProp & " of control y into tPropValue" into tDo do tDo set the altCmd of control y to tPropValue end if end if set the customPropertySet of control y to empty end if end repeat end repeat else --> WALK THRU CONTROL LIST put the altResizeControlList of stack tTheStackName into tControlList --> CORRECT STACK NAMES put the effective fileName of stack tTheStackName into tStackName repeat for each line L in tControlList put L into tStr replace "" with tStackName in tStr put tStr & cr after tList end repeat repeat for each line L in tList --> TEST TO SEE IF CONTROL NAME EXISTS if exists(L) then if "altLayoutManager" is among the lines of the customPropertySets of L then set the customPropertySet of L to "altLayoutManager" --> SET THE ALTVIS OF CONTROL PER PLATFORM put the customKeys of L into tKeysList filter tKeysList with "*altVis" if the number of lines in tKeysList > 0 then put pMode & "altVis" into tProp if tProp is among the lines of the customKeys of L then put "put the " & tProp & " of L into tPropValue" into tDo do tDo if tPropValue is false then hide L else show L end if else show L end if end if --> SET THE ALTRECT OF CONTROL PER PLATFORM if "altRect" is among the lines of the customKeys of L then put pMode & "altRect" into tProp put "put the " & tProp & " of L into tPropValue" into tDo do tDo if tPropValue is "" then put the altRect of L into tPropValue end if set the rect of L to tPropValue end if if "altCmd" is among the lines of the customKeys of L then put pMode & "altCmd" into tProp if tProp is among the lines of the customKeys of L then put "put the " & tProp & " of L into tPropValue" into tDo do tDo set the altCmd of L to tPropValue end if end if set the customPropertySet of L to empty end if else answer warning "Control not found. Exiting Now. Control name: " &cr& L with "Exit to Top" or "OK" if it is "exit to top" then exit to top end if end if end repeat end if end altSetLayoutMode on altSetRect pObj,pCommands if the vis of pObj is false then exit altSetRect put long id of this card into pRelativeTo -- ANOTHER OBJECT PASSED AS LONG ID put the left of pRelativeTo into tLeft put the top of pRelativeTo into tTop put the right of pRelativeTo into tRight put the bottom of pRelativeTo into tBot put the rect of pObj into tRect put the rect of pObj into tRectNew replace comma with cr in pCommands replace ":" with comma in pCommands repeat for each line tCmd in pCommands switch (item 1 of tCmd) case "SX" -->SCALES RIGHT put (tRight + (item 2 of tCmd)) into item 3 of tRectNew break case "SY" -->SCALES DOWN put (tBot + (item 2 of tCmd)) into item 4 of tRectNew break case "MX" --> MOVES RIGHT put (tRight + (item 2 of tCmd)) into tRightNew put tRightNew - (item 3 of tRect - item 1 of tRect) into item 1 of tRectNew put tRightNew into item 3 of tRectNew break case "MY" --> MOVES DOWN put (tBot + (item 2 of tCmd)) into tBotNew --item 4 of tRectNew put tBotNew - (item 4 of tRect - item 2 of tRect) into item 2 of tRectNew put tBotNew into item 4 of tRectNew break case "CX" --> CENTERS ALONG THE X AXIS (NO SCALE) put (item 3 of tRect - item 1 of tRect) into tWidth put round((tRight/2) - (tWidth/2)) into tLeftNew put tLeftNew + tWidth into item 3 of tRectNew put tLeftNew into item 1 of tRectNew break case "CY" --> CENTERS ALONG THE Y AXIS (NO SCALE) put (item 4 of tRect - item 2 of tRect) into tHeight put round((tBot/2) - (tHeight/2)) into tTopNew put tTopNew + tHeight into item 4 of tRectNew put tTopNew into item 2 of tRectNew break end switch end repeat set the rect of pObj to tRectNew end altSetRect on setStackRect pRect --> CALLED FROM END OF RESIZE STACK HANDLER WHEN A DIVIDER HAS BEEN USED set the rect of this stack to pRect end setStackRect on doneResizing put false into gAltChecking put the rect of this stack into tRect put item 3 of tRect into tRight put item 4 of tRect into tBottom if item 3 of gAltOldRect > tRight or item 4 of gAltOldRect > tBottom then if checkHasDividerBeenUsed() is true then initAltLayoutLib send setStackRect && quote& tRect "e to this stack in 50 milliseconds end if end if end doneResizing on CheckMouseState put true into gAltChecking if the mouse is up then doneResizing else if "CheckMouseState" is not among the items of the pendingMessages then send CheckMouseState to me in 10 milliseconds end if end if end CheckMouseState --> END ALTLAYOUT SCRIPTS daltResizeControlListbutton id 1004 of card id 1002 of stack "" field id 1006 of card id 1002 of stack "" button id 1008 of card id 1002 of stack "" group id 1009 of card id 1002 of stack "" image id 1010 of group id 1009 of card id 1002 of stack "" button id 1011 of group id 1009 of card id 1002 of stack "" button id 1012 of group id 1009 of card id 1002 of stack "" button id 1013 of group id 1009 of card id 1002 of stack "" button id 1014 of group id 1009 of card id 1002 of stack "" field id 1016 of card id 1002 of stack "" field id 1020 of card id 1002 of stack "" button id 1022 of card id 1002 of stack "" button id 1023 of card id 1002 of stack "" button id 1025 of card id 1002 of stack "" button id 1027 of card id 1002 of stack "" field id 1028 of card id 1002 of stack "" field id 1029 of card id 1002 of stack "" field id 1030 of card id 1002 of stack "" image id 1033 of card id 1002 of stack "" button id 1041 of card id 1002 of stack ""MacOSXaltMinWidth356altResizeScriptLocationcardMacOSXaltMinHeight219 altMinWidth356 altMinHeight219 altGroupMgrd UTahoma UtahomaUtahoma UTahoma cConsLastHandlerScroll0 HandlerNamestripAndShip commandcREVGeometryCachestackID1042 cREVGeneral debugObjects Pon resizeStack pNewW,pNewH,pOldW,pOldH --> AUTO-GENERATED BY altLayout Manager altSetRect (long ID of field "GroupList"), (the altLayoutManager["altCmd"] of long ID of field "GroupList") altSetRect (long ID of button "Place Selected Grp on Cd"), (the altLayoutManager["altCmd"] of long ID of button "Place Selected Grp on Cd") altSetRect (long ID of button "Remove Selected Grp from Cd"), (the altLayoutManager["altCmd"] of long ID of button "Remove Selected Grp from Cd") altSetRect (long ID of field "vers"), (the altLayoutManager["altCmd"] of long ID of field "vers") altSetRect (long ID of button "?"), (the altLayoutManager["altCmd"] of long ID of button "?") global gAltChecking, gAltOldRect if gAltChecking <> true then put the rect of this stack into gAltOldRect CheckMouseState end if pass resizeStack end resizeStack --> END AUTO-GENERATED BY altLayout Manager on preOpenStack --> AUTO-GENERATED BY altLayout Manager initAltLayoutLib end preOpenStack --> all handlers on openStack initMe end openStack on initMe stripAndShip set the hilite of btn "Auto Refresh Group List" to false if the mode of this stack is not 1 then set the hilite of btn "Auto Refresh Group List" to true send mouseUp to btn "Auto Refresh Group List" in 500 millisecs end if end initMe on refreshCurrentCardStatus put the topStack into tStack if word 2 of tStack contains "altGroupMgr" then answer warning "Please don't check THIS stack!" exit to top end if put fld "GroupList" into tList set itemDel to tab repeat with x = 1 to the number of lines in tList put item 3 of line x of tList into tGrpID if exists(group ID tGrpID of the current card of tStack) then put "YES" into item 2 of line x of tList else put "NO" into item 2 of line x of tList end if end repeat put tList into fld "GroupList" end refreshCurrentCardStatus function selectedGrp pShowErrors put the topStack into tStack if word 2 of tStack contains "altGroupMgr" then if pShowErrors <> "false" then answer warning "Please don't edit THIS stack!" end if exit to top end if put the hilitedlines of fld "GroupList" into tNum if tNum is empty then if pShowErrors <> "false" then answer information "Please select a Group from the list!" end if exit to top end if return tNum end selectedGrp on refreshGroupList put the topStack into tStack if word 2 of tStack contains "altGroupMgr" then answer warning "Please don't check THIS stack!" exit to top end if set the wholematches to true put the number of the current card into tCurrCard put the short name of the topStack into fld "CurrentStack" put the short name of the current card of the topStack into fld "CurrentCard" put "" into tTotIDs repeat with x = 1 to the number of cards in tStack repeat with y = 1 to the number of groups of card x of tStack put the id of grp y of cd x of tStack into tID if tID is not among the lines of tTotIDs then put tID & cr after tTotIDs put x &tab&tab& tID &tab& the short name of grp y of cd x of tStack & cr after tGroupList end if end repeat end repeat delete last char of tGroupList put tGroupList into fld "GroupList" refreshCurrentCardStatus refreshButtons end refreshGroupList on refreshButtons disable btn "Place Selected Grp on Cd" disable btn "Remove Selected Grp from Cd" put selectedGrp(false) into tNum put line tNum of fld "GroupList" into tGrpInfo set itemDel to tab put item 2 of tGrpInfo into tVis if tVis is "YES" then #disable btn "Place Selected Grp on Cd" enable btn "Remove Selected Grp from Cd" else enable btn "Place Selected Grp on Cd" #disable btn "Remove Selected Grp from Cd" end if end refreshButtons dcREVGeometryCacheIDs113701866915910251137015094284100610875119346381011108751193463910121137020675467103011370188636521027113701636347110221137015672020101311370159847861016113701567202410141137016391341102311370156209281009113702092933710411137015065326100411370206754841033113701601104010201138200081963104211370151105211008113701936548510281137019365486102910874661754951010cREVGeometrycachetotal21order  cREVGeneral breakPoints cConsLastHandlerScroll0 HandlerNameinitMe command Refresh Group ListEwB--> all handlers on mouseUp refreshGroupList end mouseUp ,s cConsLastHandlerScroll0 HandlerNamemouseUp message cREVGeneral revUniqueID 1137015065326  GroupList )q--> all handlers on mouseUp put selectedGrp() into tLineNum put line tLineNum of fld "GroupList" into tGrpInfo set itemDel to tab refreshButtons if item 2 of tGrpInfo is "NO" then exit mouseUp put item 3 of tGrpInfo into tGrpID repeat 4 times set the vis of grp ID tGrpID of the topStack to not the vis of grp ID tGrpID of the topStack wait 50 millisecs end repeat end mouseUp \IZ86altLayoutManager WinXPaltVistrue WinXPaltCmdSY:-37altCmdSY:-37 WinXPaltRect 13,92,342,182altRect 13,92,342,182 cConsLastHandlerScroll0 HandlerNamemouseUp message cREVGeneral revUniqueID 1137015094284 breakPoints `@E]XtogglePaletteModeA*--> all handlers on mouseUp if the mode of this stack is 1 then modeless this stack initMe else toplevel this stack remove script of btn "AutoRefresh" from front unhilite btn "Auto Refresh Group List" end if end mouseUp @ cConsLastHandlerScroll0 HandlerNamemouseUp message cREVGeneral revUniqueID 1137015110521 breakPoints  altFldHeaderA # ------------------------------------------------------------------------------------------------------------ # Control: altFldHeader # by Chipp Walters, Altuit, inc. # ------------------------------------------------------------------------------------------------------------ local l_altMoveNow,l_altMoveCol,l_altTracMode on mouseDown if the owner of the target is not me then pass mouseDown if there is an image "moveColumn" and the cursor is (the id of img "moveColumn") then lock cursor put "" into l_altMoveNow put the priv_altOrderNum of the target into x if mouseH() < item 1 of the loc of the target then #other button on left put line x-1 of the priv_altBtnIDList of me into line 1 of temp put line x of the priv_altBtnIDList of me into line 2 of temp else #other button on right put line x of the priv_altBtnIDList of me into line 1 of temp put line x + 1 of the priv_altBtnIDList of me into line 2 of temp end if put temp into l_altMoveNow put true into l_altMoveCol else if the target contains "button" then if the altEnableBtn of the target then set the hilite of the target to true end if end if pass mouseDown end mouseDown on mouseUp if the owner of the target is not me then pass mouseUp put false into l_altMoveCol put false into l_altTracMode unlock cursor if the target contains "button" then hilite the target unhilite the target end if if the environment is "development" then if the shiftKey is down then checkForCursor buildColumnButtons InitAltFldHeader end if if the optionKey is down then checkForTargetField put the altDontResize of the target into tCanResize answer question "Lock the resize of this btn" with "Yes" or "No" if it is "Yes" then set the altDontResize of the target to true else set the altDontResize of the target to false end if answer question "Enable this button for hiliting on mouseClick?" with "Yes" or "No" if it is "Yes" then set the altEnableBtn of the target to true else set the altEnableBtn of the target to false end if answer question "Set Minimum Width for this button?" with "This Width" or "Very Small Width" or "No Change" if it is "This Width" then set the altMinWidth of the target to the width of the target if it is "Very Small Width" then set the altMinWidth of the target to 10 ask "New Name for this column button" with the short name of the target if it is not empty then set the name of the target to it InitAltFldHeader end if if the ctrlKey is down then checkForTargetField put the tabStops of fld the altTargetField of me into tTabStops put the number of items of tTabStops into tNumCols ask "Change the number of columns:" with tNumCols if it is "" then exit to top put it into tNewNumCols if tNewNumCols < tNumCols and tNewNumCols > 1 then repeat with x =1 to tNewNumCols put item x of tTabStops &"," after tNewTabStops end repeat delete last char of tNewTabStops set the tabStops of fld the altTargetField of me to tNewTabStops buildColumnButtons InitAltFldHeader end if if tNewNumCols > tNumCols then repeat until tNewNumCols = tNumCols put "," & the last item of tTabStops + 40 after tTabStops add 1 to tNumCols end repeat set the tabStops of fld the altTargetField of me to tTabStops buildColumnButtons InitAltFldHeader end if end if end if altFinishTracking pass mouseUp end mouseUp on mouseEnter x,y if the owner of the target is not me then pass mouseEnter if the target contains "button" and there is a fld the altTargetField of me then lock cursor put true into l_altTracMode else put false into l_altTracMode end if pass mouseEnter end mouseEnter on mouseLeave if the owner of the target is not me then pass mouseLeave unlock cursor put false into l_altTracMode pass mouseLeave end mouseLeave on mouseRelease unlock cursor put false into l_altMoveCol put false into l_altTracMode if the target contains "button" then set the hilite of the target to false altFinishTracking pass mouseRelease end mouseRelease on mouseMove x,y if the owner of the target is not me then pass mouseMove if l_altTracMode then if the target contains "button" and the altDontResize of the target is False then switch case x < (the left of the target + 5) and the priv_altOrderNum of the target > 1 #other button on left # gets the btn id of the 'adjacent' button put (item 1 of line (max((the priv_altOrderNum of the target - 1),1)) of the priv_altBtnIDList of me) into tBtnID if the altDontResize of btn ID tBtnID then set the cursor to arrow else set the cursor to (the id of img "moveColumn") end if break case x > (the right of the target - 5) and the priv_altOrderNum of the target < the number of lines in the priv_altBtnIDList of me #other button on right # gets the btn id of the 'adjacent' button put (item 1 of line (min((the priv_altOrderNum of the target + 1),the number of lines in the priv_altBtnIDList of me)) of the priv_altBtnIDList of me) into tBtnID if the altDontResize of btn ID tBtnID then set cursor to arrow else set the cursor to (the id of img "moveColumn") end if break default set cursor to arrow end switch else set the cursor to arrow end if end if if l_altMoveCol then put l_altMoveNow into tList set the width of btn id item 1 of tList to \ min(max(x - the left of btn id item 1 of tList,item 3 of tList),(the right of btn id item 1 of line 2 of tList - the left of btn id item 1 of tList - item 3 of line 2 of tList)) put the right of btn id item 1 of line 2 of tList into tRight get the rect of btn id item 1 of line 2 of tList set the rect of btn id item 1 of line 2 of tList to \ the right of btn id item 1 of tList, \ item 2 of it, \ item 3 of it, \ item 4 of it if the altRealTimeTrack of me then altFinishTracking end if pass mouseMove end mouseMove on buildColumnButtons --> CHECK FOR A TARGET FIELD if there is not a fld the altTargetField of me then ask "Please enter the name of the field you wish to associate me with:" if it is "" then exit to top if there is not a fld it then beep answer "No field on this card by that name!" exit to top else set the altTargetField of me to it end if end if ask "Please enter the vertical space between the columnHeader and the field (in Pixels)"&cr&"Default is 0" with the altVertPad of me if not isNumber(it) then exit to top set the altVertPad of me to it answer question "Enable realtime column tracking? (default is Yes)" with "No" or "Yes" if it is "No" then set the altRealTimeTrack of me to false else set the altRealTimeTrack of me to true end if put the altTargetField of me into tFld put the tabStops of fld tFld into tTabs --> CHECK TARGET FIELD FOR TABSTOPS if the number of items in tTabs < 2 then answer question "There needs to be at least 2 columns in this field. Should I automatically add them?" with "No" or "Yes" if it is "No" then exit to top put "30,30" into tTabs set the tabStops of fld tFld to tTabs end if set the vGrid of fld tFld to true put the number of items in tTabs into tNumCols --> CHECK TO SEE IF WE SHOULD USE ALL COLUMNS set the priv_XtraTabs of me to "" if tNumCols > 3 then answer question "Do you wish to display all " &tNumCols& " columns?" with "No" or "Yes" if it is "No" then ask "How many of the " &tNumCols& " do you wish to display?" with tNumCols if it is not empty and isNumber(it) then if it > tNumCols then answer "Too many columns!" exit to top end if if it < 3 then answer "Too few columns" exit to top end if if it < tNumCols then put it into tCount repeat with y = tCount+1 to tNumCols put item y of tTabs - item (y-1) of tTabs & "," after tEndTabs end repeat delete last char of tEndTabs set the priv_XtraTabs of me to tEndTabs put tCount into tNumCols end if end if end if end if set the altNumCols of me to tNumCols --> CHECK FOR NUMBER OF BTNS IN ME put 0 into tNumMyBtns repeat with x = the number of btns on this cd down to 1 put the id of me into tID if the long ID of btn x contains ("group ID " & tID) then add 1 to tNumMyBtns if tNumMyBtns > tNumCols then delete btn x else put x into tGoodBtnToClone end if end if end repeat --> IF THE NUMBER OF BTNS IN ME IS LESS THAN THE COLUMNS IN THE FIELD if tNumMyBtns < tNumCols then repeat until tNumMyBtns = tNumCols clone btn tGoodBtnToClone add 1 to tNumMyBtns end repeat end if end buildColumnButtons on checkForTargetField if there is not a field the altTargetField of me then answer warning "Please first target a field for this control. Shift-Click on this control to do so." exit to top end if end checkForTargetField on checkForCursor if there is not an img "moveColumn" then answer warning "Please add the img 'moveColumn' to this card!" exit to top end if end checkForCursor on resizeStack pNewWidth put pNewWidth into tRight put the left of me into tL put the priv_altBtnIDList of me into tBtnIDs set the width of me to max(the priv_altMinWidth of me,tRight-the priv_altRight of me-tL) put the width of me into tWidth --> priv_altBtnIDList FOR THIS GROUP --> ITEM 1 IS THE BTN ID --> ITEM 2 IS THE % WIDTH OF GROUP (.10 = 10%) --> ITEM 3 IS THE MINWIDTH repeat for each line L in tBtnIDs set the left of btn id (item 1 of L) to tL if the altDontResize of btn id (item 1 of L) is False then set the width of btn id (item 1 of L) to max(round(tWidth * item 2 of L),the altMinWidth of btn id (item 1 of L)) end if put the right of btn id (item 1 of L) into tL end repeat set the width of btn id item 1 of last line of the priv_altBtnIDList of me to \ the right of me \ - the left of btn id item 1 of last line of the priv_altBtnIDList of me put 0 into tW set the lockLoc of fld the altTargetField of me to true if the vscrollbar of fld the altTargetField of me then put the scrollbarwidth of fld the altTargetField of me into tW end if set the width of fld the altTargetField of me to \ the width of me + tW altFinishTracking pass resizeStack end resizeStack on altFinishTracking if there is not a fld the altTargetField of me then exit to top --> SET THE TABS FOR THE ASSOCIATED FIELD --> WE HAVE HIDDEN COLUMNS, SO LET'S CAPTURE put the priv_altBtnIDList of me into t put the left of btn id item 1 of the priv_altBtnIDList of me +3 into tLeft repeat for each line L in the priv_altBtnIDList of me put the right of btn id item 1 of L - tLeft & "," after tTabs end repeat delete last char of tTabs --> ADD ANY HIDDEN TABS put the priv_XtraTabs of me into tXtabs repeat for each item I in tXtabs put "," & the last item of tTabs + I after tTabs end repeat set the tabStops of fld the altTargetField of me to tTabs #set the new button percentages put the priv_altBtnIDList of me into tList put the width of me into tWidth put 0 into tLength repeat with x = 1 to the number of lines in tList put round(100*the width of btn id item 1 of line x of tList/tWidth)/100 into \ item 2 of line x of tList if x is not the number of lines in tList then put item 2 of line x of tList + tLength into tLength else put 1 - tLength into item 2 of line x of tList end if end repeat set the priv_altBtnIDList of me to tList end altFinishTracking on InitAltFldHeader # should call this when 'setting up' the original group for the first time # not necessary to call this ever again # builds a sorted left to right list of all the IDs of the buttons in this group and sets the priv_altBtnIDList property to it if not exists(fld the altTargetField of me) then answer warning "No designated fld found. Please set the altTargetField property!" exit InitAltFldHeader end if set the lockLoc of me to true --> GET THE TAB WIDTHS put the tabStops of fld the altTargetField of me into tTabStops put the altNumCols of me into tNumCols put the left of fld the altTargetField of me into tL set the left of me to tL --> CALCULATE IF THERE IS ROOM FOR ALL OF THE TABSTOPS IN THIS FIELD put item tNumCols of tTabStops into tFldWidth put the width of fld the altTargetField of me into tWidth if the vscrollbar of fld the altTargetField of me then subtract the scrollbarwidth of fld the altTargetField of me from tWidth end if if tFldWidth > tWidth then --> THE FIELD IS NOT WIDE ENOUGH TO HANDLE ALL THE BUTTONS --> NEED TO RESET THE TABSTOPS repeat with x =1 to the number of items in tTabStops put item x of tTabStops into tempW put round(tempW/tFldWidth * tWidth) into tempW put tempW & "," after tNewTabStops end repeat delete last char of tNewTabStops put tNewTabStops into tTabStops end if --> SET THE BUTTON WIDTHS put 1 into tColCounter put 0 into tOldWidth put 0 into tMaxHeight put 0 into tBtnCounter put 1 into tOrder repeat with x = 1 to the number of btns on this cd put the id of me into tID if the long ID of btn x contains ("group ID " & tID) then put item tColCounter of tTabStops - tOldWidth into tColumnWidth if tBtnCounter = 0 then put 3 into tIncrement else put 0 into tIncrement end if if tBtnCounter + 1 = tNumCols then --> ON LAST BTN put tWidth - tOldWidth into tColumnWidth put item tColCounter of tTabStops - tOldWidth into tLastColWidth put -3 into tIncrement end if set the width of btn x to tColumnWidth + tIncrement if tBtnCounter = 0 then if there is an image "moveColumn" of me then set the loc of image "moveColumn" to the loc of btn x hide image "moveColumn" end if end if set the lockloc of btn x to true set the priv_altOrderNum of btn x to tOrder add 1 to tOrder set the left of btn x to tL put the right of btn x into tL put max(the height of btn x, tMaxHeight) into tMaxHeight add 1 to tBtnCounter put item tColCounter of tTabStops into tOldWidth add 1 to tColCounter end if end repeat --> SET THE BUTTON HEIGHTS repeat with x = 1 to the number of btns on this cd put the id of me into tID if the long ID of btn x contains ("group ID " & tID) then set the height of btn x to tMaxHeight set the top of btn x to the top of me end if end repeat --> CALCULATE RELATIVE COLUMN WIDTHS --> priv_altBtnIDList FOR THIS GROUP --> ITEM 1 IS THE BTN ID --> ITEM 2 IS THE % WIDTH OF GROUP (.10 = 10%) --> ITEM 3 IS THE MINWIDTH put 0 into tMinWidth repeat with x = 1 to the number of btns on this cd put the id of me into tID if the long ID of btn x contains ("group ID " & tID) then put the id of btn x & "," after tBtnIdList --> CALCULATE % WIDTH put round(100*the width of btn x/tWidth)/100 into tPercentWidth put tPercentWidth & "," after tBtnIdList put the altMinWidth of btn x & "," & cr after tBtnIdList add the altMinWidth of btn x to tMinWidth end if end repeat delete last char of tBtnIdList set the priv_altBtnIDList of me to tBtnIdList --> STORE THE MINIMUM WIDTH set the priv_altMinWidth of me to tMinWidth set the height of me to the formattedHeight of me set the top of me to the top of fld the altTargetField of me - tMaxHeight - the altVertPad of me set the width of me to the formattedWidth of me set the left of me to the left of fld the altTargetField of me set the priv_altRight of me to the width of this cd - the right of me altFinishTracking end InitAltFldHeader J9altRealTimeTracktruepriv_XtraTabs altNumCols4altTargetField GroupListpriv_altMinWidth80priv_altBtnIDList71011,0.19,20, 1012,0.27,20, 1013,0.19,20, 1014,0.35,20,priv_altRight30 altVertPad0 cREVGeneral revUniqueID 1137015620928 breakPoints moveColumnDKPNG  IHDR(-SgAMA=-f PLTE~OtRNS A9IDATxc` ##I@`1 YH'@$2`Ђi(8A MIENDB` cREVGeneral revUniqueID 1087466175495 Origin CdE w'on mouseUp pass mouseUp end mouseUp @ J;altDontResizefalse altEnableBtnfalsepriv_altOrderNum1 altMinWidth20 cREVGeneral revUniqueID 1087511934638 On Current Cd?hD w'on mouseUp pass mouseUp end mouseUp @HJUaltDontResizefalse altEnableBtnfalsepriv_altOrderNum2 altMinWidth20 cREVGeneral revUniqueID 1087511934639  Group IDE w'on mouseUp pass mouseUp end mouseUp @J;altDontResizefalse altEnableBtnfalse altMinWidth20priv_altOrderNum3 cREVGeneral revUniqueID 1137015672020  Group NameE w'on mouseUp pass mouseUp end mouseUp @JnaltDontResizefalse altEnableBtnfalse altMinWidth20priv_altOrderNum4 cREVGeneral revUniqueID 1137015672024   Label Field 1S cREVTable currentview Current Card: cREVGeneral revUniqueID 1137015984786 Current Card:  CurrentCard i1 cREVGeneral revUniqueID 1137016011040 Place Selected Grp on CdEwB--> all handlers on mouseUp put selectedGrp() into tLineNum set itemDel to tab put line tLineNum of fld "GroupList" into tGrpLine if item 2 of tGrpLine is "YES" then answer information "That group is already on the Current Card!" exit to top end if put item 3 of tGrpLine into tGrpID put item 1 of tGrpLine into tGrpOriginCd place grp ID tGrpID of card tGrpOriginCd of the topStack onto the current card of the topStack refreshGroupList set the hilitedlines of fld "GroupList" to tLineNum refreshButtons end mouseUp altLayoutManager WinXPaltVistrue WinXPaltCmdMY:-9altCmdMY:-9 WinXPaltRect15,187,169,210altRect15,187,169,210 cConsLastHandlerScroll0 HandlerNamemouseUp message cREVGeneral revUniqueID 1137016363471 Remove Selected Grp from CdEw--> all handlers on mouseUp put selectedGrp() into tLineNum set itemDel to tab put line tLineNum of fld "GroupList" into tGrpLine if item 2 of tGrpLine is "NO" then answer information "That group is NOT on the Current Card!" exit to top end if put item 3 of tGrpLine into tGrpID put item 1 of tGrpLine into tGrpOriginCd remove grp ID tGrpID of the topStack from the current card of the topStack refreshGroupList set the hilitedlines of fld "GroupList" to tLineNum end mouseUp altLayoutManager WinXPaltVistrue WinXPaltCmdMY:-9altCmdMY:-9 WinXPaltRect175,187,341,210altRect175,187,341,210 cConsLastHandlerScroll0 HandlerNamemouseUp message cREVGeneral revUniqueID 1137016391341 breakPoints Auto Refresh Group List`E--> all handlers on mouseUp if the hilite of me then insert the script of btn "AutoRefresh" into front else remove the script of btn "AutoRefresh" from front end if end mouseUp  cConsLastHandlerScroll0 HandlerNamemouseUp message cREVGeneral revUniqueID 1137018669159  AutoRefreshEw--> all handlers on openCard if "altGroupMgr" is not in the topStack then send "refreshGroupList" to card 1 of stack "altGroupMgr" end if pass openCard end openCard --on resumeStack -- send "refreshGroupList" to card 1 of stack "altGroupMgr" -- pass resumeStack --end resumeStack --on suspendStack -- send "refreshGroupList" to card 1 of stack "altGroupMgr" -- pass suspendStack --end suspendStack on openStack send "refreshGroupList" to card 1 of stack "altGroupMgr" pass openStack end openStack on closeStack send "refreshGroupList" to card 1 of stack "altGroupMgr" pass closeStack end closeStack K cConsLastHandlerScroll174 HandlerNameresumeStack message cREVGeneral revUniqueID 1137018863652  Label Field !S cREVTable currentviewCurrent Stack: cREVGeneral revUniqueID 1137019365485 Current Stack:  CurrentStack i! cConsLastHandlerScroll0 HandlerName cREVTable currentview card id 1002 cREVGeneral revUniqueID 1137019365486 vers on mouseUp if the shiftKey is down then ask "New Version:" with me if it is empty then exit mouseUp put it into me set the altVers of img "altPlug.png" to it end if end mouseUp 02altLayoutManager WinXPaltVistrue WinXPaltCmdMX:-2altCmdMX:-2 WinXPaltRect 304,24,354,50altRect 304,24,354,50 cREVGeneral revUniqueID 1137020675467 v0.9.4 altPlug.pngD altVersv0.9.4altOpenVisibletruealtPlugFileNamealtGroupMgr.rev altOnClickMedoIt altUpdateURL7http://www.gadgetplugins.com/altplugins/altGroupMgr.txt altGroupMgrvPNG  IHDR szzgAMA a-IDATXkU{gpV8;:i5`E#T&%JL̘m i~jMH)$TDP-%J6-8#ɐs޻>{\X':_k>R.`IE0(0@v%3yiF&O-aEz烍Ã3w,emNo(N> y;|VX;y/Z:J1>kc|kcKWn᱅,@O`+E`<Ai cLӐs8 toGF >"G?r6/<3}fkͻGގVޤ\8𗋮ˏon mouseUp answer information the altMsg of me end mouseUp EaltMsgD

altGroupMgr

by Chipp Walters, Aluit, Inc.

altGroupMgr is a plugin to help manage groups in multiple card stacks. When launched from the altPluginToolbar, it works as a palette targeting the topStack. When the Auto Refresh Group List is checked, the Group List is automatically regenerated when going from card to card in the topStack. The columns for the Group List are:

Origin Cd - This is the first instance of the group found in the stack. While multiple cards may share a group, it is only necessary to list the first instance of it.

On Current Cd? - YES if this group is placed on the current card of the topStack. No if it is not.

GroupID - The ID of the Group

Group Name - The short name of the Group

Clicking on a group selects it. If the group is already on the current card it will blink it a couple of times on the card so you can see it. You can then choose to remove it from the card by clicking the Remove Selected Grp from Cd button. Remember, there is no UNDO! If the group is not on the current card, you can choose to PLACE it there by clicking the Place Selected Grp on Cd button.

altLayoutManager WinXPaltVistrue WinXPaltCmdMX:-7altCmdMX:-7 WinXPaltRect 325,3,349,23altRect 325,3,349,23 cREVGeneral revUniqueID 1137020929337 UpdateE --> all handlers on mouseUp answer question "This will check the server for updates to this stack." &cr& \ "Any changes you have made to this stack will be lost! Continue?" with "Cancel" or "OK" if it is "Cancel" then exit to top checkForPluginUpdate end mouseUp on checkForPluginUpdate get altCheckInternetConnect() put the altVers of image "altPlug.png" into tVers put the altUpdateURL of img "altPlug.png" into tURL put URL tURL into tData put getTagData(tData,"Version") into tVers2 if tVers2 <> tVers then answer information "There is an update to this stack. Do you wish to retrieve it?" with "Cancel" or "OK" if it is "Cancel" then exit checkForPluginUpdate end if --> DOWNLOAD NEW STACK put the filename of this stack into tPluginPath put getTagData(tData,"UpdateURL") into tURL put "Downloading file, please wait..." put URL tURL into tBinData put the result into tResult if tResult is not "" then answer information "Problem downloading stack." &cr&cr& tResult altStatus "" exit to top end if topLevel this stack if char -3 to -1 of tURL is ".gz" then --> NEED TO UNCOMPRESS put "Decompressing Stack..." put decompress(tBinData) into tBinData end if put tBinData into URL ("binfile:" & tPluginPath) revert put "Stack updated!" into msg else answer information "You are currently using the latest version of this stack" end if end checkForPluginUpdate function altCheckInternetConnect --> CHECK FOR INTERNET CONNECTION TO EXTERNALS SERVER put "Checking for internet connection..." get URL "http://www.gadgetplugins.com/RevAccessTest.txt" put the result into tResult put "" if line 1 of it is not "GOOD" or tResult is not empty then answer warning "Cannot connect with the Altuit Externals Server: Error" &cr& tResult exit to top else return true end if end altCheckInternetConnect function getTagData theTagData,theTagName filter theTagData with "<" & theTagName & ">*" replace "<" & theTagName & ">" with "" in theTagData replace " " with "" in theTagData replace "" with "" in theTagData replace "|" with tab in theTagData replace "\" with return in theTagData replace "/***---***/" with "" in theTagData replace " " with "" in theTagData return theTagData end getTagData +/5 cConsLastHandlerScroll260 HandlerNamecheckForPluginUpdate command cREVGeneral scriptChecksumc:T E breakPoints handlerList?mouseUp checkForPluginUpdate altCheckInternetConnect getTagDatascriptSelectionchar 1238 to 1237 revUniqueID 1138200081963 bookmarks tempScript prevHandlermouseUpscriptx

--> all handlers

on mouseUp

answer question "This will check the server for updates to this stack." &cr& \

"Any changes you have made to this stack will be lost! Continue?" with "Cancel" or "OK"

if it is "Cancel" then exit to top

checkForPluginUpdate

end mouseUp

on checkForPluginUpdate

get altCheckInternetConnect()

put the altVers of image "altPlug.png" into tVers

put the altUpdateURL of img "altPlug.png" into tURL

put URL tURL into tData

put getTagData(tData,"Version") into tVers2

if tVers2 <> tVers then

answer information "There is an update to this stack. Do you wish to retrieve it?" with "Cancel" or "OK"

if it is "Cancel" then

exit checkForPluginUpdate

end if

--> DOWNLOAD NEW STACK

put the filename of this stack into tPluginPath

put getTagData(tData,"UpdateURL") into tURL

put "Downloading file, please wait..."

put URL tURL into tBinData

put the result into tResult

if tResult is not "" then

answer information "Problem downloading stack." &cr&cr& tResult

altStatus ""

exit to top

end if

topLevel this stack

if char -3 to -1 of tURL is ".gz" then

--> NEED TO UNCOMPRESS

put "Decompressing Stack..."

put decompress(tBinData) into tBinData

end if

put tBinData into URL ("binfile:" & tPluginPath)

revert

put "Stack updated!" into msg

else

answer information "You are currently using the latest version of this stack"

end if

end checkForPluginUpdate

function altCheckInternetConnect

--> CHECK FOR INTERNET CONNECTION TO EXTERNALS SERVER

put "Checking for internet connection..."

get URL "http://www.gadgetplugins.com/RevAccessTest.txt"

put the result into tResult

put ""

if line 1 of it is not "GOOD" or tResult is not empty then

answer warning "Cannot connect with the Altuit Externals Server: Error" &cr& tResult

exit to top

else

return true

end if

end altCheckInternetConnect

function getTagData theTagData,theTagName

filter theTagData with "<" & theTagName & ">*"

replace "<" & theTagName & ">" with "" in theTagData

replace "</" & theTagName & "> " with "" in theTagData

replace "</" & theTagName & ">" with "" in theTagData

replace "|" with tab in theTagData

replace "\" with return in theTagData

replace "/***---***/" with "" in theTagData

replace " " with "" in theTagData

return theTagData

end getTagData