JavaLikeCalc.JavaScript
if(f_start) {
	apply_active = false;
	name_active = val_min_active = val_max_active = dim_active = log_active = false;
	prm_items = prm_value = name_value = dim_value = "", log_value = false, val_min_value = val_max_value = 0;
	//Connect to linked widget 
	if(pgOpenSrc.length) lWdg = this.wdgAt(pgOpenSrc, true);
	if(lWdg) {
		//Get allowed graphic's sources for the selection
		tmplLst = "";
		prm_items = "<Clear>\n";
		if(lWdg.attrPresent("allowSelLst")) tmplLst = lWdg.attr("allowSelLst");
		else if(lWdg.ownerWdg(true).attrPresent("allowSelLst")) tmplLst = lWdg.ownerWdg(true).attr("allowSelLst");
		for(off = 0; (pIt=tmplLst.parse(0,"\n",off)).length; )
			// Archives list template process
			//t1 = "123";//SYS.messInfo("SEL", "TEST 00");	//!!!! After uncomment it next line will not work. Observe further
			if(pIt == "<varhs>") {
				aLs = SYS.Archive.nodeList("va_");
				for(i_a = 0; i_a < aLs.length; i_a++) {
					itNm = SYS.Archive[aLs[i_a]].cfg("NAME");
					if(!itNm.length) itNm = SYS.Archive[aLs[i_a]].cfg("Source");
					prm_items += tr("Archive")+" '"+itNm+"' (/Archive/"+aLs[i_a]+")\n";
				}
			}
			// Direct items list process by form "{path}:{name}:{min}:{max}:{dim}"
			else if(pIt.search("/(sub_|)Archive/") >= 0) {
				if(!(itObj=SYS.nodeAt(pIt.parse(0,":")))) continue;
				prm_items += tr("Archive")+" '"+pIt.parse(1,":")+"' ("+(pIt.parse(0,":")+":"+pIt.parse(2,":")+":"+pIt.parse(3,":")+":"+pIt.parse(4,":")).replace(new RegExp(":*$"),"")+")\n";
			}
			else {
				pathAbs = pIt.search("/(sub_|)DAQ/") >= 0;
				itObj = pathAbs ? SYS.nodeAt(pIt.parse(0,":")) : SYS.DAQ.nodeAt(pIt.parse(0,":"));
				if(!itObj) continue;
				itNm = pIt.parse(1,":");
				if(!itNm.length && typeof(itObj).search("TCntrNode:TValue[:$]") == 0) itNm = itObj.cntr().cfg("NAME") + " > " + itObj.NAME.get();
				prm_items += "DAQ '"+itNm+(pathAbs?"' (":"' (/DAQ")+(pIt.parse(0,":")+":"+pIt.parse(2,":")+":"+pIt.parse(3,":")+":"+pIt.parse(4,":")).replace(new RegExp(":*$"),"")+")\n";
			}

		//Current value processing
		itAddr = lWdg.link("addr").match("(prm|arh):([^ ]+) \\(\\+\\)");
		if(itAddr.length == 3) {
			//Get Name
			if(lWdg.link("name").search("prm:[^ ]+ \\(\\+\\)") >= 0) name_value = lWdg.attr("name");
			else if((itTmp=lWdg.link("name").match("val:(.+$)")).length == 2) name_value = itTmp[1];
			else name_value = tr("Empty");
			//Get Min and Max
			if(lWdg.link("min").search("prm:[^ ]+ \\(\\+\\)") >= 0) val_min_value = lWdg.attr("min");
			else if((itTmp=lWdg.link("min").match("val:(.+$)")).length == 2) val_min_value = itTmp[1];
			if(lWdg.link("max").search("prm:[^ ]+ \\(\\+\\)") >= 0) val_max_value = lWdg.attr("max");
			else if((itTmp=lWdg.link("max").match("val:(.+$)")).length == 2) val_max_value = itTmp[1];
			//Logarithmic scale
			if(lWdg.link("log").search("prm:[^ ]+ \\(\\+\\)") >= 0) log_value = lWdg.attr("log");
			else if((itTmp=lWdg.link("log").match("val:(.+$)")).length == 2) log_value = itTmp[1];
			//Dimension
			if(lWdg.link("ed").search("prm:[^ ]+ \\(\\+\\)") >= 0) dim_value = lWdg.attr("ed");
			else if((itTmp=lWdg.link("ed").match("val:(.+$)")).length == 2) dim_value = itTmp[1];
			//Current prm name
			if(itAddr[1] == "prm") {
				for(tAddr = "", off = 0, pos = 0; (tAddrEl=itAddr[2].parsePath(0,off)).length; pos++)
					if(pos >= 3 && off < itAddr[2].length)	tAddr += "/prm_"+tAddrEl;
					else if(tAddrEl == "var" && off >= itAddr[2].length)	continue;
					else tAddr += "/"+tAddrEl;
				prm_value = "DAQ '"+name_value+"' (/DAQ"+(tAddr+":"+val_min_value.toPrecision()+":"+val_max_value.toPrecision()+":"+dim_value).replace(new RegExp(":*$"),"")+")";
				//prm_value = "DAQ '"+name_value+"' (/DAQ"+(itAddr[2].replace(new RegExp("/var$"),"")+":"+val_min_value.toPrecision()+":"+val_max_value.toPrecision()+":"+dim_value).replace(new RegExp(":*$"),"")+")";
			}
			else if(itAddr[1] == "arh") prm_value = tr("Archive")+" '"+name_value+"' (/Archive/va_"+(itAddr[2]+":"+val_min_value.toPrecision()+":"+val_max_value.toPrecision()+":"+dim_value).replace(new RegExp(":*$"),"")+")";
			if(prm_value.length) name_active = val_min_active = val_max_active = log_active = dim_active = true;
		}

		//Load current properties
		color_value = lWdg.attr("color");

		//Load the colors list
		color_cfg = "";
		parLs = lWdg.nodePrev().nodeList("wdg_");
		for(iLs = 0; iLs < parLs.length; iLs++)
			 if((tVl=lWdg.nodePrev()[parLs[iLs]].attr("colorDef")).length)
				color_cfg += tVl+"\n";
	}
}

colorBox_backColor = color_value;

//Events for commands process
for(evRez = "", off = 0; (evCur=event.parse(0,"\n",off)).length; ) {
	//this.messInfo("Event: "+evCur);
	if(evCur == "ws_ListChange:/prm") {	//Parameter selected
		//Set properties
		itTmp = prm_value.match(".+'(.*)' \\((.+?)\\)");
		if(itTmp.length == 3) {
			if(itTmp[1].length)	name_value = itTmp[1];
			off1 = 0;
			itVal = itTmp[2].parse(0,":",off1);	//Path
			//Connect to source and get main values for parameter
			if(itVal.parsePath(0) == "DAQ" && typeof(itObj=SYS.nodeAt(itVal)).search("TCntrNode:TValue[:$]") == 0) {
				val_min_value = itObj.min.get();
				val_max_value = itObj.max.get();
				log_value = itObj.log.get();
				dim_value = itObj.ed.get();
			}
			
			//Set direct values
			if((itVal=itTmp[2].parse(0,":",off1)).length) val_min_value = itVal;
			if((itVal=itTmp[2].parse(0,":",off1)).length) val_max_value = itVal;
			if((itVal=itTmp[2].parse(0,":",off1)).length) dim_value = itVal;
		}
		else name_value = dim_value = "", val_min_value = val_max_value = 0, log_value = false;
		apply_active = name_active = val_min_active = val_max_active = log_active = dim_active = true;
		//prmSearch_value = "";
	}
	else if(evCur == "key_relsReturn:/prmSearch" && prmSearch_value.length) {
		sPos = (((sPos=prm_items.indexOf(prm_value))<0)?0:sPos) + prm_value.length;
		if(((sPos=prm_items.indexOf(prmSearch_value,sPos)) >= 0 || (sPos=prm_items.indexOf(prmSearch_value,0)) >= 0)) {
			sPos = ((sPos=prm_items.lastIndexOf("\n",sPos)) < 0) ?	0 : sPos+1;
			prm_value = ((sPos_=prm_items.indexOf("\n",sPos)) >= 0) ? prm_items.slice(sPos,sPos_) : prm_items.slice(sPos);
			event += "ws_ListChange:/prm\n";
		}
	}
	else if(evCur == "ws_LnAccept:/name" || evCur == "ws_LnAccept:/val_min" || evCur == "ws_LnAccept:/val_max" ||
				evCur == "ws_LnAccept:/dim" || evCur == "ws_LnAccept:/color" || evCur == "ws_ChkChange:/log")	apply_active = true;
	else if(evCur == "ws_BtPress:/apply") {
		//Link addr set
		itTmp = prm_value.match(".+\\((.+?)[:\\)]");
		if(itTmp.length != 2)	lWdg.linkSet("addr", "", true);		//Clear
		else {	//Set
			off1 = 0;
			firstEl = itTmp[1].parsePath(0,off1);
			if(firstEl == "Archive") {
				lWdg.linkSet("addr", "", true);	//Clear all othet values
				lWdg.linkSet("addr", "arh:"+itTmp[1].slice(off1+4));		lWdg.linkSet("name", "val:"+name_value);	lWdg.linkSet("ed", "val:"+dim_value);
				lWdg.linkSet("min", "val:"+val_min_value);						lWdg.linkSet("max", "val:"+val_max_value);
				lWdg.linkSet("log", "val:"+log_value);
			}
			else if(firstEl == "DAQ") {
				itObj = SYS.nodeAt(itTmp[1]);
				isPrm = (typeof(itObj).search("TCntrNode:TValue[:$]") == 0);
				lWdg.linkSet("addr", "", true);	//Clear all othet values
				lWdg.linkSet("addr", "prm:"+itTmp[1].slice(off1).replace("/prm_","/"), isPrm);
				if(!isPrm || name_value != itObj.NAME.get())		lWdg.linkSet("name", "val:"+name_value);
				if(!isPrm || val_min_value != itObj.min.get())	lWdg.linkSet("min","val:"+val_min_value);
				if(!isPrm || val_max_value != itObj.max.get())	lWdg.linkSet("max","val:"+val_max_value);
				if(!isPrm || log_value != itObj.log.get())			lWdg.linkSet("log","val:"+log_value);
				if(!isPrm || dim_value != itObj.ed.get())			lWdg.linkSet("ed","val:"+dim_value);
			}
		}
		lWdg.attrSet("color", color_value);
		lWdg.attrSet("event", lWdg.attr("event")+"usr_set\n");

		this.attrSet("pgOpen", false);
	}
	else if(evCur == "ws_BtPress:/cancel")	this.attrSet("pgOpen", false);
	else evRez += evCur+"\n";
}
event = evRez;