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

Changeset 42 for trunk/lingosource


Ignore:
Timestamp:
10/23/07 17:24:02 (5 years ago)
Author:
alex
Message:

first try of supporting text and fields

Location:
trunk/lingosource/castlib1
Files:
8 added
3 edited

Legend:

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

    r39 r42  
    253253  subli = [] 
    254254  svn_subli.add(subli) 
    255   subli.add("Export scripts...") 
    256   pLookUpCommandList.setaprop("Export scripts...", "mExportScriptsToFolder me, skipIcons_optional, selectionOnly_optional, convertLineBreaksToUnix, chooseNewPath_optional") 
     255  subli.add("Export scripts to SVN working copy...") 
     256  pLookUpCommandList.setaprop("Export scripts to SVN working copy...", "mExportScriptsToFolder me, skipIcons_optional, selectionOnly_optional, convertLineBreaksToUnix, chooseNewPath_optional") 
    257257   
    258258  subli.add("Import script from file...") 
     
    263263  pLookUpCommandList.setaprop("SVN Update ScriptText in Working Copy...", "mSVN_Update_Working_Copy_ScriptText me, chooseNewPath_optional") 
    264264   
    265   subli.add("SVN Update And Import Scripts...") 
    266   pLookUpCommandList.setaprop("SVN Update And Import Scripts...", "mSVN_Update_And_Import_ScriptsFromFolder me, chooseNewPath_optional, selectionOnly_optional") 
    267    
    268   subli.add("") 
    269   subli.add("SVN Commit ScriptText...") 
    270   pLookUpCommandList.setaprop("SVN Commit ScriptText...", "mSVN_Commit_CurrentScripts_ScriptText me, selected_Members_Only_optional") 
     265    subli.add("") 
     266    subli.add("SVN Import Scripts, Text and Fields from working copy...") 
     267  pLookUpCommandList.setaprop("SVN Import Scripts, Text and Fields from working copy...", "mSVN_Update_And_Import_ScriptsFromFolder me, chooseNewPath_optional, selectionOnly_optional") 
     268   
     269   
     270  subli.add("") 
     271  subli.add("SVN Commit ScriptText only...") 
     272  pLookUpCommandList.setaprop("SVN Commit ScriptText only...", "mSVN_Commit_CurrentScripts_ScriptText me, selected_Members_Only_optional") 
    271273   
    272274  subli.add("") 
     
    277279   
    278280  ---------------------------------------------------- svn functions: 
     281   
     282  svn_subli.add("") 
     283  svn_subli.add("Fields and text ex/import for SVN") 
     284  subli = [] 
     285  svn_subli.add(subli) 
     286   
     287  subli.add("Export text members to SVN working copy...") 
     288  pLookUpCommandList.setaprop("Export text members to SVN working copy...", "mExportTextAndFieldsToFolder me, skipIcons_optional, selectionOnly_optional, convertLineBreaksToUnix, chooseNewPath_optional") 
     289   
     290  subli.add("Import text from SVN working copy...") 
     291  pLookUpCommandList.setaprop("Import text from SVN working copy...", "mImportTextAndFields me, thePath_optional, castlibNumber_optional, dontWarn_optional, infolist_optional") 
     292   
     293  subli.add("") 
     294  subli.add("SVN Import Scripts, Text and Fields from working copy...") 
     295  pLookUpCommandList.setaprop("SVN Import Scripts, Text and Fields from working copy...", "mSVN_Update_And_Import_ScriptsFromFolder me, chooseNewPath_optional, selectionOnly_optional") 
     296   
     297   
     298  ---------------------------------------------------- 
     299   
     300   
    279301  svn_subli.add("") 
    280302  svn_subli.add("SVN -- binary director files") 
     
    320342  li.add("Convert textmember to HTML + copy to clipboard") 
    321343  pLookUpCommandList.setaprop("Convert textmember to HTML + copy to clipboard", "mCopyConvert2HTML") 
    322  
     344   
    323345   
    324346   
  • trunk/lingosource/castlib1/alexUtilities.ls

    r35 r42  
    22872287   
    22882288  doit = 0 
    2289    
    22902289   
    22912290  repeat with n = 1 to cnt 
     
    31823181 
    31833182-- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 
     3183on _______________SVN_SCRIPT_TEXT me 
     3184end 
     3185-- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 
     3186 
    31843187 
    31853188on mCompareCurrentScriptToWorkingCopy me, convertLineBreaksToUnix 
     
    32103213  repeat with sub in sel 
    32113214    repeat with mem = sub[1] to sub[2] 
    3212       memref = member(mem,cl)    
    3213       if memref.type = #script then 
    3214          
    3215         thePath = mFindWorkingCopyCounterpart(me, memref) 
     3215      memref = member(mem,cl) 
     3216       
     3217      memtype = memref.type 
     3218      if [#script, #field, #text].getPos(memtype) > 0 then 
     3219         
     3220        case memtype of 
     3221             
     3222            ----------------------- 
     3223          #script: 
     3224            ext = ".ls" 
     3225            st = memref.scripttext 
     3226             
     3227            ----------------------- 
     3228          #field: 
     3229            ext = ".txt" 
     3230            st = memref.text 
     3231             
     3232            ----------------------- 
     3233          #text: 
     3234            ext = ".rtf" 
     3235            st = memref.rtf 
     3236             
     3237            ----------------------- 
     3238          otherwise: 
     3239            ext = ".txt" 
     3240            st = memref.text 
     3241             
     3242        end case 
     3243         
     3244         
     3245        thePath = mFindWorkingCopyCounterpart(me, memref, ext) 
    32163246         
    32173247        if length(thePath) < 1 then 
     
    32203250        end if 
    32213251         
    3222         st = memref.scripttext 
    32233252         
    32243253         
     
    33763405           
    33773406           
    3378           memref.scripttext = scrText 
     3407           
     3408          case memtype of 
     3409               
     3410              ----------------------- 
     3411            #script: 
     3412              memref.scripttext = scrText 
     3413               
     3414              ----------------------- 
     3415            #field: 
     3416              memref.text = scrText 
     3417               
     3418              ----------------------- 
     3419            #text: 
     3420              memref.rtf = scrText 
     3421               
     3422              ----------------------- 
     3423            otherwise: 
     3424              memref.text = scrText 
     3425               
     3426          end case 
     3427           
     3428           
     3429           
    33793430           
    33803431        end if 
     
    34203471    repeat with mem = sub[1] to sub[2] 
    34213472      memref = member(mem,cl)    
    3422       if memref.type = #script then 
    3423          
    3424         thePath = mFindWorkingCopyCounterpart(me, memref) 
     3473      memtype = memref.type 
     3474      if [#script, #field, #text].getPos(memtype) > 0 then 
     3475         
     3476        case memtype of 
     3477             
     3478            ----------------------- 
     3479          #script: 
     3480            ext = ".ls" 
     3481            st = memref.scripttext 
     3482             
     3483            ----------------------- 
     3484          #field: 
     3485            ext = ".txt" 
     3486            st = memref.text 
     3487             
     3488            ----------------------- 
     3489          #text: 
     3490            ext = ".rtf" 
     3491            st = memref.rtf 
     3492             
     3493            ----------------------- 
     3494          otherwise: 
     3495            ext = ".txt" 
     3496            st = memref.text 
     3497             
     3498        end case 
     3499         
     3500         
     3501        thePath = mFindWorkingCopyCounterpart(me, memref, ext) 
    34253502         
    34263503        if length(thePath) < 1 then 
     
    34293506        end if 
    34303507         
    3431         st = memref.scripttext 
    3432          
    3433         mSaveToTextFile me, st, thePath 
     3508        ------------------- export will now be done in "mExportScriptsToFolder" 
     3509        --        st = memref.scripttext 
     3510        --        mSaveToTextFile me, st, thePath 
    34343511         
    34353512        if the platform contains "mac" then 
     
    34573534-- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 
    34583535 
    3459 on mFindWorkingCopyCounterpart me, memref 
     3536on mFindWorkingCopyCounterpart me, memref, file_extension 
     3537   
     3538  file_extension = string(file_extension) 
     3539  if length(file_extension) < 1 then file_extension = ".ls" 
    34603540   
    34613541  workingCopies = value(getPref("svn_workingCopies_paths.txt")) 
     
    35443624      fname = string(infolist[l].getaprop(#fname)) 
    35453625      if length(fname) < 1 then fname = string(infolist.getpropat(l)) 
    3546       fpath = theFolder & fname & ".ls" 
     3626      fpath = theFolder & fname & file_extension 
    35473627       
    35483628      --      put "path:" && fpath  
     
    36513731        memref = member(n, m) 
    36523732         
    3653         if memref.type = #script then 
     3733        memtype = memref.type 
     3734        if [#script, #field, #text].getPos(memtype) > 0 then 
     3735           
     3736          case memtype of 
     3737               
     3738              ----------------------- 
     3739            #script: 
     3740              ext = ".ls" 
     3741              scrText = memref.scripttext 
     3742              scrtype = memref.scripttype 
     3743              ----------------------- 
     3744            #field: 
     3745              ext = ".txt" 
     3746              scrText = memref.text 
     3747              scrtype = #field 
     3748              ----------------------- 
     3749            #text: 
     3750              ext = ".rtf" 
     3751              scrText = memref.rtf 
     3752              convertLineBreaksToUnix = 0 
     3753              scrtype = #text 
     3754              ----------------------- 
     3755            otherwise: 
     3756              ext = ".txt" 
     3757              scrText = memref.text 
     3758              scrtype = #field 
     3759          end case 
     3760           
     3761           
    36543762           
    36553763          memname = memref.name 
     
    36593767           
    36603768           
    3661           scrText = memref.scripttext 
     3769          -- scrText = memref.scripttext 
    36623770           
    36633771           
     
    37783886          ----------------------------------------- 
    37793887           
     3888           
    37803889          if theDefaultName <> origname then 
    37813890            alterText = "" 
    3782             snam = baShortFileName(thisFolder & origname & ".ls") 
     3891            snam = baShortFileName(thisFolder & origname & ext) 
    37833892            if length(snam) > 0 then 
    3784               alterText = mGetTextFromFile(me, thisFolder & origname & ".ls") 
     3893              alterText = mGetTextFromFile(me, thisFolder & origname & ext) 
    37853894            end if 
    37863895          else 
    3787             alterText = mGetTextFromFile(me, thisFolder & theDefaultName & ".ls") 
     3896            alterText = mGetTextFromFile(me, thisFolder & theDefaultName & ext) 
    37883897          end if 
    37893898           
     
    37963905               
    37973906               
    3798               mSaveToTextFile me, scrText, thisFolder & theDefaultName & ".ls" 
     3907              mSaveToTextFile me, scrText, thisFolder & theDefaultName & ext 
    37993908               
    38003909               
     
    38183927              if theDefaultName <> origname then 
    38193928                 
    3820                 snam = baShortFileName(thisFolder & origname & ".ls") 
     3929                snam = baShortFileName(thisFolder & origname & ext) 
    38213930                if length(snam) > 0 then baDeleteFile(snam) 
    3822                 erg = baRenameFile(thisFolder & theDefaultName & ".ls", thisFolder & origname & ".ls") 
    3823                 if erg <> 1 then put "Couldn't rename file " & thisFolder & theDefaultName & ".ls to " & thisFolder & origname & ".ls" 
     3931                erg = baRenameFile(thisFolder & theDefaultName & ".ls", thisFolder & origname & ext) 
     3932                if erg <> 1 then put "Couldn't rename file " & thisFolder & theDefaultName & ext & " to " & thisFolder & origname & ext 
    38243933                if bmexp = 1 then 
    38253934                  snam = baShortFileName(thisFolder & origname & ".jpg") 
     
    38393948           
    38403949           
    3841           infolist.setaprop(symbol(origname), [#scripttype: memref.scripttype, #comments: memref.comments, #membername: memname, #fname: origname]) 
     3950          infolist.setaprop(symbol(origname), [#scripttype: scrtype, #comments: memref.comments, #membername: memname, #fname: origname]) 
    38423951          -- we need to store origname as string additionally to symbol, as the symbol may change the case (although only ufs is case sensitive 
    38433952          -- I am more comfortable with not relying on case insensitivity of filesystems) 
     
    40094118    if length(fname) < 1 then fname = string(infoList.getPropAt(n)) 
    40104119    fpath = thePath & fname 
    4011     mImportScriptWithThumbnail me, fpath & ".ls", fd, 1, thisMemberInfo 
     4120     
     4121    scrtype = thisMemberInfo.getaprop(#scripttype) 
     4122    case scrtype of 
     4123      #field: ext = ".txt" 
     4124      #text: ext = ".rtf" 
     4125      otherwise: ext = ".ls" 
     4126    end case 
     4127     
     4128    mImportScriptWithThumbnail me, fpath & ext, fd, 1, thisMemberInfo 
     4129     
    40124130  end repeat 
    40134131   
     
    41104228      memref = member(m, cl) 
    41114229      dertyp = memref.type 
    4112       if dertyp = #script then 
     4230       
     4231      if [#script, #text, #field].getPos(dertyp) > 0 then 
    41134232         
    41144233        found = 0 
     
    41194238            fname = string(infolist[l].getaprop(#fname)) 
    41204239            if length(fname) < 1 then fname = string(infolist.getpropat(l)) 
    4121             fpath = thePath & fname & ".ls" 
     4240             
     4241            case dertyp of 
     4242              #text: ext = ".rtf" 
     4243              #field: ext = ".txt" 
     4244              otherwise: ext = ".ls"     
     4245            end case 
     4246             
     4247            fpath = thePath & fname & ext 
    41224248             
    41234249            found = 1 
     
    42814407   
    42824408   
     4409  case scrtype of 
     4410    #field, #text: memtype = scrtype 
     4411    otherwise: memtype = #script 
     4412  end case 
     4413   
     4414   
    42834415  askreplace = 1 
    42844416  scr = member(scrname, castlibNumber) 
    42854417  if voidP(scr) then 
    4286     scr = new(#script, castlib(castlibNumber)) 
     4418    scr = new(memtype, castlib(castlibNumber)) 
    42874419    askreplace = 0 
    42884420  end if 
    42894421  if scr.type <> #script then 
    4290     scr = new(#script, castlib(castlibNumber)) 
     4422    scr = new(memtype, castlib(castlibNumber)) 
    42914423    askreplace = 0 
    42924424  end if 
     
    43904522   
    43914523   
    4392    
    4393   scr.scripttext = scrtext 
     4524  case scrtype of 
     4525    #field: scr.text = scrtext 
     4526    #text: scr.rtf = scrtext 
     4527    otherwise: memtype = scr.scripttext = scrtext 
     4528  end case 
     4529   
    43944530   
    43954531  if [#movie, #parent, #score].getPos(scrtype) > 0 then scr.scripttype = scrtype 
     
    44084544end 
    44094545 
     4546 
     4547-- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 
     4548on _______________SVN_FIELD_TEXT me 
     4549end 
     4550-- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 
     4551 
     4552on mExportTextAndFieldsToFolder me, skipIcons_optional, selectionOnly_optional, convertLineBreaksToUnix, chooseNewPath_optional 
     4553  mExportScriptsToFolder me, skipIcons_optional, selectionOnly_optional, convertLineBreaksToUnix, chooseNewPath_optional 
     4554end 
     4555 
     4556-- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 
     4557 
     4558on mImportTextAndFields me, thePath_optional, castlibNumber_optional, dontWarn_optional, infolist_optional 
     4559  mImportScriptWithThumbnail me, thePath_optional, castlibNumber_optional, dontWarn_optional, infolist_optional 
     4560end 
    44104561 
    44114562-- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 
  • trunk/lingosource/castlib1/memberInfo.xml

    r33 r42  
    6767                <fName>bbdiff</fName> 
    6868        </bbdiff> 
     69        <menu1_button> 
     70                <scriptType>#text</scriptType> 
     71                <comments></comments> 
     72                <memberName>menu1_button</memberName> 
     73                <fName>menu1_button</fName> 
     74        </menu1_button> 
     75        <menu2_button> 
     76                <scriptType>#text</scriptType> 
     77                <comments></comments> 
     78                <memberName>menu2_button</memberName> 
     79                <fName>menu2_button</fName> 
     80        </menu2_button> 
     81        <pastefeld> 
     82                <scriptType>#field</scriptType> 
     83                <comments></comments> 
     84                <memberName>pastefeld</memberName> 
     85                <fName>pastefeld</fName> 
     86        </pastefeld> 
     87        <oldclipboard> 
     88                <scriptType>#field</scriptType> 
     89                <comments></comments> 
     90                <memberName>oldclipboard</memberName> 
     91                <fName>oldclipboard</fName> 
     92        </oldclipboard> 
     93        <searchword> 
     94                <scriptType>#field</scriptType> 
     95                <comments></comments> 
     96                <memberName>searchword</memberName> 
     97                <fName>searchword</fName> 
     98        </searchword> 
     99        <helptext> 
     100                <scriptType>#text</scriptType> 
     101                <comments>LinkedTextMember 
     102Titus:Users:alex:Desktop:handlerMenu_helptext.rtf 
     1031229860151 
     104rtf</comments> 
     105                <memberName>helptext</memberName> 
     106                <fName>helptext</fName> 
     107        </helptext> 
     108        <statusOutput> 
     109                <scriptType>#text</scriptType> 
     110                <comments>LinkedTextMember 
     111Titus:Users:alex:Desktop:handlerMenu_helptext.rtf 
     1121229860151 
     113rtf</comments> 
     114                <memberName>statusOutput</memberName> 
     115                <fName>statusOutput</fName> 
     116        </statusOutput> 
     117        <test> 
     118                <scriptType>#text</scriptType> 
     119                <comments></comments> 
     120                <memberName>test</memberName> 
     121                <fName>test</fName> 
     122        </test> 
     123        <tester2> 
     124                <scriptType>#text</scriptType> 
     125                <comments></comments> 
     126                <memberName>tester2</memberName> 
     127                <fName>tester2</fName> 
     128        </tester2> 
     129        <tester4> 
     130                <scriptType>#field</scriptType> 
     131                <comments></comments> 
     132                <memberName>tester4</memberName> 
     133                <fName>tester4</fName> 
     134        </tester4> 
    69135</Untitled> 
Note: See TracChangeset for help on using the changeset viewer.