5 Replies Latest reply on Oct 6, 2010 3:32 AM by areohbee

    Feature Request: Option to wrap static text.

    areohbee Level 5

      It would be really nice (in fact, demanded by my current client) to be able to have multi-line static text that appears as a paragraph. Unfortunately, static text is one-line and either stretches out the width of the entire dialog box if you let it or is truncated if you don't.

       

      Present work-around is to force line-breaks, but that makes for some funny looking alignment, which may not be so "funny" when you see it on the "other" platform...

       

      Thanks,

      Rob

        • 1. Re: Feature Request: Option to wrap static text.
          johnrellis Most Valuable Participant

          I faced the same issue today.  I discovered the "wrap" property applies to static_texts as well as edit_fields.   It doesn't appear to be documented at all in the SDK API Reference, while it is documented in the SDK Programmers Guide as applying to edit_fields but not static_texts.  Here's a test program illustrating its use:

           

          local LrDialogs = import 'LrDialogs'
          local LrFunctionContext = import 'LrFunctionContext'
          local LrView = import 'LrView'
          local f = LrView.osFactory()

          local text = [=[Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed feugiat quam nec mauris auctor dignissim eu sit amet sapien. Nullam scelerisque lacus libero. Donec iaculis lacinia viverra. Nulla suscipit viverra condimentum. Nam id diam metus, non ullamcorper justo. Curabitur mollis urna sed ligula molestie ullamcorper convallis nisl adipiscing. Suspendisse blandit lobortis risus non laoreet. Proin dictum, nulla a varius faucibus, enim elit pharetra tortor, a commodo mi nulla et leo. Cras in varius odio. Donec erat neque, bibendum at elementum sit amet, tincidunt a nunc. Donec tincidunt aliquet libero non vulputate. Proin eget nibh ante. Curabitur tincidunt felis quis turpis.]=]


          LrFunctionContext.callWithContext ("test", function (context)
              text = string.gsub (text, "%c", " ")
              LrDialogs.presentModalDialog {title = "Test", contents = f:column {
                  f:edit_field {value = text, wrap = true, width_in_chars = 40,
                      height_in_lines = 10, enabled = false},
                  f:static_text {title = text, wrap = true, width_in_chars = 40,
                      height_in_lines = 10}}}
              end)

          1 person found this helpful
          • 2. Re: Feature Request: Option to wrap static text.
            areohbee Level 5

            Thanks John, I tried it and it works in Lr3. Dunno  'bout Lr2 or Lr1 (my present client is still supporting v1!)

             

            Ya gotta be careful with line-height though, unlike edit-field, static-text won't scroll if it needs more lines than you give it.

             

            Thank you for this tip! - You're the best...

             

            PS - So, perhaps this feature request should be "Document static-text wrapping... (especially which versions support it)"

             

            Rob

            • 3. Re: Feature Request: Option to wrap static text.
              SeanMcCormack Adobe Community Professional

              Hi Rob, just so you know wraps is mentioned on page 93 of the SDK manual. It's also used in the default Web Gallery. I've had to use bits of both parts of the SDK to get things the way I wanted for Web Plugins (i.e. taking stuff from Export and Web).

              • 4. Re: Feature Request: Option to wrap static text.
                johnrellis Most Valuable Participant

                A clarification in case an Adobe employee reads this:

                 

                - The Lightroom SDK 3.0 Programmers Guide (page 93) documents the "wraps" (sic) proprety for edit_field, combox_box, and password_field controls, but not static_text.  The Guide should be corrected to fix the spelling, indicate that "wrap" applies to static_text as well, and that unlike editable fields, "wrap" defaults to false for static_text.

                 

                - The Lightroom 3.0 SDKI API Reference doesn't document "wrap" at all, either for editable fields or static_text.  It should.

                • 5. Re: Feature Request: Option to wrap static text.
                  areohbee Level 5

                  Thanks Sean,

                   

                  Once I realized it works for static_text too I was home free - just needs a doc update - like John said...

                   

                  R