REVO2700 0 ASG_ColorPicker 2 @ F T C cIsDocked true 4P Picker / U Lucida Grande U Lucida Grande U helvetica U helvetica W Lucida Grande U Lucida Grande U MS Sans Serif U Lucida Grande U Lucida Grande U Lucida Grande U ms sans serif U Tahoma U Segoe UI U Helvetica U Arial U Arial W Lucida Grande U Lucida Grande U courier new U Lucida Grande U Apple Casual U Arial U Arial U Apple Symbols W Lucida Grande U Lucida Grande U Lucida Grande @U Lucida Grande HU Lucida Grande U Courier U Courier U Arial W Arial U Arial U Arial U Lucida Grande U Arial U Arial U Georgia U Georgia U Trebuchet MS U Trebuchet MS U Trebuchet MS U Verdana U Arial W Arial U Arial cREVLoadInfo load startupinMenu truemode Palette cRevStandaloneSettings 7scriptLibraries Internet Geometry PrintingMacOSX true OSX,name Tools FinalMacOS,documentType UNIX,fileSelector trueWindows falseWindows,LegalCopyright )2004 Fisher All rights reserved worldwideMacOS,longVersion Tools Final 1.0.0.0UNIX,pageSetup trueOSX,documentType Linux falseWindows,documenticonFile Z/Users/alanbeat/Latest Revolution Distribution/ Revolution 2.2/Sample Icons/genericdoc.icoOdt falseinclusions search answerDialog trueSPARC false SolIntel falseOSX,documentExtension Windows,FileDescription Tools Final 1.0.0.0 for WindowsOSX,longVersion Tools Final 1.0.0.0OSX,copyright )2004 Fisher All rights reserved worldwideUNIX,printerChooser trueMacOS,MinimumSize 15000MacOS,versionnumber1 1MacOS,versionnumber2 0MacOS,Release Finalname Tools FinalMacOS,versionnumber3 0Hp9k700 falsers6000 false MacOS,Region 1OSX,shortVersion 1.0.0.0Windows,fileversion1 1Windows,fileversion2 0Windows,productversion1 1Windows,productversion2 0Windows,fileversion3 0Bsd falsecursors falseWindows,productversion3 0Windows,fileversion4 0Windows,productversion4 0 OSX,info Tools Final Version 1.0.0.0MacOS,dynamicMemory trueIris false askDialog trueWindows,iconFile Z/Users/alanbeat/Latest Revolution Distribution/ Revolution 2.2/Sample Icons/genericapp.icoOSX,signature ????MacOS,PreferredSize 15000Windows,ProductName Tools FinalUNIX,colorChooser true MacOSPPC falseWindows,companyname Fisher SolSparc falseMacOS,creator ???? cREVGeometryCache stackID 2352 cREVGeneral scriptChecksum jcht@ debugObjects breakpoints handlerList preOpenStack initializeImageTools revTriangleMouseDown revTriangleUporDown revTriangleMouseRelease revWithinCheck cDisclosedSections revDoSection revGroupsToMove revSlideOut revSlideIn revFoldDown revFoldUp moveStack paintToolsShow paintToolsHidescriptSelection char 3289 to 3288breakpointstates bookmarks breakpointconditions scripteditorvscroll 0scripteditorselection 0tempScript prevHandler revTriangleMouseDownscript
on preOpenStack
if the platform is "MacOS" and char 1 of the systemVersion is 1 then
set the loc of grp "Mac Switcher" to the cVisibleLoc of grp "Mac Switcher"
set the loc of grp "Win Switcher" to -100,-100
set the loc of grp "Linux Switcher" to -100,-100
repeat with i=1 to the num of btns in this stack
if the cPlatformChange of btn i then
set the showIcon of btn i to true
if the cMacIcon of btn i is empty then
set the showIcon of btn i to false
next repeat
end if
set the icon of btn i to the cMacIcon of btn i -- patch this back
--set the icon of btn i to the cMacHiliteIcon of btn i
set the hiliteIcon of btn i to the cMacHiliteIcon of btn i
if the cMacIcon of btn i is empty then set the showIcon of btn i to false
end if
end repeat
else if the platform is "Win32" then
set the loc of grp "Win Switcher" to the cVisibleLoc of grp "Win Switcher"
set the loc of grp "Mac Switcher" to -100,-100
set the loc of grp "Linux Switcher" to -100,-100
repeat with i=1 to the num of btns in this stack
if the cPlatformChange of btn i then
local tWinIcon, tWinHiliteIcon
#Marcus: adding in Vista skinning
if word 2 of the systemVersion < 6.0 then -- it is not Vista
put the cWinIcon of button i into tWinIcon
put the cWinHiliteIcon of button i into tWinHiliteIcon
else -- it is Vista
put the cWinVistaIcon of button i into tWinIcon
put the cWinVistaHiliteIcon of button i into tWinHiliteIcon
-- If the Vista icon does not exist, revert to XP.
if tWinIcon is empty or tWinHiliteIcon is empty then
put the cWinIcon of button i into tWinIcon
put the cWinHiliteIcon of button i into tWinHiliteIcon
end if
end if
set the showIcon of btn i to true
if tWinIcon is empty then
set the showIcon of btn i to false
next repeat
end if
set the icon of btn i to tWinIcon --the cWinIcon of btn i -- patch this back
--set the icon of btn i to the cWinHiliteIcon of btn i
set the hiliteIcon of btn i to tWinHiliteIcon --the cWinHiliteIcon of btn i
end if
end repeat
else
-- Liunx or Mac OS 9
set the loc of grp "Linux Switcher" to the cVisibleLoc of grp "Linux Switcher"
set the loc of grp "Mac Switcher" to -100,-100
set the loc of grp "Win Switcher" to -100,-100
repeat with i=1 to the num of btns in this stack
if the cPlatformChange of btn i then
set the showIcon of btn i to true
if the cLinuxIcon of btn i is empty then
set the showIcon of btn i to false
next repeat
end if
set the icon of btn i to the cLinuxIcon of btn i
set the hiliteIcon of btn i to the cLinuxHiliteIcon of btn i
if the cLinuxIcon of btn i is empty then set the showIcon of btn i to false
end if
end repeat
end if
initializeImageTools
-- OK-2006-09-19: Fix to make the stack remember the last position of the paint tools
if the cRevToolsPaintToolsVisible of stack "revPreferences" then
paintToolsShow
else
paintToolsHide
end if
end preOpenStack
#TH-2008-01-18 : Fix to ensure the correct values are selected when the toolstack is first opened
command initializeImageTools
set the text of button "Line Size" of me to the cInitialText of button "Line Size" of me
set the text of button "Paint Line Size" of me to the cInitialText of button "Paint Line Size" of me
set the lineSize to 1
set the filled to true
set the cCurrentColor of button "Line Color" to the effective foreColor of the templateGraphic
set the cCurrentColor of button "Fill Color Paint" to the brushColor
set the cCurrentColor of button "Line Color Paint" to the penColor
set the cCurrentColor of button "Fill Color" to the effective backColor of the templateGraphic
set the backColor of grc "Paint Bucket backColor" of stack "revTools" to the brushColor
set the foreColor of grc "Paint Bucket backColor" of stack "revTools" to the brushColor
set the backColor of grc "Paint Pen backColor" of stack "revTools" to the penColor
set the foreColor of grc "Paint Pen backColor" of stack "revTools" to the penColor
set the backColor of grc "Bucket backColor" of stack "revTools" to Gray89
set the foreColor of grc "Bucket backColor" of stack "revTools" to Gray89
set the backColor of grc "Pen backColor" of stack "revTools" to the effective foreColor of the templateGraphic
set the foreColor of grc "Pen backColor" of stack "revTools" to the effective foreColor of the templateGraphic
end initializeImageTools
--------Library for the Disclosure triangles that slide out, as used in Tools Palette-------------
local lSections, lTriangleIcon, lTriangleHiliteIcon, lDisclosureTimerID, lStackName
on revTriangleMouseDown
put the long id of the target into tTarget
put the icon of tTarget into lTriangleIcon
if the cDisclosed of tTarget is false then
set the icon of tTarget to the cHilitedIcon of tTarget
put the icon of tTarget into lTriangleHiliteIcon
revWithinCheck
else
set the icon of tTarget to the cDisclosedHilitedIcon of tTarget
put the icon of tTarget into lTriangleHiliteIcon
revWithinCheck
end if
end revTriangleMouseDown
on revTriangleUporDown
cancel lDisclosureTimerID
put the long id of the target into tTarget
lock screen
if the cDisclosed of tTarget is false then
set the icon of tTarget to the cIntermediateIcon of tTarget
wait 10 milliseconds
set the icon of tTarget to the cDisclosedIcon of tTarget
set the cDisclosed of tTarget to true
revSlideOut the short name of the target
else
set the icon of tTarget to the cIntermediateIcon of tTarget
wait 10 milliseconds
set the icon of tTarget to the cIcon of tTarget
set the cDisclosed of tTarget to false
revSlideIn the short name of the target
end if
unlock screen
end revTriangleUporDown
on revTriangleMouseRelease
cancel lDisclosureTimerID
put the long id of the target into tTarget
if the cDisclosed of tTarget is false then set the icon of tTarget to the cIcon of tTarget
else set the icon of tTarget to the cDisclosedIcon of tTarget
end revTriangleMouseRelease
on revWithinCheck
put the long id of the target into tTarget
if within(tTarget,the mouseLoc) then
set the icon of tTarget to lTriangleHiliteIcon
send "revWithinCheck" to tTarget in 20 milliseconds
put the result into lDisclosureTimerID
else
set the icon of tTarget to lTriangleIcon
send "revWithinCheck" to tTarget in 20 milliseconds
put the result into lDisclosureTimerID
end if
end revWithinCheck
setProp cDisclosedSections pSections
put empty into tGroupsSort
repeat with i = 1 to the num of btns in grp "sections"
put the short name of btn i of grp "sections", the top of btn i of grp "sections" & cr after tGroupsSort
end repeat
delete last char of tGroupsSort
sort lines of tGroupsSort ascending numeric by item 2 of each
put pSections into lSections
revDoSection item 1 of line 1 of tGroupsSort
repeat with i = 2 to the num of lines in tGroupsSort
put item 1 of line i of tGroupsSort into tCurrentSection
put item 1 of line (i-1) of tGroupsSort into tPrevSection
if the cDisclosed of btn tPrevSection of grp "sections"
then set the top of btn tCurrentSection to the bottom of grp tPrevSection
else set the top of btn tCurrentSection to the bottom of btn tPrevSection
revDoSection tCurrentSection
end repeat
put item 1 of the last line of tGroupsSort into tLastSection
if the cDisclosed of btn tLastSection
then put the bottom of grp tLastSection into tStackHeight
else put the bottom of btn tLastSection into tStackHeight
set the rect of this stack to item 1 to 3 of the rect of this stack, the top of this stack + tStackHeight
end cDisclosedSections
on revDoSection pSection
--fold section in or out
if pSection is among the items of lSections then
--disclose section
set the cDisclosed of btn pSection of grp "sections" to true
set the icon of btn pSection of grp "sections" to the cDisclosedIcon of btn pSection of grp "sections"
set the topLeft of grp pSection to the left of btn pSection of grp "sections", the bottom of btn pSection of grp "sections"
else
--fold in section
set the cDisclosed of btn pSection of grp "sections" to false
set the icon of btn pSection of grp "sections" to the cIcon of btn pSection of grp "sections"
set the right of grp pSection to 700
end if
end revDoSection
function revGroupsToMove pSection
--returns groups below given section
put empty into tGroupsToMove
repeat with i = 1 to the num of btns in grp "sections"
if the top of btn i of grp "sections" > the top of btn pSection of grp "sections"
then put the short name of btn i of grp "sections" & cr after tGroupsToMove
end repeat
delete last char of tGroupsToMove
return tGroupsToMove
end revGroupsToMove
on revSlideOut pSection
put the height of grp pSection into tMoveDistance
put 250 into tTotalTime
put revGroupsToMove(pSection) into tGroupsToMove
repeat for each line l in tGroupsToMove
put the top of btn l of grp "sections" into tButtonTops[l]
put the top of grp l into tGroupTops[l]
end repeat
put the bottom of this stack into tStackBottom
put tTotalTime / tMoveDistance into tFraction
put the milliseconds into tStart
lock messages
repeat
put round((the milliseconds - tStart)/tFraction) into tPosition
lock screen
repeat for each line l in tGroupsToMove
set the top of btn l of grp "sections" to tButtonTops[l]+tPosition
set the top of grp l to tGroupTops[l]+tPosition
end repeat
set the rect of this stack to item 1 to 3 of the rect of this stack ,\
tStackBottom + tPosition
unlock screen
if the milliseconds > tStart+tTotalTime then exit repeat
end repeat
--ensure full distance moved
lock screen
repeat for each line l in tGroupsToMove
set the top of btn l of grp "sections" to tButtonTops[l] + tMoveDistance
set the top of grp l to tGroupTops[l] + tMoveDistance
end repeat
set the topLeft of grp pSection to the left of btn pSection, the bottom of btn pSection
set the rect of this stack to item 1 to 3 of the rect of this stack, tStackBottom + tMoveDistance
unlock screen
unlock messages
end revSlideOut
on revSlideIn pSection
put the height of grp pSection into tMoveDistance
put 250 into tTotalTime
put revGroupsToMove(pSection) into tGroupsToMove
repeat for each line l in tGroupsToMove
put the top of btn l of grp "sections" into tButtonTops[l]
put the top of grp l into tGroupTops[l]
end repeat
put the bottom of this stack into tStackBottom
put tTotalTime / tMoveDistance into tFraction
put the milliseconds into tStart
lock messages
set the left of grp pSection to 700
repeat
put round((the milliseconds - tStart)/tFraction) into tPosition
lock screen
repeat for each line l in tGroupsToMove
set the top of btn l of grp "sections" to tButtonTops[l]- tPosition
set the top of grp l to tGroupTops[l]- tPosition
end repeat
set the rect of this stack to item 1 to 3 of the rect of this stack ,\
tStackBottom - tPosition
unlock screen
if the milliseconds > tStart+tTotalTime then exit repeat
end repeat
--ensure full distance moved
lock screen
repeat for each line l in tGroupsToMove
set the top of btn l of grp "sections" to tButtonTops[l] - tMoveDistance
set the top of grp l to tGroupTops[l] - tMoveDistance
end repeat
set the rect of this stack to item 1 to 3 of the rect of this stack, tStackBottom - tMoveDistance
unlock screen
unlock messages
end revSlideIn
---------option to fold out/in without sliding----------------------
on revFoldDown pSection
lock messages
put revGroupsToMove(pSection) into tGroupsToMove
set the topLeft of grp pSection to the left of btn pSection, the bottom of btn pSection
put the height of grp pSection into tMoveDistance
repeat for each line l in tGroupsToMove
set the top of btn l of grp "sections" to the top of btn l of grp "sections" + tMoveDistance
set the top of grp l to the top of grp l + tMoveDistance
end repeat
set the rect of this stack to item 1 to 3 of the rect of this stack,\
the bottom of this stack + tMoveDistance
unlock messages
end revFoldDown
on revFoldUp pSection
lock messages
put revGroupsToMove(pSection) into tGroupsToMove
set the left of grp pSection to 700--move offscreen
put the height of grp pSection into tMoveDistance
repeat for each line l in tGroupsToMove
set the top of btn l of grp "sections" to the top of btn l of grp "sections" - tMoveDistance
set the top of grp l to the top of grp l - tMoveDistance
end repeat
set the rect of this stack to item 1 to 3 of the rect of this stack,\
the bottom of this stack - tMoveDistance
unlock messages
end revFoldUp
on moveStack
set the cToolsTopLeft of stack "revPreferences" to the topLeft of me
end moveStack
-----------------------
# OK-2006-09-19: These are now the actual handlers that make the paint tools
# appear and disappear. The above handlers revFoldUp etc don't seem to be used.
-----------------------
on paintToolsShow
local tRect
lock screen
put the rect me into tRect
set the rect of me to item 1 to 3 of tRect, item 2 of tRect + the cMaxHeight of button "paint and draw" of me
set the loc of group "graphics and paint" to the cOnScreenLoc of group "graphics and paint"
set the hilite of button "paint and draw" of me to false
if the tool is "pointer tool" or the tool is "browse tool" then set the loc of button "Graphic Hilite" of stack "revTools" to -100, -100
unlock screen
set the toolTip of button "paint and draw" of me to "Hide Draw & Paint Controls"
set the cRevToolsPaintToolsVisible of stack "revPreferences" to true
end paintToolsShow
on paintToolsHide
local tRect
lock screen
put the rect of me into tRect
set the rect of me to item 1 to 3 of tRect, item 2 of tRect + the cMinHeight of button "paint and draw" of me
set the loc of group "graphics and paint" to -100, -100
set the hilite of button "paint and draw" of me to true
unlock screen
set the tooltip of button "paint and draw" of me to "Show Draw & Paint Controls"
set the cRevToolsPaintToolsVisible of stack "revPreferences" to false
end paintToolsHide
cProduct name asg_colorpickerversion 0.3 - 04/18/2010version_number 103 card id 1002 IP0constant kColorPickerPalette = "ColorPickerGrp" constant kRevToolsPalette = "RevTools" local lGrcBgColor, lGrcBorderColor, lScanIsPaused, lPickColorFlag on preopenCard initPicker --C end preopenCard on mouseDown pMouseButton if ((pMouseButton is 3) and (the mouseLoc is not within the rect of image "ThePicker")) then popup btn "PickerContextual" end if end mouseDown on closeStack cleanPicker --C save this stack end closeStack on resume set the visible of this stack to the visible of stack "RevTools" end resume on suspend hide this stack closeInfos --C end suspend command initPicker -- Init the picker for its first use put the long id of grc "bgColor" into lGrcBgColor put the long id of grc "borderColor" into lGrcBorderColor hide image "Infos" set the width of this stack to the width of stack kRevToolsPalette show this stack -- Read the color mode in the prefs select menuItem (the cColorPickerPrefs["colorDisplayMode"] of stack "ASG_ColorPicker_Infos") of btn "ChooseColorFormat" setFocus lGrcBgColor --C scanForMouseWithin --C scanForRevToolsEvent --C -- Checked the updates if (the cColorPickerPrefs["updater"] of stack "ASG_ColorPicker_Infos") then checkForUpdates --C end if end initPicker command cleanPicker closeInfos --C if (there is a window "ASG_ColorPicker_ColorPrefs") then close stack "ASG_ColorPicker_ColorPrefs" if (there is a window "ASG_ColorPicker_Updates") then close stack "ASG_ColorPicker_Updates" end cleanPicker command userAskForClose answer "Are you sure you want to quit the Color Picker?" with "Yes" or "No" if (it is "Yes") then close this stack end if end userAskForClose command showInfos go to stack "ASG_ColorPicker_Infos" of this stack as modeless end showInfos command closeInfos if (there is a window "ASG_ColorPicker_Infos") then close stack "ASG_ColorPicker_Infos" end closeInfos command checkForUpdates go invisible to stack "ASG_ColorPicker_Updates" as modeless end checkForUpdates local lCounter ############ Pending messages ############ command scanForMouseWithin local tVisibleFlag lock messages if (there is not a stack "pickerDragControl") then put the visible of image "infos" into tVisibleFlag if (the mouseLoc is within the rect of btn "MoveMask") then if not tVisibleFlag then showInfosButton --C end if if (the mouse is down) then add 1 to lCounter if ((lCounter = 10) \ and (the mouseLoc is not within the rect of grp "ColorPickerGrp")\ and (there is not a stack "pickerDragControl")) then startMovingPicker --C end if else stopMovingPicker --C end if else stopMovingPicker --C if (tVisibleFlag) then hideInfosButton --C end if startPendingMessage "scanForMouseWithin", 120 else hideInfosButton --C end if unlock messages end scanForMouseWithin local lScanForRevMessageID command scanForRevToolsEvent pToolsRect, pVisibility, pMode, pTool local tTheCurrentRect, tTheCurrentVisibility, tCurrentMode, tCurrentTool put the rect of stack kRevToolsPalette into tTheCurrentRect put the visible of stack kRevToolsPalette into tTheCurrentVisibility put the mode of stack kRevToolsPalette into tCurrentMode put the tool into tCurrentTool lock messages if ((there is no stack "pickerDragControl") and (the cIsDocked of this stack)) then switch case (tTheCurrentRect is not pToolsRect) -- The tool palette change of rect or loc dockPicker --C break case (tTheCurrentVisibility is not pVisibility) -- The visibility of the tool palette has changed set the visible of this stack to tTheCurrentVisibility break case (tCurrentMode is not pMode) -- The tools palette has been closed or opened set the visible of this stack to (pMode is 0) break case (tCurrentTool is not pTool) -- the tool has changed go to this stack break end switch if (",scanForRevToolsEvent," is not in the pendingmessages) then send "scanForRevToolsEvent tTheCurrentRect,tTheCurrentVisibility,tCurrentMode,tCurrentTool" to me in 150 milliseconds end if end if unlock messages end scanForRevToolsEvent ################################################ command dockPicker lock screen set the topLeft of this stack to the bottomLeft of stack kRevToolsPalette go to this stack unlock screen end dockPicker command showInfosButton if (there is not a stack "pickerDragControl") then show image "Infos" with visual effect iris open very fast else show image "Infos" end if end showInfosButton command hideInfosButton if (there is not a stack "pickerDragControl") then hide image "Infos" with visual effect iris close very fast else hide image "Infos" end if end hideInfosButton command startMovingPicker if (not visible of btn "MoveMask") then set visible of btn "MoveMask" to true set cursor to hand lock cursor click at loc of btn "MoveMask" end if end startMovingPicker command stopMovingPicker if (visible of btn "MoveMask") then lock messages set visible of btn "MoveMask" to false put 0 into lCounter unlock cursor ## Dock the picker if (the cIsDocked of this stack) then scanForRevToolsEvent --C end if unlock messages end if end stopMovingPicker command setFocus pTheObject if (pTheObject is lGrcBgColor) then -- Set the focus to the bgColor grc set the foreColor of lGrcBgColor to the hiliteColor set the foreColor of lGrcBorderColor to empty else -- Set the focus to the borderColor grc set the foreColor of lGrcBorderColor to the hiliteColor set the foreColor of lGrcBgColor to empty end if set the cFocusGrc of group kColorPickerPalette of me to pTheObject put displayColorValue(backcolor of pTheObject,the selectedText of btn "ChooseColorFormat") into fld "ColorValue" --C end setFocus function whichCollectorHasFocus return the cFocusGrc of group kColorPickerPalette of me end whichCollectorHasFocus ## Pick a color command pickColor pButtonNumber switch pButtonNumber case 1 -- on left click, start to pick colors lock cursor set cursor to hand lock messages put true into lPickColorFlag startToPickColor --C break case 3 -- on right click, choose a color in the dialog answer color if (the result <> "Cancel") then set backColor of whichCollectorHasFocus() to it put displayColorValue(it,the selectedText of btn "ChooseColorFormat") into fld "ColorValue" --C sendColorToRevTools(it) --C end if break end switch end pickColor command startToPickColor local tColorCollector put whichCollectorHasFocus() into tColorCollector if (the commandKey is down) then put false into lPickColorFlag get the mouseColor set backColor of tColorCollector to it put displayColorValue(it,selectedText of btn "ChooseColorFormat") into fld "ColorValue" --C if lPickColorFlag then startPendingMessage "startToPickColor", 100 else unlock messages unlock cursor sendColorToRevTools(it) end if end startToPickColor command sendColorToRevTools pSelectedColor ## Send the selelected color to objetcs in the revtools palette -- Bucket backColor set the backColor of the templateGraphic to pSelectedColor set the opaque of the templateGraphic to true set the backColor of graphic "Bucket backColor" of stack "revTools" to pSelectedColor set the foreColor of graphic "Bucket backColor" of stack "revTools" to pSelectedColor -- Paint Bucket backColor set the filled to true set the brushColor to pSelectedColor set the backColor of graphic "Paint Bucket backColor" of stack "revTools" to pSelectedColor set the foreColor of graphic "Paint Bucket backColor" of stack "revTools" to pSelectedColor -- Pen backColor set the foreColor of the templateGraphic to pSelectedColor set the backColor of graphic "Pen backColor" of stack "revTools" to pSelectedColor set the foreColor of graphic "Pen backColor" of stack "revTools" to pSelectedColor -- Paint Pen backColor set the penColor to pSelectedColor set the cCurrentColor of button "line color paint" of stack "revTools" to pSelectedColor set the backColor of graphic "Paint Pen backColor" of stack "revTools" to pSelectedColor set the foreColor of graphic "Paint Pen backColor" of stack "revTools" to pSelectedColor end sendColorToRevTools ## Manage controls (switcher, color value, help button, preferences, ...) command switchColor local tColor1, tColor2 -- Store the color of the two collector put the backColor of lGrcBgColor into tColor1 put the backColor of lGrcBorderColor into tColor2 -- Switch the colors set the backColor of lGrcBgColor to tColor2 set the backColor of lGrcBorderColor to tColor1 end switchColor function displayColorValue pTheColor, pColorFormat local tCurrentColorKey put char 1 of pTheColor into tCurrentColorKey switch pColorFormat case "RGB" if (tCurrentColorKey is "#") then return convertWebToRGB(pTheColor) --C else return pTheColor end if break case "Web" if (tCurrentColorKey is not "#") then return convertRGBToWeb(pTheColor) --C else return pTheColor end if break end switch end displayColorValue ## Conversion RGB -> Web or Web -> RGB function convertRGBToWeb pRGBColor local tWebValue,tColorItem if (pRGBColor <> "") then put "#" into tWebValue repeat with tColorItem = 1 to 3 get baseConvert((item tColorItem of pRGBColor),10,16) if (the length of it = 1) then put "0" before it put it after tWebValue end repeat end if return tWebValue end convertRGBToWeb function convertWebToRGB pWebColor local tRGBValue,tColorItem put "0,0,0" into tRGBValue repeat with tColorItem = 1 to 3 get (tColorItem * 2) put baseConvert((char it to it + 1 of pWebColor),16,10) into item tColorItem of tRGBValue end repeat return tRGBValue end convertWebToRGB local lClickLocFlag, lClickLoc on mouseMove if ((the mouse is down) and (visible of btn "MoveMask")) then moveColorPicker lClickLocFlag --C put true into lClickLocFlag else put false into lClickLocFlag end if end mouseMove command moveColorPicker pClickLocFlag lock messages if (the mouse is down) then if (not pClickLocFlag) then put the mouseH,the mouseV into lClickLoc end if set the topLeft of this stack to globalLoc((item 1 of the mouseLoc - item 1 of lClickLoc) & comma & (item 2 of the mouseLoc - item 2 of lClickLoc)) put dockRect() into tTheRect if (stackIsWithinRect(tTheRect)) then set the decorations of this stack to empty set the cIsDocked of this stack to true else set the decorations of this stack to default set the resizable of this stack to false set the cIsDocked of this stack to false end if end if unlock messages end moveColorPicker function dockRect get the rect of stack "RevTools" return item 1 to 3 of it & comma & item 4 of it + 25 end dockRect function stackIsWithinRect pTheRect return (the topLeft of this stack is within pTheRect \ or the bottomRight of this stack is within pTheRect \ or the topLeft of this stack is within pTheRect \ or the bottomRight of this stack is within pTheRect) end stackIsWithinRect command startPendingMessage pTheMessage, pTheTime if (comma & pTheMessage & comma is not in the pendingMessages) then send pTheMessage to me in pTheTime milliseconds end if end startPendingMessage T C cFocusGrc vgraphic id 2297 of group id 2305 of card id 1002 of stack "/Users/denisrouyer/Desktop/Revolution /revtools 311209.rev" cREVGeometryCacheIDs 1261777396987 19731261437445536 19591265217403084 22971270339702731 23521267566573939 23501262471150900 22291266713155557 23361266776516701 23441263060077225 22691265219426985 23051267473588036 2348 cREVGeometrycache order 1261437445536total 11 cREVGeneral @ scriptChecksum a#7-lTbreakPoints handlerList DmouseDown mouseDoubleUp objectSize revCreateObject validDropLocationscriptSelection char 19749 to 19748scripteditorvscroll 2940 bookmarks scripteditorselection 12336tempScript prevHandler mouseDoubleUpscript Pon mouseDown
if word 1 of the name of the target is not "button" then
exit mouseDown
end if
if the tool is not "browse tool" and the tool is not "pointer tool" then
choose "pointer" tool
end if
local tDragFromStack
put the short name of this stack into tDragFromStack
local tShortName
put the short name of the target into tShortName
lock messages
local tStartLoc
put the screenMouseLoc into tStartLoc
repeat -- check for some movement before drag
local tNowLoc
put the screenMouseLoc into tNowLoc
if abs(item 1 of tNowLoc - item 1 of tStartLoc) < 8 then
if the mouse is up then exit mouseDown
next repeat
else
exit repeat
end if
end repeat
reset the templateStack
local tLoc
put the mouseLoc into tLoc
put globalLoc(tLoc) into tLoc
set the name of the templateStack to "revDragControl"
set the visible of the templateStack to false
set the backGroundColor of the templateStack to the hiliteColor
set the decorations of the templateStack to "noShadow"
set the style of the templateStack to "palette"
if the cWindowShape of the target is not empty then set the windowShape of the templateStack to the cWindowShape of the target
set the blendLevel of the templateStack to 25
create stack
set the defaultStack to "revDragControl"
-- OK-2007-11-30 : Refactored to external function
local tObjectSize
put objectSize(tShortName) into tObjectSize
local tWidth, tHeight
put item 1 of tObjectSize into tWidth
put item 2 of tObjectSize into tHeight
set the minWidth of this stack to tWidth
set the minHeight of this stack to tHeight
set the width of this stack to tWidth + the cAddWidth of the target
set the height of this stack to tHeight + the cAddHeight of the target
revCreateObject tShortName, the short name of this stack
set the loc of control 1 to the loc of this card
set the loc of this stack to tLoc
close stack "revDragControl"
show this stack
go stack "revDragControl"
# TH-2008-01-15 : Bug fix 4962 to prevent controls being dropped on stacks behind other stacks.
# since dragging creates a temporary stack need to perform check to flag this as an invalid stack
# for dropping controls onto
local tAllStacks
local tOpenStacks
put the openStacks into tOpenStacks
repeat for each line tStack in tOpenStacks
if the short name of stack tStack is "revDragControl" then
next repeat
end if
if the visible of stack tStack and not the cantModify of stack tStack and the mode of stack tStack is 1 then
put the rect of stack tStack & tab & "valid" & tab & tStack & return after tAllstacks
else
put the rect of stack tStack & tab & "invalid" & tab & tStack & return after tAllstacks
end if
end repeat
local tCurrentCursor
put the cursor into tCurrentCursor
local tCount
put 0 into tCount
local tStackShowing
put empty into tStackShowing
local tGridSize
put the gridSize into tGridSize
local tGrid
put the grid into tGrid
local tLeftCorrect
put trunc(tWidth / 2) into tLeftCorrect
local tTopCorrect
put trunc(tHeight / 2) into tTopCorrect
repeat
put the screenMouseLoc into tNowLoc
if tGrid and tStackShowing is not empty then
local tLeft
# OK-2007-07-11 : This appears to be a bug, tStackTopLeft was being used without being initialised
# So i added the initialisation, which was previously further down.
local tStackTopLeft
put the topLeft of stack tStackShowing into tStackTopLeft
put item 1 of tNowLoc - item 1 of tStackTopLeft - tLeftCorrect into tLeft
local tRight
put item 2 of tNowLoc - item 2 of tStackTopLeft - tTopCorrect into tRight
put (round(tLeft / tGridSize) * tGridSize) + item 1 of tStackTopLeft + tLeftCorrect into item 1 of tNowLoc
put (round(tRight / tGridSize) * tGridSize) + item 2 of tStackTopLeft + tTopCorrect into item 2 of tNowLoc
end if
set the loc of this stack to tNowLoc
add 1 to tCount
if tCount is 12 then
put 0 into tCount
local tH
put item 1 of tNowLoc into tH
local tV
put item 2 of tNowLoc into tV
local tMatch
put false into tMatch
local tLineNo
local tValid
put validDropLocation(tAllStacks, tH, tV) into tValid
put line 1 of tValid into tMatch
put line 2 of tValid into tLineNo
if tMatch then
if tCurrentCursor is not 32 then
set cursor to 32
put 32 into tCurrentCursor
end if
local tBorderStack
set the itemdelimiter to tab
put item 3 of line tLineNo of tAllStacks into tBorderStack
set the itemdelimiter to comma
if tBorderStack is not tStackShowing and there is a grc "revTempBorder" of stack tStackShowing then delete grc "revTempBorder" of stack tStackShowing
if there is a grc "revTempBorder" of stack tBorderStack then next repeat
set the rect of the templateGraphic to the rect of this cd of stack tBorderStack
local tLineSize
put the lineSize of the templateGraphic into tLineSize
set the lineSize of the templateGraphic to 2
local tForeColor
put the foreColor of the templateGraphic into tForeColor
set the foreColor of the templateGraphic to the hiliteColor
local tFilled
put the filled of the templateGraphic into tFilled
set the filled of the templateGraphic to false
local tName
put the short name of the templateGraphic into tName
set the name of the templateGraphic to "revTempBorder"
set the defaultStack to tBorderStack
create grc
set the lineSize of the templateGraphic to tLineSize
set the foreColor of the templateGraphic to tForeColor
set the filled of the templateGraphic to tFilled
set the name of the templateGraphic to tName
set the defaultStack to "revDragcontrol"
put tBorderStack into tStackShowing
put the topLeft of stack tStackShowing into tStackTopLeft
else
if tCurrentCursor is not "arrow" then set cursor to arrow
put "arrow" into tCurrentCursor
-- remove drag border if present
if there is a grc "revTempBorder" of stack tStackShowing then delete grc "revTempBorder" of stack tStackShowing
put empty into tStackShowing
end if
end if
local tExit
if tExit then
exit repeat
end if
if the mouse is up then put true into tExit
end repeat
if there is a grc "revTempBorder" of stack tStackShowing then
delete grc "revTempBorder" of stack tStackShowing
end if
set cursor to arrow
delete this stack
if there is a stack "revDragControl" then
delete stack "revDragControl"
end if
reset the templateStack
put the screenMouseLoc into tNowLoc
if tGrid and tStackShowing is not empty then
put item 1 of tNowLoc - item 1 of tStackTopLeft - tLeftCorrect into tLeft
put item 2 of tNowLoc - item 2 of tStackTopLeft - tTopCorrect into tRight
put (round(tLeft / tGridSize) * tGridSize) + item 1 of tStackTopLeft + tLeftCorrect into item 1 of tNowLoc
put (round(tRight / tGridSize) * tGridSize) + item 2 of tStackTopLeft + tTopCorrect into item 2 of tNowLoc
end if
put item 1 of tNowLoc into tH
put item 2 of tNowLoc into tV
put false into tMatch
put validDropLocation(tAllStacks, tH, tV) into tValid
put line 1 of tValid into tMatch
put line 2 of tValid into tLineNo
if tMatch then
local tDefaultStack
set the itemdelimiter to tab
put item 3 of line tLineNo of tAllStacks into tDefaultStack
set the itemdelimiter to comma
else
put empty into tDefaultStack
end if
if the number of words in revFilterStacksList(tDefaultStack) is 0 then
beep
set the hilite of btn tShortName of stack "revTools" to false
exit mouseDown
end if
unlock messages
set the defaultStack to tDefaultStack
put localLoc(tNowLoc) into tNowLoc
revCreateObject tShortName, tDefaultStack, tNowLoc
choose pointer tool
set the cREVGeneral["revUniqueID"] of last control to the milliseconds
if the left of last control < 0 then set the left of last control to 0
if the top of last control < 0 then set the top of last control to 0
select last control
revUpdateAOControls
end mouseDown
on mouseDoubleUp
if the mode of the topStack is not 1 or the cantModify of the topStack then
exit mouseDoubleUp
end if
if word 1 of the name of the target is "button" then
revCreateObject the short name of the target, the short name of the topStack, the loc of this cd of the topStack
end if
choose pointer tool
select last control
end mouseDoubleUp
-- OK-2007-11-30: Refactored from mouseDown to try and improve clarity
-- Parameters
-- pShortName : the short name of the object being created
-- Description
-- Returns the size (width, height) that newly created objects with this name should be
private function objectSize pShortName
local tWidth, tHeight
switch pShortName
case "button"
case "default Button"
case "radiobutton"
case "checkbox"
put the cButtonWidth of stack "revPreferences" into tWidth
put the cButtonHeight of stack "revPreferences" into tHeight
exit switch
case "menu tabbed"
put the cTabButtonWidth of stack "revPreferences" into tWidth
put the cTabButtonHeight of stack "revPreferences" into tHeight
exit switch
case "menu pullDown"
case "menu popUp"
case "menu option"
case "menu combobox"
case "menu item"
put the cMenuWidth of stack "revPreferences" into tWidth
put the cMenuHeight of stack "revPreferences" into tHeight
exit switch
case "field field"
put the cLabelFieldWidth of stack "revPreferences" into tWidth
put the cLabelFieldHeight of stack "revPreferences" into tHeight
break
case "scrolling"
case "table"
case "list"
case "scrolling list"
put the cFieldWidth of stack "revPreferences" into tWidth
put the cFieldHeight of stack "revPreferences" into tHeight
exit switch
case "report object"
put the cButtonWidth of stack "revPreferences" into tWidth
put the cButtonHeight of stack "revPreferences" into tHeight
exit switch
case "label"
put the cLabelFieldWidth of stack "revPreferences" into tWidth
put the cLabelFieldHeight of stack "revPreferences" into tHeight
break
case "scrollbar"
if the platform is "MacOS" then
put the cMacOSScrollbarWidth of stack "revPreferences" into tWidth
put the cMacOSScrollbarHeight of stack "revPreferences" into tHeight
else
put the cScrollbarwidth of stack "revPreferences" into tWidth
put the cScrollbarHeight of stack "revPreferences" into tHeight
end if
exit switch
case "progress"
if the platform is "MacOS" then
put the cMacOSProgressScrollbarWidth of stack "revPreferences" into tWidth
put the cMacOSProgressScrollbarHeight of stack "revPreferences" into tHeight
else
put the cScrollbarwidth of stack "revPreferences" into tWidth
put the cScrollbarHeight of stack "revPreferences" into tHeight
end if
exit switch
case "small"
put 15 into tWidth
put 23 into tHeight
exit switch
case "scale"
if the platform is "MacOS" then
put the cMacOSScrollbarWidth of stack "revPreferences" into tWidth
put 38 into tHeight
else
put the cScrollbarwidth of stack "revPreferences" into tWidth
put 38 into tHeight
end if
exit switch
case "scale value"
if the platform is "MacOS" then
put the cMacOSScrollbarWidth of stack "revPreferences" into tWidth
put 38 into tHeight
else
put the cScrollbarwidth of stack "revPreferences" into tWidth
put 38 into tHeight
end if
exit switch
case "player"
put 306 into tWidth -- the cREVPlayerWidth of stack "revPreferences" into tWidth
put 260 into tHeight -- the cREVPlayerHeight of stack "revPreferences" into tHeight
break
case "image"
put the cREVImageWidth of stack "revPreferences" into tWidth
put the cREVImageHeight of stack "revPreferences" into tHeight
break
end switch
return tWidth, tHeight
end objectSize
on revCreateObject tShortName, tDefaultStack, pCreateAtLoc
global gREVStackStatus
set the defaultStack to tDefaultStack
if pCreateAtLoc is empty then
local tCreateAtLoc
put the mouseLoc into tCreateAtLoc
else
put pCreateAtLoc into tCreateAtLoc
end if
reset the templateButton
reset the templateField
set the opaque of the templateGraphic to true
reset the templateScrollBar
reset the templateImage
-- OK-2007-11-30 : Bug 5391
reset the templatePlayer
send "revNewObjectName" to btn "revBackScript" of stack "revLibrary"
set the width of the templateButton to the cButtonWidth of stack "revPreferences"
set the height of the templateButton to the cButtonHeight of stack "revPreferences"
switch tShortName
case "button"
if the revButtonStyle of the target is "blank" then
set the showName of the templateButton to false
set the traversalOn of the templateButton to false
set the hiliteBorder of the templateButton to false
set the sharedHilite of the templateButton to false
set the hiliteFill of the templateButton to false
set the showBorder of the templateButton to false
set the threeD of the templateButton to false
else
set the style of the templateButton to the revButtonStyle of the target
end if
-- OK-2006-09-19: Test fix for bug 3497
set the traversalOn of the templateButton to false
set the autoArm of the templateButton to false
set the name of the templateButton to "Button"
set the defaultStack to tDefaultStack
set the loc of the templateButton to tCreateAtLoc
create btn
exit switch
case "default Button"
set the default of the templateButton to true
set the name of the templateButton to "Button"
set the defaultStack to tDefaultStack
set the loc of the templateButton to tCreateAtLoc
create btn
break
case "radiobutton"
set the style of the templateButton to "radiobutton"
set the hiliteBorder of the templateButton to false
set the name of the templateButton to "Radio"
set the defaultStack to tDefaultStack
set the loc of the templateButton to tCreateAtLoc
create btn
exit switch
case "checkbox"
set the style of the templateButton to "checkbox"
set the name of the templateButton to "Check"
set the hiliteBorder of the templateButton to false
set the defaultStack to tDefaultStack
set the loc of the templateButton to tCreateAtLoc
create btn
exit switch
case "menu tabbed"
set the style of the templateButton to "menu"
set the menuMode of the templateButton to "tabbed"
set the name of the templateButton to "Tab Menu"
set the width of the templateButton to the cTabButtonWidth of stack "revPreferences" - 16 --engine bug
set the height of the templateButton to the cTabButtonHeight of stack "revPreferences" - 16 --engine bug
set the text of the templateButton to "Tab 1" & cr & "Tab 2" & cr & "Tab 3"
set the showName of the templateButton to false
if the platform is "MacOS" and char 1 of the systemVersion is "1" then
set the textFont of the templateButton to "Lucida Grande"
set the textSize of the templateButton to 13
end if
set the defaultStack to tDefaultStack
set the loc of the templateButton to tCreateAtLoc
create btn
exit switch
case "menu pullDown"
set the style of the templateButton to "menu"
set the menuMode of the templateButton to "pulldown"
set the name of the templateButton to "Pulldown Menu"
set the width of the templateButton to the cMenuWidth of stack "revPreferences"
set the height of the templateButton to the cMenuHeight of stack "revPreferences"
set the autoHilite of the templateButton to false
set the traversalOn of the templateButton to false
set the armBorder of the templateButton to false
set the textAlign of the templateButton to "left"
set the defaultStack to tDefaultStack
set the loc of the templateButton to tCreateAtLoc
set the text of the templateButton to "Choice 1" & cr & "Choice 2" & cr & "Choice 3"
create btn
exit switch
case "menu popUp"
set the style of the templateButton to "menu"
set the menuMode of the templateButton to "popUp"
set the name of the templateButton to "PopUp Menu"
set the width of the templateButton to the cMenuWidth of stack "revPreferences"
set the height of the templateButton to the cMenuHeight of stack "revPreferences"
set the defaultStack to tDefaultStack
set the loc of the templateButton to tCreateAtLoc
set the text of the templateButton to "Choice 1" & cr & "Choice 2" & cr & "Choice 3"
create btn
exit switch
case "menu option"
set the style of the templateButton to "menu"
set the menuMode of the templateButton to "option"
set the name of the templateButton to "Option Menu"
set the width of the templateButton to the cMenuWidth of stack "revPreferences"
set the height of the templateButton to the cMenuHeight of stack "revPreferences"
set the autoHilite of the templateButton to false
set the armBorder of the templateButton to false
set the traversalOn of the templateButton to false
set the defaultStack to tDefaultStack
set the loc of the templateButton to tCreateAtLoc
set the text of the templateButton to "Choice 1" & cr & "Choice 2" & cr & "Choice 3"
create btn
exit switch
case "menu combobox"
set the style of the templateButton to "menu"
set the menuMode of the templateButton to "combobox"
set the name of the templateButton to "ComboBox Menu"
set the width of the templateButton to the cMenuWidth of stack "revPreferences"
set the height of the templateButton to the cMenuHeight of stack "revPreferences"
set the autoHilite of the templateButton to false
set the armBorder of the templateButton to false
set the traversalOn of the templateButton to true
set the defaultStack to tDefaultStack
set the loc of the templateButton to tCreateAtLoc
set the text of the templateButton to "Choice 1" & cr & "Choice 2" & cr & "Choice 3"
create btn
exit switch
case "menu item"
if the cREVMenuItemType of btn "button menu item" of stack "revTools" is "Menu Item" then set the style of the templateButton to "standard"
else
set the style of the templateButton to "menu"
set the menuMode of the templateButton to "cascade"
end if
set the name of the templateButton to "Menu Item"
set the width of the templateButton to the cMenuWidth of stack "revPreferences"
set the height of the templateButton to the cMenuHeight of stack "revPreferences"
set the showBorder of the templateButton to false
set the autoHilite of the templateButton to false
set the autoArm of the templateButton to true
set the textAlign of the templateButton to "left"
set the defaultStack to tDefaultStack
set the loc of the templateButton to tCreateAtLoc
create btn
exit switch
case "field field"
set the loc of the templateField to tCreateAtLoc
set the name of the templateField to "Field"
set the width of the templateField to the cLabelFieldWidth of stack "revPreferences"
set the height of the templateField to the cLabelFieldHeight of stack "revPreferences"
set the defaultStack to tDefaultStack
create field
break
case "scrolling"
set the style of the templateField to "scrolling"
set the name of the templateField to "Field"
set the width of the templateField to the cFieldWidth of stack "revPreferences"
set the height of the templateField to the cFieldHeight of stack "revPreferences"
set the loc of the templateField to tCreateAtLoc
set the defaultStack to tDefaultStack
create fld
exit switch
case "table"
set the style of the templateField to "scrolling"
set the hGrid of the templateField to true
set the vGrid of the templateField to true
set the tabStops of the templateField to 75
set the lockText of the templateField to true
set the name of the templateField to "Table Field"
set the width of the templateField to the cFieldWidth of stack "revPreferences"
set the height of the templateField to the cFieldHeight of stack "revPreferences"
set the loc of the templateField to tCreateAtLoc
set the defaultStack to tDefaultStack
create fld
set the cREVGeneral["table"] of last fld to true
set the cREVTable["celledit"] of last fld to true
exit switch
case "list"
set the listBehavior of the templateField to true
set the name of the templateField to "List Field"
set the sharedText of the templateField to true
set the dontWrap of the templateField to true
set the lockText of the templateField to true
set the width of the templateField to the cFieldWidth of stack "revPreferences"
set the height of the templateField to the cFieldHeight of stack "revPreferences"
set the defaultStack to tDefaultStack
set the loc of the templateField to tCreateAtLoc
set the text of the templateField to "Choice 1" & cr & "Choice 2" & cr & "Choice 3"
create fld
exit switch
case "scrolling list"
set the style of the templateField to "scrolling"
set the name of the templateField to "Scrolling List Field"
set the dontWrap of the templateField to true
set the sharedText of the templateField to true
set the listBehavior of the templateField to true
set the defaultStack to tDefaultStack
set the width of the templateField to the cFieldWidth of stack "revPreferences"
set the height of the templateField to the cFieldHeight of stack "revPreferences"
set the lockText of the templateField to true
set the loc of the templateField to tCreateAtLoc
set the text of the templateField to "Choice 1" & cr & "Choice 2" & cr & "Choice 3"
create fld
exit switch
case "report object"
set the name of the templateField to "Report Object"
set the showName of the templateButton to false
set the traversalOn of the templateButton to false
set the hiliteBorder of the templateButton to false
set the sharedHilite of the templateButton to false
set the hiliteFill of the templateButton to false
set the showBorder of the templateButton to false
set the threeD of the templateButton to false
set the width of the templateField to the cFieldWidth of stack "revPreferences"
set the height of the templateField to the cFieldHeight of stack "revPreferences"
set the cREVGeneral["viewerobject"] of the templateButton to true
set the width of the templateButton to the cButtonWidth of stack "revPreferences"
set the height of the templateButton to the cButtonHeight of stack "revPreferences"
set the defaultStack to tDefaultStack
set the loc of the templateButton to tCreateAtLoc
create btn
exit switch
case "placeholder"
exit switch
case "label"
set the name of the templateField to "Label Field"
set the textAlign of the templateField to right
set the lockText of the templateField to true
set the sharedText of the templateField to true
set the dontWrap of the templateField to true
set the showBorder of the templateField to false
set the opaque of the templateField to false
set the traversalOn of the templateField to false
set the autoHilite of the templateField to false
set the text of the templateField to "Label:"
set the width of the templateField to the cLabelFieldWidth of stack "revPreferences"
set the height of the templateField to the cLabelFieldHeight of stack "revPreferences"
set the defaultStack to tDefaultStack
set the loc of the templateField to tCreateAtLoc
create fld
break
case "scrollbar"
set the name of the templateScrollbar to "Scrollbar"
set the style of the templateScrollbar to "scrollbar"
if the platform is "MacOS" then
set the width of the templateScrollbar to the cMacOSScrollbarWidth of stack "revPreferences"
set the height of the templateScrollbar to the cMacOSScrollbarHeight of stack "revPreferences"
else
set the width of the templateScrollbar to the cScrollbarwidth of stack "revPreferences"
set the height of the templateScrollbar to the cScrollbarHeight of stack "revPreferences"
end if
set the defaultStack to tDefaultStack
set the loc of the templateScrollBar to tCreateAtLoc
create sb
exit switch
case "progress"
set the style of the templateScrollbar to "progress"
set the name of the templateScrollbar to "Progress Scrollbar"
if the platform is "MacOS" then
set the width of the templateScrollbar to the cMacOSProgressScrollbarWidth of stack "revPreferences"
set the height of the templateScrollbar to the cMacOSProgressScrollbarHeight of stack "revPreferences"
else
set the width of the templateScrollbar to the cScrollbarwidth of stack "revPreferences"
set the height of the templateScrollbar to the cScrollbarHeight of stack "revPreferences"
end if
set the defaultStack to tDefaultStack
set the loc of the templateScrollBar to tCreateAtLoc
set the thumbPosition of the templateScrollbar to the endValue of the templateScrollbar div 5
create sb
exit switch
case "small"
set the name of the templateScrollbar to "Scrollbar"
set the style of the templateScrollbar to "scrollbar"
set the width of the templateScrollBar to 15
set the height of the templateScrollBar to 23
set the defaultStack to tDefaultStack
set the loc of the templateScrollBar to tCreateAtLoc
create sb
exit switch
case "scale"
set the style of the templateScrollbar to "scale"
set the name of the templateScrollbar to "Scale Scrollbar"
--set the startValue of the templateScrollbar to 1
--set the endValue of the templateScrollbar to 100
--set the thumbSize of the templateScrollbar to 1
if the platform is "MacOS" then
set the width of the templateScrollbar to the cMacOSScrollbarWidth of stack "revPreferences"
set the height of the templateScrollbar to 38
else
set the width of the templateScrollbar to the cScrollbarwidth of stack "revPreferences"
set the height of the templateScrollbar to 38
end if
set the defaultStack to tDefaultStack
set the loc of the templateScrollBar to tCreateAtLoc
create sb
exit switch
case "scale value"
set the style of the templateScrollbar to "scale"
set the name of the templateScrollbar to "Scrollbar"
set the startValue of the templateScrollbar to 1
set the endValue of the templateScrollbar to 100
set the thumbSize of the templateScrollbar to 1
if the platform is "MacOS" then
set the width of the templateScrollbar to the cMacOSScrollbarWidth of stack "revPreferences"
set the height of the templateScrollbar to 38
else
set the width of the templateScrollbar to the cScrollbarwidth of stack "revPreferences"
set the height of the templateScrollbar to 38
end if
set the showValue of the templateScrollbar to true
set the defaultStack to tDefaultStack
set the loc of the templateScrollBar to tCreateAtLoc
create sb
exit switch
case "rectangle"
set the style of the templateGraphic to "rectangle"
set the name of the templateGraphic to "Rectangle"
set the defaultStack to tDefaultStack
set the loc of the templateGraphic to tCreateAtLoc
create graphic
exit switch
case "oval"
set the style of the templateGraphic to "oval"
set the name of the templateGraphic to "Oval"
set the defaultStack to tDefaultStack
set the loc of the templateGraphic to tCreateAtLoc
create graphic
exit switch
case "curve"
set the style of the templateGraphic to "curve"
set the name of the templateGraphic to "Curve"
set the defaultStack to tDefaultStack
set the loc of the templateGraphic to tCreateAtLoc
create graphic
exit switch
case "round rect"
set the style of the templateGraphic to "roundRect"
set the name of the templateGraphic to "Round Rectangle"
set the defaultStack to tDefaultStack
set the loc of the templateGraphic to tCreateAtLoc
create graphic
exit switch
case "polygon"
set the style of the templateGraphic to "polygon"
set the name of the templateGraphic to "Polygon"
set the defaultStack to tDefaultStack
set the loc of the templateGraphic to tCreateAtLoc
create graphic
exit switch
case "reg poly"
set the style of the templateGraphic to "regular"
set the name of the templateGraphic to "Regular Polygon"
set the polySides of the templateGraphic to the cPolySides of btn "graphic reg poly"
set the defaultStack to tDefaultStack
set the loc of the templateGraphic to tCreateAtLoc
create graphic
exit switch
case "line"
set the style of the templateGraphic to "line"
set the name of the templateGraphic to "Line"
set the defaultStack to tDefaultStack
set the loc of the templateGraphic to tCreateAtLoc
create graphic
exit switch
case "player"
set the name of the templatePlayer to "Player"
set the defaultStack to tDefaultStack
set the width of the templatePlayer to the cREVPlayerWidth of stack "revPreferences"
set the height of the templatePlayer to the cREVPlayerHeight of stack "revPreferences"
set the loc of the templatePlayer to tCreateAtLoc
set the fileName of the templatePlayer to revEnvironmentResourcesPath() & slash & "Sample.mov"
set the showController of the templatePlayer to true
create player
break
case "image"
set the name of the templateImage to "Image"
set the showBorder of the templateImage to true
set the threeD of the templateImage to false
set the borderWidth of the templateImage to 1
set the defaultStack to tDefaultStack
set the width of the templateImage to the cREVImageWidth of stack "revPreferences"
set the height of the templateImage to the cREVImageHeight of stack "revPreferences"
set the loc of the templateImage to tCreateAtLoc
create image
break
end switch
reset the templateButton
reset the templateField
reset the templateScrollbar
reset the templateGraphic
reset the templateImage
reset the templatePlayer
if char 1 to 3 of the short name of this stack is not "rev" then put "edited" into gREVStackStatus[the short name of this stack]
end revCreateObject
# TH-2008-01-15 : Bug fix 4962 to prevent controls being dropped on stacks behind other stacks.
# Parameters
# pStacks : return delimited list of open stacks, with each item being <rect> tab <validDropTarget> tab <name>
# pHorizontal : The horizontal mouse position
# pVertical : The vertical mouse position
# Description
# Returns two values, line 1 of return value is whether or not the current mouse location is a valid place to drop an object,
# line 2 is which line number of pStacks that contains the stack that the object will be dropped onto.
private function validDropLocation pStacks, pHorizontal, pVertical
local tValid, tLineNumber
put 0 into tLineNumber
local tRect
repeat for each line tStack in pStacks
add 1 to tLineNumber
put word 1 of tStack into tRect
if pHorizontal > item 1 of tRect and pHorizontal < item 3 of tRect and pVertical > item 2 of tRect and pVertical < item 4 of tRect then
if word 2 of tStack is "valid" then
put "true" into tValid
exit repeat
else if word 2 of tStack is "invalid" then
put "false" into tValid
exit repeat
end if
end if
end repeat
return (tValid & return & tLineNumber)
end validDropLocation
( , . 0 ColorValue x $ Qlocal lRevertValue on openField put target into lRevertValue end openField on closeField try set backColor of whichCollectorHasFocus() to me --C sendColorToRevTools(me) -- C catch tError answer "This is not a correct color value!" titled "Error" put lRevertValue into target end try end closeField @ + F K cREVTable currentvscroll 0formattedview 83,141,203 viewablerows 2currentxmouseloc 57currenthscroll 0currentymouseloc 28scrollbarwidth 16 cellyspacing 10viewablecolumns 1rightfieldloc 75numbertabstops 1 cellxspacing 75 leftfieldloc 5topfieldloc 33currentview83,141,203
bottomfieldloc 50 cREVGeometry Master,scalebottomDistance Master,expectedRect 6,31,76,46Master,movevDistance falseMaster,movehDistance falseMaster,dontClipText falseMaster trueMaster,scalerightDistance Master,cardRanking 0Master,scaletopDistance Master,scaleleftDistance cREVGeneral table falserevUniqueID 1261437445536scripteditorvscroll 0scripteditorselection 0 96,170,51 ChooseColorFormat bê on menuPick pItemName put displayColorValue(backcolor of whichCollectorHasFocus(),pItemName) into fld "ColorValue" end menuPick M 9 , RGB Web cREVGeneral revUniqueID 1261777396987scripteditorvscroll 0scripteditorselection 0 ThePicker P Eon mouseUp pButtonNumber PickColor pButtonNumber --C end mouseUp PNG IHDR gAMA =-f IDATHՖKq_{̉`ɝV$S&RaXyX4 !k2iP=<Z7Z#k .`1R\-|߯<! %$@W@ @UU677F6E$:;;q\Y\xQvsΕ```IV+sssF:::HR!d2x~q4` dH$B,ٜk,'Fhkkf:aۅn&IXV133-GHb!Ja2XYY!"2044U7yXeH@OO_Ens:#a8dV/:qrA.-F( `4"-Jlf]C4z;! ';)qz#jKUa=/t v _@E:P[i@";[9Syt,S r?1C[I'!$Zhka <Z8l- `##sf!MEHՒstdto #'R;Ut4__'EW L?xC~~_@6}qߝ]ث>3r IENDB` cREVGeneral scripteditorvscroll 0revUniqueID 1263060077225scripteditorselection 37 ColorPickerGrp i3@constant kDraggableObjectPattern = "image,button,graphic,field,group" local lBorderStack, lDragFromStack, lMoveColorGrpFlag, lDragNDropColor on mouseDown pButtonNumber local tWichObject, tWidth, tHeight if (pButtonNumber = 1) then -- On left click : select the color in the picker and apply it to the rev tools palette setFocus the long id of the target put backColor of the target into lDragNDropColor if (lDragNDropColor is not empty) then sendColorToRevTools lDragNDropColor --C end if else -- On right click, remove the color for one of the color collector control set backColor of the target to empty put empty into fld "ColorValue" end if select empty -- Remove focus in the color value field if (pButtonNumber <> 1) then exit mouseDown -- Drag only on mouse left if (the ctrlKey is down) then -- Choose bg or border color (move a button in the group) put the target into tWichObject put false into lMoveColorGrpFlag else -- Choose bg & border colors (move the group) put backColor of grc "bgColor" of me into lDragNDropColor put me into tWichObject put true into lMoveColorGrpFlag end if lock messages if not (checkForMovement(the screenMouseLoc, 8)) then exit mouseDown -- Check if the user move a drag&drop control (the bg or the text color or both) put globalLoc(the loc of tWichObject) into tDragNDropLoc put the short name of this stack into lDragFromStack -- Store the name of the color picker stack -- Storing target dimension put width of tWichObject into tWidth put height of tWichObject into tHeight put listOfCheckedStacks("pickerDragControl", lDragFromStack) into tAllstacks -- Get the list of checked stacks (top stacks are valid, locked stack are invalid) createStackByTemplate "pickerDragControl", lDragFromStack, lDragNDropColor, tWidth, tHeight, tDragNDropLoc, lMoveColorGrpFlag -- Drag & Drop stack put empty into lBorderStack startToDragAndDrop tAllStacks, empty end mouseDown command startToDragAndDrop pAllStacks, pAllCtrls local tTargetStack, tLineNo, tValid, tMatch, tBorderColorPref put the cColorPickerPrefs["borderColor"] of stack "ASG_ColorPicker_Infos" into tBorderColorPref -- Move the control according to the mouseLoc set the defaultStack to pickerDragControl set the loc of this stack to the screenMouseLoc -- global coordinates put validDropLocation(pAllStacks, the screenMouseLoc) into tValid put line 1 of tValid into tMatch put line 2 of tValid into tLineNo if tMatch then -- The mouse is enter in a checked stack put getObjectProperty(3,pAllStacks,tLineNo) into tTargetStack if (lBorderStack <> tTargetStack) then -- The current stack has changed ? -- Remove the border effect for the previous valid stack removeBorder "pickerTempBorderCtrl", lBorderStack -- Read the list of controls in the new focus stack set the defaultStack to tTargetStack put listOfCheckedCtrl(tTargetStack, kDraggableObjectPattern, lDragFromStack) into pAllCtrls set the defaultStack to pickerDragControl put tTargetStack into lBorderStack end if -- Read the focus control of the focus stack put validDropLocation(pAllCtrls, the screenMouseLoc) into tValid put line 1 of tValid into tMatch put line 2 of tValid into tLineNoCtrl if tMatch then if (tCurrentCursor is not 32) then lock cursor set cursor to 32 put 32 into tCurrentCursor end if -- Prevent an odd error that I've already seen. Maybe corrected by the last release put getObjectProperty(4,pAllCtrls,tLineNoCtrl) into tTheControl try get the rect of tTheControl -- control getObjectProperty(3,pAllCtrls,tLineNoCtrl) of stack lBorderStack catch tTheError answer "An error occurs. Report this bug to the Slug"&cr&tTheError exit to top end try -- if (there is no grc "pickerTempBorderCtrl" of stack lBorderStack) then createBorderByTemplate lBorderStack, it, "pickerTempBorderCtrl", tBorderColorPref, 1 -- the hiliteColor ? #TODO set the defaultStack to "pickerDragControl" else set rect of grc "pickerTempBorderCtrl" of stack lBorderStack to it end if else -- An invalid control has the focus if (tCurrentCursor is not "arrow") then set cursor to arrow put "arrow" into tCurrentCursor unlock cursor removeBorder "pickerTempBorderCtrl", lBorderStack end if else -- The cursor pass from a valid stack to an invalid stack -- > Remove the border effect in the previous valid stack put empty into tTargetStack removeBorder "pickerTempBorderCtrl", lBorderStack end if if (the mouse is up) then -- end of the move set cursor to arrow if (there is a stack "pickerDragControl") then delete stack "pickerDragControl" ## Restart the mouseWithin scan if (",scanForMouseWithin," is not in the pendingMessages) then send "scanForMouseWithin" to me in 80 milliseconds end if if (tTargetStack is not empty) then -- A checked stack is selected if (tTheControl is not empty) then -- A ctrl is selected changeCtrlColor lMoveColorGrpFlag, tTheControl else set backColor of stack tTargetStack to lDragNDropColor -- No control is selected but a valid stack has the focus -> change the bg color of the valid stack end if end if removeBorder "pickerTempBorderCtrl", tTargetStack -- Remove the color effect from the stack set the defaultStack to lDragFromStack select empty -- Remove focus from the color value field unlock messages else send "startToDragAndDrop pAllStacks, pAllCtrls" to me in 100 milliseconds end if end startToDragAndDrop command changeCtrlColor pChangeAllColors, pTheControl # Apply the color(s) to the selected control local tColorCollector if (pChangeAllColors) then set the backColor of pTheControl to the backColor of grc "bgColor" of me set the textColor of pTheControl to the backColor of grc "borderColor" of me else put whichCollectorHasFocus() into tColorCollector if (the short name of tColorCollector is "bgColor") then set the backColor of pTheControl to the backColor of tColorCollector else set the textColor of pTheControl to the backColor of tColorCollector end if end if end changeCtrlColor function checkForMovement pStartLoc, pStep local tNowLoc repeat -- check for some movement before drag put the screenMouseLoc into tNowLoc if (abs(item 1 of tNowLoc - item 1 of pStartLoc) < pStep) then if (the mouse is up) then return false exit repeat end if next repeat else return true exit repeat end if end repeat end checkForMovement function listOfCheckedStacks pDragCtrlName, pDragFromStack # List the droppable open stacks local tOpenStacks, tStack, tAllstacks put the openStacks into tOpenStacks repeat for each line tStack in tOpenStacks if (the short name of stack tStack is pDragCtrlName) then next repeat -- Excluded the stack used to manage the drag&drop effect put the rect of stack tStack & tab & checkForValidStack(tStack, pDragFromStack) & tab & tStack & return after tAllstacks end repeat return tAllstacks end listOfCheckedStacks function listOfCheckedCtrl pBorderStack, pFilterList, pDragFromStack # List the droppable controls local tControl, tAllCtrls put "" into tAllCtrls repeat with tControl = number of controls of stack pBorderStack down to 1 -- Manage layers. Start to the upper control down to the first. get the long name of control tControl of stack pBorderStack if ((word 1 of it is among the items pFilterList) and ("of group" is not in it)) then put globalRect(the rect of control tControl of stack pBorderStack) & tab & "valid" & tab & tControl & tab & long id of control tControl of stack pBorderStack & return after tAllCtrls end if end repeat return tAllCtrls end listOfCheckedCtrl function globalRect pTheRect return globalLoc(item 1 to 2 of pTheRect), globalLoc(item 3 to 4 of pTheRect) end globalRect private function validDropLocation pOjectsList, pLoc # Portion of RunRev. Returns infos about objects (the rect, is it droppable ?) local tValidValue, tValidFlag, tLineNumber, tRect repeat with tLineNumber = 1 to number of lines of pOjectsList put getObjectProperty(1, pOjectsList, tLineNumber) into tRect put getObjectProperty(2, pOjectsList, tLineNumber) into tValidValue if (pLoc is within tRect) then put (tValidValue = "valid") into tValidFlag exit repeat else put false into tValidFlag end if end repeat return (tValidFlag & return & tLineNumber) end validDropLocation function getObjectProperty pPropertyNumber, pStacksList, pLineNumber set the itemDelimiter to tab return item pPropertyNumber of line pLineNumber of pStacksList set the itemDelimiter to comma end getObjectProperty function checkForValidStack pStackRef, pDragFromStack if ((the short name of stack pStackRef is not pDragFromStack) and (the visible of stack pStackRef) and (not the cantModify of stack pStackRef) and (the mode of stack pStackRef is 1)) then return "valid" else return "invalid" end if end checkForValidStack command createStackByTemplate pTemplateName, pDragFromStack, pDragNDropColor, pWidth, pHeight, pDragNDropLoc, pSnapShotFlag ## Create the stack to simulate the move of an object (could be the border color rectangle, the background color rectangle ## or the color group itself reset the templateStack -- Create a stack to simulate the drag and drop on an object between two stacks -- Template set the name of the templateStack to pTemplateName set the visible of the templateStack to false -- set the backColor of the templateStack to pDragNDropColor set the decorations of the templateStack to "noShadow" set the style of the templateStack to "palette" -- if (the cWindowShape of the target is not empty) then set the windowShape of the templateStack to the cWindowShape of the target set the blendLevel of the templateStack to 25 -- Stack create stack reset the templateStack set the defaultStack to pTemplateName set the backColor of this stack to pDragNDropColor set the loc of this stack to pDragNDropLoc set the minWidth of this stack to pWidth set the minHeight of this stack to pHeight set the width of this stack to pWidth set the height of this stack to pHeight -- If bg and text colors are both moved, creation of the snapshot of the colors group if pSnapShotFlag then createImageStackByTemplate the long id of grp "ColorPickerGrp" of stack pDragFromStack-- end if close stack pTemplateName show this stack go stack pTemplateName end createStackByTemplate command createImageStackByTemplate pTheGroup # Create a snapshot of the group, use it as windowshape and display it in the shape reset templateImage set the visible of the templateImage to true set the alwaysBuffer of the templateImage to true import snapShot from pTheGroup reset templateImage set the windowShape of this stack to id of image 1 of this stack end createImageStackByTemplate command createBorderByTemplate pBorderStack, pTheRectObject, pRectName, pBorderColor, pBorderSize # Create the control border rectangle local tLineSize, tForeColor, tFilled, tName set the rect of the templateGraphic to pTheRectObject put the lineSize of the templateGraphic into tLineSize set the lineSize of the templateGraphic to pBorderSize put the foreColor of the templateGraphic into tForeColor set the foreColor of the templateGraphic to pBorderColor put the filled of the templateGraphic into tFilled set the filled of the templateGraphic to false put the short name of the templateGraphic into tName set the name of the templateGraphic to pRectName set the defaultStack to pBorderStack create grc set the lineSize of the templateGraphic to tLineSize set the foreColor of the templateGraphic to tForeColor set the filled of the templateGraphic to tFilled set the name of the templateGraphic to tName end createBorderByTemplate command removeBorder pBorderName, pBorderStack # Remove the border rect in a stack if (there is a grc pBorderName of stack pBorderStack) then delete grc pBorderName of stack pBorderStack end removeBorder % &