@doc hierarchy="GMLDOM">
Aspect for editing of Scenario layouts
(c) SAP AG 2003-2006. All rights reserved.
Aspect Diagram for Layout;
// implement ILayoutable; // Uncomment when parser starts to support this
virtual property rootKey = 'root';
constructor(board, root)
if (!board) throw new Error('#TEXT[XMSG_FAIL_DISPLAY_LAYOUT_BOARD]');
this.id = base.id;
this.board = board; // board object (LayoutEditor object)
if (!root) root = base[this.rootKey];
var win = $DOM.createAspect('#NS[Layout]', root, board, this);
if (!win) throw new Error('#TEXT[XMSG_FAIL_DISPLAY_LAYOUT_BOARD]');
this.windowID = win.id;
end
destructor()
end
virtual method getParent()
return null;
end
virtual method getWindow()
return this.board.getWidget(this.windowID);
end
override virtual method paint(parentElement)
return this.getWindow().paint(parentElement);
end
override virtual method repaint(attr)
return this.getWindow().repaint(attr);
end
override virtual method applyLayout(focusWidget, operation, repaint)
var win = this.getWindow();
win.applyLayout(focusWidget, operation, repaint);
win.isRendered = false;
win.setResizePolicy({moveH: false, moveV: false, resizeH: true, resizeV: true, alignH: 1, alignV: 1});
this.board.adjustGrid();
return false;
end
override virtual method updateElements(operation, syncElems)
try { this.getWindow().updateElements(operation, syncElems); }
catch (e) { #LOG[2, 'Failed to updateElements for ' + (base.name||base.Class.name)]; }
end
override virtual method getContentRect()
var rect = this.board.getClientRect();
return {x: rect.x + 8, y: rect.y + 8, w: rect.w - 16, h: rect.h - 16};
end
virtual method getBoundingRect()
var rect = this.getWindow().getRect();
return {x: 0, y: 0, w: rect.w + 16, h: rect.h + 16};
end
override virtual method showGrid(flag)
if (flag === undefined) flag = GETVAR('FORM_SHOW_GRID');
var iChildren = RULE('getChildWidgets', this.getWindow().base);
var board = this.board;
for (var i in iChildren) showGridHelper(board.getWidget(i), flag);
function showGridHelper(widget, flag) {
if (!widget) return;
if (widget.repaintRulers) widget.repaintRulers(flag);
var jChildren = RULE('getChildWidgets', widget.base);
for (var j in jChildren) showGridHelper(board.getWidget(j), flag);
}
end
//////////////////////////////////////////////////////////////////
// LAYOUT EVENTS
<@doc>
Fires when the user triggers a layout-related action.
The base object of the drawing element that was activated
The action code (LYT_ACTIVATE)
event onLayoutAction(object, detail);