Farbflash projects: Imaging lingo table | 3-D scene list | Find all | Handler menu | Lingo message window

Changeset 215 for trunk/lingosource


Ignore:
Timestamp:
12/15/08 13:00:15 (3 years ago)
Author:
alex
Message:

only copy dir and cst files now, when doing svn update movie binaries. added function to split path in order to not assume, that the first dot is the file extension seperator

Location:
trunk/lingosource
Files:
15 edited

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 
    122property pCurrentHandlerList 
    223property 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 
    125property pCallerSprite 
    226property 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----------------------------------- 
    328 
    429property ancestor 
     
    1439on new me 
    1540  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 ancestor 
    17    
     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 
    1843  return me 
    1944end 
     
    2449 
    2550on 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   
    2658  theLastFrame = the lastFrame 
    2759  theLastChannel = the lastChannel 
     
    6294 
    6395on mOpenContainingFolder me 
     96  ----------------------------------- 
     97  --         ACTION: Open the folder, where the current movie is inside in the Finder/Explorer  
     98  --         INPUT: - 
     99  --         RETURNS: - 
     100  ----------------------------------- 
     101   
    64102  if length(the moviepath) < 1 then 
    65103    alert "The movie must be saved first!" 
     
    78116 
    79117on 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   
    80124  theResult = [:] 
    81125  dertext = mGetTextFromFile(me, pfad) 
     
    91135 
    92136on 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   
    93144  if not(list(theList)) then 
    94145    global gRetVal 
     
    111162 
    112163on 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   
    113170  retval = "" 
    114171   
     
    141198 
    142199on 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   
    143211  retval = 0 
    144212   
     
    215283 
    216284on 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  ----------------------------------- 
    217292   
    218293  pfad = string(pfad) 
     
    231306 
    232307on 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   
    233316  retval = 0 
    234317   
     
    312395   
    313396  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 
    316404    end if 
    317405    forceType = 0 
     
    359447    len = length(pfad) 
    360448    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 
    370466  end if 
    371467   
     
    630726  if (not(mac) and (theType = "pct")) then theType = "bmp" 
    631727   
    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] 
    634732   
    635733  if not(["jpg", "png", "bmp", "pct"].getPos(theType)) then exit 
     
    755853  if (not(mac) and (theType = "pct")) then theType = "bmp" 
    756854   
    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   
    760864  -- else thePath = thePath.char[1 .. theDot]&theType 
    761865   
     
    21372241          mp = the moviepath 
    21382242          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 
    21542263           
    21552264          -- in case of field we always use the plain text: 
     
    25862695RETURN & "  -- CREATED:"&\ 
    25872696RETURN & "  -- <currentDate>"&\ 
     2697RETURN & "  -- PROPERTIES:"&\ 
     2698RETURN & "  --!memberProperties: [#name: "&QUOTE&"<scriptname>"&QUOTE&", #scripttype: #<scripttype>, #scriptSyntax: #<scriptSyntax>, #comments: "&QUOTE&"<comments>"&QUOTE&"]"&\ 
    25882699RETURN & "  --"&\ 
    25892700RETURN & "  -- DESCRIPTION:"&\ 
     
    25922703RETURN & "  -- REQUIRES:"&\ 
    25932704RETURN & "  -- (Prerequisites)"&\ 
    2594 RETURN & "  --"&\ 
     2705  RETURN & "  --"&\ 
    25952706RETURN & "  -- USAGE:"&\ 
    25962707RETURN & "  -- -"&\ 
     
    26622773      --------------------------------- for the current scriptname, which we only "know" here in this script 
    26632774      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]] 
    26652776         
    26662777        repeat with repl in placeholders 
     
    29013012end 
    29023013-- 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. 
    29033018 
    29043019-- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 
     
    30383153  return memref.type 
    30393154end 
     3155 
     3156-- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 
     3157 
     3158-- split a path into its three elements => base directory, basename and extension: 
     3159 
     3160on 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   
     3203end 
  • 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 
    129property ancestor 
    230 
     
    14861514   
    14871515  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   
     1523end 
     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----------------------------------- 
    1221 
    1322-- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 
     23-- uses the selected #text member of the stage movie 
    1424 
    1525on 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 
    130property ancestor 
    231 
     
    534  return me 
    635end 
    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" statement 
    12 -- use it like so: tell window(me.pHandlerMenuWindowName) to doSomething 
    13  
    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 on 
    18 -- me.mSwitchToStatusMode(0) -- to switch it off 
    19 -- and: 
    20 -- me.mDisplayWaitStatusText(aString) -- to display a status message 
    21 ---------------------------------------------- 
    2236 
    2337-- 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 
    123-- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 
    224on _____________________PROCESS_COMMAND 
    325end 
    426-- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 
    5 -- process the command, which was chosen 
    6 -- at this point the command string is stored in the globallist, 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: 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 stage 
    13 -- unfortunately this doesn't fix the problem. I have to investigate later WHY... so calling handlers, which are in this movie will fail 
    14  
    1527 
    1628on 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 
    220 
    321property pActive 
     
    927    if not(pActive) then 
    1028       
    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 
    1331          sendSprite(xscr().mGetKanal(#handlerMenuTrigger), #mousedown) 
    14         else 
     32        else -- CTRL + TAB open utitlities menu 
    1533          sendSprite(xscr().mGetKanal(#utilitiesMenuTrigger), #mousedown) 
    1634        end if 
  • trunk/lingosource/castlib1/memberInfo.xml

    r198 r215  
    11<?xml version="1.0" encoding="ISO-8859-1" ?> 
    22<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> 
    39        <doCommandMovieScript> 
    410                <scriptType>#movie</scriptType> 
     
    4955                <fName>alexUtilities</fName> 
    5056        </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> 
    5175        <convert_Lingo_2_CSS_Html> 
    5276                <scriptType>#movie</scriptType> 
     
    115139                <fName>statusOutput</fName> 
    116140        </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> 
    141141</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 
    117property pMenuSpritename 
    218-- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 
    319 
    420on mouseDown me 
    5   spr = sprite(me.spritenum) 
    6   spr.member.color = rgb(255, 255, 255) 
    7   sprite(xscr().mGetKanal(#blueBackGround)).rect = spr.rect -- blue background 
     21  mem = sprite(me.spritenum).member 
     22  mem.color = rgb(255, 255, 255) 
     23  mem.bgcolor = rgb("#106fe7") 
    824  updatestage 
    925  sendSprite(xscr().mGetKanal(pMenuSpritename), #mShowOSCMenu, me.spritenum) 
     
    2743 
    2844on 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) 
    3148end if 
  • trunk/lingosource/castlib1/subversion_version_field.txt

    r213 r215  
    1 r213 
     1r217 
  • 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 
    127property ancestor 
    228 
     
    13071333  put the itemdelimiter after thePath 
    13081334   
    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 
    13191347   
    13201348  if ilk(infolist) <> #proplist then 
     
    28222850    thisFile = flist[n] 
    28232851    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 
    28292862    end if 
    28302863  end repeat 
    2831    
    28322864   
    28332865end 
  • 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----------------------------------- 
    1435 
    1536on startmovie 
     
    1839   
    1940  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 
    2245  if ilk(theResult) <> #rect then theResult = rect(0,0,(the activewindow).rect.width, (the activewindow).rect.height).offset(50, 50) 
    2346  (the activewindow).rect = theResult 
     
    3861   
    3962  -------------- 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 
    4268   
    4369  forget the activewindow 
     
    5783-- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 
    5884-- 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 
    5987 
    6088on mBuildList kw 
     
    338366      parentheseOffs = offset(")", l1) 
    339367      if parentheseOffs > 0 then 
    340         put " " into char parentheseOffs of scrtext 
     368        -- put " " into char parentheseOffs of scrtext 
     369        delete char parentheseOffs of scrtext 
    341370      end if 
    342371    end if 
  • trunk/lingosource/castlib2/PseudoXMLPS.ls

    r208 r215  
    822822on mEscapeSpecialChars me, str 
    823823   
     824  val = mReplaceAllGT(me, val, "&", "&amp;") 
    824825  val = mReplaceAllGT(me, string(str), "<", "&lt;") 
    825826  val = mReplaceAllGT(me, val, ">", "&gt;") 
    826   val = mReplaceAllGT(me, val, "&", "&amp;") 
    827827  val = mReplaceAllGT(me, val, "'", "&apos;") 
    828828  val = mReplaceAllGT(me, val, QUOTE, "&quot;") 
     
    838838  val = mReplaceAllGT(me, string(str), "&lt;", "<") 
    839839  val = mReplaceAllGT(me, val, "&gt;", ">") 
    840   val = mReplaceAllGT(me, val, "&amp;", "&") 
    841840  val = mReplaceAllGT(me, val, "&apos;", "'") 
    842841  val = mReplaceAllGT(me, val, "&quot;", QUOTE) 
     842  val = mReplaceAllGT(me, val, "&amp;", "&") 
    843843   
    844844  return val 
  • trunk/lingosource/castlib2/commonMovieScript.ls

    r196 r215  
    296296 
    297297on 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 
    304312    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   
    315315  return value(intVers) 
    316316end 
     
    333333  if voidP(gPlatform) then 
    334334     
    335   isMac = the platform contains "Macintosh" 
    336   if isMac then 
    337        
    338     onX = value(char 1 of (the last word of (the environment).osversion)) <= 5 
     335    isMac = the platform contains "Macintosh" 
     336    if isMac then 
     337       
     338      onX = value(char 1 of (the last word of (the environment).osversion)) <= 5 
    339339      if onX then gPlatform = #osx 
    340340      else gPlatform = #os9 
     
    14131413  len = length(dateiname) 
    14141414  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 
    14171418    this = dateiname.char[n] 
    14181419    put this before ext 
Note: See TracChangeset for help on using the changeset viewer.