10 Replies Latest reply: May 11, 2013 6:00 PM by areohbee RSS

    You too can display non-modal dialog boxes: LrDialogs.presentFloatingDialog

    areohbee Community Member

      Undocumented function: LrDialogs.presentFloatingDialog

       

      ref: http://feedback.photoshop.com/photoshop_family/topics/sdk_lrdialogs_presentfloatingdialog_ and_showstringsdialog_undocumented

       

      This works for displaying non-modal dialog box:

       

      LrFunctionContext.postAsyncTaskWithContext( "test", function( context )

          local LrPhotoPictureView = import 'LrPhotoPictureView'

          local photo = catalog:getTargetPhoto()

       

          local pictureView = LrPhotoPictureView.makePhotoPictureView{

                width = 400, height = 400, photo = photo,

          }

       

          local result = LrDialogs.presentFloatingDialog {

              title = "Thumbnail test",

              background_color = LrColor ("white"), -- required for (uncolored) static_text display, else inside of box is black and so can't see black text.

              contents = vf:column {

                  vf:static_text {

                      title = photo:getFormattedMetadata ("fileName"),

                  },

                  pictureView,

                  --vf:edit_field { - no sirve, presumably keystrokes are not trapped by box.

                  --    bind_to_object = prefs,

                  --    value = app:getGlobalPrefBinding( 'tempForTest' ),

                  --},

                  vf:push_button {

                      title = "Click me",

                      action = function( button )

                          app:show{ info="Pushed" } -- glorified call to LrDialogs.presentModalDialog - works.

                      end,

                  }

              },

          }

       

          -- LrDialogs( app:getGlobalPref( 'tempForTest' ), result ) -- no sirve.

       

      end )

       

      Enjoy!

      Rob