📄 testingcase04.js
字号:
//*****************************************************************************
// A Practical Guide to Script-Driven Software Development
// Author: Qiming Lu Date: 5/1/2006
//*****************************************************************************
// Testing Case 4: pass scripting objects to the C++ side
Debugger.addBlankLine(1);
Debugger.trace("Testing Case 4", "pass scripting objects to the C++ side");
var kumhoWheel = Application.car.createWheel("KUMHO", "black");
Application.car.installWheel(kumhoWheel, 0);
//////////////////////////////////////////////////////////////////////////////
// Define a JavaScript object
function Wheel(brand, color)
{
this.brand = brand;
this.color = color;
}
Wheel.prototype.rotate = function()
{
Debugger.trace("Function", "Wheel.prototype.rotate called.");
}
Wheel.prototype.adjustParameters = function(param1, param2, param3)
{
var msg = "Wheel.prototype.adjustParameters called. Adjusted to: ";
msg += param1 + ", " + param2 + ", " + param3;
Debugger.trace("Function", msg);
}
var jsWheel = new Wheel("MICHELIN", "gray");
Application.car.installWheel(jsWheel, 1);
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -