Skip navigation
Currently Being Moderated

Now possible to scroll line-wrapped output in window of ModalDialog?

Feb 14, 2013 6:14 PM

Tags: #dialogs #scrollable_content #presentmodaldialog

Hello,

 

At some point the plugin I am working on must display a window with extracted values (varPathName), in this case the full-path-names to image files.

Depending on the users selection there are many or only a few full-path-names in the output.

The output is one line that wraps within the given width of the window and should remain so.

No problem for adjusting the height of the window by calculating the value for the variable 'outputlines'.

But sometimes there might be more output than available space inside the window (full height on the screen). Therefore I would like to have a scroll-bar on the right side of the window.

How can this be achieved given the code below. Is it possible to create a scroll-bar after all?

 

local f = LrView.osFactory()
     local c = f:row{
          bind_to_object = props,
               f:column {
                    f:edit_field {
                         value = varPathName,
                         width_in_chars = 80,
                         height_in_lines = outputlines
                    },
               },
     }
     dialogValue = LrDialogs.presentModalDialog({
          title = "extracted Paths and File Names" ,
          contents = c,
     })

 

Feedback is much appreciated.

 

(reference: http://forums.adobe.com/message/3190135#3190135)

 

Message was edited by: snahphoto

 
Replies
  • Currently Being Moderated
    Feb 14, 2013 6:17 PM   in reply to snahphoto

    Lr4 has scrolled_view, but of course your plugin will no longer by Lr3 compatible if you're depending on it.

     

    One Lr3-too option is to use an edit_field, which auto-scrolls. you'd need height_in_lines = math.min( outputlines, some-number ).

     

    There won't be a scroll bar - no way to do it in Lr3-compatible fashion, without (what I assume is a lot of) work. Jeffrey Friedl did it but I have no idea how.

     

    Rob

     
    |
    Mark as:
  • Currently Being Moderated
    Feb 14, 2013 7:42 PM   in reply to snahphoto

    Well, that's one way to get around the scroll problem.

     

    Consider opening in default app instead - in case user has preferred text editor, e.g. -

     

    Mac: LrShell.openFilesInApp( { file }, "open") -- macs like to feed the file to the "open" command.

    Win: LrShell.openFilesInApp( { "" }, file) -- open file like an app, windows knows what to do.

     

    R

     
    |
    Mark as:
  • Currently Being Moderated
    Feb 14, 2013 9:54 PM   in reply to Rob Cole

    Jeffrey Friedl did it but I have no idea how.

    I think he did it the way other plugs do it -- a pre-allocated set of rows of controls whose contents get dynamically changed.

     

    But he went beyond other plugins and provided a nice graphical scrollbar.  If you look in the i/ subdirectory of his plugin, you'll see a bunch of PNGs, some of which represent pieces of the scrollbar.  I'm guessing he created a column of dozens of picture controls, and dynamically changes them as the user clicks.  But just a guess.

     
    |
    Mark as:
  • Currently Being Moderated
    Feb 14, 2013 10:24 PM   in reply to John R. Ellis

    John R. Ellis wrote:

     

    ...as the user clicks...

    Easy enough (albeit not that easy) to implement click scrolling, but Jeffrey Friedl's scrollbars can be dragged - *that's* the part I can't imagine how he did, since I didn't think SDK provided any sort of mouse info. Maybe he uses external app for support? Or knows how to get "ag" mouse info via lua, without SDK support?

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (1)

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