function HeaderObject(id) { this.m_obj = g_dc.getElemFormID(id); this.m_obj.style.position = 'absolute'; this.m_origxPos = this.m_xPos = toInt(this.m_obj.getAttribute("X"))+g_dc.GetWorkAreaRC().m_left; this.m_origyPos = this.m_yPos = toInt(this.m_obj.getAttribute("Y"))+g_dc.GetWorkAreaRC().m_top; this.m_origW = this.m_width = this.m_obj.getAttribute("W"); this.m_origH = this.m_height = this.m_obj.getAttribute("H"); this.m_hdrID = this.m_obj.getAttribute("hdrID"); this.m_obj.onmousedown = g_eventRouter.OnHeaderMouseDown; this.m_obj.onmouseup =g_eventRouter.OnHeaderMouseUp; this.m_obj.ondblclick =g_eventRouter.OnHeaderDblClick; this.m_obj.dragContainer=this; this.m_obj.style.fontSize=HEADER_FONT_SIZE; this.m_obj.style.fontFamily=HEADER_FONT_FAMILY; this.m_obj.style.fontWeight=HEADER_FONT_WEIGHT; this.m_deleted = false; this.CreateResizeHandles(); this.ResizeTo(this.m_width, this.m_height); this.MoveTo(this.m_xPos,this.m_yPos); this.Show(); this.SetSelected(false); this.ondblclick = g_eventRouter.OnHeaderDblClick; this.m_origTxt = this.Edit_getText(); } HeaderObject.prototype.CreateResizeHandles = function() { this.m_resizeHandle = g_dc.CreateResizeHandleObj(); this.m_obj.appendChild(this.m_resizeHandle); this.m_resizeHandle.dragContainer = this; //this.m_resizeHandle.style.position = "static"; //if (g_dc.ie) // this.m_resizeHandle.style.styleFloat = "right"; //else // this.m_resizeHandle.style.cssFloat='right'; } HeaderObject.prototype.Delete = function() { try { //g_dc.m_aElements[this.m_expObj.id]= null; this.m_obj.parentNode.removeChild(this.m_obj); this.m_deleted = true; //delete this; } catch (err){ alert(err.description) } } HeaderObject.prototype.GetCurrRC = function() { if (!(this.m_obj)){alert('error61');return;} return new Rect(toInt(this.m_obj.style.top), toInt(this.m_obj.style.left), toInt(this.m_obj.offsetWidth), toInt(this.m_obj.offsetHeight)); } HeaderObject.prototype.FixPos = function(rc) { return g_dc.FixPos(rc, "workingArea"); } HeaderObject.prototype.SetSelected = function(bSel) { ; if (typeof(this.m_selected)==dd_u) this.m_selected = null; if (this.m_selected==bSel) return; this.m_selected=bSel; this.m_obj.style.borderWidth=bSel?'3px':'2px'; var rsHandle = g_dc.GetObjInnerByName(this.m_obj, "resizeHandle")[0]; g_dc.showElem(rsHandle, bSel); if (bSel) this.maximizeZ(); } HeaderObject.prototype.maximizeZ = function() { g_dc.maxZ(this.m_obj); } HeaderObject.prototype.DragElem = function(diffX,diffY) { return this.MoveBy(diffX, diffY); } HeaderObject.prototype.MoveBy = function(dx,dy) { var retarr = new Array(); retarr['xresidue']=0; retarr['yresidue']=0; if (!(this.m_obj)) {alert('error91');return;} var newLeft = (toInt(this.m_obj.style.left)+dx); var newTop = (toInt(this.m_obj.style.top)+dy); var pos = new Rect( newTop, newLeft, this.m_obj.style.width, this.m_obj.style.height); pos.SnapTopLeft(6, (dx<0), (dy<0)); this.FixPos(pos); retarr['xresidue']=dx-(pos.m_left-toInt(this.m_obj.style.left)); retarr['yresidue']=dy-(pos.m_top-toInt(this.m_obj.style.top)); this.m_obj.style.left = pos.m_left+'px'; this.m_obj.style.top = pos.m_top+'px'; this.m_xPos=pos.m_left; this.m_yPos=pos.m_top; g_dc.setDirty(true); return retarr; } HeaderObject.prototype.MoveTo = function(x,y) { if (!(this.m_obj)){alert('error60');return;} currRC = this.GetCurrRC(); currRC.m_left = x; currRC.m_top = y; this.FixPos(currRC); this.m_obj.style.left = currRC.m_left+'px'; this.m_obj.style.top = currRC.m_top+'px'; this.m_xPos=currRC.m_left; this.m_yPos=currRC.m_top; g_dc.setDirty(true); } HeaderObject.prototype.Show = function() { if (!(this.m_obj)) {alert('error50');return;} g_dc.showElem(this.m_obj, true); } HeaderObject.prototype.Hide = function() { if (!(this.m_obj)) {alert('error50');return;} g_dc.showElem(this.m_obj, false); } HeaderObject.prototype.c_minWidth = 100; HeaderObject.prototype.c_minHeight = 10; HeaderObject.prototype.c_maxWidth = 800; HeaderObject.prototype.c_maxHeight = 300; HeaderObject.prototype.ResizeToDiff = function(dw, dh) { try{ if (!(this.m_obj) || !(this.m_obj)) {alert('error120');return;} var rc = this.GetCurrRC(); var w = rc.m_width+dw; var h = rc.m_height+dh; this.ResizeTo(w, h); } catch(err) { alert(err); } } HeaderObject.prototype.GetXmlChanges = function() { var bNew = (this.m_hdrID.indexOf("newHeader")>=0); if (bNew && this.m_deleted) return ""; var str = "