Skip navigation
Currently Being Moderated

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

Feb 4, 2013 4:20 PM

Tags: #non-modal_windows #non-modal #lrdialogs #presentfloatingdialog #presentmodaldialog #non-modal_dialog_box #non-modal_dialog

Undocumented function: LrDialogs.presentFloatingDialog

 

ref: http://feedback.photoshop.com/photoshop_family/topics/sdk_lrdialogs_pr esentfloatingdialog_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

 
Replies
  • Currently Being Moderated
    Feb 6, 2013 11:20 PM   in reply to Rob Cole

    Doesn't seem to be really useful, there is no way to activate previously opened dialog?

     
    |
    Mark as:
  • Currently Being Moderated
    Apr 17, 2013 5:57 AM   in reply to Rob Cole

    How did you discover that?

     
    |
    Mark as:
  • Currently Being Moderated
    Apr 17, 2013 12:17 PM   in reply to Rob Cole

    I'd love to know a better way to do it.

    Me too.

     
    |
    Mark as:
  • Currently Being Moderated
    May 11, 2013 2:45 PM   in reply to Rob Cole

    Dialog acts like independent window (won't track Lr proper). In Lr4, minimizing Lr main window would minimize non-modal dialogs along with...

    That's unfortunate.  Have you discovered any way around that, e.g. a way a plugi could discover the minimized state of the main application window?

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points