Skip navigation
Currently Being Moderated

Responding to clicks on viewFactory:picture()?

Sep 1, 2010 1:38 PM

Is there a way to make a picture created with viewFactory:picture() clickable?  :static_text() has the mouse_down property, but :picture() doesn't seem to recognize that. I thought I demoed a plugin that had clickable icons, but I can't find that anymore.  Am I missing something obvious?

 
Replies
  • Currently Being Moderated
    Sep 1, 2010 1:44 PM   in reply to John R. Ellis

    johnrellis wrote:

     

    Is there a way to make a picture created with viewFactory:picture() clickable?  :static_text() has the mouse_down property, but :picture() doesn't seem to recognize that. I thought I demoed a plugin that had clickable icons, but I can't find that anymore.  Am I missing something obvious?

     

    I wouldn't mind having clickable pictures either. And, if there was some way to make it evident, that would be even better (e.g. rollover cursor change) - same goes for static text.

     

    John - if you ever run across a plugin with clickable pictures let me know - I'll do the same.

     
    |
    Mark as:
  • Currently Being Moderated
    Mar 10, 2012 6:52 PM   in reply to Rob Cole

    Here's a hack:

     

    Use place = 'overlapping' and combine two LrView elements on top of each other.

     

    A cheesy example:

     

                   f:row {
                        place = 'overlapping',
                        
                        f:picture {
                             value = _PLUGIN:resourceId( 'fnord.gif' ),
                        },
                        
                        f:static_text {
                             -- A block of overlapping transparent text. Adjust for image size.
                             title = "01234567890123456789012345678901234567890123456789",
                             height_in_lines = -1,
                             width_in_chars = 10,
                             text_color = LrColor(),
                             mouse_down = function(view)
                                  LrFunctionContext.postAsyncTaskWithContext('Fnord',
                                  function(context)
                                       LrDialogs.message( 'Fnord', nil, 'info' )
                                  end)
                             end,
                        },
    

     

    Works for me. The overlapping text block might be stupid overkill -- I never looked deeper into this.

     
    |
    Mark as:
  • Currently Being Moderated
    Mar 11, 2012 10:42 AM   in reply to clvrmnky

    Oh man, last night I had the awful, terrible idea that you might be able to use this technique to create sort of a fake HTML image map, and have various clickable areas of carefully overlapped invisible (or not, as you would) text that responds in different ways. (Assuming the size of the text title actually means anything. It looks like even a title of "" is clickable across the entire image. Just as well, I suppose.)

     
    |
    Mark as:
  • Currently Being Moderated
    Mar 12, 2012 4:49 AM   in reply to clvrmnky

    Thanks for the placement="overlapping" tip, I had forgotten it totally! 

     

    Some time ago I was experimenting with a face detection plugin (sometime that merely counts the faces, I'd like to use it to classify photos into human/non-human), but back then I could'nt figure out a way to properly show detected face regions from the plugin, because I wasn't able to get components overlapping.  catalog_photo with overlapped group_box and static_text seem to offer just what I want.  Actually, with click support, it could probably be used to classify the faces as well...

     
    |
    Mark as:
  • Currently Being Moderated
    Jun 1, 2012 11:36 AM   in reply to jarnoh

    I've now created new plugin, which is relying on the overlapping placement of controls.... only to find out that it does not work on Windows!

     

    On Windows, only the first item is visible or clickable, tested on LR4.1. 

     

    I'm seriously thinking about going for 100% Mac, but there's still the 50% users who have Windows...

     
    |
    Mark as:
  • Currently Being Moderated
    Jun 12, 2012 2:47 PM   in reply to John R. Ellis

    Would "square button" do the job?

     

    http://forums.adobe.com/message/4393376

     
    |
    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