// *****************************************************************************
// 文 件 名: jocxctrl.js
// 作 者: wsj
// 版 本: 1.0.0.0
// 日 期: 2014-07-15
// 文件描述:
// 基于ocx的电话条控件
// 说 明:
// 基于ocx的电话条控件
// 修改说明:
// *****************************************************************************
var g_oAsynTimer = null;
function AsynOnMethodResponseEvent(cmdName, param) {
application.oJVccBar.GetBarCtrl()._invokeAsynMethodReturn(cmdName, param);
if(g_oAsynTimer != null){
clearTimeout(g_oAsynTimer);
g_oAsynTimer = null;
}
}
function AsynOnMethodResponseEvent2() {
if(application.oJVccBar == null)
return;
if(application.oJVccBar.GetBarCtrl() == null)
return;
var oItem = application.oJVccBar.GetBarCtrl().oAsynMothmod.getHeadItem();
if(oItem != null){
application.oJVccBar.GetBarCtrl()._invokeAsynMethodReturn(oItem.cmdName, oItem.param);
}
}
function BeginAsynFunctionTimer(interval)
{
if(application.oJVccBar.GetBarCtrl()._asynMethodTimerID == null)
application.oJVccBar.GetBarCtrl()._asynMethodTimerID = setInterval( function(){ application.oJVccBar.GetBarCtrl().PopAsynResponseEvent()} ,interval);
}
function EndAsynFunctionTimer()
{
if(application.oJVccBar.GetBarCtrl()._asynMethodTimerID != null){
clearInterval(application.oJVccBar.GetBarCtrl()._asynMethodTimerID);
application.oJVccBar.GetBarCtrl()._asynMethodTimerID = null;
}
}
function JAsynFunctionItem(sName,sParam)
{
this.cmdName = sName;
this.param = sParam;
return this;
}
function JAsynFunctionManeger()
{
this.arrFunction = new Array();
this._timerBgn = false;
this._timerID = null;
this.getHeadItem = function getHeadItem(){
if(this.arrFunction.length>0){
return this.arrFunction[0];
}
return null;
}
this.addNewItem = function addNewItem(sName,sParam){
this.arrFunction.push(new JAsynFunctionItem(sName,sParam));
}
this.removeHeadItem = function removeHeadItem(){
if(this.arrFunction.length>0) {
this.arrFunction.splice(0, 1);
// this.arrFunction.length = this.arrFunction.length - 1;
}
}
}
function JOcxCtrl(nLeft,nTop,nWidth,nHeight,bShow,oContentWindow)
{
//########################//
// 属性 //
//########################//
//公共属性
this.left = nLeft;
this.top = nTop;
this.width = nWidth;
this.height = nHeight;
this.showFlag = bShow;
this._contentWindow = (oContentWindow==null)?window:oContentWindow;
this.id = "oBar_" + Math.ceil(Math.random() * 100);
this.name = this.id + "_Ctrl";
this.ismsie = (application.oBrowserSys.os == "msie");
// 主图相关的HTML对象
this.oBarShow = null;
this.oATL_BarShow = null;
//特殊的参数
this._agentSubBusyStatus = -1;
this.oEvent = {};
this.errDescription = ""; // 错误提示信息
this.eventCallBack = null; //事件的回调事件
this.methodCallBack = null; //方法的异步回调事件
this.asynExecuteMethod = 1;//异步执行方法名
this._asynMethodTimerID = null;
this.oAsynMothmod = new JAsynFunctionManeger();
//########################//
// 方法 //
//########################//
//内部方法:
this._createObject = function _createObject()
{
//this.oBarShow = this._contentWindow.document.createElement("
");
this.oBarShow = this._contentWindow.document.createElement("DIV");
this.oBarShow.style.cursor = "move";
this.oBarShow.style.position = "absolute";
this.oBarShow.style.padding = "5px";
this.oBarShow.style.left = this.left+"px";
this.oBarShow.style.top = this.top+"px";
this._contentWindow.document.body.appendChild(this.oBarShow);
try
{
// 创建电话条控件
if(this.ismsie == true)
{
this.oBarShow.innerHTML = "";
this.oATL_BarShow = this.oBarShow.firstChild;
this.oATL_BarShow.id = "oATL_BarShow_Ctrl_" + this.id;
this._attachOCXEvents();
}
else
{
var eventText = this._attachFOCXEvents();
this.oBarShow.innerHTML = "