Adobe 65007312 - Photoshop Lightroom Programmer's Manual page 99

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

Advertisement

C
5: Creating a User Interface for Your Plug-in
HAPTER
},
-- (add radio button container here for example 2)
-- (add pop-up container here for example 3)
local result = LrDialogs.presentModalDialog( -- invoke the dialog
{
}
)
end )
Binding radio button selections
The user cannot uncheck a radio button; a selected button is deselected only when another button in the
group is selected. Simply putting the buttons in the same container does not enforce this usage; to
arrange it, bind the value of each button in the set to a different value of the same key.
E
XAMPLE
f:group_box { -- the buttons in this container make a set
},
f:checkbox {
title = "Value will be string",
value = bind 'checkbox_state', -- bind to the key value
checked_value = 'checked', -- this is the initial state
unchecked_value = 'unchecked', -- when the user unchecks the box,
},
f:static_text {
fill_horizontal = 1,
title = bind 'checkbox_state', -- bound to same key as checkbox value
},
title = "Binding Buttons Example",
contents = contents,
2: Add this to the previous code for an example of binding in a set of radio buttons:
title = "Radio Buttons",
fill_horizontal = 1,
spacing = f:control_spacing(),
f:radio_button {
title = "Value 1",
value = bind 'my_value', -- all of the buttons bound to the same key
checked_value = 'value_1',
},
f:radio_button {
title = "Value 2",
value = bind 'my_value',
checked_value = 'value_2',
},
f:radio_button {
title = "Value 3",
value = bind 'my_value',
checked_value = 'value_3',
},
f:static_text {
fill_horizontal = 1,
title = bind 'my_value',
},
Binding UI values to data values 99
-- this becomes the value, and thus
-- the bound key value as well.

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Photoshop lightroom sdk 3.0

Table of Contents