<@script name="LayoutGlobals"> Layout Code (c) SAP AG 2003-2006. All rights reserved. function LOGMETHOD(obj, methodName) { return; if (!obj) { WRITE(methodName); return; } if (typeof(obj) == 'string') { WRITE('{ ' + obj + '.' + methodName); return; } if (obj.base != null) { WRITE('{ ' + obj.Class.name + '(' + obj.base.name + ').' + methodName); return; } else if (obj.Class != null) { WRITE('{ ' + obj.Class.name + '.' + methodName); return; } WRITE(methodName); } // NOTE: doc this: returns @core.lib!BOUNDING_BOX structure, made from input params function MAKE_RECT(xOrPos, yOrSize, w, h) { if (arguments.length == 2) { return {x: xOrPos.x||0, y: xOrPos.y||0, w: yOrSize.w||320, h: yOrSize.h||240}; } return {x: xOrPos||0, y: yOrSize||0, w: w||320, h: h||240}; } // pThis: Object/GmlObject/Aspect, i.e. the one that will be 'this' // NOTE: think to add this func to core.lib:Global.js to be usefull everywhere function makeEventHandler(pThis, handler) { return function() { try { // // We use event object from the element (this) and not window.event, because we can // sit in another HTML window, so that window.event is set to something else or null. // var evt = this.document.parentWindow.event; if (!evt) return; return handler.apply(pThis, [evt]); } catch (e) { #LOG[4, 'makeEventHandler(' + ((pThis || !pThis.Class) ? 'unknown' : pThis.Class.name) + '): exception in event handler. ' + e.description]; } } } function isPointInRect(point, rect) { return (((rect.x < point.x) && (point.x < (rect.x + rect.w))) && ((rect.y < point.y) && (point.y < (rect.y + rect.h)))); }