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

Changeset 245


Ignore:
Timestamp:
03/21/10 11:39:48 (2 years ago)
Author:
alex
Message:

cleanup

Location:
trunk/lingosource
Files:
2 added
14 edited

Legend:

Unmodified
Added
Removed
  • trunk/lingosource/castlib1/alexUtilities.ls

    r244 r245  
    3838property pCaseLists 
    3939 
     40property pCachedFiles 
     41 
    4042 
    4143on new me 
     44  pCachedFiles = [:] 
    4245  ancestor = new(script "PseudoXMLPS") -- we need this script later 
    4346  -- and as we may already be in the scope of the stage, we use it as ancestor 
     
    124127  ----------------------------------- 
    125128   
     129  theResult = pCachedFiles.getaprop(pfad) 
     130  if listP(theResult) then return theResult 
     131   
    126132  theResult = [:] 
    127133  dertext = mGetTextFromFile(me, pfad) 
    128134  if length(dertext) > 0 then 
    129135    statusSwitched = mSwitchToStatusMode(me, 1) 
    130     theResult = mGetListFromXMLString(me, dertext) 
     136    theResult = mGetListFromXMLStringX(me, dertext) 
     137    pCachedFiles.setaProp(pfad, theResult) 
    131138    if statusSwitched = 1 then statusSwitched = mSwitchToStatusMode(me, 0) 
    132139  end if 
    133140  return theResult 
     141end 
     142 
     143-- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 
     144 
     145on mClearXML_Cache me, string_fullPath 
     146  ----------------------------------- 
     147  --         ACTION: We have a cache for xml files, sio that we do not need to parse the same 
     148  --                 file over and over again, as itis time consuming esp. during repeat loops 
     149  --                 so we store the result in pCachedFiles by filename. 
     150  --                 In order to flush this cache for either one file (with parameter) or all files 
     151  --                 (without parameter) use this handler 
     152  --  
     153  --         INPUT: <string_fullPath> ; string ; full pathname ; optional => default "" => clear all cahced files 
     154  --         RETURNS: - 
     155  ----------------------------------- 
     156   
     157  string_fullPath = string(string_fullPath) 
     158  if length(string_fullPath) > 0 then 
     159    pCachedFiles.deleteProp(string_fullPath) 
     160  else 
     161    pCachedFiles = [:] 
     162  end if 
    134163end 
    135164 
     
    149178    if not(list(theList)) then theList = [:] 
    150179  end if 
     180  pCachedFiles.setaProp(thePath, theList) 
    151181  theResult = mGetXMLStringFromList(me, theList) 
    152182  return mSaveToTextFile(me, theResult, thePath) 
     
    29272957end 
    29282958 
    2929  
    2930 -- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 
    2931  
    2932 on mGetWindowsHomeFolder me 
    2933    
    2934   if mCheckForXtra(me, "Shell") = 0 then 
    2935     home = mDoShellCmd(me, "echo %HOMEPATH%", void, void, 1) 
    2936     home = home[1] 
    2937   else if mCheckForXtra(me, "BudAPI") then 
    2938     olddelim = the itemdelimiter 
    2939     the itemdelimiter = "\" 
    2940     home = baSysFolder("personal") 
    2941     if the last char of home = "\" then delete the last char of home 
    2942     if the last item of home = "Documents" then delete the last item of home 
    2943     the itemdelimiter = olddelim 
    2944   else 
    2945     home = "" 
    2946   end if 
    2947    
    2948   return home 
    2949 end 
    2950  
    29512959-- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 
    29522960on _______________GLOSSARY_ITEMS me 
     
    35323540  end if 
    35333541   
    3534   -- pUPPERCASE = "ABCDEFGHIJKLMNOPQRSTUVWXYZZÁÀ"&vA& "ÄÃÅÇÉÈÊËÍÌÎÏÑÓÒÔÖÕÚÙ€ÜÆØŒŸ" 
    3535   -- pLowercase = "abcdefghijklmnopqrstuvwxyzáà"&"â"&"äãåçéèêëíìîïñóòôöõúùûüæøœÿ" 
    3536   pCaseLists.setaprop(#uppercase, ["A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z", "Á", "À", vA, "A", "Ä", "Ã", "Å", "Ç", "É", "È", "Ê", "Ë", "Í", "Ì", "Î", "Ï", "Ñ", "Ó", "Ò", "Ô", "Ö", "Õ", "Ú", "Ù", "U", "Ü", "Æ", "Ø", "Œ", "Ÿ"]) 
    3537   pCaseLists.setaprop(#lowercase, ["a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z", "á", "à", vA, "â", "ä", "ã", "å", "ç", "é", "è", "ê", "ë", "í", "ì", "î", "ï", "ñ", "ó", "ò", "ô", "ö", "õ", "ú", "ù", "û", "ü", "æ", "ø", "œ", "ÿ"]) 
     3542  -- pUPPERCASE = "ABCDEFGHIJKLMNOPQRSTUVWXYZZçË"&vA& "€Ì‚ƒéæèêíëì„îñï 
     3543Íòôۆ®¯ÎÙ" 
     3544  -- pLowercase = "abcdefghijklmnopqrstuvwxyz‡ˆ"&"‰"&"Š‹ŒŽ‘’“”•–—˜™š›œžŸŸ¿ÏØ" 
     3545  pCaseLists.setaprop(#uppercase, ["A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z", "ç", "Ë", vA, "A", "€", "Ì", "", "‚", "ƒ", "é", "æ", "è", "ê", "í", "ë", "ì", "„", "î", "ñ", "ï", " 
     3546", "Í", "ò", "ô", "U", "†", "®", "¯", "Î", "Ù"]) 
     3547  pCaseLists.setaprop(#lowercase, ["a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z", "‡", "ˆ", vA, "‰", "Š", "‹", "Œ", "", "Ž", "", "", "‘", "’", "“", "”", "•", "–", "—", "˜", "™", "š", "›", "œ", "", "ž", "Ÿ", "Ÿ", "¿", "Ï", "Ø"]) 
    35383548   
    35393549end 
  • trunk/lingosource/castlib1/bbedit_Utilities.ls

    r244 r245  
    6464      if memref.type = #script then 
    6565        fname = memref.filename 
    66         if length(fname) < 1 then fname = mGetFilePathFromMemberComments(me, memref) 
    67         if length(fname) > 0 then 
     66        if fname.length then 
    6867           
    6968          ppath = mConvertHFS2Unix(me, fname) 
     
    10551054          offs = offset("/", comm) 
    10561055        end repeat 
    1057         home = mGetWindowsHomeFolder(me) 
    1058         put home into char 1 to 2 of comm 
     1056        put baSysFolder("personal") into char 1 to 2 of comm 
    10591057        aPath = comm 
    10601058      end if 
     
    10781076         
    10791077        if comm starts "/Users/alex/" then 
    1080           put mGetWindowsHomeFolder(me) & "\" into char 1 to 12 of comm 
     1078          put baSysFolder("personal") into char 1 to 12 of comm 
    10811079        end if 
    10821080        aPath = comm 
  • trunk/lingosource/castlib1/helptext.html

    r244 r245  
    55<body bgcolor="#FFFFFF"> 
    66<br> 
    7 <font face="Arial, Helvetica" size=4><b>Handler Menu</font></b><font size=3> by Alex da Franca -- </font><a href="mailto:alex@farbflash.de"><font color="#000096"><u>alex@farbflash.de<p> 
     7<font face="Arial" size=4><b>Handler Menu</font></b><font size=3> by Alex da Franca -- </font><a href="mailto:alex@farbflash.de"><font color="#000096"><u>alex@farbflash.de<p> 
    88</a></font></u><font color="#000000">Quickly <b>execute handlers</b> which are found in the <b>currently open stage movie</b> from this menu.<br> 
    99Holding the <b>Option&#47;Alt</b> key pressed, while selecting a menu item <b>opens the script</b> and highlights the handler in the editor instead of executing the handler.<br> 
  • trunk/lingosource/castlib1/menu1_button.html

    r244 r245  
    44</head> 
    55<body bgcolor="#FFFFFF"> 
    6 <font face="Arial, Helvetica" size=4 color="#141414">Utilities</font></body> 
     6<font face="Arial" size=4 color="#141414">Utilities</font></body> 
    77</html> 
  • trunk/lingosource/castlib1/menu2_button.html

    r244 r245  
    44</head> 
    55<body bgcolor="#FFFFFF"> 
    6 <font face="Arial, Helvetica" size=4 color="#141414">Handlers</font></body> 
     6<font face="Arial" size=4 color="#141414">Handlers</font></body> 
    77</html> 
  • trunk/lingosource/castlib1/statusOutput.html

    r244 r245  
    44</head> 
    55<body bgcolor="#FFFFFF"> 
    6 <font face="Arial, Helvetica">The following operation may take some time...</font></body> 
     6<font face="Arial">The following operation may take some time...</font></body> 
    77</html> 
  • trunk/lingosource/castlib1/subversion_version_field.txt

    r242 r245  
    1 r244 
     1r247 
  • trunk/lingosource/castlib1/svn_Utilities.ls

    r244 r245  
    4040on mCompareCurrentScriptToWorkingCopy me, convertLineBreaksToUnix 
    4141   
    42    
    4342  if not(the platform contains "mac") then 
    4443     
     
    104103        end case 
    105104         
    106          
    107105        thePath = mFindWorkingCopyCounterpart(me, memref, ext) 
    108106         
     
    113111           
    114112        else 
    115            
    116            
    117113           
    118114          tempSrcHFSPath = mGetTempFilePath(me, "temp_SVN_Diff_file1.ls") 
     
    123119            tempSrcPath = tempSrcHFSPath 
    124120          end if 
    125            
    126121           
    127122          ------------------------------------------ trac subversion support works better with unix linebreaks... 
     
    156151          end if 
    157152          ----------------------------------------- 
    158            
    159153           
    160154          theResult = mSaveTextToTempFile(me, st, tempSrcHFSPath) 
     
    208202             
    209203            if writeBack = 1 then 
    210                
    211204               
    212205              if convertLineBreaksToUnix = 1 then 
     
    434427     
    435428    infolistPath = theFolder & "memberInfo.xml" 
     429     
    436430    infolist = mReadXML_2_List(me, infolistPath) 
    437431     
     
    450444  repeat with l = 1 to cnt 
    451445    li = infolist[l] 
    452     --    put "memberName:" && li.getaprop(#memberName) 
     446     
    453447    if li.getaprop(#memberName) = memref.name then 
    454448       
     
    457451      fpath = theFolder & fname & file_extension 
    458452       
    459       --      put "path:" && fpath  
    460453      if length(baShortFilename(fpath)) > 0 then return fpath 
    461        
    462       -- if baFileExists(fpath) then return fpath 
    463454       
    464455    end if 
  • trunk/lingosource/castlib2/FileIOFunktionen.ls

    r244 r245  
    1 -- FileIO Handlers -- c03 Alex da Franca -- alex@farbflash.de 
    2 --------------------------------------------------------------------- 
     1-- FileIOFunktionen 
     2----------------------------------- 
     3-- CREATED: 
     4-- c03 Alex da Franca -- alex@farbflash.de 
     5-- PROPERTIES: 
     6--!memberProperties: [#name: "FileIOFunktionen", #scripttype: #parent, #scriptSyntax: #lingo, #comments: "~/Documents/Scripts/lingo/FileIOFunktionen.ls"] 
     7-- 
     8-- DESCRIPTION: FileIO Handlers 
     9-- - 
     10-- 
     11-- REQUIRES: 
     12-- (Prerequisites) 
     13-- 
     14-- USAGE: 
     15-- - 
     16-- 
     17-- EXAMPLE: 
     18-- - 
     19----------------------------------- 
     20 
     21on _____________________PROPERTY_DECLARATION me 
     22end 
     23-- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 
     24property ancestor 
     25 
     26-- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 
     27on ___________________STANDARD_EVENTS me 
     28end 
     29-- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 
     30 
     31on new me 
     32  Script_Root_Object = member("Script_Root_Object") 
     33  if ilk(Script_Root_Object) = #member then 
     34    if Script_Root_Object.type = #script then 
     35      ancestor = new(script "Script_Root_Object") 
     36      mSetScriptName me, "FileIOFunktionen" 
     37    end if 
     38  end if 
     39  return me 
     40end 
     41 
     42-- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 
     43on ___________________PUBLIC_EVENTS me 
     44end 
     45-- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 
    346 
    447 
     
    98141  else 
    99142    paramList.setaprop(#theTextResult, mGetTextFromFile(me, paramList.getaprop(#theURL), paramList[#isByteArray], paramList[#charset])) 
    100     call(paramList.getaprop(#handler), [paramList.getaprop(#target)], paramList) 
     143    theResult = xscr().mDoDelayedCallback(paramList) 
     144    if theResult <> 1 then call(paramList.getaprop(#handler), [paramList.getaprop(#target)], paramList) 
    101145  end if 
    102146end 
     
    321365 
    322366on mGetFilePathFromUser me, startDir, defaultName, filetypes, prompt 
     367  ----------------------------------- 
     368  -- CREATED: - 
     369  -- ACTION: Asks the user for a path to a file and returns the filepath 
     370  -- INPUT: <startDir> ; string ; the directory to start the file selection dialog (only if buddyApi xtra is installed) 
     371  --        <defaultName> ; string ; pre-entered filename (only if buddyApi xtra is installed) 
     372  --        <filetypes> ; string ; filetype filter (only if buddyApi xtra is installed) 
     373  --        <prompt> ; string ; Caption of the dialog (only if buddyApi xtra is installed) 
     374  -- RETURNS: string ; absolute pathname delimited by the pathdelimiter of the current platform (widnows: "\", mac: ":") or "", if user canceled the process 
     375  -- EXAMPLE: relPath = xscr(#FileIOFunktionen).mGetFilePathFromUser(the moviepath, "soundRadius.xml", ".xml", "Please select soundradius scriptsettings") 
     376  ----------------------------------- 
     377   
    323378  retval = "" 
    324379   
     
    361416   
    362417  return retval 
     418end 
     419 
     420-- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 
     421 
     422on mGetMovieRelativePathFromUser me, startDir, defaultName, filetypes, prompt 
     423  ----------------------------------- 
     424  -- CREATED: 14.12.2009 
     425  -- ACTION: Asks the user for a path to a file 
     426  --         Takes care, that the file starts with the moviepath => is WITHIN the moviepath, 
     427  --         otherwise it calls itself until either the user selects a relative file or cancels the process. 
     428  --         Converts path delimiters to "/" => normalize the pathdelimiter for both platforms 
     429  -- INPUT: <startDir> ; string ; the directory to start the file selection dialog (only if buddyApi xtra is installed) 
     430  --        <defaultName> ; string ; pre-entered filename (only if buddyApi xtra is installed) 
     431  --        <filetypes> ; string ; filetype filter (only if buddyApi xtra is installed) 
     432  --                               SPECIAL VALUE: can be "folder", which would not return a path to a folder, 
     433  --                               but rather a path to a folder 
     434  --        <prompt> ; string ; Caption of the dialog (only if buddyApi xtra is installed) 
     435  -- RETURNS: string ; relative pathname delimited by "/" or "", if user canceled the process 
     436  -- EXAMPLE: relPath = xscr(#FileIOFunktionen).mGetMovieRelativePathFromUser(the moviepath, "soundRadius.xml", ".xml", "Please select soundradius scriptsettings") 
     437  ----------------------------------- 
     438   
     439  if filetypes = "folder" then 
     440    searchItem = "folder" 
     441    thePath = mGetFolderPathFromUser(me) 
     442  else 
     443    searchItem = "file" 
     444    thePath = mGetFilePathFromUser(me, startDir, defaultName, filetypes, prompt) 
     445  end if 
     446  if length(thePath) > 0 then 
     447    if offset(the moviepath, thePath) <> 1 then 
     448      alert "This " & searchItem & " is NOT within the moviepath. Please choose a " & searchItem & ", which is inside the current movie's path!" 
     449      return mGetMovieRelativePathFromUser(me, startDir, defaultName, filetypes, prompt) 
     450    end if 
     451    delete char 1 to length(the moviepath) of thePath 
     452    delim = the last char of the moviepath 
     453    if delim <> "/" then 
     454      offs = offset(delim, thePath) 
     455      repeat while offs > 0 
     456        put "/" into char offs of thePath 
     457        offs = offset(delim, thePath) 
     458      end repeat 
     459    end if 
     460    if filetypes = "folder" then 
     461      if the last char of thePath <> "/" then put "/" after thePath 
     462      end if 
     463    end if 
     464    return thePath 
    363465end 
    364466 
  • trunk/lingosource/castlib2/GetSetPrefs.ls

    r244 r245  
    1 -- store, read and write preferences 
    2  
     1-- GetSetPrefs 
     2----------------------------------- 
     3-- CREATED: 
     4-- 28.02.2010 
     5-- PROPERTIES: 
     6--!memberProperties: [#name: "GetSetPrefs", #scripttype: #parent, #scriptSyntax: #lingo, #comments: "~/Documents/Scripts/lingo/GetSetPrefs.ls"] 
     7-- 
     8-- DESCRIPTION: store, read and write preferences 
     9-- - 
     10-- 
     11-- REQUIRES: 
     12-- (Prerequisites) 
     13-- 
     14-- USAGE: 
    315-- on startmovie: theResult = call(#mReadPrefs, mGetXscript(#GetSetPrefs), "prefsname") 
    416-- on stopmovie: theResult = call(#mSavePrefs, mGetXscript(#GetSetPrefs), "prefsname", useAleXML) 
     
    719-- theResult = call(#mGetPrefValue, mGetXscript(#GetSetPrefs), "prefname") 
    820-- theResult = call(#mSetPrefValue, mGetXscript(#GetSetPrefs), "prefname", newValue) 
    9  
    10  
    11 -- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 
     21-- 
     22-- EXAMPLE: 
     23-- - 
     24----------------------------------- 
     25 
     26on _____________________PROPERTY_DECLARATION me 
     27end 
     28-- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 
     29property ancestor 
     30 
     31-- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 
     32on ___________________STANDARD_EVENTS me 
     33end 
     34-- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 
     35 
     36on new me 
     37  Script_Root_Object = member("Script_Root_Object") 
     38  if ilk(Script_Root_Object) = #member then 
     39    if Script_Root_Object.type = #script then 
     40      ancestor = new(script "Script_Root_Object") 
     41      mSetScriptName me, "GetSetPrefs" 
     42    end if 
     43  end if 
     44  return me 
     45end 
     46 
     47-- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 
     48on ___________________PUBLIC_EVENTS me 
     49end 
     50-- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 
     51 
    1252 
    1353on interface me 
     
    88128        resetUNames = 0 
    89129        if the platform contains "mac" then 
    90         if baSysFolder("prefs") starts "/" then 
    91           baReturnUnixNames(0) 
    92           resetUNames = 1 
    93         end if 
     130          if baSysFolder("prefs") starts "/" then 
     131            baReturnUnixNames(0) 
     132            resetUNames = 1 
     133          end if 
    94134        end if 
    95135         
     
    177217   
    178218  if offset("<?xml", prefsText.line[1]) > 0 then 
    179 --    delete line 1 of prefsText 
     219    --    delete line 1 of prefsText 
    180220     
    181221    gPrefs = call(#mGetListFromXMLStringX, mGetXScript(#PseudoXMLPS), prefsText) 
     
    184224  else 
    185225    olddelim = the itemdelimiter 
    186     the itemdelimiter = "¬ø" 
     226    the itemdelimiter = "¿" 
    187227     
    188228    anz = prefsText.line.count 
     
    263303        resetUNames = 0 
    264304        if the platform contains "mac" then 
    265         if baSysFolder("prefs") starts "/" then 
    266           baReturnUnixNames(0) 
    267           resetUNames = 1 
    268         end if 
     305          if baSysFolder("prefs") starts "/" then 
     306            baReturnUnixNames(0) 
     307            resetUNames = 1 
     308          end if 
    269309        end if 
    270310         
     
    335375    repeat with n = 1 to anz 
    336376       
    337       if objectP(prefliste) then prefStr = string(prefliste.getPropAt(n))&"¬ø" 
     377      if objectP(prefliste) then prefStr = string(prefliste.getPropAt(n))&"¿" 
    338378       
    339379      dieserWert = prefliste[n] 
     
    342382         
    343383        repeat with m = 1 to count(dieserWert) 
    344           put dieserWert[m]&"¬ø" after prefStr 
     384          put dieserWert[m]&"¿" after prefStr 
    345385        end repeat 
    346386         
    347387      else 
    348         put prefliste[n]&"¬ø" after prefStr 
     388        put prefliste[n]&"¿" after prefStr 
    349389      end if 
    350390       
  • trunk/lingosource/castlib2/PseudoXMLPS.ls

    r244 r245  
    2424--              -- Convert a list to an xml string: 
    2525--              xmlString = PseudoXMLPS.mGetXMLStringFromList(["one", "two", [#prop: 3]]) 
    26 --              lingolist = PseudoXMLPS.mGetListFromXMLStringX(xmlString) 
     26--              lingolist = PseudoXMLPS.mGetListFromXMLString(xmlString) 
    2727--              ---------- basically that's it 
    2828-- 
     
    4040-- xmlString = PseudoXMLPS.mGetXMLStringFromList(myList, "myList", 1, 1) 
    4141-- ... 
    42 -- myList = PseudoXMLPS.mGetListFromXMLStringX(xmlString) 
     42-- myList = PseudoXMLPS.mGetListFromXMLString(xmlString) 
    4343-- repeat with n = countmyList) down to 1 
    4444--   thisValue = myList[n] 
     
    7979on _____________________PROPERTY_DECLARATION me 
    8080end 
    81 -- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 
     81-- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 
     82property ancestor 
    8283property pXMLParserXtra 
    8384property pXmlxtraversion, pVersionNumber 
    8485 
    8586-- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 
    86 on ___________PUBLIC_EVENTS me 
     87on ___________________STANDARD_EVENTS me 
    8788end 
    8889-- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 
    8990 
    9091on new me 
     92  Script_Root_Object = member("Script_Root_Object") 
     93  if ilk(Script_Root_Object) = #member then 
     94    if Script_Root_Object.type = #script then 
     95      ancestor = new(script "Script_Root_Object") 
     96      mSetScriptName me, "PseudoXMLPS" 
     97    end if 
     98  end if 
    9199  return me 
    92100end 
    93101 
     102-- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 
     103on ___________________ENGINE_EVENTS me 
     104end 
    94105-- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 
    95106 
     
    99110 
    100111-- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 
    101  
     112on ___________PUBLIC_EVENTS me 
     113end 
     114-- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 
    102115 
    103116-- on handler me 
     
    117130   
    118131  put RETURN & "----- Parse XML-ish string to lingo list" after str 
    119   put RETURN & "on mGetListFromXMLString me, string_XMLstring, integer_convertValues" after str 
     132  put RETURN & "on mGetListFromXMLStringlingo me, string_XMLstring, integer_convertValues" after str 
    120133  put RETURN & "-- -- <convertValues> #integer" after str 
    121134  put RETURN & "-- -- -- 0 => don't convert (fast, all values are strings)" after str 
     
    126139   
    127140  put RETURN & "----- Parse XML string to lingo list using XML xtra:" after str 
    128   put RETURN & "on mGetListFromXMLStringX me, string_XMLstring, integer_convertValues" after str 
     141  put RETURN & "on mGetListFromXMLString me, string_XMLstring, integer_convertValues" after str 
    129142  put RETURN & "-- -- <convertValues> #integer" after str 
    130143  put RETURN & "-- -- -- 0 => don't convert (fast, all values are strings)" after str 
     
    205218 
    206219 
    207 on mGetListFromXMLString me, str, convertValues, withParams 
     220on mGetListFromXMLStringlingo me, str, convertValues, withParams 
    208221  ----------------------------------- 
    209222  -- CREATED: 06.03.2008 
     
    214227  --          <withParams> : #boolean : parse parameters too. new, not very well tested 
    215228  -- RETURNS: property list 
    216   -- EXAMPLE: lingo_list = mGetListFromXMLString(me, saveString) 
     229  -- EXAMPLE: lingo_list = mGetListFromXMLStringlingo(me, saveString) 
    217230  -- CHANGES: implemented parameter parsing 
    218231  ----------------------------------- 
     
    250263 
    251264-- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 
    252  
     265-- this is just backward compatibility with older scripts 
    253266 
    254267on mGetListFromXMLStringX me, str, convertValues, withParams 
     268  return mGetListFromXMLString(me, str, convertValues, withParams) 
     269end 
     270 
     271-- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 
     272 
     273on mGetListFromXMLString me, str, convertValues, withParams 
    255274  ----------------------------------- 
    256275  -- CREATED: 06.03.2008 
     
    265284  --           -- -- 2 => try to convert all data with value(), even parse for colors in hexstring format (slow) 
    266285  -- RETURNS: property list 
    267   -- EXAMPLE: lingo_list = mGetListFromXMLStringX(me, saveString) 
     286  -- EXAMPLE: lingo_list = mGetListFromXMLString(me, saveString) 
    268287  -- CHANGES: resorts to the slower lingo function on xml parser error. So this handler can always be used. 
    269288  ----------------------------------- 
     
    310329  end if 
    311330   
    312   if pXmlxtraversion < 10 then return mGetListFromXMLString(me, str, convertValues, withParams) 
     331  if pXmlxtraversion < 10 then return mGetListFromXMLStringlingo(me, str, convertValues, withParams) 
    313332  ------------------ end XML Parser xtra version 10 check 
    314333   
     
    329348  end if 
    330349   
     350   
    331351  if not(objectP(pXMLParserXtra)) then pXMLParserXtra = new(xtra "XmlParser") 
    332352  pXMLParserXtra.parseString(str) 
    333353   
    334354  if not(voidP(pXMLParserXtra.getError())) then 
    335     put "Script: PseudoXMLPS; Handler: mGetListFromXMLStringX; error:" && pXMLParserXtra.getError() 
    336     return mGetListFromXMLString(me, str, convertValues, withParams) 
     355    put "Script: PseudoXMLPS; Handler: mGetListFromXMLString; error:" && pXMLParserXtra.getError() 
     356    return mGetListFromXMLStringlingo(me, str, convertValues, withParams) 
    337357  end if 
    338358   
     
    341361  li = mConvertXMLPropList(me, [xx], convertValues, dontEscapeSpecialChars) 
    342362   
    343   -- put "PseudoXMLPS: mGetListFromXMLStringX:" && the milliseconds - ms 
     363  -- put "PseudoXMLPS: mGetListFromXMLString:" && the milliseconds - ms 
    344364   
    345365  if not(listP(li)) then return [:] 
     
    363383   
    364384  dertext = xscr(#FileIOFunktionen).mGetTextFromFile(thePath, void, "windows-1252") 
    365   if length(dertext) > 0 then return mGetListFromXMLStringX(me, dertext) 
     385  if length(dertext) > 0 then return mGetListFromXMLString(me, dertext) 
    366386  return [:] 
    367387end 
     
    12301250 
    12311251on mGetListFromPListString me, str 
    1232   return mConvertKeyList(me, mGetListFromXMLStringX(me, str, 0)) 
     1252  return mConvertKeyList(me, mGetListFromXMLString(me, str, 0)) 
    12331253end 
    12341254 
     
    13291349    end repeat 
    13301350  end repeat 
    1331    
    13321351   
    13331352  zehn = numToChar(10) 
  • trunk/lingosource/castlib2/aleXtrasMovieScript.ls

    r244 r245  
    5656    end if 
    5757     
    58     alextras = rawnew(cms.script) 
     58    alextras = new(cms.script) 
    5959    if ilk(alextras) <> #instance then 
    6060      alert "Script" & QUOTE & "commonMovieScript" & QUOTE && "is missing. This movie can't proceed!" 
     
    109109  if scrName = "commonMovieScript" then return alextras 
    110110   
    111   inst = alextras.mGetInstance(scrName, 1) 
     111  str_scrName = alextras.mSymb2String(scrName) 
     112  inst = alextras.mGetInstance(str_scrName, 1) 
    112113  if ilk(inst) <> #instance then 
    113114    if the runmode contains "aut" then 
    114       put "Script" && QUOTE & scrName & QUOTE && "is missing! This may cause unwanted behavior" 
    115     end if 
    116       inst = [] 
    117     end if 
     115      put "Script" && QUOTE & str_scrName & QUOTE && "is missing! This may cause unwanted behavior" 
     116    end if 
     117    inst = [] 
     118  end if 
     119  if ilk(inst) = #instance then 
     120    if inst.handler(#new) = 1 then inst.new() 
     121  end if 
    118122  return inst 
    119123  ---------------------- 
    120124   
    121125   
    122   scrName = symbol(scrName) 
     126  scrName = alextras.mSymbolify(scrName) 
    123127  if ilk(scrName) <> #symbol then scrName = #commonmoviescript 
    124128  scri = (mGetAleXtras()).getaprop(#scripts) 
     
    233237  end repeat 
    234238  includes.deleteOne(#commonMovieScript) 
    235     globs[#gParentScriptInstances] = includes 
     239  globs[#gParentScriptInstances] = includes 
    236240   
    237241  exit 
     
    280284  if not(objectP(incl)) then 
    281285    put "No scriptinstances stored" 
    282   exit 
     286    exit 
    283287  end if 
    284288   
  • trunk/lingosource/castlib2/commonMovieScript.ls

    r244 r245  
    6666----------------------------------- 
    6767 
    68 -- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 
    69 -- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 
    70  
    71  
    72  
     68on _____________________PROPERTY_DECLARATION me 
     69end 
     70-- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 
     71property ancestor 
    7372property pGList 
    7473property pCaseLists 
     74 
     75 
     76-- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 
     77on ___________________STANDARD_EVENTS me 
     78end 
     79-- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 
     80 
     81on new me 
     82  Script_Root_Object = member("Script_Root_Object") 
     83  if ilk(Script_Root_Object) = #member then 
     84    if Script_Root_Object.type = #script then 
     85      ancestor = new(script "Script_Root_Object") 
     86      mSetScriptName me, "commonMovieScript" 
     87    end if 
     88  end if 
     89  return me 
     90end 
     91 
     92-- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 
     93 
     94on mFilterString me, string_Input, string_keyword 
     95  ----------------------------------- 
     96  -- CREATED: 26.02.2010 
     97  -- ACTION: Filter to constrain the results 
     98  --                       use "%" or "^" as the first char if the filter shall be => 
     99  --                                                     'word STARTS with <string_keyword>' 
     100  --                       use "$" as the last char if the filter shall be => 
     101  --                                                     'word ENDS with <string_keyword>' 
     102  --                       (HINT: if searching for the exact phrase use ^keyword$ as filter) 
     103  --                       otherwise the string <string_keyword> may appear anywhere in the word => 
     104  --                                                     'word CONTAINS <string_keyword>' 
     105  -- INPUT: <string_Input> ; string 
     106  --        <string_keyword> ; string 
     107  -- RETURNS: boolean (integer 1 or 0) ; true or false 
     108  -- EXAMPLE: put xscr().mFilterString("commonmoviescript", "%comm") -- STARTS 
     109  --          -- 1 
     110  --          put xscr().mFilterString("commonmoviescript", "ript$") 
     111  --          -- 1 
     112  --          put xscr().mFilterString("commonmoviescript", "%commonmoviescript$") 
     113  --          -- 1 
     114  --          put xscr().mFilterString("commonmoviescript", "movie") 
     115  --          -- 1 
     116  ----------------------------------- 
     117   
     118  string_Input = string(string_Input) 
     119  if length(string_Input) < 1 then return 0 
     120   
     121  string_keyword = string(string_keyword) 
     122  if length(string_keyword) < 1 then return 1 
     123   
     124  if string_keyword starts "^" then 
     125    delete char 1 of string_keyword 
     126    offs = offset(string_keyword, string_Input) 
     127    return (offs = 1) 
     128  else if string_keyword starts "%" then 
     129    delete char 1 of string_keyword 
     130    offs = offset(string_keyword, string_Input) 
     131    return (offs = 1) 
     132  else if the last char of string_keyword = "$" then 
     133    delete the last char of string_keyword 
     134    offs = offset(string_keyword, string_Input) 
     135    return (offs = (length(string_Input) - length(string_keyword) + 1)) 
     136  else 
     137    offs = offset(string_keyword, string_Input) 
     138    return (offs > 0) 
     139  end if 
     140   
     141end 
     142 
     143-- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 
    75144 
    76145on mGetGlobalList me 
     
    163232  ----------------------------------- 
    164233   
     234  delayedCallBackList = mGetGlobalValue(me, #delayedCallBackList) 
     235  if ilk(delayedCallBackList) = #proplist then 
     236    jobs = delayedCallBackList[#jobs] 
     237    repeat with n = count(jobs) down to 1 
     238      toName = jobs.getPropAt(n) 
     239      dto = timeout(toName) 
     240      if ilk(dto) = #timeout then dto.forget() 
     241    end repeat 
     242    delayedCallBackList[#jobs] = [:] 
     243  end if 
    165244   
    166245  sendAllSprites(#mStopMovieWasCalled) 
     
    218297    mSetGlobalValue(me, #playBackModeValueList, playBackModeValueList) 
    219298  end if 
    220   return playBackModeValueList[symbol_Prop] = any_value 
     299  playBackModeValueList[symbol_Prop] = any_value 
    221300end 
    222301 
     
    317396 
    318397on mGetFloatVersionNumber me, prodVers 
    319     offs = offset(".", prodVers) 
    320     if offs > 0 then 
    321       intVers = char 1 to offs of prodVers 
    322       delete char 1 to offs of prodVers 
    323     else 
    324       intVers = "" 
    325     end if 
    326     cnt = length(prodVers) 
    327     repeat with n = 1 to cnt 
    328       c = prodVers.char[n] 
    329       if integerP(integer(c)) then 
    330         put c after intVers 
    331       else if c <> "." then 
    332         exit repeat 
    333       end if 
    334     end repeat 
    335      
     398  offs = offset(".", prodVers) 
     399  if offs > 0 then 
     400    intVers = char 1 to offs of prodVers 
     401    delete char 1 to offs of prodVers 
     402  else 
     403    intVers = "" 
     404  end if 
     405  cnt = length(prodVers) 
     406  repeat with n = 1 to cnt 
     407    c = prodVers.char[n] 
     408    if integerP(integer(c)) then 
     409      put c after intVers 
     410    else if c <> "." then 
     411      exit repeat 
     412    end if 
     413  end repeat 
     414   
    336415  return value(intVers) 
    337416end 
     
    363442      env = gLameAuthoringHack_forSlowEnvironment_onMac 
    364443    else 
    365     env = the environment 
     444      env = the environment 
    366445    end if 
    367446     
     
    388467  if voidP(gPlatform) then 
    389468     
    390   isMac = the platform contains "Macintosh" 
    391   if isMac then 
     469    isMac = the platform contains "Macintosh" 
     470    if isMac then 
    392471       
    393472      onX = value(char 1 of (the last word of (mGetEnvironment(me)).osversion)) <= 5 
     
    553632  --         <p1 - p3> ; arbitrary parameters ; just in case additional parameters are required, 
    554633  --             which can not, for some reason, be stored in the object <callbackObject> itself 
    555   -- RETURNS: either a string or an integer. In case of 1 the callback was successfully called, otherwise 
     634  -- RETURNS: either a string or any value. In case of a parameter error 
    556635  --             an errorstring is returned and the callback was NOT successfully called. 
    557   -- EXAMPLE: xscr().mDoCallBack(callBackObject) 
     636  -- EXAMPLE: theResult = xscr().mDoCallBack(callBackObject) 
    558637  ----------------------------------- 
    559638   
     
    578657  case ilk(tgt) of 
    579658    #script, #instance: 
    580       call(hnd, [tgt], callbackObject, p1, p2, p3) 
     659      retval = call(hnd, [tgt], callbackObject, p1, p2, p3) 
    581660    #list, #proplist: 
    582661      if count(tgt) = 0 then 
     
    591670        put "p3:" && p3 
    592671        put "---------------------------" 
     672        retval = 1 
    593673      else 
    594       call(hnd, tgt, callbackObject, p1, p2, p3) 
     674        retval = call(hnd, tgt, callbackObject, p1, p2, p3) 
    595675      end if 
    596676       
     
    598678      spr = mGetKanal(me, tgt) 
    599679      if spr < 1 then return "callbackObject[#target] is neither an object nor a spritenumber/name:" && callbackObject[#target] 
    600       sendSprite(spr, hnd, callbackObject, p1, p2, p3) 
     680      retval = sendSprite(spr, hnd, callbackObject, p1, p2, p3) 
    601681  end case 
    602682   
     683  return retval 
     684end 
     685 
     686-- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 
     687 
     688on mDoDelayedCallback me, proplist_callbackObject, integer_DelayTime, any_param1, any_param2, any_param3 
     689  ----------------------------------- 
     690  -- CREATED: 04.02.2010 
     691  -- ACTION: Break the event chain by deleying a call by at least one milliseconds 
     692  -- INPUT:  <callbackObject> ; object (propertylist) ; required ; a callBack object of the format: 
     693  --             [#handler:symbol, #target:object], which can be any number of additional properties 
     694  --             since this object will be provided as parameter to the recipient 
     695  --             the recipient can access all these additional properties 
     696  --         <integer_DelayTime> ; integer ; timeoutlength in milliseconds, optional, default = 1 
     697  --         <any_param1 - any_param3> ; arbitrary parameters ; just in case additional parameters are required, 
     698  --             which can not, for some reason, be stored in the object <callbackObject> itself 
     699  -- RETURNS: true for success 
     700  -- EXAMPLE: cb = [#target:me, #handler:#foo] 
     701  --          xscr().mDoDelayedCallback(cb, 1, "abc", 3, []) 
     702  ----------------------------------- 
     703   
     704  delayedCallBackList = mGetGlobalValue(me, #delayedCallBackList) 
     705  if ilk(delayedCallBackList) <> #proplist then 
     706    delayedCallBackList = [:] 
     707    delayedCallBackList[#lastIndex] = 0 
     708    delayedCallBackList[#jobs] = [:] 
     709    mSetGlobalValue(me, #delayedCallBackList, delayedCallBackList) 
     710  end if 
     711   
     712  if ilk(integer_DelayTime) <> #integer then integer_DelayTime = 1 
     713  integer_DelayTime = max(1, integer_DelayTime) 
     714   
     715  delayedCallBackList[#lastIndex] = delayedCallBackList[#lastIndex] + 1 
     716  if delayedCallBackList[#lastIndex] = the maxinteger then delayedCallBackList[#lastIndex] = 1 
     717   
     718  toName = "delayedCallbackTimeout" & mGetMemoryAddress(me, me) & delayedCallBackList[#lastIndex] 
     719   
     720  delayedCallBackList[#jobs][toName] = [#cobj: proplist_callbackObject, #params:[any_param1, any_param2, any_param3]] 
     721   
     722  dto = mCreateTimeOut(me, toName, integer_DelayTime, #delayedCallCallback, me) 
     723   
    603724  return 1 
     725end 
     726 
     727-- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 
     728-- cal the callback after the delay timeout 
     729 
     730on delayedCallCallback me, dto 
     731  if ilk(dto) <> #timeout then exit 
     732  toName = dto.name 
     733  dto.forget() 
     734  delayedCallBackList = mGetGlobalValue(me, #delayedCallBackList) 
     735  if ilk(delayedCallBackList) <> #proplist then exit 
     736  thisJob = delayedCallBackList[#jobs][toName] 
     737  if voidP(thisJob) then exit 
     738  delayedCallBackList[#jobs].deleteProp(toName) 
     739  mDoCallBack me, thisJob[#cobj], thisJob[#params][1], thisJob[#params][2], thisJob[#params][3] 
    604740end 
    605741 
     
    8981034   
    8991035  tempMembers = mGetTempMemberList(me, aType) 
    900   tempMembers.add(aMember) 
     1036  if tempMembers.getPos(aMember) < 1 then tempMembers.add(aMember) 
    9011037   
    9021038end 
     
    14751611end 
    14761612 
     1613-- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 
     1614 
     1615on mGetMemoryAddress me, theObject 
     1616  ----------------------------------- 
     1617  -- CREATED: 08.12.2009 
     1618  -- ACTION: Convert argument into a string and chop the last char 
     1619  --         Usually used to get a unique identifier for a scriptinstance (=> the last word of string(me)) 
     1620  --         but without the trailing ">". 
     1621  --         Not only this looks nicer, but also if used for a filename the ">" character is problematic in a filename 
     1622  -- INPUT: <theObject> ; any ilk which can be converted to a string 
     1623  -- RETURNS: string ; the stringified object without the trailing char 
     1624  -- EXAMPLE: uniqueInstanceIdentifier = xscr().mGetMemoryAddress(me) 
     1625  ----------------------------------- 
     1626   
     1627  theObject = the last word of string(theObject) 
     1628  delete the last char of theObject 
     1629  return theObject 
     1630end 
     1631 
     1632-- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 
     1633 
     1634on mGetPropertyRecursive me, proplist_source, list_propnames 
     1635  ----------------------------------- 
     1636  -- CREATED: 08.03.2010 
     1637  -- ACTION: Dereference a proplist recursively 
     1638  -- INPUT: <proplist_source> ; property list ; the source list 
     1639  --        <list_propnames> ; linear list ; linear list with property names, which lead to the last property 
     1640  -- RETURNS: any value 
     1641  -- EXAMPLE: sourceList = [#one:[#two:[#three:3]]] 
     1642  --          val = xscr().mGetPropertyRecursive(sourceList, [#one, #two, #three]) 
     1643  ----------------------------------- 
     1644   
     1645  if ilk(proplist_source) <> #proplist then return void 
     1646  if not(listP(list_propnames)) then return void 
     1647  cnt = count(list_propnames) 
     1648  if cnt < 1 then return void 
     1649  if cnt = 1 then return proplist_source[list_propnames[1]] 
     1650  propname = list_propnames[1] 
     1651  list_propnames.deleteAt(1) 
     1652  return mGetPropertyRecursive(me, proplist_source[propname], list_propnames) 
     1653end 
    14771654 
    14781655-- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 
     
    15081685 
    15091686on mGetNextPowerOfTwo me, breite 
     1687  powerList = mGetPowerOf2List(me) 
     1688  retval = powerList.findPosNear(integer(breite)) 
     1689  return powerList[min(retval, powerList.count)] 
     1690end 
     1691 
     1692-- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 
     1693 
     1694on mGetNextLowerPowerOfTwo me, breite 
     1695  powerList = mGetPowerOf2List(me) 
     1696  if powerList.getPos(breite) > 0 then return breite 
     1697  return powerList[max(1, powerList.findPosNear(integer(breite)) - 1)] 
     1698end 
     1699 
     1700-- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 
     1701 
     1702on mGetPowerOf2List me 
    15101703  theGlobs = mGetGlobalList(me) 
    15111704  gPowerList = theGlobs.getaprop(#gPowerList) 
    15121705  if ilk(gPowerList) <> #list then 
    1513     gPowerList = [2,4,8,16,32,64,128,256,512,1024] 
     1706    gPowerList = [1,2,4,8,16,32,64,128,256,512,1024] 
    15141707    gPowerList.sort() 
    15151708    theGlobs[#gPowerList] = gPowerList 
    15161709  end if 
    1517   retval = gPowerList.findPosNear(integer(breite)) 
    1518   return gPowerList[min(retval, gPowerList.count)] 
    1519 end 
    1520  
    1521 -- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 
    1522  
    1523 on mGetNextLowerPowerOfTwo me, breite 
    1524   theGlobs = mGetGlobalList(me) 
    1525   gPowerList = theGlobs.getaprop(#gPowerList) 
    1526   if ilk(gPowerList) <> #list then 
    1527     gPowerList = [1,2,4,8,16,32,64,128,256,512,1024] -- mac openGL only does 512 
    1528     gPowerList.sort() 
    1529     theGlobs[#gPowerList] = gPowerList 
    1530   end if 
    1531   if gPowerList.getPos(breite) > 0 then return breite 
    1532   return gPowerList[max(1, gPowerList.findPosNear(integer(breite)) - 1)] 
    1533 end 
    1534  
    1535  
     1710  return gPowerList 
     1711end 
    15361712 
    15371713-- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 
     
    16321808        mp = "" 
    16331809      else 
    1634       mp = the applicationpath 
     1810        mp = the applicationpath 
    16351811      end if 
    16361812      if length(mp) < 1 then 
     
    17391915  if delim = "\" then 
    17401916    if length(thePath) > 1 then 
    1741     if thePath.char[2] = ":" then 
    1742       num = charToNum(thePath.char[1]) 
    1743       if (num > 64 and num < 91) or (num > 96 and num < 123) then 
    1744         praef = thePath.char[1 .. 2] 
    1745         delete char 1 to 2 of thePath 
     1917      if thePath.char[2] = ":" then 
     1918        num = charToNum(thePath.char[1]) 
     1919        if (num > 64 and num < 91) or (num > 96 and num < 123) then 
     1920          praef = thePath.char[1 .. 2] 
     1921          delete char 1 to 2 of thePath 
     1922        else 
     1923          praef = "" 
     1924        end if 
    17461925      else 
    17471926        praef = "" 
    17481927      end if 
    1749     else 
    1750       praef = "" 
    1751     end if 
    17521928    else 
    17531929      praef = "" 
     
    17681944      praef = "" 
    17691945    end if 
     1946     
     1947    ----------- now we want to strip the domain too, because there could be a : for the port 
     1948    ----------- but : is one of the chars we want to translate, therefore we exclude the doamin also 
     1949    if length(praef) > 0 then 
     1950       
     1951      repeat with xy = 1 to 2 
     1952        if char 1 of thePath = "/" then 
     1953          praef = praef & "/" 
     1954          delete char 1 of thePath 
     1955        end if 
     1956      end repeat 
     1957       
     1958      domain = offset("/", thePath) 
     1959      if domain = 0 then domain = length(thePath) 
     1960      praef = praef & thePath.char[1 .. domain] 
     1961      delete char 1 to domain of thePath 
     1962    end if 
     1963    ------------ 
    17701964     
    17711965  else 
     
    18982092  if voidP(uebersetzung) then return mReplacePlaceHoldersInString(me, aString, variablesList) 
    18992093   
    1900     currLang = call(#mGetPrefValue, [mGetXScript(#GetSetPrefs)], #gLanguage) 
    1901     if voidP(currLang) then 
    1902       currLang = theGlobs.getaprop(#gSprache) 
    1903       if voidP(currLang) then currLang = 0 
    1904       call(#mSetPrefValue, [mGetXScript(#GetSetPrefs)], #gLanguage, currLang) 
    1905     end if 
    1906     ind = currLang + 1 
    1907     if ind > count(uebersetzung) then ind = 1 
     2094  currLang = call(#mGetPrefValue, [mGetXScript(#GetSetPrefs)], #gLanguage) 
     2095  if voidP(currLang) then 
     2096    currLang = theGlobs.getaprop(#gSprache) 
     2097    if voidP(currLang) then currLang = 0 
     2098    call(#mSetPrefValue, [mGetXScript(#GetSetPrefs)], #gLanguage, currLang) 
     2099  end if 
     2100  ind = currLang + 1 
     2101  if ind > count(uebersetzung) then ind = 1 
    19082102   
    19092103  return mReplacePlaceHoldersInString(me, uebersetzung[ind], variablesList) 
     
    20352229-- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 
    20362230 
     2231on mSymbolify me, any_var 
     2232  any_var = string(any_var) 
     2233  repeat while char 1 of any_var = "#" 
     2234    delete char 1 of any_var 
     2235  end repeat 
     2236  any_var = mString2Symb(me, any_var) 
     2237  return symbol(any_var) 
     2238end 
     2239 
     2240-- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 
     2241 
    20372242on mString2Symb me, str 
    20382243   
     
    20432248  end repeat 
    20442249   
     2250  offs = offset(".", str) 
     2251  repeat while offs > 0 
     2252    put "_d_" into char offs of str 
     2253    offs = offset(".", str) 
     2254  end repeat 
     2255   
     2256  offs = offset("-", str) 
     2257  repeat while offs > 0 
     2258    put "_b_" into char offs of str 
     2259    offs = offset("-", str) 
     2260  end repeat 
     2261   
    20452262  if integerP(integer(str.char[1])) then put "n__" before str 
    20462263   
     
    20572274    put " " into char offs to offs+2 of str 
    20582275    offs = offset("_s_", str) 
     2276  end repeat 
     2277   
     2278  offs = offset("_d_", str) 
     2279  repeat while offs > 0 
     2280    put "." into char offs to offs+2 of str 
     2281    offs = offset("_d_", str) 
     2282  end repeat 
     2283   
     2284  offs = offset("_b_", str) 
     2285  repeat while offs > 0 
     2286    put "-" into char offs to offs+2 of str 
     2287    offs = offset("_b_", str) 
    20592288  end repeat 
    20602289   
     
    21232352-- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 
    21242353 
    2125  
    2126  
    21272354on mUpperCase me, aString 
    21282355   
     
    21742401  end if 
    21752402   
    2176   -- pUPPERCASE = "ABCDEFGHIJKLMNOPQRSTUVWXYZZ¯Å¯Ä"&vA& "¯Ñ¯É¯Ö¯á¯â¯à¯ä¯ã¯ç¯å¯é¯è¯ë¯ì¯í¯î¯ñ¯ï¯ö¯ô‚Çš¯ú¯Ü¯òŒíŒÞ" 
    2177   -- pLowercase = "abcdefghijklmnopqrstuvwxyz¯°¯†"&"¯¢"&"¯§¯£¯•¯ß¯©¯®¯™¯Ž¯¯š¯Æ¯Ø¯±¯Ž¯¯¥¯ð¯µ¯Š¯þ¯ª¯º¯¶¯ÞŒì¯ø" 
    2178   pCaseLists.setaprop(#uppercase, ["A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z", "¯Å", "¯Ä", vA, "A", "¯Ñ", "¯É", "¯Ö", "¯á", "¯â", "¯à", "¯ä", "¯ã", "¯ç", "¯å", "¯é", "¯è", "¯ë", "¯ì", "¯í", "¯î", "¯ñ", "¯ï", "¯ö", "¯ô", "U", "¯ú", "¯Ü", "¯ò", "Œí", "ŒÞ"]) 
    2179   pCaseLists.setaprop(#lowercase, ["a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z", "¯°", "¯†", vA, "¯¢", "¯§", "¯£", "¯•", "¯ß", "¯©", "¯®", "¯™", "¯Ž", "¯", "¯š", "¯Æ", "¯Ø", "¯±", "¯Ž", "¯", "¯¥", "¯ð", "¯µ", "¯Š", "¯þ", "¯ª", "¯º", "¯¶", "¯Þ", "Œì", "¯ø"]) 
     2403  -- pUPPERCASE = "ABCDEFGHIJKLMNOPQRSTUVWXYZZÁÀ"&vA& "ÄÃà
     2404ÇÉÈÊËÍÌÎÏÑÓÒÔÖÕÚÙ€ÜÆØŒŞ" 
     2405  -- pLowercase = "abcdefghijklmnopqrstuvwxyzáà"&"â"&"ÀãåçéÚêëíìîïñóòÎöõúùûÌÊÞœÿ" 
     2406  pCaseLists.setaprop(#uppercase, ["A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z", "Á", "À", vA, "A", "Ä", "Ã", "à
     2407", "Ç", "É", "È", "Ê", "Ë", "Í", "Ì", "Î", "Ï", "Ñ", "Ó", "Ò", "Ô", "Ö", "Õ", "Ú", "Ù", "U", "Ü", "Æ", "Ø", "Œ", "Åž"]) 
     2408  pCaseLists.setaprop(#lowercase, ["a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z", "á", "à", vA, "â", "À", "ã", "Ã¥", "ç", "é", "Ú", "ê", "ë", "í", "ì", "î", "ï", "ñ", "ó", "ò", "ÃŽ", "ö", "õ", "ú", "ù", "û", "ÃŒ", "Ê", "Þ", "œ", "ÿ"]) 
    21802409   
    21812410end 
     
    21952424      li = ["Montag","Dienstag","Mittwoch","Donnerstag","Freitag","Samstag","Sonntag"] 
    21962425    "pt": 
    2197       li = ["Segunda-feira","Ter¯ßa-feira","Quarta-feira","Quinta-feira","Sexta-feira","S¯°bado","Domingo"] 
     2426      li = ["Segunda-feira","Terça-feira","Quarta-feira","Quinta-feira","Sexta-feira","Sábado","Domingo"] 
    21982427    "fr": 
    21992428      li = ["Lundi","Mardi","Mercredi","Jeudi","Vendredi","Samedi","Dimanche"] 
    22002429    "es": 
    2201       li = ["Lunes","Martes","Mi¯©rcoles","Jueves","Viernes","S¯°bado","Domingo"] 
     2430      li = ["Lunes","Martes","Miércoles","Jueves","Viernes","Sábado","Domingo"] 
    22022431    "it": 
    2203       li = ["Luned¯š","Marted¯š","Mercoled¯š","Gioved¯š","Venerd¯š","Sabato","Domenica"] 
     2432      li = ["Lunedì","Martedì","Mercoledì","Giovedì","Venerdì","Sabato","Domenica"] 
    22042433    "nl": 
    22052434      li = ["Maandag","Dinsdag","Woensdag","Donderdag","Vrijdag","Zaterdag","Zondag"] 
     
    26192848  put RETURN & "" after str 
    26202849   
    2621     put RETURN & "-- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" after str 
     2850  put RETURN & "-- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" after str 
    26222851  put RETURN & "-- xxxxxxxxxxxxxxxxxx put <html>, <title> and <body> tags around chunk in order to use it as html of a text member" after str 
    26232852  put RETURN & "on mHTMLize me, str" after str 
     
    26562885  return str 
    26572886end 
     2887 
     2888-- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 
     2889 
     2890on getReferenceString me 
     2891  return "xscr()" 
     2892end 
  • trunk/lingosource/castlib2/memberInfo.xml

    r244 r245  
    4949                <fName>subversionVersionChecker</fName> 
    5050        </subversionVersionChecker> 
     51        <Script_Root_Object> 
     52                <scriptType>#parent</scriptType> 
     53                <comments>~/Documents/Scripts/lingo/Script_Root_Object.ls</comments> 
     54                <memberName>Script_Root_Object</memberName> 
     55                <fName>Script_Root_Object</fName> 
     56        </Script_Root_Object> 
     57        <scriptTextParser> 
     58                <scriptType>#parent</scriptType> 
     59                <comments>~/Documents/Scripts/lingo/scriptTextParser.ls</comments> 
     60                <memberName>scriptTextParser</memberName> 
     61                <fName>scriptTextParser</fName> 
     62        </scriptTextParser> 
    5163</Untitled> 
Note: See TracChangeset for help on using the changeset viewer.