Changeset 215 for trunk/lingosource
- Timestamp:
- 12/15/08 13:00:15 (3 years ago)
- Location:
- trunk/lingosource
- Files:
-
- 15 edited
-
castlib1/OSCmenu_Handlers.ls (modified) (1 diff)
-
castlib1/OSCmenu_Utilities.ls (modified) (1 diff)
-
castlib1/alexUtilities.ls (modified) (20 diffs)
-
castlib1/bbedit_Utilities.ls (modified) (2 diffs)
-
castlib1/convert_Lingo_2_CSS_Html.ls (modified) (1 diff)
-
castlib1/custom_Utilities.ls (modified) (2 diffs)
-
castlib1/doCommandMovieScript.ls (modified) (1 diff)
-
castlib1/keyboardNavigation_FrameLoop.ls (modified) (2 diffs)
-
castlib1/memberInfo.xml (modified) (3 diffs)
-
castlib1/simpleBMMenu.ls (modified) (2 diffs)
-
castlib1/subversion_version_field.txt (modified) (1 diff)
-
castlib1/svn_Utilities.ls (modified) (3 diffs)
-
castlib1/thisMoviesScript.ls (modified) (5 diffs)
-
castlib2/PseudoXMLPS.ls (modified) (2 diffs)
-
castlib2/commonMovieScript.ls (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/lingosource/castlib1/OSCmenu_Handlers.ls
r180 r215 1 -- OSCmenu_Handlers 2 ----------------------------------- 3 -- PROPERTIES: 4 --!memberProperties: [#name: "OSCmenu_Handlers", #scripttype: #score, #scriptSyntax: #lingo, #comments: ""] 5 -- 6 -- DESCRIPTION: 7 -- This script handles the parsing and handling of the menu with 8 -- all handlers of the current stage movie 9 -- 10 -- REQUIRES: 11 -- script "aleXtrasMovieScript" as provider for library scripts -> xscr() 12 -- script "commonMovieScript" -- standard handlers 13 -- 14 -- USAGE: 15 -- behavior which is either on the OSC control menu member 16 -- (in case of using OSC for the menu display) 17 -- or an invisible shape mmember 18 -- (in case of using buddyMenu to display the menu) 19 -- Accordingto the type of the sprite.member the corresponding xtra is used 20 ----------------------------------- 21 1 22 property pCurrentHandlerList 2 23 property pCallerSprite -
trunk/lingosource/castlib1/OSCmenu_Utilities.ls
r198 r215 1 -- OSCmenu_Utilities 2 ----------------------------------- 3 -- CREATED: 4 -- 14.12.2008 5 -- 6 -- DESCRIPTION: 7 -- This Script defines the contents of the Utilities menu 8 -- the handler mShowOSCMenu builds a list with menu entries and corresponding handler calls 9 -- there are two lists: 10 -- one hierarchical list with only the menu items text 11 -- and one flat property list which acts as lookup list for each item 12 -- The lookup list "translates" the text of a menu entry to the corresponding function 13 -- and "knows" in which scriptmember that function can be found 14 -- so the syntax is: 15 -- ["Menu title": ["function name with paramters", "name of the scriptmember to instantiate"]] 16 -- 17 -- REQUIRES: 18 -- script "aleXtrasMovieScript" as provider for library scripts -> xscr() 19 -- script "commonMovieScript" to get the globallist -> mGetGlobalList 20 -- 21 -- USAGE: 22 -- 23 ----------------------------------- 24 1 25 property pCallerSprite 2 26 property pCallBackParams -
trunk/lingosource/castlib1/alexUtilities.ls
r202 r215 1 -- Some of my Authoring Utility Handlers -- ©06 Alex da Franca -- alex@farbflash.de 2 ----------------------------------------------------------------------------------- 1 -- alexUtilities 2 ----------------------------------- 3 -- CREATED: 4 -- 14.12.2008 5 -- PROPERTIES: 6 --!memberProperties: [#name: "alexUtilities", #scripttype: #parent, #scriptSyntax: #lingo, #comments: "~/Documents/Scripts/lingo/commonMovieScript.ls"] 7 -- 8 -- DESCRIPTION: 9 -- Some of my Authoring Utility Handlers -- c06 Alex da Franca -- alex@farbflash.de 10 -- 11 -- REQUIRES: 12 -- script "PseudoXMLPS" -> parse xml 13 -- although it does not really REQUIRE shell xtra and buddyApi xtra 14 -- still much of the functionality will gracefully fail, if those are not present 15 -- In order to export images, the sharp image exporter is required 16 -- if missing those functions fail gracefully 17 -- 18 -- USAGE: 19 -- This script is instantiated and used in the "tell the stage" block and one of the functions 20 -- which are defined in script "OSCmenu_Utilities" and which was selected by the user 21 -- will be executed in "stage scope". That means, that references are made form within the stage context 22 -- e.g. member("foo") will refer to a member in one of the stages castlibs 23 -- sprite(x) will refere to sprite(x) in the stages score and so on 24 -- 25 -- Please see the descriptions of many of those handlers at: http://www.farbflash.org/trac/HandlerMenu/wiki/utilityHandlers 26 -- (Although I started to comment each handler, I didn't reach far until now...) 27 ----------------------------------- 3 28 4 29 property ancestor … … 14 39 on new me 15 40 ancestor = new(script "PseudoXMLPS") -- we need this script later 16 -- and as we may already be in the scope of the stage, we have it as ancestor17 41 -- and as we may already be in the scope of the stage, we use it as ancestor 42 -- because once in another scope, it will not be available as member 18 43 return me 19 44 end … … 24 49 25 50 on Authoring_ExchangeScriptListColorsToRGBs me 51 ----------------------------------- 52 -- ACTION: fix the score data which has #color instead of #rgb when authored with D10 53 -- which fails with the older player (AUTHORING ONLY!) 54 -- INPUT: - 55 -- RETURNS: - 56 ----------------------------------- 57 26 58 theLastFrame = the lastFrame 27 59 theLastChannel = the lastChannel … … 62 94 63 95 on mOpenContainingFolder me 96 ----------------------------------- 97 -- ACTION: Open the folder, where the current movie is inside in the Finder/Explorer 98 -- INPUT: - 99 -- RETURNS: - 100 ----------------------------------- 101 64 102 if length(the moviepath) < 1 then 65 103 alert "The movie must be saved first!" … … 78 116 79 117 on mReadXML_2_List me, pfad 118 ----------------------------------- 119 -- ACTION: Read xml text from file and parse into lingo list using pseudoXMLPS script 120 -- INPUT: <pfad> ; string ; full pathname ; optional => default "" => show file selection dialog 121 -- RETURNS: lingo list or property list ; [:] in case of invalid xml file 122 ----------------------------------- 123 80 124 theResult = [:] 81 125 dertext = mGetTextFromFile(me, pfad) … … 91 135 92 136 on mSaveList_2_XML me, theList, thePath 137 ----------------------------------- 138 -- ACTION: Convert a lingo list or property list to xml and write xml string to file 139 -- INPUT: <theList> ; #list or #proplist ; required 140 -- <thePath> ; string ; full pathname ; optional => default "" => show file save dialog 141 -- RETURNS: string => full pathname of newly created file or "", if user cancelled process 142 ----------------------------------- 143 93 144 if not(list(theList)) then 94 145 global gRetVal … … 111 162 112 163 on mGetTextFromFile me, pfad 164 ----------------------------------- 165 -- ACTION: Read contents of textfile 166 -- INPUT: <pfad> ; string ; full pathname ; optional => default "" => show file selection dialog 167 -- RETURNS: string => contents of textfile or "", if user cancelled process 168 ----------------------------------- 169 113 170 retval = "" 114 171 … … 141 198 142 199 on mSaveToTextFile me, theText, pfad, theTitle, theDefaultName, startfolder 200 ----------------------------------- 201 -- ACTION: Save text to textfile 202 -- INPUT: <theText> ; string ; string to save 203 -- <pfad> ; string ; full pathname ; optional => default "" => show file save dialog 204 -- <theTitle> ; string ; caption of the save dialog (if any => pfad == "") 205 -- <theDefaultName> ; string ; default filename provided in the save dialog (if any => pfad == "") 206 -- <startfolder> ; string ; startfolder of the save dialog (if any => pfad == "") 207 -- RETURNS: string => full pathname of newly created file or "", if user cancelled process 208 ----------------------------------- 209 210 143 211 retval = 0 144 212 … … 215 283 216 284 on mSaveTextToTempFile me, theText, pfad 285 ----------------------------------- 286 -- ACTION: Write text out to a temporary file 287 -- (helper for the bbdiff and svn handler) 288 -- INPUT: <theText> ; string ; string to save 289 -- <pfad> ; string ; full pathname ; optional => default "tmpfile.txt" in temporary files folder 290 -- RETURNS: string => full pathname of newly created file or "", if user cancelled process 291 ----------------------------------- 217 292 218 293 pfad = string(pfad) … … 231 306 232 307 on mAppendTextToFile me, theText, pfad 308 ----------------------------------- 309 -- ACTION: Write text out to a temporary file 310 -- (helper for the bbdiff and svn handler) 311 -- INPUT: <theText> ; string ; string to append to file <pfad> 312 -- <pfad> ; string ; full pathname ; optional => default "" => show file selection dialog 313 -- RETURNS: string => full pathname of newly created file or "", if user cancelled process 314 ----------------------------------- 315 233 316 retval = 0 234 317 … … 312 395 313 396 if length(theType) < 1 then 314 if offset(".", theDefaultName) > 1 then 315 theType = theDefaultName.char[offset(".", theDefaultName) + 1 .. length(theDefaultName)] 397 splitpath = mSplitPath(me, theDefaultName) 398 -- if offset(".", theDefaultName) > 1 then 399 -- theType = theDefaultName.char[offset(".", theDefaultName) + 1 .. length(theDefaultName)] 400 -- end if 401 if length(splitpath[#extension]) > 0 then 402 theType = splitpath[#extension] 403 delete char 1 of theType 316 404 end if 317 405 forceType = 0 … … 359 447 len = length(pfad) 360 448 if len < 1 then exit 361 basename = pfad 362 ext = "" 363 repeat with n = len down to 1 364 c = char n of pfad 365 if c = "." then exit repeat 366 put c before ext 367 if length(ext) > 4 then exit repeat 368 end repeat 369 if ["txt", "rtf", "htm", "html"].getPos(ext) > 0 then theType = ext 449 -- basename = pfad 450 -- ext = "" 451 -- repeat with n = len down to 1 452 -- c = char n of pfad 453 -- if c = "." then exit repeat 454 -- put c before ext 455 -- if length(ext) > 4 then exit repeat 456 -- end repeat 457 -- if ["txt", "rtf", "htm", "html"].getPos(ext) > 0 then theType = ext 458 splitpath = mSplitPath(me, pfad) 459 ext = splitpath[#extension] 460 if length(ext) > 0 then 461 if ".txt.rtf.htm.html" contains ext then 462 delete char 1 of ext 463 theType = ext 464 end if 465 end if 370 466 end if 371 467 … … 630 726 if (not(mac) and (theType = "pct")) then theType = "bmp" 631 727 632 theDot = offset(".", thePath) 633 if theDot then thePath = thePath.char[1 .. (theDot - 1)] 728 -- theDot = offset(".", thePath) 729 -- if theDot then thePath = thePath.char[1 .. (theDot - 1)] 730 splitpath = mSplitPath(me, thePath) 731 thePath = splitpath[#basedir] & splitpath[#basename] 634 732 635 733 if not(["jpg", "png", "bmp", "pct"].getPos(theType)) then exit … … 755 853 if (not(mac) and (theType = "pct")) then theType = "bmp" 756 854 757 -- ensure the right file extension: 758 theDot = offset(".", thePath) 759 if theDot = 0 then thePath = thePath&"."&theType 855 -- -- ensure the right file extension: 856 857 -- theDot = offset(".", thePath) 858 -- if theDot = 0 then thePath = thePath&"."&theType 859 860 splitpath = mSplitPath(me, thePath) 861 if length(splitpath[#extension]) < 1 then splitpath[#extension] = "." & theType 862 thePath = splitpath[#basedir] & splitpath[#basename] & splitpath[#extension] 863 760 864 -- else thePath = thePath.char[1 .. theDot]&theType 761 865 … … 2137 2241 mp = the moviepath 2138 2242 delim = the last char of mp 2139 od = the itemdelimiter 2140 the itemdelimiter = delim 2141 fname = the last item of pfad 2142 the itemdelimiter = od 2143 len = fname.length 2144 if fname.char[len - 3] = "." then 2145 fnameW = fname.char[1 .. len - 4] 2146 ext = fname.char[len - 2 .. len] 2147 else if fname.char[len - 4] = "." then 2148 fnameW = fname.char[1 .. len - 5] 2149 ext = fname.char[len - 3 .. len] 2150 else 2151 fnameW = fname 2152 ext = "" 2153 end if 2243 -- od = the itemdelimiter 2244 -- the itemdelimiter = delim 2245 -- fname = the last item of pfad 2246 -- the itemdelimiter = od 2247 -- len = fname.length 2248 -- if fname.char[len - 3] = "." then 2249 -- fnameW = fname.char[1 .. len - 4] 2250 -- ext = fname.char[len - 2 .. len] 2251 -- else if fname.char[len - 4] = "." then 2252 -- fnameW = fname.char[1 .. len - 5] 2253 -- ext = fname.char[len - 3 .. len] 2254 -- else 2255 -- fnameW = fname 2256 -- ext = "" 2257 -- end if 2258 splitpath = mSplitPath(me, pfad) 2259 fnameW = splitpath[#basename] 2260 ext = splitpath[#extension] 2261 fname = fnameW & ext 2262 if length(ext) > 0 then delete char 1 of ext 2154 2263 2155 2264 -- in case of field we always use the plain text: … … 2586 2695 RETURN & " -- CREATED:"&\ 2587 2696 RETURN & " -- <currentDate>"&\ 2697 RETURN & " -- PROPERTIES:"&\ 2698 RETURN & " --!memberProperties: [#name: ""E&"<scriptname>""E&", #scripttype: #<scripttype>, #scriptSyntax: #<scriptSyntax>, #comments: ""E&"<comments>""E&"]"&\ 2588 2699 RETURN & " --"&\ 2589 2700 RETURN & " -- DESCRIPTION:"&\ … … 2592 2703 RETURN & " -- REQUIRES:"&\ 2593 2704 RETURN & " -- (Prerequisites)"&\ 2594 RETURN & " --"&\2705 RETURN & " --"&\ 2595 2706 RETURN & " -- USAGE:"&\ 2596 2707 RETURN & " -- -"&\ … … 2662 2773 --------------------------------- for the current scriptname, which we only "know" here in this script 2663 2774 if replacePlaceHolder = 1 then 2664 placeholders = [["<currentDate>", the short date], ["<scriptname>", theMem.name] ]2775 placeholders = [["<currentDate>", the short date], ["<scriptname>", theMem.name], ["<scripttype>", theMem.scripttype], ["<scriptSyntax>", theMem.scriptSyntax], ["<comments>", theMem.comments]] 2665 2776 2666 2777 repeat with repl in placeholders … … 2901 3012 end 2902 3013 -- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 3014 3015 -- the following handlers are mostly duplicates from the script "commonMovieScript", 3016 -- because we are running in the scope of the stage here, we can not use it directly 3017 -- and therefore this script shall be completely self contained. 2903 3018 2904 3019 -- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx … … 3038 3153 return memref.type 3039 3154 end 3155 3156 -- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 3157 3158 -- split a path into its three elements => base directory, basename and extension: 3159 3160 on mSplitPath me, fname, delim -- delim optional: default = the systems pathdelimiter 3161 3162 olddelim = the itemdelimiter 3163 delim = string(delim) 3164 if length(delim) < 1 then 3165 delim = the last char of the moviepath 3166 if length(delim) < 1 then 3167 3168 if the runmode contains "plug" then 3169 delim = "/" 3170 else 3171 delim = the last char of the applicationpath 3172 end if 3173 3174 3175 if length(delim) < 1 then delim = "/" 3176 end if 3177 end if 3178 the itemdelimiter = delim 3179 dateiname = the last item of fname 3180 delete the last item of fname 3181 put delim after fname 3182 the itemdelimiter = olddelim 3183 3184 3185 len = length(dateiname) 3186 ext = "" 3187 until = max(1, len-8) -- let's pretend, that a file extension is not langer than 8 chars 3188 3189 repeat with n = len down to until 3190 this = dateiname.char[n] 3191 put this before ext 3192 delete char n of dateiname 3193 if this = "." then exit repeat 3194 end repeat 3195 3196 if char 1 of ext <> "." then -- no extension 3197 put ext after dateiname 3198 ext = "" 3199 end if 3200 3201 return [#basedir:fname, #basename:dateiname, #extension:ext] 3202 3203 end -
trunk/lingosource/castlib1/bbedit_Utilities.ls
r182 r215 1 -- bbedit_Utilities 2 ----------------------------------- 3 -- PROPERTIES: 4 --!memberProperties: [#name: "bbedit_Utilities", #scripttype: #parent, #scriptSyntax: #lingo, #comments: "~/Documents/Scripts/lingo/commonMovieScript.ls"] 5 -- 6 -- DESCRIPTION: 7 -- This script externalizes all functions which are related to the use of an external editor for script editing 8 -- It started as interface to BBEdit, hence the name, later I added support for arbitrary editors 9 -- as there is not BBEdit for windows. I tested with UltraEdit and Tortoise SVN for the merge/diff functionality 10 -- I'd appreciate any enhencements made for other external editors, but the above are the ones I use 11 -- and therefore I haven't tested against others 12 -- 13 -- REQUIRES: 14 -- script "alexUtilities" -> ancestor -> basic function provider 15 -- most functionality is provided through the shell xtra and buddyApi xtra 16 -- although it should fail gracefully, if those are not present 17 -- not much will work without them 18 -- 19 -- USAGE: 20 -- This script is instantiated and used in the "tell the stage" block and one of the functions 21 -- which are defined in script "OSCmenu_Utilities" and which was selected by the user 22 -- will be executed in "stage scope". That means, that references are made form within the stage context 23 -- e.g. member("foo") will refer to a member in one of the stages castlibs 24 -- sprite(x) will refere to sprite(x) in the stages score and so on 25 -- 26 -- Please see the descriptions of many of those handlers at: http://www.farbflash.org/trac/HandlerMenu/wiki/utilityHandlers 27 ----------------------------------- 28 1 29 property ancestor 2 30 … … 1486 1514 1487 1515 mn = the moviename 1488 offs = offset(".", mn) 1489 if offs > 0 then mn = mn.char[1 .. offs-1] 1490 1491 mSaveToTextFile me, str, "", "Save list of used linked scripts", mn & "_linkedScripts_List.txt" 1492 1493 end 1494 1516 -- offs = offset(".", mn) 1517 -- if offs > 0 then mn = mn.char[1 .. offs-1] 1518 1519 spl = mSplitPath(me, mn) 1520 1521 mSaveToTextFile me, str, "", "Save list of used linked scripts", spl[#basename] & "_linkedScripts_List.txt" 1522 1523 end 1524 -
trunk/lingosource/castlib1/convert_Lingo_2_CSS_Html.ls
r180 r215 1 -- Create HTML code from a lingo script 2 -- ©06 Alex da Franca -- alex@farbflash.de 3 4 5 -- Usage: 6 -- -- Copy the scripttext from a script editor 7 -- -- make a new #text member 8 -- -- open the new #textmember in the text editor 9 -- -- paste the contents of the clipboard (now the text member has the script text WITH the formatting) 10 -- -- use the below handler "mConvertCode2HTML" with the html of the textmember as argument to get a CSS html string 11 1 -- convert_Lingo_2_CSS_Html 2 ----------------------------------- 3 -- CREATED: 4 -- 2006 5 -- PROPERTIES: 6 --!memberProperties: [#name: "convert_Lingo_2_CSS_Html", #scripttype: #movie, #scriptSyntax: #lingo, #comments: "~/Documents/Scripts/lingo/convert_Lingo_2_CSS_Html.ls"] 7 -- 8 -- DESCRIPTION: 9 -- Create HTML code from a lingo script -- c06 Alex da Franca -- alex@farbflash.de 10 -- 11 -- REQUIRES: 12 -- xtra "pregex" for fast search and replace functionality 13 -- 14 -- USAGE: 15 -- Copy the scripttext from a script editor into the clipboard 16 -- make a new #text member 17 -- open the new #textmember in the text editor 18 -- paste the contents of the clipboard (now the text member has the script text WITH the formatting) 19 -- use the below handler "mConvertCode2HTML" with the html of the textmember as argument to get a CSS html string 20 ----------------------------------- 12 21 13 22 -- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 23 -- uses the selected #text member of the stage movie 14 24 15 25 on mCopyConvert2HTML -
trunk/lingosource/castlib1/custom_Utilities.ls
r180 r215 1 -- custom_Utilities 2 ----------------------------------- 3 -- PROPERTIES: 4 --!memberProperties: [#name: "custom_Utilities", #scripttype: #parent, #scriptSyntax: #lingo, #comments: "~/Documents/Scripts/lingo/commonMovieScript.ls"] 5 -- 6 -- DESCRIPTION: 7 -- you can use the utility handlers from script alexUtilities in this script, as it uses it as ancestor. 8 -- 9 -- REQUIRES: 10 -- script "alexUtilities" -> ancestor -> basic function provider 11 -- 12 -- USAGE: 13 -- define the handlers, which are provided in the Utilities menu and defined in script "OSCmenu_Utilities" 14 -- 15 -- 16 -- if you want to display a status for long calls (like my svn utilities do) 17 -- use: 18 -- me.mSwitchToStatusMode(1) -- to switch it on 19 -- me.mSwitchToStatusMode(0) -- to switch it off 20 -- and: 21 -- me.mDisplayWaitStatusText(aString) -- to display a status message 22 -- 23 -- 24 -- WARNINGS: 25 -- keep in mind, that you are in the scope of the stage, when these hadlers here are called! 26 -- so calling a script of this movie "Handlermenu" here is only possible, if you use a "tell" statement 27 -- use it like so: tell window(me.pHandlerMenuWindowName) to doSomething 28 ----------------------------------- 29 1 30 property ancestor 2 31 … … 5 34 return me 6 35 end 7 8 -- you can use the utility handlers from script alexUtilities in this script, as it uses it as ancestor.9 10 -- keep in mind, that you are in the scope of the stage, when these hadlers here are called!11 -- so calling a script of this movie "Handlermenu" here is only possible, if you use a "tell" statement12 -- use it like so: tell window(me.pHandlerMenuWindowName) to doSomething13 14 ----------------------------------------------15 -- if you ant to display a status for long calls (like my svn utilities do)16 -- use:17 -- me.mSwitchToStatusMode(1) -- to switch it on18 -- me.mSwitchToStatusMode(0) -- to switch it off19 -- and:20 -- me.mDisplayWaitStatusText(aString) -- to display a status message21 ----------------------------------------------22 36 23 37 -- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx -
trunk/lingosource/castlib1/doCommandMovieScript.ls
r188 r215 1 -- doCommandMovieScript 2 ----------------------------------- 3 -- DESCRIPTION: 4 -- process the command, which was chosen 5 -- at this point the command string is stored in the globallist, 6 -- as we come here in an asynch process -> MUI dialog 7 -- the command and the paramaters are stored in the global list which we get with: 8 -- call(#mGetGlobalList, mGetXScript()) 9 -- the command string is glob.getaprop(#cmd) 10 -- the parameters are in glob.getaprop(#theParams) 11 -- 12 -- REQUIRES: 13 -- script "aleXtrasMovieScript" as provider for library scripts -> xscr() 14 -- script "commonMovieScript" -- standard handlers -> here to get the globallist -> mGetGlobalList() 15 -- USAGE: 16 -- 17 -- NOTES: 18 -- This handler used to be in "thisMovieScript", but due to a scope bug with calling handlers 19 -- in other movies -> tell the stage unfortunately this doesn't fix the problem. 20 -- I have to investigate later WHY... so calling handlers, which are in this movie will fail 21 ----------------------------------- 22 1 23 -- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 2 24 on _____________________PROCESS_COMMAND 3 25 end 4 26 -- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 5 -- process the command, which was chosen6 -- at this point the command string is stored in the globallist, as we come here in an asynch process -> MUI dialog7 -- the command and the paramaters are stored in the global list which we get with: call(#mGetGlobalList, mGetXScript())8 -------- the command string is glob.getaprop(#cmd)9 -------- the parameters are in glob.getaprop(#theParams)10 11 12 ---- This handler used to be in "thisMovieScript", but due to a scope bug with calling handlers in other movies -> tell the stage13 -- unfortunately this doesn't fix the problem. I have to investigate later WHY... so calling handlers, which are in this movie will fail14 15 27 16 28 on mDoCmd dto, dto2 -
trunk/lingosource/castlib1/keyboardNavigation_FrameLoop.ls
r1 r215 1 -- keyboard navigation using control+tab to access the menu without mouse 1 -- keyboardNavigation_FrameLoop 2 ----------------------------------- 3 -- DESCRIPTION: 4 -- frame loop and keyboard input "watcher" 5 -- keyboard navigation using control+tab to access the menu without mouse 6 -- 7 -- REQUIRES: 8 -- none 9 -- 10 -- USAGE: 11 -- put this behavior on a framescript in order to loop on that frame 12 -- and track whether the user presses ctrl + TAB 13 -- Currently it is set to track the whole time, therefore the menus even appear 14 -- if the app is not in foreground. 15 -- A deactivate application trigger could change that. I am ok with it myself 16 -- and I even sometimes look up items, when I am in other apps like bbedit... 17 ----------------------------------- 18 19 2 20 3 21 property pActive … … 9 27 if not(pActive) then 10 28 11 if keypressed(48) then 12 if the shiftdown then 29 if keypressed(48) then -- TAB key 30 if the shiftdown then -- CTRL + SHIFT + TAB open handler menu 13 31 sendSprite(xscr().mGetKanal(#handlerMenuTrigger), #mousedown) 14 else 32 else -- CTRL + TAB open utitlities menu 15 33 sendSprite(xscr().mGetKanal(#utilitiesMenuTrigger), #mousedown) 16 34 end if -
trunk/lingosource/castlib1/memberInfo.xml
r198 r215 1 1 <?xml version="1.0" encoding="ISO-8859-1" ?> 2 2 <Untitled> 3 <subversion_version_field> 4 <scriptType>#field</scriptType> 5 <comments>http://www.farbflash.de/cgi-bin/versionChecker.pl?movieName=HandlerMenu_OSC</comments> 6 <memberName>subversion_version_field</memberName> 7 <fName>subversion_version_field</fName> 8 </subversion_version_field> 3 9 <doCommandMovieScript> 4 10 <scriptType>#movie</scriptType> … … 49 55 <fName>alexUtilities</fName> 50 56 </alexUtilities> 57 <bbedit_Utilities> 58 <scriptType>#parent</scriptType> 59 <comments>~/Documents/Scripts/lingo/commonMovieScript.ls</comments> 60 <memberName>bbedit_Utilities</memberName> 61 <fName>bbedit_Utilities</fName> 62 </bbedit_Utilities> 63 <svn_Utilities> 64 <scriptType>#parent</scriptType> 65 <comments>~/Documents/Scripts/lingo/commonMovieScript.ls</comments> 66 <memberName>svn_Utilities</memberName> 67 <fName>svn_Utilities</fName> 68 </svn_Utilities> 69 <custom_Utilities> 70 <scriptType>#parent</scriptType> 71 <comments>~/Documents/Scripts/lingo/commonMovieScript.ls</comments> 72 <memberName>custom_Utilities</memberName> 73 <fName>custom_Utilities</fName> 74 </custom_Utilities> 51 75 <convert_Lingo_2_CSS_Html> 52 76 <scriptType>#movie</scriptType> … … 115 139 <fName>statusOutput</fName> 116 140 </statusOutput> 117 <bbedit_Utilities>118 <scriptType>#parent</scriptType>119 <comments>~/Documents/Scripts/lingo/commonMovieScript.ls</comments>120 <memberName>bbedit_Utilities</memberName>121 <fName>bbedit_Utilities</fName>122 </bbedit_Utilities>123 <svn_Utilities>124 <scriptType>#parent</scriptType>125 <comments>~/Documents/Scripts/lingo/commonMovieScript.ls</comments>126 <memberName>svn_Utilities</memberName>127 <fName>svn_Utilities</fName>128 </svn_Utilities>129 <custom_Utilities>130 <scriptType>#parent</scriptType>131 <comments>~/Documents/Scripts/lingo/commonMovieScript.ls</comments>132 <memberName>custom_Utilities</memberName>133 <fName>custom_Utilities</fName>134 </custom_Utilities>135 <subversion_version_field>136 <scriptType>#field</scriptType>137 <comments>http://www.farbflash.de/cgi-bin/versionChecker.pl?movieName=HandlerMenu_OSC</comments>138 <memberName>subversion_version_field</memberName>139 <fName>subversion_version_field</fName>140 </subversion_version_field>141 141 </Untitled> -
trunk/lingosource/castlib1/simpleBMMenu.ls
r180 r215 1 -- simpleBMMenu 2 ----------------------------------- 3 -- DESCRIPTION: 4 -- behavior on the btton to show the menu 5 -- invoke the menu on mousedown and stay hilited until the menu is disposed 6 -- the menu calls mUnhilite, if it is closed 7 -- 8 -- REQUIRES: 9 -- none (uses sendSprite() to send the "menu open" event to a sprite named like it is defined in the GPDL) 10 -- 11 -- USAGE: 12 -- drag this behavior onto a sprite with a member of type #text 13 ----------------------------------- 14 15 16 1 17 property pMenuSpritename 2 18 -- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 3 19 4 20 on mouseDown me 5 spr = sprite(me.spritenum)6 spr.member.color = rgb(255, 255, 255)7 sprite(xscr().mGetKanal(#blueBackGround)).rect = spr.rect -- blue background21 mem = sprite(me.spritenum).member 22 mem.color = rgb(255, 255, 255) 23 mem.bgcolor = rgb("#106fe7") 8 24 updatestage 9 25 sendSprite(xscr().mGetKanal(pMenuSpritename), #mShowOSCMenu, me.spritenum) … … 27 43 28 44 on mUnhilite me 29 sprite(me.spritenum).member.color = rgb(20, 20, 20) 30 sprite(xscr().mGetKanal(#blueBackGround)).locV = -1000 -- blue background 45 mem = sprite(me.spritenum).member 46 mem.color = rgb(20, 20, 20) 47 mem.bgcolor = rgb(255, 255, 255) 31 48 end if -
trunk/lingosource/castlib1/subversion_version_field.txt
r213 r215 1 r21 31 r217 -
trunk/lingosource/castlib1/svn_Utilities.ls
r213 r215 1 -- svn_Utilities 2 ----------------------------------- 3 -- PROPERTIES: 4 --!memberProperties: [#name: "svn_Utilities", #scripttype: #parent, #scriptSyntax: #lingo, #comments: "~/Documents/Scripts/lingo/commonMovieScript.ls"] 5 -- 6 -- DESCRIPTION: 7 -- This script externalizes all functions which are related to the use of subversion with director 8 -- 9 -- 10 -- REQUIRES: 11 -- script "alexUtilities" -> ancestor -> basic function provider 12 -- most functionality is provided through the shell xtra and buddyApi xtra 13 -- although it should fail gracefully, if those are not present 14 -- not much will work without them 15 -- It also requires the svn command line client to be installed on the machine 16 -- 17 -- USAGE: 18 -- This script is instantiated and used in the "tell the stage" block and one of the functions 19 -- which are defined in script "OSCmenu_Utilities" and which was selected by the user 20 -- will be executed in "stage scope". That means, that references are made form within the stage context 21 -- e.g. member("foo") will refer to a member in one of the stages castlibs 22 -- sprite(x) will refere to sprite(x) in the stages score and so on 23 -- 24 -- Please see the descriptions of many of those handlers at: http://www.farbflash.org/trac/HandlerMenu/wiki/utilityHandlers 25 ----------------------------------- 26 1 27 property ancestor 2 28 … … 1307 1333 put the itemdelimiter after thePath 1308 1334 1309 extension = "" 1310 repeat while length(fname) 1311 put the last char of fname before extension 1312 delete the last char of fname 1313 if char 1 of extension = "." then exit repeat 1314 end repeat 1315 if char 1 of extension <> "." then 1316 put extension after fname 1317 extension = "" 1318 end if 1335 splitpath = mSplitPath(fname) 1336 extension = splitpath[#extension] 1337 -- extension = "" 1338 -- repeat while length(fname) 1339 -- put the last char of fname before extension 1340 -- delete the last char of fname 1341 -- if char 1 of extension = "." then exit repeat 1342 -- end repeat 1343 -- if char 1 of extension <> "." then 1344 -- put extension after fname 1345 -- extension = "" 1346 -- end if 1319 1347 1320 1348 if ilk(infolist) <> #proplist then … … 2822 2850 thisFile = flist[n] 2823 2851 if thisFile starts ".svn" then next repeat 2824 erg = baCopyFileProgress(fromFolder & thisFile, toFolder & thisFile, "Always", "Replacing movie with the version of the working folder", "", 33) 2825 if erg <> 0 then 2826 alert "An error occurred during copying the file (" & thisFile & "). Error:" && erg 2827 else 2828 put "Replaced file:" && thisFile 2852 -- we get ourselves only dir and cast files: 2853 len = length(thisFile) 2854 ext = thisFile.char[len-3 .. len] 2855 if ext = ".dir" or ext = ".cst" then 2856 erg = baCopyFileProgress(fromFolder & thisFile, toFolder & thisFile, "Always", "Replacing movie with the version of the working folder", "", 33) 2857 if erg <> 0 then 2858 alert "An error occurred during copying the file (" & thisFile & "). Error:" && erg 2859 else 2860 put "Replaced file:" && thisFile 2861 end if 2829 2862 end if 2830 2863 end repeat 2831 2832 2864 2833 2865 end -
trunk/lingosource/castlib1/thisMoviesScript.ls
r136 r215 1 --------------------------------------------- 2 -- IMPORTANT: 3 -- If you prefer to use buddyMenu xtra (which is buggy, but free) over OSControl xtra (you need a license to use it in authoring) 4 -- simply replace the OSControl menu member with another member. You can use the member "OSControlReplacement". 5 -- Select sprite 2 and 3 in the score window, then select member "OSControlReplacement" in the cast window and select: 6 -- "Edit -> Exchange Cast Members" (or press Cmd + E). 7 -- You can delete the OSControl member "oscontrolMenu" afterwards. 8 -- From that time on the buddyMenu xtra is used to draw the menu instead of the OSControl xtra. 9 -- the only difference in the script is in script "OSCmenu_Utilities" and "OSCmenu_Handlers": 10 -- if sprite(me.spritenum).member.type = #OSmenu then ... 11 12 -- Please read the readme file in order to learn how to add your own handlers to this menu 13 --------------------------------------------- 1 -- thisMoviesScript 2 ----------------------------------- 3 -- DESCRIPTION: 4 -- Main movie script of this movie, with the standard moviescript handlers like: 5 -- startMovie, stopmovie, closeWindow and idle 6 -- 7 -- REQUIRES: 8 -- script "aleXtrasMovieScript" as provider for library scripts -> xscr() 9 -- script "commonMovieScript" -- standard handlers 10 -- script "GetSetPrefs" -- read and write preferences 11 -- 12 -- WARNINGS: 13 -- IMPORTANT NOTES: 14 -- This movie uses the sleep method on idle in order to prevent CPU hogging 15 -- by a movie, which is supposed ti run all the time 16 -- This means, that on mac, you will sleep one tick on idle, while on PC it is only a millisecond 17 -- While that keeps the CPU usage low, the main movie won't run at "full speed" 18 -- So in order to test the speed of the main movie close this MIAW tool! 19 -- 20 -- which xtra to use for the menu? 21 -- If you prefer to use buddyMenu xtra (which is buggy, but free) over OSControl xtra 22 -- (you need a license to use it in authoring) 23 -- simply replace the OSControl menu member with another member. 24 -- You can use the member "OSControlReplacement". 25 -- Select sprite 2 and 3 in the score window, then select 26 -- member "OSControlReplacement" in the cast window and select: 27 -- "Edit -> Exchange Cast Members" (or press Cmd + E). 28 -- You can delete the OSControl member "oscontrolMenu" afterwards. 29 -- From that time on the buddyMenu xtra is used to draw the menu instead of the OSControl xtra. 30 -- the only difference in the script is in script "OSCmenu_Utilities" and "OSCmenu_Handlers": 31 -- if sprite(me.spritenum).member.type = #OSmenu then ... 32 33 -- Please read the readme file in order to learn how to add your own handlers to this menu 34 ----------------------------------- 14 35 15 36 on startmovie … … 18 39 19 40 prefsScript = xscr(#GetSetPrefs) 20 theResult = prefsScript.mReadPrefs("handlerMenuToolPrefs") 21 theResult = prefsScript.mGetPrefValue(#windowrect) 41 if ilk(prefsScript) = #instance then 42 theResult = prefsScript.mReadPrefs("handlerMenuToolPrefs") 43 theResult = prefsScript.mGetPrefValue(#windowrect) 44 end if 22 45 if ilk(theResult) <> #rect then theResult = rect(0,0,(the activewindow).rect.width, (the activewindow).rect.height).offset(50, 50) 23 46 (the activewindow).rect = theResult … … 38 61 39 62 -------------- I've put it back in now, as I am having a problem on windows anyway, that I'll need to investigate further 40 theResult = call(#mSetPrefValue, [mGetXscript(#GetSetPrefs)], #windowrect, (the activewindow).rect) 41 theResult = call(#mSavePrefs, [mGetXscript(#GetSetPrefs)], "handlerMenuToolPrefs", 1) 63 prefsScript = xscr(#GetSetPrefs) 64 if ilk(prefsScript) = #instance then 65 theResult = call(#mSetPrefValue, prefsScript, #windowrect, (the activewindow).rect) 66 theResult = call(#mSavePrefs, prefsScript, "handlerMenuToolPrefs", 1) 67 end if 42 68 43 69 forget the activewindow … … 57 83 -- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 58 84 -- get a list of all handlers used in the current stage movie, sorted by scripttype and castlib 85 -- the more scripts you have in your main movie, the longer it takes 86 -- therefore it caches the results, so that it is only slow the first time the handler menu is opened 59 87 60 88 on mBuildList kw … … 338 366 parentheseOffs = offset(")", l1) 339 367 if parentheseOffs > 0 then 340 put " " into char parentheseOffs of scrtext 368 -- put " " into char parentheseOffs of scrtext 369 delete char parentheseOffs of scrtext 341 370 end if 342 371 end if -
trunk/lingosource/castlib2/PseudoXMLPS.ls
r208 r215 822 822 on mEscapeSpecialChars me, str 823 823 824 val = mReplaceAllGT(me, val, "&", "&") 824 825 val = mReplaceAllGT(me, string(str), "<", "<") 825 826 val = mReplaceAllGT(me, val, ">", ">") 826 val = mReplaceAllGT(me, val, "&", "&")827 827 val = mReplaceAllGT(me, val, "'", "'") 828 828 val = mReplaceAllGT(me, val, QUOTE, """) … … 838 838 val = mReplaceAllGT(me, string(str), "<", "<") 839 839 val = mReplaceAllGT(me, val, ">", ">") 840 val = mReplaceAllGT(me, val, "&", "&")841 840 val = mReplaceAllGT(me, val, "'", "'") 842 841 val = mReplaceAllGT(me, val, """, QUOTE) 842 val = mReplaceAllGT(me, val, "&", "&") 843 843 844 844 return val -
trunk/lingosource/castlib2/commonMovieScript.ls
r196 r215 296 296 297 297 on mGetFloatVersionNumber me, prodVers 298 offs = offset(".", prodVers) 299 if offs > 0 then 300 intVers = char 1 to offs of prodVers 301 delete char 1 to offs of prodVers 302 else 303 intVers = "" 298 offs = offset(".", prodVers) 299 if offs > 0 then 300 intVers = char 1 to offs of prodVers 301 delete char 1 to offs of prodVers 302 else 303 intVers = "" 304 end if 305 cnt = length(prodVers) 306 repeat with n = 1 to cnt 307 c = prodVers.char[n] 308 if integerP(integer(c)) then 309 put c after intVers 310 else if c <> "." then 311 exit repeat 304 312 end if 305 cnt = length(prodVers) 306 repeat with n = 1 to cnt 307 c = prodVers.char[n] 308 if integerP(integer(c)) then 309 put c after intVers 310 else if c <> "." then 311 exit repeat 312 end if 313 end repeat 314 313 end repeat 314 315 315 return value(intVers) 316 316 end … … 333 333 if voidP(gPlatform) then 334 334 335 isMac = the platform contains "Macintosh"336 if isMac then337 338 onX = value(char 1 of (the last word of (the environment).osversion)) <= 5335 isMac = the platform contains "Macintosh" 336 if isMac then 337 338 onX = value(char 1 of (the last word of (the environment).osversion)) <= 5 339 339 if onX then gPlatform = #osx 340 340 else gPlatform = #os9 … … 1413 1413 len = length(dateiname) 1414 1414 ext = "" 1415 1416 repeat with n = len down to 1 1415 until = max(1, len-8) -- let's pretend, that a file extension is not langer than 8 chars 1416 1417 repeat with n = len down to until 1417 1418 this = dateiname.char[n] 1418 1419 put this before ext
Note: See TracChangeset
for help on using the changeset viewer.
