Halfbaked version :(

This commit is contained in:
2015-03-17 17:02:34 -07:00
parent b77c9bd56f
commit 13741e9c95
4 changed files with 11 additions and 68 deletions
+1 -52
View File
@@ -1,52 +1 @@
yGeneric_data = new Object();
yGeneric_data.scriptName = 'YTBGen';
yGeneric_data.scriptDesc = 'YToolBox Generic Script is the base for adding tools.';
yGeneric_data.scriptVer = '0.1a';
yGeneric_data.webLink = 'yorchnet.com';
yGeneric_data.img = yToolBox_data.icon;
//if yToolBox Exists add it to its tool list.
if (typeof(yToolBox_data)!=='undefined'){
//it should be called from toolbox.
yGeneric_data.buttonWidth=76;
yGeneric_data.buttonHeight=30;
yGeneric_data.btnLayout = "btn_"+yGeneric_data.scriptName+": Button { preferredSize: ['"+ yGeneric_data.buttonWidth+"','"+ yGeneric_data.buttonHeight+"'], text:'"+yGeneric_data.scriptName+"', helpTip:'"+yGeneric_data.scriptDesc+"' }";
}
yGeneric_data.res = "window { \
type:'palette' , text:'"+yGeneric_data.scriptName+' '+yGeneric_data.scriptVer+"',\
\
\
info: Group { \
alignment:['center','bottom'], \
icon: Image {icon:'"+String(yGeneric_data.img.path+"/"+yGeneric_data.img.name)+"',preferredSize: [15, 18]},\
website: StaticText { text:'"+yGeneric_data.webLink+"', alignment:['fill','center'] }\
}\
\
}";
//--------//--------//--------//--------//--------//--------//--------//--------//--------//--------//--------//--------//--------//--------//--------//--------//--------
// MAIN SCRIPT GOES HERE.
//--------//--------//--------//--------//--------//--------//--------//--------//--------//--------//--------//--------//--------//--------//--------//--------//--------
function build_yGeneric_data_UI(){
yGeneric_data.window = new Window ( yGeneric_data.res);
yGeneric_data.window.show();
}
yGeneric_data.activate = build_yGeneric_data_UI ;
//alert();
//CHECKS that the toolbox exists, and if it doesn´t it runs the script on its own.
//if (typeof(yToolBox_data)=='undefined'){
yGeneric_data.activate();
//}else{
//}
//if (typeof(ytb)!=='undefined'){␍ ␍yGenericTool =␍{ ␍ info : ␍ {␍ name : 'YGenericTool',␍ description : 'YToolBox Generic Script is the base for adding tools.',␍ version : '0.1a',␍ status : "alpha",␍ url : 'yorchnet.com'␍ },␍ resources :␍ {␍ img : new File('../header.png')␍ },␍ gui_preferences :␍ {␍ buttonWidth : 76,␍ buttonHeight : 30␍ },␍ toolbox :␍ {␍ buttons :␍ "btn_" + this.info.name + ": Button\␍ {\␍ preferredSize: ['" + this.gui_preferences.buttonWidth + "','" + this.gui_preferences.buttonHeight + "'],\␍ text:'" + this.info.name + "',\␍ helpTip:'" + this.info.description + "'\␍ }",␍ gui :␍ "window\␍ {\␍ type:'palette',\␍ text:'" + this.info.name + ' ' + this.info.version + " " + this.info.status + "',\␍ info: Group\␍ {\␍ alignment:['center','bottom'],\␍ icon: Image\␍ {\␍ icon:'" + String( this.resources.img.path + "/" + this.resources.img.name ) + "',\␍ preferredSize: [15, 18]\␍ },\␍ website: StaticText\␍ {\␍ text:'" + this.info.url + "',\␍ alignment:['fill','center'] \␍ }\␍ }\␍ }"␍ },␍ getInfo : function getInfo( info_request )␍ {␍ var info = null ;␍ ␍ switch (info_request)␍ {␍ case "name":␍ info = this.name;␍ break;␍ case "description":␍ info = this.description;␍ break;␍ case "version":␍ info = this.version;␍ break;␍ case "status":␍ info = this.status;␍ break;␍ case "url":␍ info = this.url;␍ break;␍ }␍ return info;␍ },␍ getInfo : function getInfo( resource_request )␍ {␍ var resource = null ;␍ ␍ switch ( resource_request )␍ {␍ case "img":␍ resource = this.img;␍ break;␍ }␍ return info;␍ },␍ getToolBoxButtons : function getToolBoxButtons()␍ {␍ return this.toolbox.buttons;␍ },␍ getToolBoxGui : function getToolBoxGui()␍ {␍ return this.toolbox.gui;␍ },␍ buildUI : function buildUI()␍ { ␍ this.window = new Window ( this.toolbox.gui , {resizable:true});␍ this.window.show();␍ },␍ addToBox : function addToBox()␍ {␍ ytb.addTool(this);␍ }, ␍ init : function init()␍ {␍ if ( typeof ytb !== "undefined" )␍ {␍ this.addToBox();␍ }␍ this.buildUI();␍ }␍}␍␍yGenericTool.init()␍␍
+8 -15
View File
@@ -1,5 +1,4 @@
#include "../yScripts/y_JSExtensions.jsx";
ySetProject_data = new Object();
ySetProject_data.scriptName = 'YSetStructure';
@@ -8,16 +7,9 @@ ySetProject_data.scriptVer = '0.1a';
ySetProject_data.webLink = 'yorchnet.com';
//if yToolBox Exists add it to its tool list.
if (typeof(yToolBox_data)!=='undefined'){
yToolBox_data.tools.push(ySetProject_data);
//it should be called from toolbox.
/*
ySetProject_data.buttonWidth=76;
ySetProject_data.buttonHeight=30;
*/
ySetProject_data.btnLayout = "btn_"+ ySetProject_data.scriptName+": Button { preferredSize: ['"+ yToolBox_data.buttonWidth+"','"+ yToolBox_data.buttonHeight+"'], text:'"+ySetProject_data.scriptName+"', helpTip:'"+ySetProject_data.scriptDesc+"' }";
if (typeof(ytb)!=='undefined'){
ySetProject_data.btnLayout = "btn_"+ ySetProject_data.scriptName+": Button { preferredSize: ['"+ ytb.buttonWidth+"','"+ ytb.buttonHeight+"'], text:'"+ySetProject_data.scriptName+"', helpTip:'"+ySetProject_data.scriptDesc+"' }";
ytb.addTool(ySetProject_data);
}
ySetProject_data.res = "window { \
@@ -77,7 +69,8 @@ function build_ySetProject_data_UI(){
ySetProject_data.activate = ySetProject ;
//CHECKS that the toolbox exists, and if it doesn´t it runs the script on its own.
if (typeof(yToolBox_data)=='undefined'){
ySetProject_data.activate();
}else{
}
if (typeof(ytb)=='undefined')
{
ySetProject_data.activate();
}else{
}