Adobe 65007312 Programming Guide - Page 113
This example creates the overlapping views shown in the where the controls shown below
UPC - 883919154398
View all Adobe 65007312 manuals
Add to My Manuals
Save this manual to your list of manuals |
Page 113 highlights
CHAPTER 5: Creating a User Interface for Your Plug-in Determining layout 113 This example creates the overlapping views shown in the figure, where the controls shown below the format pop-up depend on the selection in the pop-up menu. local LrBinding = import "LrBinding" local LrDialogs = import "LrDialogs" local LrFunctionContext = import "LrFunctionContext" local LrView = import "LrView" LrFunctionContext.callWithContext( 'bindingExample', function( context ) local f = LrView.osFactory() -- obtain the view factory local properties = LrBinding.makePropertyTable( context ) -- make settings table -- add some keys with initial values properties.format = "jpeg" properties.jpeg_quality = 80 properties.tiff_compression = "none" local contents = f:column { -- define the view hierarchy spacing = f:control_spacing(), bind_to_object = properties, -- default bound table is the one we made f:popup_menu { items = { { title = "JPEG", value = "jpeg" }, { title = "TIFF", value = "tiff" }, }, value = LrView.bind 'format', -- bind selection to the format key }, f:column { -- place two views in the same space place = "overlapping", -- JPEG view f:view { -- shown only when format selection is JPEG visible = LrBinding.keyEquals( "format", "jpeg" ), margin = 3, f:row { spacing = f:label_spacing(), f:static_text { title = "Quality:", }, f:slider { min = 0, max = 100, value = LrView.bind 'jpeg_quality', -- sets a JPEG value fill_horizontal = 1, place_vertical = 0.5, }, f:edit_field { width_in_digits = 3, min = 0, max = 100, precision = 0, value = LrView.bind 'jpeg_quality', -- sets a JPEG value TIFF view f:view { -- shown only when format selection is TIFF visible = LrBinding.keyEquals( "format", "tiff" ), margin = 3, f:row { spacing = f:label_spacing(), f:static_text {