<@doc hierarchy="GMLDOM"> Layout Code (c) SAP AG 2003-2006. All rights reserved. abstract Class Ruler inherit gml:Object; <@doc scope="private">containing FormView object's id property parentID = ''; <@doc scope="private">HTML element of this child property elem = null; <@doc scope="private">For the use by LayoutBoard and SelectionMgr property type = ''; property board = null; property id = ''; property index = 0; property isVertical = true; constructor(board, parent, index, isVertical) this.type = this._getType(); this.board = board; this.parentID = parent.id; this.index = index; this.id = this.parentID + (isVertical ? '_V_' : '_H_') + index; this.isVertical = isVertical ? true : false; var elem = null, parentElem = this._getParentElem(parent); if (this.isVertical) elem = parent.createHtmlElement(this._getVType(), this._getVCSS(), this.id, parentElem); else elem = parent.createHtmlElement(this._getHType(), this._getHCSS(), this.id, parentElem); this.elem = elem; board.setWidget(this); var st = elem.style; st.resizePolicy = this.encodeResizePolicy(this.getResizePolicy(isVertical)); end method getBox() return null; end method getParent() return this.board.getWidget(this.parentID); end method setVisible(value) this.elem.style.display = value ? 'block' : 'none'; end method setSelectable(value) this.elem.style.selectable = value ? 'yes' : 'no'; end method setPos(pos, snap) if (this.isVertical) { var x = INT(pos.x); var elem = this.elem; elem.x = x; elem.style.left = x; } else { var y = INT(pos.y); var elem = this.elem; elem.y = y; elem.style.top = y; } end method getResizePolicy(isVertical) if (isVertical) return {moveH: true, moveV: false, resizeH: false, resizeV: false, cursor: #[LYT_COL_RESIZE]}; else return {moveH: false, moveV: true, resizeH: false, resizeV: false, cursor: #[LYT_ROW_RESIZE]}; end method encodeResizePolicy(policy) if (!policy) policy = {}; var values = []; values[0] = (policy['moveH'] === false) ? 0 : 1; values[1] = (policy['moveV'] === false) ? 0 : 1; values[2] = (policy['resizeH'] === false) ? 0 : 1; values[3] = (policy['resizeV'] === false) ? 0 : 1; values[4] = (policy['alignH'] !== undefined) ? policy['alignH'] : 0; values[5] = (policy['alignV'] !== undefined) ? policy['alignV'] : 0; values[6] = (policy[''] !== undefined) ? policy['cursor'] : 0; return JOINN(values, 1); end <@doc scope="private">horizontal HTML element type abstract method _getHType(); <@doc scope="private">vertical HTML element type abstract method _getVType(); <@doc scope="private">horizontal CSS abstract method _getHCSS() return ''; end <@doc scope="private">vertical CSS abstract method _getVCSS() return ''; end abstract method _getType(); <@doc scope="private">the UI element under which to create the Ruler abstract method _getParentElem(parent); <@doc scope="public"> returns whether the dragging could continue to the precified location abstract method canApplayRect(x, y, w, h); <@doc scope="public"> Apply the position of the Ruler @dontChangeFoc - [optional] if exsists, focus stays in context abstract method applyPos(dontChangeFoc);