C
5: Creating a User Interface for Your Plug-in
HAPTER
},
f:static_text {
},
}
local result = LrDialogs.presentModalDialog( -- invoke dialog
{
}
)
end )
Determining layout
Both the initial layout of a container, and subsequent automatic layout operations, use a set of parameters
set by properties in both the container and its child nodes. These values control the initial layout, and, if
the containing dialog is resizeable, the way the layout changes if the dialog size changes.
Properties control these broad categories of placement and sizing:
Spacing values determine how child nodes are placed relative to one another. See
of sibling nodes" on page
Margin values determine how a node is placed and sized within its parent node. See
within the parent" on page
You can obtain default layout values using
page
spacing = f:label_spacing(),
f:static_text {
title = "Type more:",
alignment = 'right',
width = LrView.share( 'label_width' ),
},
f:edit_field {
fill_horizonal = 1,
width_in_chars = 20,
immediate = true,
value = LrView.bind( 'text2' ), -- bind to the second key
},
place_horizontal = 0.5,
title = "This is only visible when the text in the two fields are equal",
visible = LrView.bind {
keys = { 'text1', 'text2' }, -- bind to both keys
operation = function( binder, values, fromTable )
if fromTable then
return values.text1 == values.text2 -- check that values are ==
end
return LrBinding.kUnsupportedDirection
end,
},
title = "Multi Binding Example",
contents = contents,
108.
108.
109.
"Factory functions for obtaining layout values" on
Determining layout 107
"Relative placement
"Placement