基本スケルトン
/*
Description : 説明
Support : 動作の対応
scripted : 作成者
ver 1.0.0.0
*/
(function(){
//ここに本文。
}());
クラス風表記スケルトン
/*
Description : 説明
Support : 動作の対応
scripted : 作成者
ver 1.0.0.0
*/
var class_like = (function(){
//constractor
function class_like(iv){
//internal variable
var _version = '1.0';
var _iv = iv;
// functions
function _method(src){
var dst = "Method Call : "+String(src);
return dst;
}
//public properties,methods
this.version = _version;
this.iv = _iv;
this.__proto__ = {
method : function(src){return _method(src);}
}
}
return class_like;
})();
var cl = new class_like("class_like_test");
var res1 = cl.method("test");
var res2 = cl.iv;
alert(res1,res2);
パネル表示のスケルトン
/*
Description : hogefuga
Support : scripted :
*/
(function(UI){
var panelName = File.decode(new File($.fileName).name).split(".jsx")[0];
var panel = (UI instanceof Panel) ? isPanel : new Window('window', panelName, [100, 100, 400,200], {resizeable:true});
var accept_btn = panel.add('button', bdbx([15,15,265,70]), 'button');
if(!(UI instanceof Panel)){
panel.location = [200,200];
panel.show();
}
accept_btn.onClick = function(){
alert("push!!");
panel.close();
}
function bdbx(b){
return [b[0],b[1],b[0]+b[2],b[1]+b[3]];
}
})(this);
ドッキングパネルのスケルトン Script UI Panels 内に保存する
/*
Description : hogefuga
Support : scripted :
*/
function dockPanel(UI) {
this.scriptName = File.decode(new File($.fileName).name).split(".jsx")[0];
this.panel = UI;
this.label = null;
this.btn = null;
//-----------------------------
this.btnClick = function(){
alert("Click");
}
//-----------------------------
this.run = function(){
this.lbl = this.panel.add("statictext",bdbx([15,15,100,30]),this.scriptName);
this.btn = this.panel.add("button",bdbx([15,45,100,30]),"push");
this.btn.onClick = this.btnClick;
}
function bdbx(b){
return [b[0],b[1],b[0]+b[2],b[1]+b[3]];
}
}
var dkpl = new dockPanel(this);
dkpl.run();