EDOBE XDOM TAKE 6 IR - PRODUCTSHEET Especificaciones Pagina 96

  • Descarga
  • Añadir a mis manuales
  • Imprimir
  • Pagina
    / 304
  • Tabla de contenidos
  • MARCADORES
  • Valorado. / 5. Basado en revisión del cliente
Vista de pagina 95
CHAPTER 4: User-Interface Tools Automatic layout 96
/* Define a custom layout manager that arranges the children
** of ’container’ in a stair-step fashion.*/
function StairStepButtonLayout (container) { this.initSelf(container); }
// Define its ’method’ functions
function SSBL_initSelf (container) { this.container = container; }
function SSBL_layout() {
var top = 0, left = 0;
var width;
var vspacing = 10, hspacing = 20;
for (i = 0; i < this.container.children.length; i++) {
var child = this.container.children[i];
if (typeof child.layout != "undefined")
// If child is a container, call its layout method
child.layout.layout();
child.size = child.preferredSize;
child.location = [left, top];
width = left + child.size.width;
top += child.size.height + vspacing;
left += hspacing;
}
this.container.preferredSize = [width, top - vspacing];
}
// Attach methods to Object’s prototype
StairStepButtonLayout.prototype.initSelf = SSBL_initSelf;
StairStepButtonLayout.prototype.layout = SSBL_layout;
// Define a string containing the resource specification for the controls
res = "dialog { \
whichInfo: DropDownList { alignment:’left’ }, \
allGroups: Panel { orientation:’stack’, \
info: Group { orientation: ’column’, \
name: Group { orientation: ’row’, \
s: StaticText { text:’Name:’ }, \
e: EditText { characters: 30 } \
} \
}, \
workInfo: Group { orientation: ’column’, \
name: Group { orientation: ’row’, \
s: StaticText { text:’Company name:’ }, \
e: EditText { characters: 30 } \
} \
}, \
}, \
buttons: Group { orientation: ’row’, alignment: ’right’, \
okBtn: Button { text:’OK’, properties:{name:’ok’} }, \
cancelBtn: Button { text:’Cancel’, properties:{name:’cancel’} } \
} \
}";
Vista de pagina 95
1 2 ... 91 92 93 94 95 96 97 98 99 100 101 ... 303 304

Comentarios a estos manuales

Sin comentarios