Adobe 65007312 - Photoshop Lightroom Programmer's Manual page 106

Mac
Hide thumbs Also See for 65007312 - Photoshop Lightroom:
Table of Contents

Advertisement

C
5: Creating a User Interface for Your Plug-in
HAPTER
operation
transform
This example shows multiple binding. The dialog contains two edit fields, each with its
different key. A static text box below them has its
makes it true only when both values are equal (meaning that the same text has been typed into both edit
fields, or they are both empty).
local LrBinding = import "LrBinding"
local LrDialogs = import "LrDialogs"
local LrFunctionContext = import "LrFunctionContext"
local LrView = import "LrView"
LrFunctionContext.callWithContext( 'multiBindingExample', function( context )
local f = LrView.osFactory() -- get view factory
local properties = LrBinding.makePropertyTable( context ) -- make empty table
local contents = f:column { -- create view hierarchy
spacing = f:control_spacing(),
bind_to_object = properties, -- default bound table is the one we made
f:row {
},
f:row {
Required. A function defining an operation to perform on the key values; the
result of this operation is passed to the
This function is called when any specified key value changes. The function
you define receives three parameters:
binder
values
of all specified keys. The
name, if provided. (This is not a general-purpose table; you cannot
iterate over the values.)
fromTable
was in the bound table, false if the change was in the bound view
property.
This function is not called immediately, but at the end of an event cycle; this
means that, if the change is in the bound table, more than one key value can
have changed. If changes occur in both directions, the function is called
twice.
Optional. A function that maps the return value of the
the local property value. See
fill_horizonal = 1,
spacing = f:label_spacing(),
f:static_text {
title = "Type anything:",
alignment = 'right',
width = LrView.share( 'label_width' ),
},
f:edit_field {
fill_horizonal = 1,
width_in_chars = 20,
immediate = true,
value = LrView.bind( 'text1' ), -- bind to the first key
},
fill_horizonal = 1,
: For internal use.
: A special look-up table of key-value pairs with the current values
portion of the pair uses the
key
(Boolean): True if the change that triggered this notification
"Transforming values" on page
property bound to both keys; the
visible
Binding UI values to data values 106
function.
transform
uniqueKey
operation
103.
value
function to
bound to a
operation

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Photoshop lightroom sdk 3.0

Table of Contents