
CHAPTER 4: User-Interface Tools Localization in ScriptUI objects 103
Margins around the title and graphic object
The margins property specifies the number of pixels separating each edge of an element from the visible
content within that element. This value overrides the default margin settings (no margins for most
element types, 6 pixels at each edge for
iconbutton).
X For iconbutton, the margins value controls the padding between the button's frame and its title and
icon image.
X For other element types, margins controls the padding between the imaginary border surrounding
the union of the bounding boxes of the title and graphic object, which makes the space occupied by
an element larger than its default measurements.
This example demonstrates overriding the default margins for
iconbutton and dropdownlist elements.
The lists are enclosed in panels to create artificial borders around them:
w.btn1 = w.add("iconbutton { title: 'Default margins', image: 'SystemWarningIcon' }");
w.btn2 = w.add("iconbutton { title: 'Extra T/B margins',
image: 'SystemWarningIcon' }");
var defaultBtnMargins = w.btn2.titleLayout.margins;
w.btn2.titleLayout = { margins: [defaultBtnMargins[0], 15, defaultBtnMargins[2], 15] };
w.panel1 = w.add("panel { margins: 0, ddl1: DropDownList
{ title: 'Default margins' } }");
w.panel2 = w.add("panel { margins: 0, ddl2: DropDownList
{ title: 'Extra L/R margins' } }");
w.panel2.ddl2.titleLayout = { margins: [15, 0, 15, 0] };
Localization in ScriptUI objects
For portions of your user interface that are displayed on the screen, you may want to localize the displayed
text. You can localize the display strings in any ScriptUI object simply and efficiently, using the global
localize function. This function takes as its argument a localization object containing the localized
versions of a string.
For complete details of this ExtendScript feature, see “
Localizing ExtendScript strings” on page 224.
A localization object is a JavaScript object literal whose property names are locale names, and whose
property values are the localized text strings. The locale name is an identifier as specified in the ISO 3166
Comentários a estes Manuais