Changeset 110 for trunk/lingosource
- Timestamp:
- 01/16/08 09:41:10 (4 years ago)
- Location:
- trunk/lingosource/castlib1
- Files:
-
- 1 added
- 2 edited
-
doCommandMovieScript.ls (added)
-
memberInfo.xml (modified) (1 diff)
-
thisMoviesScript.ls (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/lingosource/castlib1/memberInfo.xml
r96 r110 127 127 <fName>custom_Utilities</fName> 128 128 </custom_Utilities> 129 <doCommandMovieScript> 130 <scriptType>#movie</scriptType> 131 <comments></comments> 132 <memberName>doCommandMovieScript</memberName> 133 <fName>doCommandMovieScript</fName> 134 </doCommandMovieScript> 129 135 </Untitled> -
trunk/lingosource/castlib1/thisMoviesScript.ls
r108 r110 383 383 384 384 385 -- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 386 on _____________________PROCESS_COMMAND 387 end 388 -- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 389 -- process the command, which was chosen 390 -- at this point the command string is stored in the gloabllist, as we come here in an asynch process -> MUI dialog 391 -- the command and the paramaters are stored in the global list which we get with: call(#mGetGlobalList, mGetXScript()) 392 -------- the command string is glob.getaprop(#cmd) 393 -------- the parameters are in glob.getaprop(#theParams) 394 395 396 on mDoCmd dto, dto2 397 398 if ilk(dto) = #timeout then dto.forget() 399 if ilk(dto2) = #timeout then dto2.forget() 400 401 global gRetVal 402 glob = call(#mGetGlobalList, mGetXScript()) 403 404 skipFirstSpace = 0 405 406 inst = glob.getaprop(#theTargetInstance) 407 if ilk(inst) = #instance then 408 theMemberName = glob.getaprop(#theMemberName) 409 if glob.getaprop(#copy2ClipBoard) = 2 then 410 411 ----------- alex syntax (I have my own "global handler" to create scriptinstances differently): 412 -- dostr = "call(#" & symbol(glob.getaprop(#cmd)) & ", mGetXscript(#" & theMemberName & ")," 413 if string(theMemberName) = "commonMovieScript" then 414 dostr = "xscr()." & glob.getaprop(#cmd) & "(" 415 else 416 dostr = "xscr(#" & theMemberName & ")." & glob.getaprop(#cmd) & "(" 417 end if 418 skipFirstSpace = 1 419 del = 0 420 else if glob.getaprop(#copy2ClipBoard) = 1 then 421 ----------- standard syntax, create new script instance for each call (this is NOT the optimized way !) 422 dostr = "call(#" & symbol(glob.getaprop(#cmd)) & ", new(script " & QUOTE & theMemberName & QUOTE & ")," 423 424 ----------- better: store the intsance in a variable and reuse it (you will need to delete the new(script foo) lines) 425 -- dostr = "theScriptInstance = new(script " & QUOTE & theMemberName & QUOTE & ")" & RETURN & "call(#" & symbol(glob.getaprop(#cmd)) & ", theScriptInstance," 426 del = 1 427 else 428 dostr = "call(#" & symbol(glob.getaprop(#cmd)) & ", [inst]," 429 del = 1 430 end if 431 432 else 433 434 if glob.getaprop(#isBehavior) = 1 then 435 theParams = glob.getaprop(#theParams) 436 sprnum = theParams.getaprop("spritenum") 437 if length(string(sprnum)) < 1 then 438 sprnum = 0 439 else if not(integerP(integer(sprnum))) then 440 sprnum = QUOTE & sprnum & QUOTE 441 end if 442 theParams.deleteprop("spritenum") 443 444 dostr = "sendSprite(" & sprnum & ", #" & glob.getaprop(#cmd) & "," 445 del = 1 446 else 447 dostr = glob.getaprop(#cmd) & "(" 448 skipFirstSpace = 1 449 del = 0 450 end if 451 end if 452 453 theParams = glob.getaprop(#theParams) 454 if theParams.count then 455 repeat with thisParam in theParams 456 457 theVal = value(thisParam) 458 if voidP(theVal) then 459 if (string(thisParam)).word.count > 0 then 460 if skipFirstSpace = 1 then 461 put QUOTE&thisParam"E&"," after dostr 462 skipFirstSpace = 0 463 else 464 put " ""E&thisParam"E&"," after dostr 465 end if 466 else 467 put " void," after dostr 468 end if 469 470 else 471 if length(string(thisParam)) > 0 then 472 if skipFirstSpace = 1 then 473 put thisParam&"," after dostr 474 skipFirstSpace = 0 475 else 476 put " "&thisParam&"," after dostr 477 end if 478 else 479 put " void," after dostr 480 end if 481 482 end if 483 484 del = 1 485 486 end repeat 487 488 end if 489 if del then delete the last char of dostr 490 491 put ")" after dostr 492 493 if (glob.getaprop(#copy2ClipBoard) = 1) or (glob.getaprop(#copy2ClipBoard) = 2) then 494 put "theResult = " before dostr 495 496 member("pastefeld").text = dostr 497 copyToClipBoard(member("pastefeld")) 498 499 else 500 501 tell the stage 502 res = the result 503 do dostr 504 if the result <> res then 505 gRetVal = the result 506 if (string(gRetVal)).length < 100 then put gRetVal 507 else put "Too many chars to put in the message window. Get the result from the global variable gRetVal"&RETURN&"put gRetVal"&RETURN 508 end if 509 end tell 510 end if 511 512 end 385 513 386 514 387
Note: See TracChangeset
for help on using the changeset viewer.
