EDOBE XDOM TAKE 6 IR - PRODUCTSHEET Spezifikationen Seite 97

  • Herunterladen
  • Zu meinen Handbüchern hinzufügen
  • Drucken
  • Seite
    / 304
  • Inhaltsverzeichnis
  • LESEZEICHEN
  • Bewertet. / 5. Basierend auf Kundenbewertungen
Seitenansicht 96
CHAPTER 4: User-Interface Tools Automatic layout 97
// Create window using resource spec
win = new Window (res);
// Create list items, select first one
win.whichInfo.onChange = function () {
if (this.selection != null) {
for (var g = 0; g < this.items.length; g++)
this.items[g].group.visible = false;
this.selection.group.visible = true;
}
}
var item = win.whichInfo.add (’item’, ’Personal Info’);
item.group = win.allGroups.info;
item = win.whichInfo.add (’item’, ’Work Info’);
item.group = win.allGroups.workInfo;
win.whichInfo.selection = win.whichInfo.items[0];
// Override the default layout manager for the ’buttons’ group
// with custom layout manager
win.buttons.layout = new StairStepButtonLayout(win.buttons);
win.center();
win.show();
The AutoLayoutManager algorithm
When a script creates a Window object and its elements and shows it the first time, the visible
user-interface-platform window and controls are created. At this point, if no explicit placement of controls
was specified by the script, all the controls are located at [0, 0] within their containers, and have default
dimensions. Before the window is made visible, the layout manager’s
layout method is called to assign
locations and sizes for all the elements and their containers.
The default
AutoLayoutManager’s layout method performs these steps when invoked during the initial
call to a
Window object’s show method:
1. Read the
bounds property for the managed container; if undefined, proceed with auto layout. If
defined, assume that the script has explicitly placed the elements in this container, and cancel the
layout operation (if both the
location and size property have been set, this is equivalent to setting
the
bounds property, and layout does not proceed).
2. Determine the container’s margins and inter-element spacing from its
margins and spacing
properties, and the orientation and alignment of its child elements from the containers
orientation
and
alignChildren properties. If any of these properties are undefined, use default settings obtained
from platform and user-interface framework-specific default values.
3. Enumerate the child elements, and for each child:
Z If the child is a container, call its layout manager (that is, execute this entire algorithm again for the
container).
Z Read its alignment property; if defined, override the default alignment established by the parent
container with its
alignChildren property.
Z Read its size property: if defined, use it to determine the child’s dimensions. If undefined, read its
preferredSize property to get the child’s dimensions. Ignore the child’s location property.
All the per-child information is collected for later use.
4. Based on the orientation, calculate the trial location of each child in the row or column, using
inter-element spacing and the container’s margins.
Seitenansicht 96
1 2 ... 92 93 94 95 96 97 98 99 100 101 102 ... 303 304

Kommentare zu diesen Handbüchern

Keine Kommentare