EDOBE XDOM TAKE 6 IR - PRODUCTSHEET Spezifikationen Seite 95

  • Herunterladen
  • Zu meinen Handbüchern hinzufügen
  • Drucken
  • Seite
    / 304
  • Inhaltsverzeichnis
  • LESEZEICHEN
  • Bewertet. / 5. Basierend auf Kundenbewertungen
Seitenansicht 94
CHAPTER 4: User-Interface Tools Automatic layout 95
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’} } \
} \
}";
win = new Window (res);
win.whichInfo.onChange = function () {
if (this.selection != null) {
for (var g = 0; g < this.items.length; g++)
this.items[g].group.visible = false; //hide all other groups
this.selection.group.visible = true;//show this group
}
}
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];
win.center();
win.show();
Custom layout-manager example
This script creates a dialog almost identical to the one in the previous example, except that it defines a
layout-manager subclass, and assigns an instance of this class as the
layout property for the last Group in
the dialog. (The example also demonstrates the technique for defining a reusable class in JavaScript.)
This script-defined layout manager positions elements in its container in a stair-step fashion, so that the
buttons are staggered rather than in a straight line.
Seitenansicht 94
1 2 ... 90 91 92 93 94 95 96 97 98 99 100 ... 303 304

Kommentare zu diesen Handbüchern

Keine Kommentare